Package gbp :: Module tristate :: Class Tristate
[hide private]
[frames] | no frames]

Class Tristate

object --+
         |
        Tristate

Tri-state value: on, off or auto

Instance Methods [hide private]
 
__init__(self, val)
x.__init__(...) initializes x; see help(type(x)) for signature
 
__repr__(self)
repr(x)
 
is_auto(self)
 
is_on(self)
 
is_off(self)
 
do(self, function, *args, **kwargs)
Run function if tristate is on or auto, only report a failure if tristate is on since failing is o.k.

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

Class Methods [hide private]
 
is_valid_state(self, stat)
Class Variables [hide private]
  ON = True
  OFF = False
  AUTO = -1
  _VALID_NAMES = ['on', 'off', 'true', 'false', 'auto']
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, val)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

__repr__(self)
(Representation operator)

 

repr(x)

Overrides: object.__repr__
(inherited documentation)

do(self, function, *args, **kwargs)

 

Run function if tristate is on or auto, only report a failure if tristate is on since failing is o.k. for autodetect.