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:
JobBaseSubmit torrent file and other metadata to tracker
This job adds the following signals to
signal:submittingEmitted when attempting to upload metadata. Registered callbacks get no arguments.
submittedEmitted when upload attempt ended. Registered callbacks get the torrent page URL of the submitted torrent as a positional argument or a
RequestErrorif the upload failed.
- cache_id = None
- initialize(*, tracker_jobs)[source]
Set internal state
- Parameters:
tracker (TrackerBase) – Return value of
tracker()tracker_jobs (TrackerJobsBase) – Instance of
TrackerJobs
- async run()[source]
Do the work
This method is called by
start(). Its coroutine is passed toadd_task().Any keyword arguments passed to
initialize()are available viakwargs.The job
is_finishedwhen alladded tasksare done or cancelled. (See alsofinalize()andfinalization().)This method may call
add_task()if more tasks are required.
Hide this job if
submission_okis falsyIf
submission_okis 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_uploadhave finished successfully.
- property output
Output from
_main_job
- property exit_code
Exit code from last enabled job in
jobs_before_uploadif notsubmission_okJobBase.exit_codeotherwise.