kojismokydingo.tags¶
Koji Smoky Dingo - tags and targets
- author:
Christopher O'Brien <obriencj@gmail.com>
- license:
GPL v3
- collect_tag_extras(session, tag, prefix=None)[source]¶
Similar to session.getBuildConfig but with additional information recording which tag in the inheritance supplied the setting.
Returns an dict of tag extra settings, keyed by the name of the setting. Each setting is represented as its own dict composed of the following keys:
name - the extra setting key
value - the extra setting value
blocked - whether the setting represents a block
tag_name - the name of the tag this setting came from
tag_id - the ID of the tag this setting came from
- Parameters:
- Since:
1.0
- Return type:
- convert_tag_extras(taginfo, into=None, prefix=None)[source]¶
Provides a merged view of the tag extra settings for a tag. The extras are decorated with additional keys:
name - str, the name of the setting
blocked - bool, whether the setting is blocked
tag_name - str, the name of the tag that provided this setting
tag_id - int, the ID of the tag that provided this setting
When into is not None, then only settings which are not already present in that dict will be set. This behavior is used by
collect_tag_extras
to merge the extra settings across a tag and all its parents into a single dict.- Parameters:
- Since:
1.0
- Return type:
- ensure_tag(session, name)[source]¶
Given a name, resolve it to a tag info dict. If there is no such tag, then create it and return its newly created tag info.
- find_inheritance_parent(inheritance, parent_id)[source]¶
Find the parent link in the inheritance list with the given tag ID.
- Parameters:
inheritance (List[TagInheritanceEntry]) -- the output of a
getFullInheritance
callparent_id (int) -- the ID of a parent tag to look for in the inheritance data.
- Returns:
matching inheritance link data, or None if none are found with the given parent_id
- Since:
1.0
- Return type:
- gather_affected_targets(session, tagnames)[source]¶
Returns the list of target info dicts representing the targets which inherit any of the given named tags. That is to say, the targets whose build tags are children of the named tags.
This list allows us to gauge what build configurations would be impacted by changes to the given tags.
- gather_tag_ids(session, shallow=None, deep=None, results=None)[source]¶
Load IDs from shallow tags, and load IDs from deep tags and all their parents. Returns a set of all IDs found.
If results is specified, it must be a set instance into which the disovered tag IDs will be added. Otherwise a new set will be allocated and returned.
- Parameters:
- Since:
1.0
- Return type:
- renum_inheritance(inheritance, begin=0, step=10)[source]¶
Create a new copy of the tag inheritance data with the priority values renumbered. Ordering is preserved.
- Parameters:
inheritance (List[TagInheritanceEntry]) -- Inheritance structure data
begin (int) -- Starting point for renumbering priority values. Default, 0
step (int) -- Priority value increment for each priority after the first. Default, 10
- Since:
1.0
- Return type:
- resolve_tag(session, name, target=False)[source]¶
Given a name, resolve it to a taginfo.
If target is False, name is treated as a tag's name.
If target is True, name is treated as a target's name, and the resulting taginfo will be from that target's build tag.
- Parameters:
- Raises:
NoSuchTag -- if the tag could not be resolved
NoSuchTarget -- if
target
is True and name cannot be resolved as a target
- Since:
1.0
- Return type: