RSPImageTagCollection

class controller.models.domain.rsptag.RSPImageTagCollection(tags)

Bases: object

Hold and perform operations on a set of RSPImageTag objects.

Parameters:

tags (Iterable[RSPImageTag]) – RSPImageTag objects to store.

Methods Summary

all_tags()

Iterate over all tags.

from_tag_names(tag_names, aliases[, cycle])

Create a collection from tag strings.

subset(*[, releases, weeklies, dailies, include])

Return a subset of the tag collection.

tag_for_tag_name(tag_name)

Look up a tag by tag name.

Methods Documentation

all_tags()

Iterate over all tags.

Yields:

RSPImageTag – Each tag in sorted order.

Return type:

Iterator[RSPImageTag]

classmethod from_tag_names(tag_names, aliases, cycle=None)

Create a collection from tag strings.

Parameters:
  • tag_names (list[str]) – Tag strings that should be parsed as tags.

  • aliases (set[str]) – Tags by these names, if found, should be treated as aliases.

  • cycle (int | None, default: None) – If given, only add tags with a matching cycle.

Returns:

The resulting collection of tags.

Return type:

RSPImageTagCollection

subset(*, releases=0, weeklies=0, dailies=0, include=None)

Return a subset of the tag collection.

Parameters:
  • releases (int, default: 0) – Number of releases to include.

  • weeklies (int, default: 0) – Number of weeklies to include.

  • dailies (int, default: 0) – Number of dailies to include.

  • include (set[str] | None, default: None) – Include this list of tags even if they don’t meet other criteria.

Returns:

The desired subset.

Return type:

RSPImageTagCollection

tag_for_tag_name(tag_name)

Look up a tag by tag name.

Parameters:

tag_name (str) – Tag to search for.

Returns:

The tag if found in the collection, else None.

Return type:

bool