Interface to connection design locks on a connection component on a member's end. More...
Methods defined here: | |
def | __contains__ |
def | __enter__ |
def | __eq__ |
def | __exit__ |
def | __getitem__ |
def | __init__ |
def | __len__ |
def | __ne__ |
def | __reduce__ |
def | __repr__ |
def | __setitem__ |
def | __str__ |
def | commit |
def | has_key |
def | has_key_with_prefix |
def | has_key_with_subtring |
def | items |
def | keys |
def | lockables_with_prefix |
def | lockables_with_substring |
def | locked_lockables |
def | update |
def | values |
Data and other attributes defined here: | |
int | __instance_size__ = 184 |
Data descriptors inherited from Boost.Python.instance: | |
def | __dict__ |
def | __weakref__ |
Data and other attributes inherited from Boost.Python.instance: | |
def | __new__ |
Interface to connection design locks on a connection component on a member's end.
When instantiated, it generates a dictionary of LockableValues that possess the same values and validations as connection design locks member edit.
In order to commit LockableValues to connection design locks, this class must be instantiated as a context manager (using the 'with' keyword).
When not instantiated as a context manager, interaction with the dictionary of LockableValues is still permitted.
Standalone Instantiation:
import sds2.lockable ''' Get ConnectionLocks from member 1's left end. ''' mn = sds2.lockable.ConnectionLocks(1,0) ''' Get the LockableValue associated with op_top_op_type. ''' lk = mn['op_top_op_type'] ''' Get member edit label corresponding to this LockableValue. ''' print lk.get_screen_label() ''' Modify the LockableValue on the ConnectionLocks object. ''' lk.set_lock(True) '''Try to commit the change to the connection component. Since this ConnectionLocks instance was not created as a context manager, this operation will throw an exception.''' mn.commit() '''Assuming a variable spacing LockableValue exists, and it has a key 'spa': Try to set it to zero. Note: Most spacing fields on member edit do not permit non-positive values. Hence, this attempt at setting zero will validate and throw an exception.''' mn['spa'].set(0)
There are only two differences between a context manager instance of ConnectionLocks and a regular instance:
The context manager instance is permitted to modify and write the connection component out to disk.
import sds2.lockable
''' Get ConnectionLocks from member 1's left end, set the top and bottom end preparations to 'Cope plain' and commit the connection component to disk.''' with sds2.lockable.ConnectionLocks(1,0) as mn:
# dict style update of multiple LockableValues. mn.update(op_top_op_type='Cope plain', op_btm_op_type='Cope plain') mn.commit()
ConnectionLocks
Boost.Python.instance
builtin.object
def sds2.lockable.ConnectionLocks.__init__ | ( | arg1, | |
member_number, | |||
end_number | |||
) |
def sds2.lockable.ConnectionLocks.__contains__ | ( | self, | |
key | |||
) |
def sds2.lockable.ConnectionLocks.__dict__ | ( | args | ) |
def sds2.lockable.ConnectionLocks.__enter__ | ( | self | ) |
def sds2.lockable.ConnectionLocks.__eq__ | ( | arg1, | |
arg2 | |||
) |
def sds2.lockable.ConnectionLocks.__exit__ | ( | self, | |
ex_type, | |||
ex_value, | |||
ex_obj | |||
) |
def sds2.lockable.ConnectionLocks.__getitem__ | ( | self, | |
key | |||
) |
def sds2.lockable.ConnectionLocks.__len__ | ( | self | ) |
def sds2.lockable.ConnectionLocks.__ne__ | ( | arg1, | |
arg2 | |||
) |
def sds2.lockable.ConnectionLocks.__new__ | ( | args | ) |
T.__new__(S, ...) -> a new object with type S, a subtype of T
__new__ = <built-in method __new__ of Boost.Python.class object>
def sds2.lockable.ConnectionLocks.__reduce__ | ( | args | ) |
__reduce__ = <unnamed Boost.Python function>(args)
def sds2.lockable.ConnectionLocks.__repr__ | ( | arg1 | ) |
def sds2.lockable.ConnectionLocks.__setitem__ | ( | arg1, | |
arg2, | |||
self | |||
) |
def sds2.lockable.ConnectionLocks.__str__ | ( | arg1 | ) |
def sds2.lockable.ConnectionLocks.__weakref__ | ( | args | ) |
def sds2.lockable.ConnectionLocks.commit | ( | self | ) |
Apply LockableValues to the associated connection component and write it out to disk.
def sds2.lockable.ConnectionLocks.has_key | ( | self, | |
key | |||
) |
Check if the ConnectionLocks instance has 'key'
def sds2.lockable.ConnectionLocks.has_key_with_prefix | ( | self, | |
prefix | |||
) |
Check if the ConnectionLocks instance has a key with the specified prefix
def sds2.lockable.ConnectionLocks.has_key_with_subtring | ( | self, | |
substr | |||
) |
Check if the ConnectionLocks instance has a key with the given substring.
def sds2.lockable.ConnectionLocks.items | ( | self | ) |
def sds2.lockable.ConnectionLocks.keys | ( | self | ) |
def sds2.lockable.ConnectionLocks.lockables_with_prefix | ( | self, | |
prefix | |||
) |
Returns a subset dictionary with keys having the given prefix.
def sds2.lockable.ConnectionLocks.lockables_with_substring | ( | self, | |
substr | |||
) |
Returns a subset dictionary with keys having the given substring.
def sds2.lockable.ConnectionLocks.locked_lockables | ( | self | ) |
Get a dictionary that contains user-visible locked lockables.
def sds2.lockable.ConnectionLocks.update | ( | args | ) |
object update(tuple args, dict kwds) : Update a connection's LockableValues with args, kwds if valid.
def sds2.lockable.ConnectionLocks.values | ( | self | ) |
|
staticprivate |