under construction

This framework helps to build arbitrarily complex property definitions and automate their handling. Properties can be nested arbitrarily.

It is extremely simple and nothing more than a wrap around standard python descriptors, adding a stronger (and more extensible) interface and some convenience.

Components

Properties are implemented using python descriptors, which in turn return instance of type PropertyBase. The latter implement a basic get/set interface, which can also respond to deletion (e.g. del(self.property)).

As an additional (and optional) layer, there are MetaClasses which facilitate using properties.

Components Summary

Examples

In the first example, a \ref butility.properties.types.PrefixProperty "PrefixProperty" is used to formalize accessing the classes member variables. For safety and efficiency, they are put into slots. However, technique works similarly without slots as well.

@snippet bapp/tests/core/test_properties.py PrefixPropertyClass

This is how properties can be accessed.

@snippet bapp/tests/core/test_properties.py PrefixPropertyClass Usage

The next example uses the specialization for EnvironmentContextClients.

@snippet bapp/tests/core/component/test_properties.py ExampleContextClient

When using the properties, access was simplified to be more the way the kvstore is supposed to be used. Also note the direct property access, as opposed to using property access methods.

@snippet bapp/tests/core/component/test_properties.py ExampleContextClient Usage