|
def | __init__ (self, kwds) |
|
def | load (self, kwds) |
|
def | load_wcjson (self, string) |
|
def | load_wcfile (self, filename) |
|
def | load_configlist (self, cfglist) |
|
def | load_configdict (self, cfgdict) |
|
def | get (self, type, name='') |
|
def | load_one (self, type, name, data) |
|
def | merge (self, other) |
|
def | wcjson (self) |
|
def | __str__ (self) |
|
Definition at line 25 of file command.py.
def wirecell.command.Config.__init__ |
( |
|
self, |
|
|
|
kwds |
|
) |
| |
def wirecell.command.Config.__str__ |
( |
|
self | ) |
|
def wirecell.command.Config.get |
( |
|
self, |
|
|
|
type, |
|
|
|
name = '' |
|
) |
| |
Definition at line 55 of file command.py.
55 def get(self, type, name=''):
56 return self.
_cfg[(type,name)]
def get(self, type, name='')
def wirecell.command.Config.load |
( |
|
self, |
|
|
|
kwds |
|
) |
| |
Definition at line 33 of file command.py.
35 obj = kwds.get(form,
None)
37 meth = getattr(self,
'load_'+form)
def wirecell.command.Config.load_configdict |
( |
|
self, |
|
|
|
cfgdict |
|
) |
| |
Definition at line 51 of file command.py.
52 for (t,n),d
in self._cfg.items():
def load_one(self, type, name, data)
def load_configdict(self, cfgdict)
def wirecell.command.Config.load_configlist |
( |
|
self, |
|
|
|
cfglist |
|
) |
| |
Definition at line 47 of file command.py.
49 self.
load_one(d[
'type'], d.get(
'name',
''), d[
'data'])
def load_one(self, type, name, data)
def load_configlist(self, cfglist)
def wirecell.command.Config.load_one |
( |
|
self, |
|
|
|
type, |
|
|
|
name, |
|
|
|
data |
|
) |
| |
Definition at line 58 of file command.py.
59 val = self.
get(type,name)
61 self.
_cfg[(type,name)] = val
def load_one(self, type, name, data)
def get(self, type, name='')
def wirecell.command.Config.load_wcfile |
( |
|
self, |
|
|
|
filename |
|
) |
| |
Definition at line 44 of file command.py.
def load_wcfile(self, filename)
int open(const char *, int)
Opens a file descriptor.
def load_wcjson(self, string)
int read(int, char *, size_t)
Read bytes from a file descriptor.
def wirecell.command.Config.load_wcjson |
( |
|
self, |
|
|
|
string |
|
) |
| |
Definition at line 40 of file command.py.
41 cl = json.loads(string)
def load_configlist(self, cfglist)
def load_wcjson(self, string)
def wirecell.command.Config.merge |
( |
|
self, |
|
|
|
other |
|
) |
| |
Merge other into copy of self and return new Config object
Definition at line 64 of file command.py.
66 Merge other into copy of self and return new Config object 69 for (t,n),d
in self._cfg.items():
72 for (t,n),d
in other._cfg.items():
def wirecell.command.Config.wcjson |
( |
|
self | ) |
|
Return wire-cell compatible JSON representation.
Definition at line 76 of file command.py.
78 Return wire-cell compatible JSON representation. 81 for (t,n),d
in self._cfg.items():
82 dat.append(dict(type=t, name=n, data=d))
83 return json.dumps(dat)
wirecell.command.Config._cfg |
|
private |
string wirecell.command.Config.formats = 'wcjson wcfile configlist configdict' |
|
static |
The documentation for this class was generated from the following file: