0.24 Python bindings/System Calls

From MythTV Official Wiki
Revision as of 18:15, 6 August 2010 by Wagnerrp (talk | contribs) (initial page)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This page is for classes intended for use calling external functions and programs.

System

This class is the base handler for external calls. The class is designed to take function paths from an entry in the settings table, but direct paths can be provided instead.

Inputs are:

  • path=None - absolute path to external executable
  • setting=None - name of value in settings table to use for path
  • db=None - will read from config.xml if not provided

Either `path` or `setting` must be defined.

append

Accepts one or more strings as arguments, and appends them to the internal path. Can be used to add an argument to a call that is to be used repeatedly.

command

Accepts one or more strings as arguments, and appends them to the path for this run only. Method returns the terminal output from the run. If an errorcode not equal to one is returned, the method will error, and `returncode` and `stderr` attributes will be populated for inspection.

Grabber

This class is a modified System class, following the MythTV Universal Metadata Format. This class cannot be called directly, but must be subclasses, with a 'cls' attribute defined as a result handler.

search

Inputs are:

  • phrase - title or phrase to search for
  • subtitle=None - optional secondary search argument
  • tolerance=None - pull from database value if not defined

This method will return a generator of Metadata objects, filtering for only those equal or less than the Levenshtein distance. The default value if undefined is 5 shifts.

sortedSearch

Accepts the same inputs as search, but returns a list sorted by the Levenshtein distance.

grabInetref

Inputs are:

  • inetref - TMDB/TTVDB/IMDB reference string, to be handled as a unique identifier by the grabber script
  • season=None - optional integer season number
  • episode=None - optional integer episode number

Returns a single matching Metadata object

VideoGrabber

This class is a modified Grabber class, with pre-defined setting names for use with MythVideo.

Inputs are:

  • mode - 'TV' or 'Movie', depending on which MythVideo grabber to use
  • lang='en' - optional language to pass to grabber script
  • db=None

InternetSource

The class does not call external executables directly, but accesses data from them being run on the backend over MythXML. This class should not be run directly, but instead retrieved through MythXML.getInternetSources().

searchContent

Inputs are:

  • query - search string to pass to grabber
  • page=1 - optional paging argument to pass to grabber

Returns a generator of InternetMetadata objects.

SystemEvent

This class is a modified System class for handling system events received from the backend. This class is only to be called automatically by MythSystemEvent, in order to run the executable defined in the database, and should not be called directly.