MythTV master
main.py
Go to the documentation of this file.
1# smolt - Fedora hardware profiler
2#
3# Copyright (C) 2009 Sebastian Pipping <sebastian@pipping.org>
4# Copyright (C) 2011 James Meyer <james.meyer@operamail.com>
5#
6# This program is free software; you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation; either version 2 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program; if not, write to the Free Software
18# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
19
20import os
21from distros.distro import Distro
22import distros.shared.html as html
23
24
25
27 def key(self):
28 return 'mythtv'
29
30 def detected(self, debug=False):
31
32 #return False
33 return True
34
35
36 def gather(self, gate, debug=False):
37 def _stage(text):
38 print('Processing %s' % (text))
39 from distros.mythtv_data.data_mythtv import create_mythtv_data
40
41 _stage('MythTV Data')
42 features = create_mythtv_data(gate)
43
44 machine_data = {}
45 html_lines = []
46 rst_lines = []
47 metrics_dict = {}
48
49 rst_lines.append('MythTV data')
50 rst_lines.append('=================================')
51 machine_data['protocol'] = '1.2'
52
53
54 machine_data['features'] = features.serialize()
55 features.dump_rst(rst_lines)
56 rst_lines.append('')
57
58 excerpt_lines = []
59 excerpt_lines.append('...')
60
61 self._data = machine_data
62 self._html = '\n'.join(html_lines)
63 self._rst = '\n'.join(rst_lines)
64 self._excerpt = '\n'.join(excerpt_lines)
65
66 def data(self):
67 return self._data
68
69 def html(self):
70 return self._html
71
72 def rst(self):
73 return self._rst
74
75 def rst_excerpt(self):
76 return self._excerpt
77
78
80 return _Mythtv()
81
82
83if __name__ == '__main__':
84 # Enable auto-flushing for stdout
85 import sys
86 sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
87
88 from gate import create_passing_gate
89 mythtv = create_mythtv()
90 mythtv.gather(create_passing_gate(), debug=True)
91
92 print(mythtv.rst())
def gather(self, gate, debug=False)
Definition: main.py:36
def create_passing_gate()
Definition: gate.py:91
static void print(const QList< uint > &raw_minimas, const QList< uint > &raw_maximas, const QList< float > &minimas, const QList< float > &maximas)