Trees | Indices | Help |
|
---|
|
object --+ | Sea --+ | Atom
This class represents the "atomic" parameters in a config file. Atomic parameters do not contain further sub-elements. For example, 'force.type' is an atomic parameter, whereas 'force' is not because it has sub-elements like 'type', 'gibbs', etc.
Public attributes:
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from Inherited from Inherited from |
|
|||
|
|||
|
|||
Inherited from |
|
|||
WILDCARD_PATTERN = re.compile(r'\*
|
|||
__refmemo =
|
|
|||
raw_val Readwrite. |
|||
sval Readonly. |
|||
bval Readonly. |
|||
dval Readonly. |
|||
val Readwrite. |
|||
Inherited from |
|
This function is used to tell about strings like "*.*.keyword". It returns a tuple object. The first element is the number of wildcards "*", the second element is the word at the end after the '.' symbol. For example: num_wildcard( "*.*.keyword" ) will yield (2, "keyword"). See more examples in the unit tests below. |
Guesses the type of the object that 's' represents. A tuple will be returned. The first element is the object of the guessed type, the second element is the type. If 's' is a non-str object of buildin type, 's' and its type will be returned. If 's' is str object, the type of the object that the string represents will be guessed and the string will be converted to an object of the guessed type. Note these strings: "yes", "true", "on", "no", "false", and "off" will be considered as bool type of objects. If 's' is None, (None, None) will be returned. If 's' is of other types than the above, a ValueError exception will be returned. |
Constructs a 'Atom' object based on the value 's'.
|
Converts the value to a string. If the value itself is a string, then returns the value flanked with double-quotes (i.e., "<value>").
|
Returns True if the value of this object equals that of 'rhs'. If the values of both this and 'rhs' are floating numbers, the is_equal function (see above) will be used for comparison. If 'rhs' is not an 'Atom' object, False will be returned.
|
|
Sets the value.
|
Used by the sval property, which is to get an Sea object of the value that is represented by this Sea object. If the value is a reference, the sval of the referenced Sea object will be returned; otherwise, this object will be returned. This function will raise ValueError if the reference is invalid or if the reference is circular. |
Returns the value. If the raw value is a string, the returned value will have all macros (if any) expanded. If the value is a reference, the actual referenced value will be returned. |
Updates the value with 'val'. If 'val' is a Atom, then this Atom object will be altered to be the same as 'val'. So the type of the value of this object can be altered by the update function. If 'val' is not a Atom, then this function will behave exactly the same as setting the value via the 'val' property.
|
|
|
raw_valReadwrite. When read, this returns the raw value.
|
svalReadonly. Returns the dereferenced `Sea' object.
|
bvalReadonly. Returns a new `Atom' object, which has all macros expanded and references dereferenced.
|
dvalReadonly. Returns a new `Atom' object with dereferenced value.
|
valReadwrite. When read, this returns the current value. |
Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Thu Aug 6 04:50:54 2015 | http://epydoc.sourceforge.net |