upsies.jobs.bdinfo

Wrapper for bdinfo command

Classes

class upsies.jobs.bdinfo.BdinfoJob(*, 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

Provide (partial) BDInfo report

This job adds the following signals to signal:

progress

Emitted in short intervals after playlists_selected() was called at least once until all BDInfo reports are available. Registered callbacks get a BdinfoProgress instance.

bdinfo_report

Emitted when a BDInfo report is available. Registered callbacks get a BdinfoReport instance.

cache_id = None
initialize(*, summary=None, format='{BDINFO}')[source]

Set internal state

Parameters:
  • summary

    Only provide a shorter summary as output

    One of full, quick or None.

    Note that this only affects the output. bdinfo_reports, full_summaries and quick_summaries are always available.

  • format – String that contains the placeholder "{BDINFO}", which is replaced by the actual BDInfo report

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.

terminate(reason=None)[source]

Cancel all added tasks

Do nothing if job is_finished or is_terminated.

Parameters:

reason – Why this job is terminated (only used for debugging)

property bdinfo_reports

Sequence of BdinfoReport instances

property reports_by_file

Map playlist filepaths (.mpls) to BDInfo reports gathered so far

property full_summaries

Sequence of full_summary values from bdinfo_reports

property quick_summaries

Sequence of quick_summary values from bdinfo_reports

class upsies.jobs.bdinfo.BdinfoProgress(*, playlist, percent=0, time_elapsed=0, time_remaining=0)[source]

Bases: dict

Simple dict subclass with the following keys:

Keys are also conveniently available as attributes.

class upsies.jobs.bdinfo.BdinfoReport(report, playlist)[source]

Bases: str

BDInfo report as special string with the additional properties full_summary, quick_summary and playlist

property full_summary

Full summary of the BDInfo report

property quick_summary

Quick summary of the BDInfo report

property playlist

Source of the BDInfo report as a Playlist instance