1 from Screen import Screen
2 from Components.ServiceScan import ServiceScan as CScan
3 from Components.ProgressBar import ProgressBar
4 from Components.Label import Label
5 from Components.ActionMap import ActionMap
6 from Components.FIFOList import FIFOList
7 from Components.Sources.FrontendInfo import FrontendInfo
9 class ServiceScanSummary(Screen):
11 <screen position="0,0" size="132,64">
12 <widget name="Title" position="6,4" size="120,42" font="Regular;16" transparent="1" />
13 <widget name="scan_progress" position="6,50" zPosition="1" borderWidth="1" size="56,12" backgroundColor="dark" />
14 <widget name="Service" position="6,22" size="120,26" font="Regular;12" transparent="1" />
17 def __init__(self, session, parent, showStepSlider = True):
18 Screen.__init__(self, session, parent)
20 self["Title"] = Label(parent.title or "ServiceScan")
21 self["Service"] = Label("No Service")
22 self["scan_progress"] = ProgressBar()
24 def updateProgress(self, value):
25 self["scan_progress"].setValue(value)
27 def updateService(self, name):
28 self["Service"].setText(name)
30 class ServiceScan(Screen):
34 if self["scan"].isDone():
44 self.oldtimeoutvalue = open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "r").readline()
45 open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write("0")
47 print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
49 def resetTimeout(self):
51 open("/sys/module/dvb_core/parameters/dvb_shutdown_timeout", "w").write(self.oldtimeoutvalue)
53 print "[info] no /sys/module/dvb_core/parameters/dvb_shutdown_timeout available"
55 def __init__(self, session, scanList):
56 Screen.__init__(self, session)
58 self.scanList = scanList
60 self.session.nav.stopService()
62 self["scan_progress"] = ProgressBar()
63 self["scan_state"] = Label(_("scan state"))
64 self["network"] = Label()
65 self["transponder"] = Label()
67 self["pass"] = Label("")
68 self["servicelist"] = FIFOList(len=10)
69 self["FrontendInfo"] = FrontendInfo()
71 self["actions"] = ActionMap(["OkCancelActions"],
79 self.onFirstExecBegin.append(self.doServiceScan)
81 def doServiceScan(self):
82 self["scan"] = CScan(self["scan_progress"], self["scan_state"], self["servicelist"], self["pass"], self.scanList, self["network"], self["transponder"], self["FrontendInfo"], self.session.summary)
84 def createSummary(self):
85 print "ServiceScanCreateSummary"
86 return ServiceScanSummary