class MultiContext(ListenableMixin, PersistableMixin, DictMixin): (source)
Wrap several subcontexts.
Method | __contains__ |
Undocumented |
Method | __delitem__ |
Remove the given key with [] access. |
Method | __getitem__ |
Undocumented |
Method | __init__ |
Undocumented |
Method | __iter__ |
Undocumented |
Method | __len__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __setitem__ |
Set item with [] access. |
Method | __str__ |
Undocumented |
Method | allows |
Undocumented |
Method | checkpoint |
Make a shallow copy of the context. |
Method | keys |
Undocumented |
Method | subcontexts |
Pass events up. |
Class Variable | name |
Undocumented |
Class Variable | subcontexts |
Undocumented |
Class Variable | veto |
Undocumented |
Method | _subcontexts |
Trait listener for items of subcontexts list. |
Inherited from ListenableMixin
:
Method | deferred |
Context manager that sets defer_events to False |
Instance Variable | defer |
Undocumented |
Method | _add |
Defer this event. |
Method | _defer |
Undocumented |
Method | _defer |
Undocumented |
Method | _fire |
Fire an ItemsModifiedEvent. |
Class Variable | _deferred |
Undocumented |
Inherited from PersistableMixin
:
Static Method | load |
Unpickle the context from a file |
Method | save |
Pickle the data context out to a file |
Remove the given key with [] access. Only deletes the first instance of the key. Parameters ---------- key : str Raises ------ KeyError if the kew is not available in the context.
Set item with [] access. The first subcontext which allows the key/value pair will get it. If an earlier subcontext has the key, but does not allow the assignment, then that key will be deleted. Later contexts with the key will be untouched. If the key/value pair cannot be assigned to anything, no deletion will take place. Parameters ---------- key : str value : object Raises ------ ValueError if the key is not permitted to be assigned that value.
Make a shallow copy of the context. Technically, this is actually a fairly deep copy. All of the object structure should be replicated, but the actual dictionary storage will be shallowly copied:: copy = context.shallow_copy() copy[key] is context[key] for key in context.keys() These semantics are useful for saving out checkpointed versions of the context for implementing an undo/redo stack. They may not be useful for other purposes. Returns ------- copy : IContext
def subcontexts_items_modified(self, event): (source)
Pass events up.