vcorelib.target.expression
index
/home/vkottler/src/vkottler/workspace/vcorelib/vcorelib/target/expression.py

A module implementing expression evaluation for targets.

 
Classes
       
vcorelib.target.evaluation.TargetEvaluatorInterface(abc.ABC)
ExpressionTargetEvaluator
vcorelib.target.evaluation.TargetInterface(abc.ABC, typing.Generic)
ExpressionTarget

 
class ExpressionTarget(vcorelib.target.evaluation.TargetInterface)
    ExpressionTarget(data: 'str') -> 'None'
 
A class for evaluating expressions based on substitution data.
 
 
Method resolution order:
ExpressionTarget
vcorelib.target.evaluation.TargetInterface
abc.ABC
typing.Generic
builtins.object

Methods defined here:
compile_match(self, target: vcorelib.target.Target, data: str) -> Optional[str]
If a target matches provided data, compile our expression and return
the result.

Class methods defined here:
parse(data: str) -> Optional[vcorelib.target.expression.ExpressionTargetEvaluator] from abc.ABCMeta
Obtain an expression target-evaluator from provided string data. If
data doesn't contain any target-evaluation syntax, return None.

Data and other attributes defined here:
__abstractmethods__ = frozenset()
__orig_bases__ = (vcorelib.target.evaluation.TargetInterface[vcorelib.target.expression.ExpressionTargetEvaluator],)
__parameters__ = ()

Methods inherited from vcorelib.target.evaluation.TargetInterface:
__eq__(self, other: 'object') -> 'bool'
Check if two targets are equal.
__hash__(self) -> 'int'
Get the hash for this target.
__init__(self, data: 'str') -> 'None'
Initialize this target.
__str__(self) -> 'str'
Get this target as a string.
compile(self, substitutions: 'Substitutions' = None) -> 'str'
Attempt to get a target literal from this target and optional
substitutions.

Class methods inherited from vcorelib.target.evaluation.TargetInterface:
is_literal(data: 'str') -> 'bool' from abc.ABCMeta
Determine if a target is guaranteed to be literal or not.
segment_count(data: 'str') -> 'int' from abc.ABCMeta
Count the number of dynamic segments and validate syntax.

Data descriptors inherited from vcorelib.target.evaluation.TargetInterface:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

Data and other attributes inherited from vcorelib.target.evaluation.TargetInterface:
dynamic_end = '}'
dynamic_start = '{'

Class methods inherited from typing.Generic:
__class_getitem__(...) from abc.ABCMeta
Parameterizes a generic class.
 
At least, parameterizing a generic class is the *main* thing this
method does. For example, for some generic class `Foo`, this is called
when we do `Foo[int]` - there, with `cls=Foo` and `params=int`.
 
However, note that this method is also called when defining generic
classes in the first place with `class Foo[T]: ...`.
__init_subclass__(...) from abc.ABCMeta
Function to initialize subclasses.

 
class ExpressionTargetEvaluator(vcorelib.target.evaluation.TargetEvaluatorInterface)
    ExpressionTargetEvaluator(original: 'str', keys: '_List[str]', markers: '_List[_Tuple[int, int]]') -> 'None'
 
An interface for evaluating expression targets.
 
 
Method resolution order:
ExpressionTargetEvaluator
vcorelib.target.evaluation.TargetEvaluatorInterface
abc.ABC
builtins.object

Methods defined here:
compile_key(self, key: str, values: Dict[str, Union[str, int]]) -> str
Process the key based on substitution data.

Data and other attributes defined here:
__abstractmethods__ = frozenset()

Methods inherited from vcorelib.target.evaluation.TargetEvaluatorInterface:
__init__(self, original: 'str', keys: '_List[str]', markers: '_List[_Tuple[int, int]]') -> 'None'
Initialize this evaluator.
compile(self, values: 'Substitutions') -> 'str'
Build a string from this target with values replaced for keys that
appeared in the original string.

Data descriptors inherited from vcorelib.target.evaluation.TargetEvaluatorInterface:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object