class documentation

class IAdapter(ABCHasTraits): (source)

View In Hierarchy

Handles management of an adapter stack for objects that implement IContext.

Method adapt_getitem Apply the adapter to values accessed through __getitem__ of a context.
Method adapt_keys Returns an iterable containing any keys (names) defined by this adapter. Should return all names which could successfully be passed to adapt_name.
Method adapt_name Apply the adapter to names sent to a context through __setitem__ and __getitem__.
Method adapt_setitem Apply the adapter to values sent to a context through __setitem__.
def adapt_getitem(self, context, name, value): (source)

Apply the adapter to values accessed through __getitem__ of a context. context: The context being adapted. name: Name of variable sent to Context.__setitem__ value: Value of variable sent to Context.__setitem__ Returns a name/value pair.

def adapt_keys(self, context, name): (source)

Returns an iterable containing any keys (names) defined by this adapter. Should return all names which could successfully be passed to adapt_name. Note: This method is optional, useful only if adapt_name is implemented.

def adapt_name(self, context, name): (source)

Apply the adapter to names sent to a context through __setitem__ and __getitem__. Returns a name. Note: This method is optional.

def adapt_setitem(self, context, name, value): (source)

Apply the adapter to values sent to a context through __setitem__. context: The context being adapted. name: Name of variable sent to Context.__setitem__ value: Value of variable sent to Context.__setitem__ Returns a name/value pair.