Infrastructure, common and multi-layer classes, helpers.
Various enhancements to Python.
Bases: collections.abc.Iterable
Simple enum class.
Example Usage:
codes = Enum("FOO", "BAR", "BAZ") # codes.BAZ will be 2 and so on and str.BAZ will be "BAZ"
Parameters: | names (Iterator<str>) – Iterable of Enum members. |
---|
Bases: builtins.object
Decorator that declares a function as an event.
Implements a C#-like events (a call dispatchers). Decorating a function or method with this decorator declares it as an event. In order to subscribe a handler function to the event, one should use the “+=” operator and to unsubscribe the “-=” operator. Such event can be fired by a calling the decorated function. This will dispatch the event to all subscribers, i.e. subscribed handler methods are called.
Note
Decorated function should implement only pass as its body.
Note
Decorated function can take any number of parameters or keyword parameters. Subscriber functions has to take same parameters as the event.
Example usage:
class Button:
# ...
@event
def clicked(self, some_parameter):
"Fired when the button was clicked."
pass
def _fireClicked(self, some_parameter):
clicked(some_parameter)
# ...
class Ui:
def __init__(self, button):
button.clicked += self._onButtonClicked
def _onButtonClicked(self, some_parameter):
"Handle the button click."
# play a sound...
Parameters: | eventFunction (function) – Decorated function or method that becomes an event. |
---|
AppEnvironment class
Bases: builtins.object
Container class for various application-related information.
Parameters: |
|
---|
ApplicationContext class.
Bases: builtins.object
Provides access to a various program-related objects.
Parameters: |
|
---|
Gets access to application configuration.
Return type: | ConfigurationBase |
---|
Warning
Can be None
Gets access to application persistent storage.
Return type: | FileStorage |
---|
Warning
Can be None