Difference between revisions of "0.24 Python bindings/System Calls"
m (→System) |
|||
(One intermediate revision by the same user not shown) | |||
Line 9: | Line 9: | ||
|inputs=path=None<br>setting=None<br>db=None | |inputs=path=None<br>setting=None<br>db=None | ||
|outputs=self | |outputs=self | ||
− | |description=Must be provided either the name of a '''setting''', or the absolute '''path''' to an executable. | + | |description=Must be provided either the name of a '''setting''', or the absolute '''path''' to an executable. If both are given, the database setting will take precedence if defined. |
|example=<pre> | |example=<pre> | ||
>>> s = System(path='echo') | >>> s = System(path='echo') | ||
Line 106: | Line 106: | ||
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. | 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. | ||
− | [[Category: | + | [[Category:0.24 Python Bindings]] |
Latest revision as of 09:09, 9 November 2010
This page is for classes intended for use calling external functions and programs.
Contents
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.
__init__
>>> s = System(path='echo') >>> s.path 'echo' | ||||||
append
>>> s.append('some appended','"string"') >>> s.path 'echo some appended "string"' | ||||||
command
>>> s.command('some string') 'some appended string some string\n' >>> s.command('another','string') 'some appended string another string\n' |
Grabber
This class is a modified System class, following the MythTV Universal Metadata Format. This class cannot be called directly, but must be subclassed, with a 'cls' attribute defined as a result handler.
search
| ||||||
sortedSearch
| ||||||
grabInetref
|
VideoGrabber
This class is a modified Grabber class, with pre-defined setting names for use with MythVideo.
__init__
>>> grab = VideoGrabber('TV') >>> grab.search('Better Off Ted', 'Heroes') <generator object search at 0x804f1e1e0> >>> grab.search('Better Off Ted', 'Heroes').next() {'subtitle': 'Heroes', 'revenue': None, ... 'trailer': None} >>> grab.grabInetref(84021, 1, 2).next() {'subtitle': 'Heroes', 'revenue': None, ... 'trailer': 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
>>> igrab = xml.getInternetSources().next() >>> igrab.searchContent('Top Gear') <generator object searchContent at 0x804f1e410> >>> igrab.searchContent('Top Gear').next() {'description': "Jeremy Clarkson asks why there aren't more three-wheeled cars in the world. (R)", ... 'length': None} |
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.