ntd2d_action.variants

Representations of a branches and tags.

Classes

class ntd2d_action.variants.Variant(repo, name, rebuild_menu=False, true_name=None)

Bases: object

Representation of a branch or tag.

Parameters:
  • repo (Repository) – Git repository containing this branch or tag.

  • name (str) – Ref name of branch or tag.

  • rebuild_menu (bool) – Whether to rebuild variant menu after updating variants (default: False).

  • true_name (str) – Name of actual branch or tag associated with stable or latest variants.

property css_name

Escape ref name to satisfy css class naming requirements

Used to escape characters that are - allowed by man git-check-ref-format - disallowed by https://www.w3.org/International/questions/qa-escapes#cssescapes


class ntd2d_action.variants.VariantCollection(initlist=None)

Bases: UserList

A collection of Variant objects.

append(item)

S.append(value) – append value to the end of the sequence

clear() None -- remove all items from S
count(value) integer -- return number of occurrences of value
extend(other)

S.extend(iterable) – extend sequence by appending elements from the iterable

index(value[, start[, stop]]) integer -- return first index of value.

Raises ValueError if the value is not present.

Supporting start and stop arguments is optional, but recommended.

insert(i, item)

S.insert(index, value) – insert value before index

pop([index]) item -- remove and return item at index (default last).

Raise IndexError if list is empty or index is out of range.

remove(item)

S.remove(value) – remove first occurrence of value. Raise ValueError if the value is not present.

reverse()

S.reverse() – reverse IN PLACE


class ntd2d_action.variants.VariantCollector(repo, current_variant)

Bases: object

Tool that aggregates branches and versions.

Parameters:
  • repo (Repository) – Git repository to be scanned for branches and tags.

  • current_variant (Variant) – Branch or tag which triggered the workflow.


class ntd2d_action.variants.Version(repo, name, rebuild_menu=False)

Bases: Variant

A Variant that satisfies the PEP 440 version specification

Raises:

InvalidVersion – If the name is not parsable by packaging.version.

property css_name

Escape ref name to satisfy css class naming requirements

Used to escape characters that are - allowed by man git-check-ref-format - disallowed by https://www.w3.org/International/questions/qa-escapes#cssescapes