upsies.jobs.rules

Tracker rules

Classes

class upsies.jobs.rules.RulesJob(*, home_directory=None, cache_directory=None, cache_id='', ignore_cache=False, no_output_is_ok=False, hidden=False, autostart=True, guaranteed=False, precondition=None, prejobs=(), callbacks={}, **kwargs)[source]

Bases: JobBase

Check if a particulare release does not violate tracker rules

This job adds the following signals to signal:

checking

Emitted when a rule is checked. Registered callbacks get the TrackerRuleBase subclass as a positional argument.

checked

Emitted when a rule was checked. Registered callbacks get the TrackerRuleBase subclass and a RuleBroken instance or None as positional arguments.

cache_id = None
property tracker

Instance of a TrackerBase subclass

property tracker_jobs

Instance of a TrackerJobsBase subclass

property release_name

ReleaseName instance

initialize(*, tracker_jobs, only_warn=False)[source]

Set internal state

Parameters:
  • tracker_jobs – Instance of a TrackerJobsBase subclass

  • only_warn (bool) – Exceptions from broken rules are passed to warn() instead of error() (i.e. allow submissions with broken rules)

async run()[source]

Do the work

This method is called by start(). Its coroutine is passed to add_task().

Any keyword arguments passed to initialize() are available via kwargs.

The job is_finished when all added tasks are done or cancelled. (See also finalize() and finalization().)

This method may call add_task() if more tasks are required.