ftrack_application_launcher package

Submodules

ftrack_application_launcher.asynchronous module

ftrack_application_launcher.asynchronous.asynchronous(method)[source]

Decorator to make a method asynchronous using its own thread.

ftrack_application_launcher.configure_logging module

ftrack_application_launcher.configure_logging.get_log_directory()[source]

Get log directory.

Will create the directory (recursively) if it does not exist.

Raise if the directory can not be created.

ftrack_application_launcher.configure_logging.configure_logging(logger_name, level=None, format=None, extra_modules=None)[source]

Configure loggerName loggers with console and file handler.

Optionally specify log level (default WARNING)

Optionally set format, default: %(asctime)s - %(name)s - %(levelname)s - %(message)s.

Optional extra_modules to extend the modules to be set to level.

ftrack_application_launcher.discover_applications module

class ftrack_application_launcher.discover_applications.DiscoverApplications(session, applications_config_paths)[source]

Bases: object

property current_os
__init__(session, applications_config_paths)[source]
register()[source]

ftrack_application_launcher.usage module

ftrack_application_launcher.usage.send_event(session, event_name, metadata=None, asynchronous=True)[source]

Send usage event with event_name and metadata.

If asynchronous is True, the event will be sent in a new thread.

Module contents

ftrack_application_launcher.DEFAULT_VERSION_EXPRESSION = re.compile('(?P<version>\\d[\\d.vabc]*?)[^\\d]*$')

Default expression to match version component of executable path. Will match last set of numbers in string where numbers may contain a digit followed by zero or more digits, periods, or the letters ‘a’, ‘b’, ‘c’ or ‘v’ E.g. /path/to/x86/some/application/folder/v1.8v2b1/app.exe -> 1.8v2b1

ftrack_application_launcher.prepend_path(path, key, environment)[source]

Prepend path to key in environment.

ftrack_application_launcher.append_path(path, key, environment)[source]

Append path to key in environment.

ftrack_application_launcher.pop_path(path, key, environment)[source]

Remove path to key in environment.

class ftrack_application_launcher.ApplicationStore(session)[source]

Bases: object

Discover and store available applications on this host.

property current_os
property session

Return current session.

__init__(session)[source]

Instantiate store and discover applications.

get_application(identifier)[source]

Return first application with matching identifier.

identifier may contain a wildcard at the end to match the first substring matching entry.

Return None if no application matches.

class ftrack_application_launcher.ApplicationLauncher(applicationStore)[source]

Bases: object

Launch applications described by an application store.

Launched applications are started detached so exiting current process will not close launched applications.

property current_os
property location

Return current location.

property session

Return current session.

__init__(applicationStore)[source]

Instantiate launcher with applicationStore of applications.

applicationStore should be an instance of ApplicationStore holding information about applications that can be launched.

discover_integrations(application, context)[source]
launch(applicationIdentifier, context=None)[source]

Launch application matching applicationIdentifier.

context should provide information that can guide how to launch the application.

Return a dictionary of information containing:

success - A boolean value indicating whether application launched
          successfully or not.
message - Any additional information (such as a failure message).
class ftrack_application_launcher.ApplicationLaunchAction(*args: Any, **kwargs: Any)[source]

Bases: BaseAction

context = []
property session

Return convenient exposure of the self._session reference.

__init__(session, application_store, launcher, priority=9223372036854775807)[source]
validate_selection(entities)[source]

Return True if the selection is valid.

Utility method to check entities validity.

get_version_information(event)[source]
register()[source]

Register discover actions on logged in user.