Bases: object
Base class for all annotations defined in this library.
It contains functions to override in order to catch initialisation of this Annotation and annotated elements binding (also called commonly target in the context of Annotation).
All annotations which inherit from this are registered to target objects and are accessibles through the static method Annotation.get_annotations.
Instance methods to override are: - __init__: set parameters during its instantiation. - _bind_target: called to bind target to this. - on_bind_target: fired when the annotated element is bound to this.
And properties are: - propagate: (default True) determines if an annotation is propagated to all sub target elements. - override: (default False) exclude previous annotation of the same type as self class. - _ttl: (default None) self time to leave. - _in_memory: (default False) save instance in a global dictionary.
Bind self annotation to target.
Parameters: |
|
---|---|
Returns: | bound target. |
Free global annotation memory.
Get dict of {annotated fields: annotations} by annotation_type of input instance.
Returns: | a set of (annotated fields, annotations) |
---|---|
Return type: | dict |
Returns all input target annotations of annotation_type type sorted by definition order.
Parameters: |
|
---|
Parameters: |
|
---|---|
Returns: | target local annotations |
Return type: | list |
Get annotations in memory which inherits from annotation_type.
Parameters: | exclude (tuple/type) – annotation type(s) to exclude from search |
---|---|
Returns: | found annotations which inherits from annotation_type. |
Return type: | set |
Returns: | True if self is in a global memory of annotations. |
---|
Fired after target is bound to self.
Parameters: |
|
---|
Remove from target annotations which inherit from annotation_type
Parameters: |
|
---|
Remove self annotation from target annotations.
Parameters: |
|
---|
Get actual ttl in seconds.
Returns: | actual ttl |
---|---|
Return type: | float |
Bases: b3j0f.annotation.core.Annotation
Stop propagation for annotation types.
Bases: b3j0f.annotation.core.Annotation
Dedicated to add information on any routine, routine parameters or routine result.