| |
- __builtin__.dict(__builtin__.object)
-
- namelist
class namelist(__builtin__.dict) |
|
a class for editing,creating,and managing namelists from a template. |
|
- Method resolution order:
- namelist
- __builtin__.dict
- __builtin__.object
Methods defined here:
- __cmp__(self, other)
- compare to another namelist to see if same
- __eq__(self, other)
- compare to another namelist to see if same
- __getitem__(self, key)
- define getitem to return namelist_dict entries as well
- __init__(self, template_namelist_path, verbose=0)
- __ne__(self, other)
- __nonzero__(self)
- __repr__(self)
- __setitem__(self, key, value)
- define setitem to update namelist_dict entries as well
- __str__(self)
- diff(self, other)
- Find differences between the current namelist and the input one.
- edit_namelist(self, edit_dict)
- updates namelist from a dictionary which can be a subset
of self.template_namelist.
- get_comment(self)
- returns a comment string associated with namelist file
- get_edit_dict(self, parm_list)
- return a dictionary sutible for the edit_namelist function input
based upon current values in namelist.
- get_namelist_dict(self)
- get_namelist_list(self)
- get list of namelists associated with a namelist in file.
- get_namelist_path(self)
- get_parm_list(self, nml)
- get list of parameters associated with a namelist in file.
- get_template_path(self)
- get_value(self, nml, parm)
- gets a value list for a namelist parameter.
* nml is the namelist name
* parm is the parameter
* value_list is a list of values in the proper format
for writting to namelist
- in_nml(self, nml)
- is namelist in file?
- is_edited(self)
- make_compat(self, other)
- make self compatible with PASS release of other and retaines
values of current namelist where possible
- parse_comment(self)
- Use the first line of the file as a comment.
- read_template(self)
- same_release(self, other)
- compares namelist keys and parameter names to check to see
if other is from the same PASS release.
- set_comment(self, comment)
- sets value of comment line
- set_template_path(self, template_namelist_path)
- sets template namelist path and updates self.path whenever
template changes.
- set_value(self, nml, parm, value_list)
- set a value list for a namelist parameter.
* nml is the namelist name
* parm is the parameter
* value_list is a list of values in the proper format
for writting to namelist
- write_namelist(self, path)
- write out a new namelist file and save path name
copied from pass_util with addition of comment
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.dict:
- __contains__(...)
- D.__contains__(k) -> True if D has a key k, else False
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __sizeof__(...)
- D.__sizeof__() -> size of D in memory, in bytes
- clear(...)
- D.clear() -> None. Remove all items from D.
- copy(...)
- D.copy() -> a shallow copy of D
- fromkeys(...)
- dict.fromkeys(S[,v]) -> New dict with keys from S and values equal to v.
v defaults to None.
- get(...)
- D.get(k[,d]) -> D[k] if k in D, else d. d defaults to None.
- has_key(...)
- D.has_key(k) -> True if D has a key k, else False
- items(...)
- D.items() -> list of D's (key, value) pairs, as 2-tuples
- iteritems(...)
- D.iteritems() -> an iterator over the (key, value) items of D
- iterkeys(...)
- D.iterkeys() -> an iterator over the keys of D
- itervalues(...)
- D.itervalues() -> an iterator over the values of D
- keys(...)
- D.keys() -> list of D's keys
- pop(...)
- D.pop(k[,d]) -> v, remove specified key and return the corresponding value.
If key is not found, d is returned if given, otherwise KeyError is raised
- popitem(...)
- D.popitem() -> (k, v), remove and return some (key, value) pair as a
2-tuple; but raise KeyError if D is empty.
- setdefault(...)
- D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
- update(...)
- D.update([E, ]**F) -> None. Update D from dict/iterable E and F.
If E present and has a .keys() method, does: for k in E: D[k] = E[k]
If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v
In either case, this is followed by: for k in F: D[k] = F[k]
- values(...)
- D.values() -> list of D's values
- viewitems(...)
- D.viewitems() -> a set-like object providing a view on D's items
- viewkeys(...)
- D.viewkeys() -> a set-like object providing a view on D's keys
- viewvalues(...)
- D.viewvalues() -> an object providing a view on D's values
Data and other attributes inherited from __builtin__.dict:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |