Difference between revisions of "0.24 Python bindings/Connection Handlers"

From MythTV Official Wiki
Jump to: navigation, search
(Created page with '== Database Connections == === MythDB === === MythVideo === === MythMusic === == MythProto Connections == === MythBE === === BEEventMonitor === === M…')
 
Line 1: Line 1:
 
== Database Connections ==
 
== Database Connections ==
 
=== MythDB ===
 
=== MythDB ===
 +
{| border=1 cellspacing=0 cellpadding=5
 +
| Command
 +
| Inputs
 +
| Returns
 +
| Description
 +
|-
 +
| backendCommand
 +
| command string
 +
| result string
 +
| This method sends a low level string to the backend, and returns the response.
 +
|-
 +
| getRecording
 +
| chanid<br>starttime
 +
| None or [[Trunk Python bindings/Data Handlers#Program|Program]] object
 +
| Returns information for a single recording
 +
|-
 +
| deleteRecording
 +
| Program object<br>force=False (optional)
 +
|
 +
| Informs the backend to delete the recording using whatever mechanism was selected
 +
|-
 +
| forgetRecording
 +
| Program object
 +
|
 +
| Informs the backend to mark a recording as re-recordable
 +
|-
 +
| deleteFile
 +
| relative path to file<br>storage group name
 +
|
 +
| Delete a single managed file on the backend
 +
|-
 +
| getHash
 +
| relative path to file<br>storage group name
 +
| hash string
 +
| Calculate the [http://trac.opensubtitles.org/projects/opensubtitles/wiki/HashSourceCodes hash] value for a managed file
 +
|-
 +
| reschedule
 +
| recordid=-1 (optional)<br>wait=False (optional)
 +
|
 +
| Issue a scheduler run on all rules, or on one specific rule if other than '-1'. Will optionally wait for the scheduler to finish before returning.
 +
|-
 +
| fileExists
 +
| relative path to file<br>sgroup='Default' (optional)
 +
| None or full path to file
 +
| Searches storage groups on the backend for given file
 +
|-
 +
| download
 +
| url
 +
| DownloadFileTransfer object
 +
| Starts a managed download on the backend to the Temp storage group, and returns a file object. The downloaded file will be automatically deleted when the file is closed.
 +
|-
 +
| downloadTo
 +
| url<br>storage group<br>relative path to file<br>openfile=False (optional)
 +
| None or DownloadFileTransfer object (if openfile is True)
 +
| Starts a managed download on the backend to the specified location. Optionally opens the new file for reading.
 +
|-
 +
| allocateEventLock
 +
| regular expression
 +
| EventLock object
 +
| Opens a lock object that cannot be acquired until an event matching the regular expression has been received.
 +
|-
 +
| getPendingRecordings
 +
|
 +
| list of Program objects
 +
| Returns a list of programs scheduled to be recorded
 +
|-
 +
| getScheduledRecordings
 +
|
 +
| list of Program objects
 +
| Returns a list of programs scheduled to be recorded
 +
|-
 +
| getUpcomingRecordings
 +
|
 +
| list of Program objects
 +
| Returns a list of programs scheduled to be recorded, filtered for only those that will be recorded
 +
|-
 +
| getConflictedRecordings
 +
|
 +
| list of Program objects
 +
| Returns a list of programs scheduled to be recorded, filtered for only those with scheduling conflicts
 +
|-
 +
| getRecorderList
 +
|
 +
| list of integers
 +
| Returns a list of defined card IDs
 +
|-
 +
| getFreeRecorderList
 +
|
 +
| list of integers
 +
| Returns a list of available card IDs
 +
|-
 +
| lockTuner
 +
| id=None (optional)
 +
| (ID, video node, audio node, VBI node) or integer error
 +
| Returns the information about the locked tuner, -1 if no tuners are available, or -2 if the optionally requested tuner is already locked.
 +
|-
 +
| freeTuner
 +
| id=None (optional)
 +
|
 +
| Free all tuners currently locked by this connection, or one specific tuner.  This is automatically run when the connection is closed.
 +
|-
 +
| getCurrentRecording
 +
| recorder
 +
| Program object
 +
| Returns the program currently being recorded by the given ID.
 +
|-
 +
| isRecording
 +
| recorder
 +
| boolean
 +
| Returns True or False whether the recorder is actively being used.
 +
|-
 +
| isActiveBackend
 +
| hostname
 +
| boolean
 +
| Returns True or False whether the provided host is connected as a backend.
 +
|-
 +
| getRecordings
 +
|
 +
| list of Program objects
 +
| Returns a list of existing recordings.
 +
|-
 +
| getExpiring
 +
|
 +
| list of Program objects
 +
| Returns a list of existing recordings nearing expiration.
 +
|-
 +
| getCheckfile
 +
| Program object
 +
| path string
 +
| Returns the path to the recording on the backend.
 +
|-
 +
| getFreeSpace
 +
| all=False (optional)
 +
| list of FreeSpace objects
 +
| Returns information about the recording directories on the local or all backends.
 +
|-
 +
| getFreeSpaceSummary
 +
|
 +
| total and used space (in integer KB)
 +
| Returns information about disk usage.
 +
|-
 +
| getLoad
 +
|
 +
| 1, 5, and 15 minute load averages
 +
|
 +
|-
 +
| getUptime
 +
|
 +
| uptime in seconds
 +
|
 +
|-
 +
| walkSG
 +
|
 +
|
 +
|
 +
|-
 +
| getSGList
 +
|
 +
|
 +
|
 +
|-
 +
| getSGFile
 +
|
 +
|
 +
|
 +
|-
 +
| getLastGuideData
 +
|
 +
| string date of last guide data
 +
|
 +
|}
 
=== MythVideo ===
 
=== MythVideo ===
 
=== MythMusic ===
 
=== MythMusic ===
Line 12: Line 183:
 
=== MythXML ===
 
=== MythXML ===
 
=== Frontend ===
 
=== Frontend ===
 +
 +
[[Category:Trunk_Python_Bindings]]

Revision as of 19:45, 21 July 2010

Database Connections

MythDB

Command Inputs Returns Description
backendCommand command string result string This method sends a low level string to the backend, and returns the response.
getRecording chanid
starttime
None or Program object Returns information for a single recording
deleteRecording Program object
force=False (optional)
Informs the backend to delete the recording using whatever mechanism was selected
forgetRecording Program object Informs the backend to mark a recording as re-recordable
deleteFile relative path to file
storage group name
Delete a single managed file on the backend
getHash relative path to file
storage group name
hash string Calculate the hash value for a managed file
reschedule recordid=-1 (optional)
wait=False (optional)
Issue a scheduler run on all rules, or on one specific rule if other than '-1'. Will optionally wait for the scheduler to finish before returning.
fileExists relative path to file
sgroup='Default' (optional)
None or full path to file Searches storage groups on the backend for given file
download url DownloadFileTransfer object Starts a managed download on the backend to the Temp storage group, and returns a file object. The downloaded file will be automatically deleted when the file is closed.
downloadTo url
storage group
relative path to file
openfile=False (optional)
None or DownloadFileTransfer object (if openfile is True) Starts a managed download on the backend to the specified location. Optionally opens the new file for reading.
allocateEventLock regular expression EventLock object Opens a lock object that cannot be acquired until an event matching the regular expression has been received.
getPendingRecordings list of Program objects Returns a list of programs scheduled to be recorded
getScheduledRecordings list of Program objects Returns a list of programs scheduled to be recorded
getUpcomingRecordings list of Program objects Returns a list of programs scheduled to be recorded, filtered for only those that will be recorded
getConflictedRecordings list of Program objects Returns a list of programs scheduled to be recorded, filtered for only those with scheduling conflicts
getRecorderList list of integers Returns a list of defined card IDs
getFreeRecorderList list of integers Returns a list of available card IDs
lockTuner id=None (optional) (ID, video node, audio node, VBI node) or integer error Returns the information about the locked tuner, -1 if no tuners are available, or -2 if the optionally requested tuner is already locked.
freeTuner id=None (optional) Free all tuners currently locked by this connection, or one specific tuner. This is automatically run when the connection is closed.
getCurrentRecording recorder Program object Returns the program currently being recorded by the given ID.
isRecording recorder boolean Returns True or False whether the recorder is actively being used.
isActiveBackend hostname boolean Returns True or False whether the provided host is connected as a backend.
getRecordings list of Program objects Returns a list of existing recordings.
getExpiring list of Program objects Returns a list of existing recordings nearing expiration.
getCheckfile Program object path string Returns the path to the recording on the backend.
getFreeSpace all=False (optional) list of FreeSpace objects Returns information about the recording directories on the local or all backends.
getFreeSpaceSummary total and used space (in integer KB) Returns information about disk usage.
getLoad 1, 5, and 15 minute load averages
getUptime uptime in seconds
walkSG
getSGList
getSGFile
getLastGuideData string date of last guide data

MythVideo

MythMusic

MythProto Connections

MythBE

BEEventMonitor

MythSystemEvent

Other Connections

MythXML

Frontend