lib Package

applist Module

Listing and importing applications

stoq.lib.applist.N_(s)
stoq.lib.applist.get_application_names()[source]

Get a list of application names, useful for launcher programs

@returns: application names

stoq.lib.applist.get_application_icon(appname)[source]
class stoq.lib.applist.ApplicationDescriptions[source]
get_application_names()[source]
get_descriptions()[source]
class stoq.lib.applist.Application(name, fullname, icon, description)[source]

Bases: object

Describes an application

@ivar name: short name of application @ivar fullname: complete name of application @ivar icon: application icon @ivar description: long description of application

dependencies Module

Check Stoq dependencies

class stoq.lib.dependencies.DependencyChecker[source]

Bases: object

check_kiwi(version)[source]
check()[source]
stoq.lib.dependencies.check_dependencies(text_mode=False)[source]

options Module

Command line configuration options

stoq.lib.options.get_option_parser()[source]

Get the option parser used to parse arguments on the command line @returns: an optparse.OptionParser

startup Module

Database startup routines

stoq.lib.startup.setup_path()[source]
stoq.lib.startup.setup(config=None, options=None, register_station=True, check_schema=True, load_plugins=True)[source]

Loads the configuration from arguments and configuration file.

@param config: a StoqConfig instance @param options: a Optionparser instance @param register_station: if we should register the branch station. @param check_schema: if we should check the schema @param load_plugins: if we should load plugins for the system

status Module

class stoq.lib.status.ResourceStatus[source]

Bases: gobject._gobject.GObject

The status of a given resource

status_label = {0: 'N/A', 1: 'OK', 2: 'WARNING', 3: 'ERROR'}
name = None
label = None
priority = 0
status_str
refresh()[source]

Refresh the resource status

Subclasses should override this and update status and reason

Note that this will not be running on the main thread, so be cautelous with non thread-safe operations.

get_actions()[source]

Get the actions that can be run for this resource

refresh_and_notify()[source]

Refresh the resource status and notify for changes

STATUS_ERROR = 3
STATUS_NA = 0
STATUS_OK = 1
STATUS_WARNING = 2
class stoq.lib.status.ResourceStatusAction(resource, name, label, callback, threaded=True, admin_only=True)[source]

Bases: object

class stoq.lib.status.ResourceStatusManager[source]

Bases: gobject._gobject.GObject

REFRESH_TIMEOUT = 60
classmethod get_instance()[source]

Get the manager singleton instance

status

The general status of the resources

add_resource(resource, refresh=False)[source]

Add a ResourceStatus on the manager

refresh_and_notify(force=False)[source]

Refresh the status and notify for changes

handle_action(action)[source]

Ask the given resource to handle the given action

stoq.lib.status.register(resource_class, refresh=False)[source]