kojismokydingo.sift.tags¶
Koji Smoky Dingo - Sifty Dingo filtering for Koji Tags
This module provides sieves for filtering through koji tag info dicts.
- author:
Christopher O'Brien <obriencj@gmail.com>
- license:
GPL v3
- class ArchSieve(sifter, *tokens)[source]¶
Bases:
MatcherSieve
usage:
(arch [ARCH...])
If no
ARCH
patterns are specified, matches tags which have any architectures at all.If
ARCH
patterns are specified, then only matches tags which have an architecture that matches any of the given patterns.- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'arch'¶
- class BuildTagSieve(sifter, *tokens)[source]¶
Bases:
TargetSieve
usage:
(build-tag [TARGET...])
If no
TARGET
is specified, then matches tags which are used as the build tag for any target.If any
TARGET
patterns are specified, then matches tags which are used as the build tag for a target with a name matching any of the patterns.- name = 'build-tag'¶
- class CompareLatestSieve(sifter, pkgname, op='>=', ver='0')[source]¶
Bases:
Sieve
usage:
(compare-latest PKG [OP VER])
If OP and VER are not specified, matches tags which have any build of the given package name as latest.
If OP and VER are specified, matches tags which have the a latest build of the given package name which compare correctly. If tag doesn't have any build of the given package name, it will not match.
- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'compare-latest'¶
- class DestTagSieve(sifter, *tokens)[source]¶
Bases:
TargetSieve
usage:
(dest-tag [TARGET...])
If no
TARGET
is specified, then matches tags which are used as the destination tag for any target.If any
TARGET
patterns are specified, then matches tags which are used as the destination tag for a target with a name matching any of the patterns.- name = 'dest-tag'¶
- class ExactArchSieve(sifter, *tokens)[source]¶
Bases:
SymbolSieve
usage:
(exact-arch [ARCH...])
If no
ARCH
names are specified, matches only tags which have no architectures.If
ARCH
names are specified, they must be specified as symbols. Only matches tags which have the exact same set of architectures.- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- get_info_cache(tinfo)[source]¶
Gets a cache dict from the sifter using the name of this sieve and the sifter's designated key for the given info dict. The default sifter key will get the "id" value from the info dict.
The same cache dict will be returned for this info dict until the sifter has its
reset
method invoked.
- name = 'exact-arch'¶
- class GroupPkgSieve(sifter, group, pkg, *pkgs, require_all=False)[source]¶
Bases:
SymbolSieve
,CacheMixin
usage:
(group-pkg GROUP PKG [PKG...] [require_all: False])
Matches tags which have the given install group, which also contains any of the given
PKG
names- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'group-pkg'¶
- class GroupSieve(sifter, group, *groups)[source]¶
Bases:
SymbolSieve
,CacheMixin
usage:
(group GROUP [GROUP...])
Matches tags which have any of the given install groups configured. Honors inheritance.
- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'group'¶
- class HasAncestorSieve(sifter, *tokens)[source]¶
Bases:
InheritanceSieve
usage:
(has-ancestor [TAG...])
alias:(inherits-from [TAG...])
If no
TAG
patterns are specified, matches tags which have any parents.If
TAG
patterns are specified, matches tags which have a parent at any depth matching any of the given patterns.- name = 'has-ancestor'¶
- class HasChildSieve(sifter, *tokens)[source]¶
Bases:
InheritanceSieve
usage:
(has-child [TAG...])
alias:(parent-of [TAG...])
If no
TAG
patterns are specified, matches tags which are the direct parent to any other tag.If
TAG
patterns are specified, matches tags which are the direct parent to any tag matching any of the given patterns.- name = 'has-child'¶
- class HasDescendantSieve(sifter, *tokens)[source]¶
Bases:
InheritanceSieve
usage:
(has-descendant [TAG...])
alias:(inherited-by [TAG...])
If no
TAG
patterns are specified, matches tags which are inherited by any other tag.If
TAG
patterns are specified, matches tags which are inherited by any tag matching any of the patterns, at any depth.- name = 'has-descendant'¶
- class HasParentSieve(sifter, *tokens)[source]¶
Bases:
InheritanceSieve
usage:
(has-parent [TAG...])
alias:(child-of [TAG...])
If no
TAG
patterns are specified, matches tags which have any parents.If
TAG
patterns are specified, matchs tags which have any direct parent matching any of the given patterns.- name = 'has-parent'¶
- class LatestSieve(sifter, *exprs)[source]¶
Bases:
NVRSieve
usage:
(latest [NVR...])
If no
NVR
is specified, matches tags which have any builds tagged in them or inherited from parent tags.If
NVR
is specified, matches tags which have any of the given builds as the latest inherited build of the relevant package name. EachNVR
must be valid a reference to a build in this koji instance, or a NoSuchBuild exception will be raised.- name = 'latest'¶
- class LockedSieve(sifter)[source]¶
Bases:
Sieve
usage:
(locked)
Matches tags which have been locked
- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'locked'¶
- class NameSieve(sifter, *exprs)[source]¶
Bases:
ItemSieve
Usage:
(name NAME [NAME...])
filters for dict infos whose name matches any of the given
NAME
matchers.- field = 'name'¶
- name = 'name'¶
- class PermissionSieve(sifter, *tokens)[source]¶
Bases:
MatcherSieve
usage:
(permission [PERM...])`
If no
PERM
is specified, then matches tags which have any non-None permission set.If any
PERM
patters are specified, then matches tags which have any of the listed permissions set.- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'permission'¶
- class PkgAllowedSieve(sifter, pkgname, *pkgnames)[source]¶
Bases:
PkgListSieve
usage:
(pkg-allowed PKG [PKG...])
Matches tags which have a package listing with any of the given
PKG
contained therein and not blocked, honoring inheritance.- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'pkg-allowed'¶
- class PkgBlockedSieve(sifter, pkgname, *pkgnames)[source]¶
Bases:
PkgListSieve
usage:
(pkg-blocked PKG [PKG...])
Matches tags which have a package listing with any of the given
PKG
contained therein and blocked, honoring inheritance.- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'pkg-blocked'¶
- class PkgUnlistedSieve(sifter, pkgname, *pkgnames)[source]¶
Bases:
PkgListSieve
usage:
(pkg-unlisted PKG [PKG...])
Matches tags which have no package listing (neither allowed nor blocked) for any of the given
PKG
names. Honors inheritance.- check(session, taginfo)[source]¶
Override to return True if the predicate matches the given info dict.
This is used by the default
run
implementation in a filter. Only the info dicts which return True from this method will be included in the results.- Parameters:
info -- The info dict to be checked.
- name = 'pkg-unlisted'¶
- class TaggedSieve(sifter, *exprs)[source]¶
Bases:
NVRSieve
usage:
(tagged [NVR...])
If no
NVR
is specified, matches tags which have any builds tagged in them.If
NVR
is specified, matches tags which have any of the given builds tagged in them. EachNVR
must be a valid reference to a build in this koji instance, or a NoSuchBuild exception will be raised.- name = 'tagged'¶
- sift_tagnames(session, src_str, names, params=None)[source]¶
- Parameters:
- Returns:
mapping of flags to matching tag info dicts
- Return type:
- sift_tags(session, src_str, tag_infos, params=None)[source]¶
- Parameters:
- Returns:
mapping of flags to matching tag info dicts
- Return type:
- tag_info_sieves()[source]¶
A new list containing the default tag-info sieve classes.
This function is used by
tag_info_sifter
when creating itsSifter
instance.