Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Application.Application Class Reference
Inheritance diagram for UM.Application.Application:
UM.Qt.QtApplication.QtApplication

Public Member Functions

None __init__ (self, str name, str version, str latest_url, str api_version, str app_display_name="", str build_type="", bool is_debug_mode=False, **kwargs)
 
"Version" getAPIVersion (self)
 
WorkspaceMetadataStorage getWorkspaceMetadataStorage (self)
 
WorkspaceMetadataStorage getCurrentWorkspaceInformation (self)
 
None addCommandLineOptions (self)
 
None parseCliOptions (self)
 
None initialize (self)
 
None startSplashWindowPhase (self)
 
None startPostSplashWindowPhase (self)
 
bool hasJustUpdatedFromOldVersion (self)
 
 run (self)
 
ContainerRegistry getContainerRegistry (self)
 
str getApplicationLockFilename (self)
 
None setGlobalContainerStack (self, Optional["ContainerStack"] stack)
 
Optional["ContainerStack"] getGlobalContainerStack (self)
 
None hideMessage (self, Message message)
 
None showMessage (self, Message message)
 
None showToastMessage (self, str title, str message)
 
str getVersion (self)
 
str getBuildType (self)
 
bool getIsDebugMode (self)
 
bool getIsHeadLess (self)
 
bool getUseExternalBackend (self)
 
None hideMessageById (self, int message_id)
 
