| |
- Propertied(object)
-
- BaseContext
class BaseContext(Propertied) |
|
Execution environment in which an action operates
Like an event, a context is a transient object which
binds together the particular features of an execution
environment for the duration of an action's operation.
Normally a sub-class would provide features such as
retrieving the current document, the current selection
set, the current (object) focus etc. |
|
- Method resolution order:
- BaseContext
- Propertied
- object
Data and other attributes defined here:
- action = <BasicProperty 'action'>
- The action associated with the context
- event = <BasicProperty 'event'>
- wxPython event which triggered the action or None
- window = <BasicProperty 'window'>
- The wxPython window associated with the context
Methods inherited from Propertied:
- __init__(self, *arguments, **namedarguments)
- Propertied object initialisation, allows passing in initial values for properties by name
- __str__(self)
- Get a friendly representation of the object
- clone(self, **newValues)
- Clone this object, with optional new property values
This method calls the __init__ method of your class with
the current property values of your class. Providing newValues
(a dictionary) overrides property settings with new values.
- getCloneProperties(self)
- Get properties dictionary (key:value) for use in cloning of the instance
By default you get getProperties()' values, with an
attempt made to use the property's name, then the property's
direct "__get__" method.
- toString(self, indentation='', alreadyDone=None, indentString=' ')
- Get a nicely formatted representation of this object
This version assumes that getProperties returns
the list of properties which should be presented,
it recursively calls it's children with greater
indents to get their representations.
indentation -- current string indentation level
alreadyDone -- set of object ids which are already finished
XXX Needs a far better API, likely a stand-alone class
without the automatic inheritance problems here :(
Class methods inherited from Propertied:
- getProperties(cls) from type
- Get the BasicProperty properties for a particular object's class
Data and other attributes inherited from Propertied:
- __dict__ = <dictproxy object at 0x02891750>
- dictionary for instance variables (if defined)
- __weakref__ = <attribute '__weakref__' of 'Propertied' objects>
- list of weak references to the object (if defined)
| |