footprints.collectors¶
Handling of footprints collectors. Module’s usage is mostly dedicated to the main footprints package. The footprints proxy could make some part of the interface visible as well.
Functions¶
Classes¶
- class footprints.collectors.Collector(*args, **kw)[source]¶
Bases:
GetByTag,Catalog,ObserverA class collector is devoted to the gathering of class references that inherit from a given class (here a class with a footprint), according to some other optional criteria.
- Parameters:
non_ambiguous_loglevel (int) – The loglevel used in the find_best method when several choices are possible but the priority of the various candidates makes the choice easy (default: logging.INFO).
Some class variables may have an impact on GetByTag behaviour:
_tag_default: Sets the defaulttag(if thetagattribute is omitted when calling the constructor, the_tag_defaultstring will be used._tag_implicit_new: If set toFalse, unlessnew=Trueis specified when calling the constructor, it won’t be allowed to create new objects (a RuntimeError exception will be thrown)._tag_topcls: if set toFalse, the tags list will be shared with the parent class (and possibly other siblings). Thetag_classes()class method allows to retrieve the list of Classes sharing the same list of tags
- almost_clone(original, **extra)[source]¶
Return an almost clone, with some extra or different attributes.
- default(**kw)[source]¶
Try to find in existing instances tracked by the
tagcollector a suitable candidate according to description.
- delobsitem(item, info)[source]¶
Unregister an existing object in the current collector of instances.
- discard_higher_level(tag, verbose=True)[source]¶
Discard from current collector classes with priority level higher or equal to
level.
- discard_lower_level(tag, verbose=True)[source]¶
Discard from current collector classes with priority level lower than
level.
- discard_onflag(flagmethod, default=True, verbose=True)[source]¶
Discard from current collector classes with method
flagmethodreturningdefault.
- discard_package(packname, verbose=True)[source]¶
Discard from current collector classes with name starting with
packname.
- filter_higher_level(tag)[source]¶
Find in current collector classes with priority level higher or equal to
level.
- filter_lower_level(tag)[source]¶
Find in current collector classes with priority level lower than
level.
- filter_onflag(flagmethod, default=True)[source]¶
Find in current collector classes with method
flagmethodreturningdefault.
- filter_package(packname)[source]¶
Find in current collector classes with name starting with
packname.
- find_all(desc, resolvecache=None)[source]¶
Returns all the items of the collector that
footprint_couldbe()as described by argumentdesc.
- find_any(desc, resolvecache=None)[source]¶
Return the first item of the collector that
footprint_couldbe()as described by argumentdesc.
- find_best(desc, resolvecache=None)[source]¶
Returns the best of the items returned by the
find_all()method according to potential priority rules.
- get_values(attrname)[source]¶
Complete set of values which are explicitly authorized for a given attribute.
- grep(**kw)[source]¶
Grep in the current instances of the collector items that match the set of attributes given as named arguments.
- newobsitem(item, info)[source]¶
Register a new instance of some of the classes in the current collector.
- pickup(desc, resolvecache=None)[source]¶
Try to pickup inside the collector an item that could match the description.
- pickup_and_cache(desc, resolvecache=None)[source]¶
Try to pickup inside the collector an item that could match the description.
- property report_last¶
Return the subpart of the report related to the last sequence of evaluation through the current collector.
- report_sorted(**kw)[source]¶
Return the subpart of the report related to the last sequence of evaluation through the current collector ordered by args.
- report_whynot(classname)[source]¶
Report why any class matching the
classnamepattern has not been selected through the last evaluation.
- reset_package_level(packname, tag)[source]¶
Reset priority level current collector classes with name starting with
packname.
- show_attrkeys(only=None)[source]¶
Show the list of attribute names that could be found in classes collected by the current collector.