List[MessagegetVisibleMessages (self)
 
str getApplicationName (self)
 
str getApplicationDisplayName (self)
 
Preferences getPreferences (self)
 
None savePreferences (self)
 
str getApplicationLanguage (self)
 
List[str] getRequiredPlugins (self)
 
None setRequiredPlugins (self, List[str] plugin_names)
 
None setBackend (self, "Backend" backend)
 
"Backend" getBackend (self)
 
PluginRegistry getPluginRegistry (self)
 
Controller getController (self)
 
OperationStack getOperationStack (self)
 
OutputDeviceManager getOutputDeviceManager (self)
 
Renderer getRenderer (self)
 
None functionEvent (self, CallFunctionEvent event)
 
None callLater (self, Callable[..., Any] func, *args, **kwargs)
 
threading.Thread getMainThread (self)
 
None addExtension (self, "Extension" extension)
 
List["Extension"] getExtensions (self)
 
None addFileProvider (self, "FileProvider" file_provider)
 
List["FileProvider"] getFileProviders (self)
 
"Application" getInstance (cls, *args, **kwargs)
 

Static Public Member Functions

str getAppFolderPrefix ()
 
str getInstallPrefix ()
 

Public Attributes

 default_theme = self._app_name
 
str change_log_url = "https://github.com/Ultimaker/Uranium"
 
str beta_change_log_url = "https://github.com/Ultimaker/Uranium"
 
str latest_url = latest_url
 
 setBackend = os.environ.get('URANIUM_DATA_ROOT', None)
 
 addExtension
 
 addFileProvider
 
 showMessage
 
 hideMessage
 

Static Public Attributes

 applicationShuttingDown = Signal()
 
 showMessageSignal = Signal()
 
 hideMessageSignal = Signal()
 
 globalContainerStackChanged = Signal()
 
 workspaceLoaded = Signal()
 
 visibleMessageAdded = Signal()
 
 visibleMessageRemoved = Signal()
 

Protected Member Functions

None _loadPlugins (self)
 

Protected Attributes

 _api_version = Version(api_version)
 
 _app_name = name
 
 _app_display_name = app_display_name if app_display_name else name
 
 _version = version
 
 _build_type = build_type
 
 _is_debug_mode = is_debug_mode
 
bool _is_headless = False
 
bool _use_external_backend = False
 
bool _just_updated_from_old_version = False
 
str _config_lock_filename = "{name}.lock".format(name = self._app_name)
 
 _cli_args = None
 
 _cli_parser = argparse.ArgumentParser(prog = self._app_name, add_help = False)
 
 _main_thread = threading.current_thread()
 
str _default_language = "en_US"
 
 _preferences_filename = None
 
 _preferences = None
 
list _extensions = []
 
list _file_providers = []
 
list _required_plugins = []
 
 _package_manager_class = PackageManager
 
 _package_manager = None
 
 _plugin_registry = None
 
 _container_registry_class = ContainerRegistry
 
 _container_registry = None
 
 _global_container_stack = None
 
 _file_provider_model = FileProviderModel(application = self)
 
 _controller = None
 
 _backend = None
 
 _output_device_manager = None
 
 _operation_stack = None
 
list _visible_messages = []
 
 _message_lock = threading.Lock()
 
str _app_install_dir = self.getInstallPrefix()
 
 _workspace_metadata_storage = WorkspaceMetadataStorage()
 
 _current_workspace_information = WorkspaceMetadataStorage()
 

Detailed Description

Central object responsible for running the main event loop and creating other central objects.

The Application object is a central object for accessing other important objects. It is also
responsible for starting the main event loop. It is passed on to plugins so it can be easily
used to access objects required for those plugins.

Constructor & Destructor Documentation

◆ __init__()

None UM.Application.Application.__init__ ( self,
str name,
str version,
str latest_url,
str api_version,
str app_display_name = "",
str build_type = "",
bool is_debug_mode = False,
** kwargs )
Init method

:param name: :type{string} The name of the application.
:param version: :type{string} Version, formatted as major.minor.rev
:param build_type: Additional version info on the type of build this is, such as "master".
:param is_debug_mode: Whether to run in debug mode.

Member Function Documentation

◆ _loadPlugins()

None UM.Application.Application._loadPlugins ( self)
protected
Function that needs to be overridden by child classes with a list of plugins it needs.

◆ callLater()

None UM.Application.Application.callLater ( self,
Callable[..., Any] func,
* args,
** kwargs )
Call a function the next time the event loop runs.

You can't get the result of this function directly. It won't block.
:param func: The function to call.
:param args: The positional arguments to pass to the function.
:param kwargs: The keyword arguments to pass to the function.

◆ functionEvent()

None UM.Application.Application.functionEvent ( self,
CallFunctionEvent event )
Post a function event onto the event loop.

This takes a CallFunctionEvent object and puts it into the actual event loop.
:exception NotImplementedError

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ getApplicationLanguage()

str UM.Application.Application.getApplicationLanguage ( self)
Get the currently used IETF language tag.
The returned tag is during runtime used to translate strings.
:returns: Language tag.

◆ getApplicationLockFilename()

str UM.Application.Application.getApplicationLockFilename ( self)
Get the lock filename

◆ getApplicationName()

str UM.Application.Application.getApplicationName ( self)
Get name of the application.
:returns: app_name

◆ getBackend()

"Backend" UM.Application.Application.getBackend ( self)
Get the backend of the application (the program that does the heavy lifting).
:returns: Backend

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ getBuildType()

str UM.Application.Application.getBuildType ( self)
Get the build type of the application

◆ getController()

Controller UM.Application.Application.getController ( self)
Get the Controller of this application.
:returns: Controller

◆ getInstance()

"Application" UM.Application.Application.getInstance ( cls,
* args,
** kwargs )

◆ getMainThread()

threading.Thread UM.Application.Application.getMainThread ( self)
Get the application's main thread.

◆ getPluginRegistry()

PluginRegistry UM.Application.Application.getPluginRegistry ( self)
Get the PluginRegistry of this application.
:returns: PluginRegistry

◆ getPreferences()

Preferences UM.Application.Application.getPreferences ( self)
Get the preferences.
:return: preferences

◆ getRenderer()

Renderer UM.Application.Application.getRenderer ( self)
Return an application-specific Renderer object.
:exception NotImplementedError

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ getRequiredPlugins()

List[str] UM.Application.Application.getRequiredPlugins ( self)
Application has a list of plugins that it *must* have. If it does not have these, it cannot function.
These plugins can not be disabled in any way.

◆ getVersion()

str UM.Application.Application.getVersion ( self)
Get the version of the application

◆ getVisibleMessages()

List[Message] UM.Application.Application.getVisibleMessages ( self)
Get list of all visible messages

◆ hideMessageById()

None UM.Application.Application.hideMessageById ( self,
int message_id )
Hide message by ID (as provided by built-in id function)

◆ run()

UM.Application.Application.run ( self)
Run the main event loop.
This method should be re-implemented by subclasses to start the main event loop.
:exception NotImplementedError:

Reimplemented in UM.Qt.QtApplication.QtApplication.

◆ setBackend()

None UM.Application.Application.setBackend ( self,
"Backend" backend )
Set the backend of the application (the program that does the heavy lifting).

◆ setRequiredPlugins()

None UM.Application.Application.setRequiredPlugins ( self,
List[str] plugin_names )
Set the plugins that the application *must* have in order to function.
:param plugin_names: List of strings with the names of the required plugins

The documentation for this class was generated from the following file: