Download latest PDF - Read the Docs
Transcript
PyTek Documentation, Release 1.1 (v1.1.1.0-x-dev)
False
>>>
>>> dev.frobbed("ON")
~~~> FROBBED ON
>>> dev.frobbed()
???? FROBBED
<<<< ON
True
>>>
>>> dev.frobbed("???")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "src\pytek\util.py", line 125, in config
return self(device, val)
File "src\pytek\util.py", line 116, in __call__
self.configure(device, self.name, self.set(device, val))
File "temp.py", line 94, in frobbed
raise ValueError()
ValueError
>>>
>>>
>>> help(dev.foobar)
Help on method foobar in module pytek.util:
foobar(device, val=None) method of temp.MyDevice instance
Configures or queries the value of the ‘‘FOO:BAR‘‘ setting on the device.
If a value is given, then the setting is configured to the given value.
If the value is ‘None‘ (the default), then the setting is queried and the value
is returned.
>>>
>>> help(dev.frobbed)
Help on method frobbed in module pytek.util:
frobbed(device, val=None) method of temp.MyDevice instance
Configures or queries the value of the ‘‘FROBBED‘‘ setting on the device.
If a value is given, then the setting is configured to the given value.
If the value is ‘None‘ (the default), then the setting is queried and the value
is returned.
Querying returns True for "ON", and False for "OFF".
Valid values for configuring are True and False, or synonomously
"ON" and "OFF".
>>>
>>>
Parameters
• name – Specifies the name of the setting accessed by this object. Should be either a
callable object with a __name__ attribute, or a string. Strings will be used directly,
callables will be filtered through func_to_name.
• get (callable) – Optional: if given, passed to getter.
• set (callable) – Optional: if given, passed to setter.
2.3. pytek.util module
17