Abstract Config class.
To make use of the facilities of this package, it is necessary to implement subclasses of the Config class by defining the abstract properties CONFIG and _FIELD_MAP.
CONFIG is a class with an initializer which takes keyword arguments. _FIELD_MAP maps the keywords to a pair of a string and a Selector. The string is a label for the option, the selector describes how the value for the option is obtained from the user.
Bases: object
Top level class for configuration gadgets.
A decorator indicating abstract properties.
Requires that the metaclass is ABCMeta or derived from it. A class that has a metaclass derived from ABCMeta cannot be instantiated unless all of its abstract properties are overridden. The abstract properties can be called using any of the normal ‘super’ call mechanisms.
Usage:
- class C:
__metaclass__ = ABCMeta @abstractproperty def my_abstract_property(self):
...
This defines a read-only property; you can also define a read-write abstract property using the ‘long’ form of property declaration:
- class C:
- __metaclass__ = ABCMeta def getx(self): ... def setx(self, value): ... x = abstractproperty(getx, setx)
Get a dictionary of values associated with this gadget.
Returns: | a dictionary of value |
---|---|
Return type: | dict of str * object |
Set the members according to config.
Parameters: | config (a justbytes configuration) – a configuration |
---|
top level widget