24 __mashup_title__ =
"spaceMashup"
25 __author__=
"R.D. Vaughan"
29 __usage_examples__ =
'''
32 Usage: ./space.py -hduvlST [parameters] <search text>
33 Version: v0.1.0 Author: R.D.Vaughan
35 For details on the MythTV Netvision plugin see the wiki page at:
36 http://www.mythtv.org/wiki/MythNetvision
39 -h, --help show this help message and exit
40 -d, --debug Show debugging info (URLs, raw XML ... etc, info
42 -u, --usage Display examples for executing the script
43 -v, --version Display grabber name and supported options
44 -l LANGUAGE, --language=LANGUAGE
45 Select data that matches the specified language fall
46 back to English if nothing found (e.g. 'es' EspaƱol,
47 'de' Deutsch ... etc). Not all sites or grabbers
49 -p PAGE NUMBER, --pagenumber=PAGE NUMBER
50 Display specific page of the search results. Default
51 is page 1. Page number is ignored with the Tree View
53 -T, --treeview Display a Tree View of a sites videos
61 __search_max_page_items__ = 20
62 __tree_max_page_items__ = 20
68 """Wraps a stream with an encoder"""
77 """Wraps the output stream, encoding Unicode strings with the specified encoding"""
78 if isinstance(obj, unicode):
80 self.out.write(obj.encode(self.
encoding))
90 """Delegate everything but write to the stream"""
91 return getattr(self.
out, attr)
100 '''Import the common python class
105 The subdirectory "nv_python_libs/common" containing the modules mashups_api.py and
106 mashups_exceptions.py (v0.1.3 or greater),
107 They should have been included with the distribution of MythNetvision
112 if common_api.__version__ <
'0.1.3':
113 sys.stderr.write(
"\n! Error: Your current installed common_api.py version is (%s)\nYou must at least have version (0.1.3) or higher.\n" % target.__version__)
119 '''Import the python mashups support classes
124 The subdirectory "nv_python_libs/mashups" containing the modules mashups_api and
125 mashups_exceptions.py (v0.1.0 or greater),
126 They should have been included with the distribution of space.py.
130 if target.__version__ <
'0.1.0':
131 sys.stderr.write(
"\n! Error: Your current installed mashups_api.py version is (%s)\nYou must at least have version (0.1.0) or higher.\n" % target.__version__)
139 The python script "nv_python_libs/mainProcess.py" must be present.
144 if process.__version__ <
'0.2.0':
145 sys.stderr.write(
"\n! Error: Your current installed mainProcess.py version is (%s)\nYou must at least have version (0.2.0) or higher.\n" % process.__version__)
148 if __name__ ==
'__main__':
152 target.baseProcessingDir = os.path.dirname( os.path.realpath( __file__ ))
154 target.common = common_api.Common()
155 main = process.mainProcess(target, apikey, )
156 main.grabberInfo = {}
157 main.grabberInfo[
'title'] = __title__
158 main.grabberInfo[
'command'] =
u'space.py'
159 main.grabberInfo[
'mashup_title'] = __mashup_title__
160 main.grabberInfo[
'author'] = __author__
161 main.grabberInfo[
'thumbnail'] =
'space.png'
162 main.grabberInfo[
'type'] = [
'video', ]
163 main.grabberInfo[
'desc'] =
u"Mashups combines media from multiple sources to create a new work"
164 main.grabberInfo[
'version'] = __version__
165 main.grabberInfo[
'search'] = target.common.checkIfDBItem(
'dummy', {
'feedtitle': __title__, })
166 main.grabberInfo[
'tree'] =
True
167 main.grabberInfo[
'html'] =
False
168 main.grabberInfo[
'usage'] = __usage_examples__
169 main.grabberInfo[
'SmaxPage'] = __search_max_page_items__
170 main.grabberInfo[
'TmaxPage'] = __tree_max_page_items__