Package scripts :: Package objects :: Script base :: Class Lockable
[hide private]
[frames] | no frames]

Class Lockable

source code

object --+            
         |            
BaseObject --+        
             |        
 DynamicObject --+    
                 |    
object --+       |    
         |       |    
BaseObject --+   |    
             |   |    
    Scriptable --+    
                 |    
          Openable --+
                     |
                    Lockable

Allows objects to be locked

Instance Methods [hide private]
 
__init__(self, locked=False, is_open=True, **kwargs)
Init operation for lockable objects
source code
 
unlock(self)
Handles unlocking functionality
source code
 
lock(self)
Handles locking functionality
source code
 
open(self, *args, **kwargs)
Adds a check to see if the object is unlocked before running the .open() function of the parent class
source code

Inherited from Openable: close

Inherited from DynamicObject: __getstate__, __setstate__, getStateForSaving, prepareStateForSaving, restoreState

Inherited from Scriptable: runScript, setScript

Inherited from BaseObject: trueAttr

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, locked=False, is_open=True, **kwargs)
(Constructor)

source code 

Init operation for lockable objects

Parameters:
  • locked (Boolean) - Keyword boolen argument sets the initial locked state.
  • is_open (Boolean) - Keyword boolean argument sets the initial open state. It is ignored if locked is True -- locked objects are always closed.
Overrides: object.__init__

open(self, *args, **kwargs)

source code 

Adds a check to see if the object is unlocked before running the .open() function of the parent class

Overrides: Openable.open