Package pype :: Module ptable :: Class ParamTable
[frames] | no frames]

Class ParamTable

source code

object --+
         |
        ParamTable

Instance Methods
 
__init__(self, parent, table, file=None, decorate=1, locks=1, allowalt=True, loadable=1)
Parameter management table class
source code
 
__del__(self) source code
 
addbutton(self, text='userdef', command=None)
Add user-defined button to param table.
source code
 
find(self, name, show=1)
Find parameter tables fields that (partial) match name.
source code
 
lockfield(self, name, toggle=None, state=DISABLED)
Lock specififed row of table.
source code
 
keys(self)
Get list of keys (ie, row names) for this table/
source code
 
query(self, qname)
Retrieve single value from the parameter table by name without validation.
source code
 
queryv(self, qname)
Retrieve single value from the parameter table by name with validation.
source code
 
set(self, name, value)
Set current value for named row.
source code
 
save(self, file=None, remove=1)
Save state for table to file.
source code
 
load(self, file=None)
Load pickled table database - note that the pickled dictionary will be unpickled, but only those values referenced in the table will actually be used. The rest (ie, obsolete) are discarded. This way you can safely inherit from previous modules w/o accumulating excess garbage.
source code
 
frompypefile(self) source code
 
view(self)
View current contents of table (in a popup dialog box).
source code
 
check(self, mergewith=None)
Validate parameter table.
source code
 
runlock(self, lock=1)
Lock table (in preparation for a run.
source code

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

Properties

Inherited from object: __class__

Method Details

__init__(self, parent, table, file=None, decorate=1, locks=1, allowalt=True, loadable=1)
(Constructor)

source code 
Parameter management table class
Overrides: object.__init__

addbutton(self, text='userdef', command=None)

source code 
Add user-defined button to param table.
Parameters:
  • text - (string) text of button label
  • command - (function) function to call when clicked
Returns:
Button

find(self, name, show=1)

source code 
Find parameter tables fields that (partial) match name.
Parameters:
  • name - (string) name of field find/match
  • show - (bool) popup table with found entries?
Returns:
list of matching tables [(table, slotname, index), ...]

lockfield(self, name, toggle=None, state=DISABLED)

source code 
Lock specififed row of table.
Returns:
nothing

query(self, qname)

source code 
Retrieve single value from the parameter table by name without validation.
Parameters:
  • qname - (string) slot name
Returns:
(string) current value

queryv(self, qname)

source code 
Retrieve single value from the parameter table by name with validation.
Parameters:
  • qname - (string) slot name
Returns:
(variable) validated current value -- might not be string!

set(self, name, value)

source code 

Set current value for named row.

Warning: this might not work for Dict and Tuple fields anymore..

Parameters:
  • name - (string) slot name
  • value - (string) new value
Returns:
nothing

save(self, file=None, remove=1)

source code 
Save state for table to file.
Parameters:
  • file - (string) If specified, name of output file (goes in subject-specific-dir).
Returns:
nothing

view(self)

source code 
View current contents of table (in a popup dialog box).
Returns:
nothing

check(self, mergewith=None)

source code 

Validate parameter table.

NOTE: This forces the user to actually make all the slots valid!

Parameters:
  • mergewith - (dict) optional dictionary to start with; values from the table will be merged into this existing dictionary and the merged dictionary returned.
Returns:
(dict) validated dictionary of all params