This is a helper class for custom members. More...
Methods defined here: | |
def | __convert__ |
def | __getstate__ |
def | __init__ |
def | __setstate__ |
Data descriptors defined here: | |
def | __dict__ |
dictionary for instance variables (if defined) | |
def | __weakref__ |
list of weak references to the object (if defined) |
Data and other attributes defined here: | |
__getstate_manages_dict__ = True |
This is a helper class for custom members.
Inherit from this class before inheriting from MemberBase: Set _arguments as a class object. It should be a dictionary which contains lists of tuples. Each tuple in the list is a name and a default value. These names will become properties on your member object. The key for the dictionary should be your current version.
You'll have one list of lists for every version of your member that you currently support reading. So, when you want to add something, remove something, or change something increment your version and start a new list.
When you want to change the meaning of a field, you can override the convert method.
Objects contained within your StateAccessor Memberbase object should derive from StateAccessor and DummyBase.
Example: import math from MemberBase import MemberBase from StateAccessor import StateAccessor, DummyBase
class ExampleMember( StateAccessor, MemberBase ): _version = 2 _arguments = {} _arguments[ 0 ] = ( ('one', 1), ('angle', 180.) ) _arguments[ 1 ] = ( ('one', 1), ('angle', math.pi) ) _arguments[ 2 ] = ( ('one', 1), ('angle', math.pi), ('ends', [ExampleMemberEnd(),ExampleMemberEnd()] ) )
def convert( self, old_version ): if old_version == 0: self.angle = math.radians( self.angle )
class ExampleMemberEnd( StateAccessor, DummyBase ): _version = 0 _arguments = {} _arguments[0] = (('end_angle',math.pi),)
def StateAccessor.StateAccessor.__init__ | ( | args | ) |
def StateAccessor.StateAccessor.__convert__ | ( | args | ) |
__convert__(args)
Reimplemented in JoistMemberCore.JoistManufacturer.JoistSetupBase, UnreadableComponentProxy.UnreadableComponentProxy, JoistMemberCore.JoistManufacturer.JoistBIMBase, and HashingComponent.HashingComponent.
def StateAccessor.StateAccessor.__dict__ | ( | args | ) |
dictionary for instance variables (if defined)
Reimplemented in JoistMemberCore.JoistManufacturer.JoistSetupBase, UnreadableComponentProxy.UnreadableComponentProxy, JoistMemberCore.JoistManufacturer.JoistBIMBase, and HashingComponent.HashingComponent.
def StateAccessor.StateAccessor.__getstate__ | ( | args | ) |
__getstate__(args)
Reimplemented in JoistMemberCore.JoistManufacturer.JoistSetupBase, UnreadableComponentProxy.UnreadableComponentProxy, JoistMemberCore.JoistManufacturer.JoistBIMBase, and HashingComponent.HashingComponent.
def StateAccessor.StateAccessor.__setstate__ | ( | args | ) |
__setstate__(args)
Reimplemented in JoistMemberCore.JoistManufacturer.JoistSetupBase, UnreadableComponentProxy.UnreadableComponentProxy, JoistMemberCore.JoistManufacturer.JoistBIMBase, and HashingComponent.HashingComponent.
def StateAccessor.StateAccessor.__weakref__ | ( | args | ) |
list of weak references to the object (if defined)
Reimplemented in JoistMemberCore.JoistManufacturer.JoistSetupBase, UnreadableComponentProxy.UnreadableComponentProxy, JoistMemberCore.JoistManufacturer.JoistBIMBase, and HashingComponent.HashingComponent.
|
staticprivate |