0.22 Python bindings/MythTV

From MythTV Official Wiki
Jump to: navigation, search

This class is used for general access to mythbackend through use of the [Myth Protocol] interface. By default, the class will connect to the master backend as a 'Monitor'. An alternate can be specified by either an IP address or hostname.

MythTV(backend=None, conn_type='Monitor')

Class initiator.

close()

Shortcut for calling the class destructor

backendCommand(data)

Provides direct access to Myth Protocol for functions not yet implemented in the bindings.

getCurrentRecording(recorder_id)

Returns a Program object for the program currently being recorded on the specified tuner.

getFreeRecorderList()

Returns a list of free recorder IDs (integers)

getPendingRecordings()

Returns a list of Program objects of all upcoming recording matches

getRecorderDetails(recorder_id)

Returns a Recorder object for the specified recorder

getRecorderList()

Returns a list of recorder IDs (integers)

getScheduledRecordings()

Returns a list of Program objects of recording schedules

getUpcomingRecordings()

Returns a list of Program objects of upcoming recordings that will be recorded (after duplicate and conflict filtering)

isActiveBackend(hostname)

Returns a bool as to whether the specified host is an active backend

isRecording(recorder_id)

Returns a bool as to whether the specified recorder is recording

getRecording(chanid, starttime)

Returns a Program object of the specified recording

getRecordings()

Returns a list of Program objects for all existing recordings

getExpiring()

Returns a tuple of Program objects nearing expiration

getCheckfile(program)

Returns the filesystem location of the specified recording

deleteRecording(program,force=False)

Deletes recording defined by program instance. Force will force mythtv to delete metadata even if recording file is not found

forgetRecording(program)

Allows recording defined by program instance to be re-recorded

lockTuner(id=None)

Request a tuner be locked, with an optional id for a specific tuner. Returns a tuple of ID, Video dev node, Audio dev node, and VBI dev node. ID will be <0 on failure.

freeTuner(id=None)

Unlocks a tuner specified by an optional ID. lockTuner() and freeTuner() manage an internal list of tuners locked by the instance. Not supplying an ID will cause the function to unlock all tuner in the list. This is called automatically during cleanup by the destructor.

getFreeSpace(all=False)

Returns a tuple of information about storage devices on the local system. All returns information about all systems, and a summary line

getFreeSpaceSummary()

Returns summary information of all available storage devices

getLoad()

Returns standard 1/5/15 load averages

getUptime()

Returns the machine uptime in seconds

getLastGuideData()

Returns the last date for which guide data exists. (YYYY-MM-DD)

getFrontends()

Returns a list of Frontend objects for frontends with accessible control sockets

getFrontend(hostname)

Returns a Frontend object for the given host. Will throw an exception if it cannot connect

splitInt(integer)

Returns a pair of signed high/low integers, to be used with file sizes