Module gnue.common.datasources.GConditions
Classes for the condition object tree.
| Function Summary |
| |
buildCondition(condition,
comparison,
logic)
Create a condition tree either from a sequence in prefix notation or a
dictionary. |
| |
buildConditionFromDict(dictionary,
comparison,
logic)
This function creates a new condition tree using the given comparison
as operation between keys and values and a given logic as concatenation
for all keys. |
| |
buildConditionFromPrefix(prefixList)
This function creates a new condition tree from the given element
sequence, which must be in prefix notation. |
| |
combineConditions(cond1,
cond2)
Combine two conditions using an AND operator. |
| |
getXMLelements(updates)
|
| |
unify(values)
Convert all items in a given sequence to the same types. |
buildCondition(condition,
comparison=<class 'gnue.common.datasources.GConditions.GCeq'>,
logic=<class 'gnue.common.datasources.GConditions.GCand'>)
Create a condition tree either from a sequence in prefix notation or
a dictionary. In the latter case an optional comparison- and
logic-operator class might be specified.
-
- Parameters:
condition -
sequence in prefix notation or a dictionary with the condition
to be converted
comparison -
(operator) class used to compare keys and values
logic -
(operator) class used to concatenate multiple comparisons
- Returns:
-
GCondition tree
|
buildConditionFromDict(dictionary,
comparison=<class 'gnue.common.datasources.GConditions.GCeq'>,
logic=<class 'gnue.common.datasources.GConditions.GCand'>)
This function creates a new condition tree using the given
comparison as operation between keys and values and a given logic as
concatenation for all keys.
-
- Parameters:
dictionary -
dictionary with (key, value) pairs to convert into a condition
tree
comparison -
(operator) class used to compare keys and values
logic -
(operator) class used to concatenate multiple comparisons
- Returns:
-
GCondition tree
|
buildConditionFromPrefix(prefixList)
This function creates a new condition tree from the given element
sequence, which must be in prefix notation.
-
- Parameters:
prefixList -
sequence of condition elements in prefix notation
- Returns:
-
GCondition tree
|
combineConditions(cond1,
cond2)
Combine two conditions using an AND operator. Both arguments can be
given as condition trees (GCondition), dictionaries or prefix
sequences. The resulting combination is a *new* condition tree. None of
the arguments will be changed.
-
- Parameters:
cond1 -
condition-tree, -dictionary or -sequence (prefix list)
cond2 -
condition-tree, -dictionary or -sequence (prefix list)
- Returns:
-
new GCondition instance with an AND-combination of both
conditions
|
getXMLelements(updates={})
-
|
unify(values)
Convert all items in a given sequence to the same types.
-
- Parameters:
values -
sequence of items to be converted to a common type
- Returns:
-
sequence of converted items having all the same datatype.
|