upsies.jobs.submit

Share generated metadata

Classes

class upsies.jobs.submit.SubmitJob(*, 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

Submit torrent file and other metadata to tracker

This job adds the following signals to signal:

submitting

Emitted when attempting to upload metadata. Registered callbacks get no arguments.

submitted

Emitted when upload attempt ended. Registered callbacks get the torrent page URL of the submitted torrent as a positional argument or a RequestError if the upload failed.

cache_id = None
initialize(*, tracker_jobs)[source]

Set internal state

Parameters:
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.

property hidden

Hide this job if submission_ok is falsy

If submission_ok is falsy, that usually means we are only generating some metadata that is not supposed to be submitted.

It also should mean this job is not displayed until all jobs_before_upload have finished successfully.

property output

Output from _main_job

property exit_code

Exit code from last enabled job in jobs_before_upload if not submission_ok

JobBase.exit_code otherwise.