kojismokydingo.sift.common

Koji Smoky Dingo - Koji-specific utilities for working with Sifty Sieves

author:

Christopher O'Brien <obriencj@gmail.com>

license:

GPL v3

class CacheMixin(sifter, *tokens, **options)[source]

Bases: Sieve

Mixin providing some caching interfaces to various koji calls. These will store cached results on the instance's sifter. The cache is cleared when the sifter's reset method is invoked.

Parameters:

sifter (Sifter)

allowed_packages(session, tag_id, inherited=True)[source]

a caching wrapper for session.listPackages which returns a set containing only the package names which are not blocked.

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherited (bool)

Return type:

Set[str]

blocked_packages(session, tag_id, inherited=True)[source]

a caching wrapper for session.listPackages which returns a set containing only the package names which are blocked.

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherited (bool)

Return type:

Set[str]

bulk_get_tag_groups(session, tag_ids)[source]

a multicall caching wrapper for session.getTagGroups. Shares a cache with get_tag_groups

Parameters:
Return type:

Dict[int, List[TagGroupInfo]]

bulk_list_packages(session, tag_ids, inherited=True)[source]

a multicall caching wrapper for session.listPackages

shares the same cache as list_packages (and therefore allowed_packages and blocked_packages)

Parameters:
Return type:

Dict[int, List[TagPackageInfo]]

get_tag_groups(session, tag_id)[source]

a caching wrapper for session.getTagGroups

Parameters:
  • session (ClientSession)

  • tag_id (int)

Return type:

List[TagGroupInfo]

latest_build_ids(session, tag_id, inherit=True)[source]

a caching wrapper for session.getLatestBuilds which returns a set containing only the build IDs

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherit (bool)

Return type:

Set[int]

latest_builds(session, tag_id, inherit=True)[source]

a caching wrapper for session.getLatestBuilds

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherit (bool)

Return type:

List[BuildInfo]

latest_builds_by_name(session, tag_id, inherit=True)[source]

a caching wrapper for session.getLatestBuilds which returns a dict mapping the build names to the build info

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherit (bool)

Return type:

Dict[str, BuildInfo]

latest_maven_build_ids(session, tag_id, inherit=True)[source]

a caching wrapper for kojismokydingo.builds.latest_maven_builds which returns a set containing only the build IDs

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherit (bool)

Return type:

Set[int]

latest_maven_builds(session, tag_id, inherit=True)[source]

a caching wrapper for kojismokydingo.builds.latest_maven_builds

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherit (bool)

Return type:

Dict[Tuple[str, str, str], BuildInfo]

list_packages(session, tag_id, inherited=True)[source]

a caching wrapper for session.listPackages

Parameters:
  • session (ClientSession)

  • tag_id (int)

  • inherited (bool)

Return type:

List[TagPackageInfo]

ensure_comparison(value)[source]

Converts a comparison operator symbol into a comparison function.

Parameters:

value (str) -- The symbol or string to convert. Should be one of '==', '!=', '>', '>=', '<', '<='

Raises:

SifterError -- if the value isn't one of the known operators

Return type:

Callable[[Any, Any], bool]