23 __title__ =
"Technology";
24 __mashup_title__ =
"technologyMashup"
25 __author__=
"R.D. Vaughan"
29 __usage_examples__ =
'''
32 Usage: ./technology.py -hduvlST [parameters] <search text>
33 Version: v0.XX 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
57 <name>Technology</name>
58 <author>R.D. Vaughan</author>
59 <thumbnail>technology.png</thumbnail>
60 <command>technology.py</command>
62 <description>Mashups combines media from multiple sources to create a new work</description>
63 <version>0.XX</version>
69 > ./technology.py -S "Video"
74 __search_max_page_items__ = 20
75 __tree_max_page_items__ = 20
81 """Wraps a stream with an encoder"""
90 """Wraps the output stream, encoding Unicode strings with the specified encoding"""
91 if isinstance(obj, str):
93 self.
out.buffer.write(obj)
96 """Delegate everything but write to the stream"""
97 return getattr(self.
out, attr)
99 if isinstance(sys.stdout, io.TextIOWrapper):
107 '''Import the common python class
110 except Exception
as e:
112 The subdirectory "nv_python_libs/common" containing the modules common_api.py and
113 common_exceptions.py (v0.1.3 or greater),
114 They should have been included with the distribution of MythNetvision
118 if common_api.__version__ <
'0.1.3':
119 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__)
126 '''Import the python mashups support classes
129 except Exception
as e:
131 The subdirectory "nv_python_libs/mashups" containing the modules mashups_api and
132 mashups_exceptions.py (v0.1.0 or greater),
133 They should have been included with the distribution of technology.py.
137 if target.__version__ <
'0.1.0':
138 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__)
144 except Exception
as e:
146 The python script "nv_python_libs/mainProcess.py" must be present.
151 if process.__version__ <
'0.2.0':
152 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__)
155 if __name__ ==
'__main__':
159 target.baseProcessingDir = os.path.dirname( os.path.realpath( __file__ ))
161 target.common = common_api.Common()
162 main = process.mainProcess(target, apikey, )
163 main.grabberInfo = {}
164 main.grabberInfo[
'enabled'] =
True
165 main.grabberInfo[
'title'] = __title__
166 main.grabberInfo[
'command'] =
'technology.py'
167 main.grabberInfo[
'mashup_title'] = __mashup_title__
168 main.grabberInfo[
'author'] = __author__
169 main.grabberInfo[
'thumbnail'] =
'technology.png'
170 main.grabberInfo[
'type'] = [
'video', ]
171 main.grabberInfo[
'desc'] =
"Mashups combines media from multiple sources to create a new work"
172 main.grabberInfo[
'version'] = __version__
174 main.grabberInfo[
'search'] = target.common.checkIfDBItem(
'dummy', {
'feedtitle': __title__, })
175 main.grabberInfo[
'tree'] =
True
176 main.grabberInfo[
'html'] =
False
177 main.grabberInfo[
'usage'] = __usage_examples__
178 main.grabberInfo[
'SmaxPage'] = __search_max_page_items__
179 main.grabberInfo[
'TmaxPage'] = __tree_max_page_items__