def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.AspectRatioSwitch.showmsg.value: Notifications.AddPopup( text=_("Aspect ratio switched from:\n %s\nto:\n %s") % (ASPECTMSG[ASPECT[aspectnum]], ASPECTMSG[ASPECT[newaspectnum]]), type=MessageBox.TYPE_INFO, timeout=5, id='AspectRatioSwitch') print( pluginPrintname, "Aspect ratio switched from %d - %s to %d - %s" % (aspectnum, ASPECT[aspectnum], newaspectnum, ASPECT[newaspectnum]))
def changeVideoMode(self): iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() aspectnum += 1 if aspectnum >= len(self.videomodes): aspectnum = 0 iAVSwitch.setAspectRatio(aspectnum) config.av.aspectratio.setValue(self.videomodes[aspectnum])
def ok(self): index = self['menu'].getIndex() videomode = self.videomodes_enabled[index] iAVSwitch = AVSwitch() iAVSwitch.setAspectRatio(self.videomodes.index(videomode)) config.av.aspectratio.setValue(videomode) self.close()
def changeVideoMode(self): iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() aspectnum += 1 if aspectnum >= len(self.videomodes): aspectnum = 0 iAVSwitch.setAspectRatio(aspectnum) config.av.aspectratio.setValue(self.videomodes[aspectnum])
def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.GBAspectRatioSwitch.showmsg.value: Notifications.AddPopup(text=ASPECTMSG[ASPECT[newaspectnum]], type=MessageBox.TYPE_INFO, timeout=2, id='GBAspectRatioSwitch')
def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.GBAspectRatioSwitch.showmsg.value: Notifications.AddPopup(text=ASPECTMSG[ASPECT[newaspectnum]], type=MessageBox.TYPE_INFO, timeout=2, id='GBAspectRatioSwitch')
def changeMode(self): self.videomodes_enabled = [] if config.sifteam.switch_4_3_letterbox.value == True: self.videomodes_enabled.append("4_3_letterbox") if config.sifteam.switch_4_3_panscan.value == True: self.videomodes_enabled.append("4_3_panscan") if config.sifteam.switch_16_9.value == True: self.videomodes_enabled.append("16_9") if config.sifteam.switch_16_9_always.value == True: self.videomodes_enabled.append("16_9_always") if config.sifteam.switch_16_10_letterbox.value == True: self.videomodes_enabled.append("16_10_letterbox") if config.sifteam.switch_16_10_panscan.value == True: self.videomodes_enabled.append("16_10_panscan") if config.sifteam.switch_16_9_letterbox.value == True: self.videomodes_enabled.append("16_9_letterbox") if len(self.videomodes_enabled) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() if aspectnum >= len(self.videomodes): aspectnum = 0 currentmode = self.videomodes[aspectnum] aspectnum = 0 for i in range(0, len(self.videomodes_enabled)): if self.videomodes_enabled[i] == currentmode: aspectnum = i break aspectnum += 1 if aspectnum >= len(self.videomodes_enabled): aspectnum = 0 newmode = self.videomodes_enabled[aspectnum] aspectnum = 0 for i in range(0, len(self.videomodes)): if self.videomodes[i] == newmode: aspectnum = i break iAVSwitch.setAspectRatio(aspectnum) config.av.aspectratio.setValue(self.videomodes[aspectnum]) self.session.open(VideoSelectionNotify, self.videodescs[aspectnum])
def switchAspectRatio(self, direction=1): if len(self.enabledaspects) < 2: return iAVSwitch = AVSwitch() aspectnum = iAVSwitch.getAspectRatioSetting() try: localaspectnum = self.enabledaspects.index(aspectnum) except ValueError: localaspectnum = 0 newaspectnum = self.enabledaspects[(localaspectnum + direction) % len(self.enabledaspects)] iAVSwitch.setAspectRatio(newaspectnum) config.av.aspectratio.setValue(ASPECT[newaspectnum]) if config.plugins.AspectRatioSwitch.showmsg.value: Notifications.AddPopup(text=_("Aspect ratio switched from:\n %s\nto:\n %s") % (ASPECTMSG[ASPECT[aspectnum]], ASPECTMSG[ASPECT[newaspectnum]]), type=MessageBox.TYPE_INFO, timeout=5, id='AspectRatioSwitch') print pluginPrintname, "Aspect ratio switched from %d - %s to %d - %s" % (aspectnum, ASPECT[aspectnum], newaspectnum, ASPECT[newaspectnum])
def autostart(reason, **kwargs): #STANDARD beim Systemstart global aspect_ratio_switch if reason == 0: # startup keymappath = "/usr/share/enigma2/keymap.xml" if os.path.exists(keymappath): keymapfile = open(keymappath, "r") keymaptext = keymapfile.read() keymapfile.close() changed = False if '<key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />', '<key id="KEY_CHANNELUP" mapto="openServiceList" flags="b" />') changed = True if '<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />', '<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="b" />') changed = True if '<key id="KEY_VIDEO" mapto="showMovies" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_VIDEO" mapto="showMovies" flags="m" />', '<key id="KEY_VIDEO" mapto="showMovies" flags="b" />') changed = True if '<key id="KEY_RADIO" mapto="showRadio" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('key id="KEY_RADIO" mapto="showRadio" flags="m" />', 'key id="KEY_RADIO" mapto="showRadio" flags="b" />') changed = True if '<key id="KEY_HELP" mapto="displayHelp" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_HELP" mapto="displayHelp" flags="m" />', '<key id="KEY_HELP" mapto="displayHelp" flags="b" />') changed = True if changed: print pluginPrintname, "Preparing keymap.xml..." keymapfile = open(keymappath, "w") keymapfile.write(keymaptext) keymapfile.close() keymapparser.removeKeymap(keymappath) keymapparser.readKeymap(keymappath) iAVSwitch = AVSwitch() if config.plugins.AspectRatioSwitch.autostart_ratio_enabled.value: iAVSwitch.setAspectRatio(int(config.plugins.AspectRatioSwitch.autostart_ratio.value)) config.av.aspectratio.setValue(ASPECT[int(config.plugins.AspectRatioSwitch.autostart_ratio.value)]) print pluginPrintname, "startup, keymap =", config.plugins.AspectRatioSwitch.keymap print pluginPrintname, "Initially set to:", ASPECT[int(config.plugins.AspectRatioSwitch.autostart_ratio.value)] else: print pluginPrintname, "Initiation disabled" if config.plugins.AspectRatioSwitch.enabled.value and aspect_ratio_switch is None: aspect_ratio_switch = AspectRatioSwitch() aspect_ratio_switch.enable() elif reason == 1: print pluginPrintname, "shutdown" if aspect_ratio_switch is not None: aspect_ratio_switch.disable()
def autostart(reason, **kwargs): #STANDARD beim Systemstart global aspect_ratio_switch if reason == 0: # startup keymappath = "/usr/share/enigma2/keymap.xml" if os.path.exists(keymappath): keymapfile = open(keymappath, "r") keymaptext = keymapfile.read() keymapfile.close() changed = False if '<key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_CHANNELUP" mapto="openServiceList" flags="m" />', '<key id="KEY_CHANNELUP" mapto="openServiceList" flags="b" />') changed = True if '<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="m" />', '<key id="KEY_CHANNELDOWN" mapto="openServiceList" flags="b" />') changed = True if '<key id="KEY_VIDEO" mapto="showMovies" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_VIDEO" mapto="showMovies" flags="m" />', '<key id="KEY_VIDEO" mapto="showMovies" flags="b" />') changed = True if '<key id="KEY_RADIO" mapto="showRadio" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('key id="KEY_RADIO" mapto="showRadio" flags="m" />', 'key id="KEY_RADIO" mapto="showRadio" flags="b" />') changed = True if '<key id="KEY_HELP" mapto="displayHelp" flags="m" />' in keymaptext: keymaptext = keymaptext.replace('<key id="KEY_HELP" mapto="displayHelp" flags="m" />', '<key id="KEY_HELP" mapto="displayHelp" flags="b" />') changed = True if changed: print pluginPrintname, "Preparing keymap.xml..." keymapfile = open(keymappath, "w") keymapfile.write(keymaptext) keymapfile.close() keymapparser.removeKeymap(keymappath) keymapparser.readKeymap(keymappath) iAVSwitch = AVSwitch() if config.plugins.AspectRatioSwitch.autostart_ratio_enabled.value: iAVSwitch.setAspectRatio(int(config.plugins.AspectRatioSwitch.autostart_ratio.value)) config.av.aspectratio.setValue(ASPECT[int(config.plugins.AspectRatioSwitch.autostart_ratio.value)]) print pluginPrintname, "startup, keymap =", config.plugins.AspectRatioSwitch.keymap print pluginPrintname, "Initially set to:", ASPECT[int(config.plugins.AspectRatioSwitch.autostart_ratio.value)] else: print pluginPrintname, "Initiation disabled" if config.plugins.AspectRatioSwitch.enabled.value and aspect_ratio_switch is None: aspect_ratio_switch = AspectRatioSwitch() aspect_ratio_switch.enable() elif reason == 1: print pluginPrintname, "shutdown" if aspect_ratio_switch is not None: aspect_ratio_switch.disable()
class FactoryTest(Screen): skin = """ <screen position="120,125" size="440,400" title="Test Menu" > <widget name="testlist" position="10,0" size="340,350" /> <widget name="resultlist" position="370,0" size="60,350" /> <widget name="testdate" position="20,350" size="150,25" font="Regular;22" /> <widget name="testversion" position="20,375" size="150,25" font="Regular;22" /> <widget name="mactext" position="180,350" size="230,25" font="Regular;22" /> </screen>""" def __init__(self, session): self["actions"] = ActionMap(["OkCancelActions","WizardActions"], { "ok": self.TestAction, "cancel": self.keyCancel, "agingstart": self.Agingmode, }, -2) Screen.__init__(self, session) TESTPROGRAM_DATE = "2009-12-09" TESTPROGRAM_VERSION = "Version 00.01" self["testdate"]=Label((TESTPROGRAM_DATE)) self["testversion"]=Label(("Loading version...")) self["mactext"]=Label(("Loading mac address...")) nimConfig = nimmanager.getNimConfig(0) nimConfig.configMode.slot_id=0 nimConfig.configMode.value= "simple" nimConfig.diseqcMode.value="diseqc_a_b" nimConfig.diseqcA.value="160" nimConfig.diseqcB.value="100" nimConfig = nimmanager.getNimConfig(1) nimConfig.configMode.slot_id=1 nimConfig.configMode.value= "simple" nimConfig.diseqcMode.value="diseqc_a_b" nimConfig.diseqcA.value="130" nimConfig.diseqcB.value="192" nimmanager.sec.update() system("cp /usr/lib/enigma2/python/Plugins/SystemPlugins/FactoryTest/testdb /etc/enigma2/lamedb") db = eDVBDB.getInstance() db.reloadServicelist() tlist = [] tlist.append((" 0. sata & extend hdd test",0)) tlist.append((" 1. Front test",1)) tlist.append((" 2. Smartcard test",2)) tlist.append((" 3. T1 H 22K x 4:3 CVBS",3)) tlist.append((" 4. T1 V 22k o 16:9 RGB",4)) tlist.append((" 5. T2 H 22k x 4:3 YC",5)) tlist.append((" 6. T2 V 22k o 16:9 CVBS",6)) tlist.append((" 7. VCR Scart loop",7)) tlist.append((" 8. rs232 test",8)) tlist.append((" 9. usb test",9)) tlist.append(("10. ethernet & mac test",10)) # tlist.append(("11. DRAM test",11)) # tlist.append(("12. Flash test",12)) # tlist.append(("13. DRAM+Flash test",13)) tlist.append(("11. factory default",11)) tlist.append(("12. shutdown",12)) self["testlist"] = MenuList(tlist) self.rlist = [] # for x in range(15): for x in range(12): self.rlist.append(("..")) self["resultlist"] = TestResultList(self.rlist) self.NetworkState = 0 self.first = 0 self.avswitch = AVSwitch() self.memTest = eMemtest() self.scTest= eSctest() self.feid=0 self.servicelist = ServiceList() self.oldref = session.nav.getCurrentlyPlayingServiceReference() print "oldref",self.oldref session.nav.stopService() # try to disable foreground service self.tunemsgtimer = eTimer() self.tunemsgtimer.callback.append(self.tunemsg) self.camstep = 1 self.camtimer = eTimer() self.camtimer.callback.append(self.cam_state) self.getmacaddr() self.getversion() self.tunerlock = 0 self.tuningtimer = eTimer() self.tuningtimer.callback.append(self.updateStatus) def updateStatus(self): index = self["testlist"].getCurrent()[1] if index ==2 or index==3: tunno = 1 result = eSctest.getInstance().getFrontendstatus(0) else: tunno = 2 result = eSctest.getInstance().getFrontendstatus(1) if index == 2 or index==4: hv = "Hor" else: hv = "Ver" print "eSctest.getInstance().getFrontendstatus - %d"%result if result == 0: self.tunerlock = 0 self.tunemsgtimer.stop() self.session.nav.stopService() self.session.open( MessageBox, _("Tune%d %s Locking Fail..."%(tunno,hv)), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" else : self.tunerlock = 1 def getversion(self): try: fd = open("/proc/stb/info/version","r") version = fd.read() self["testversion"].setText(("Version %s"%version)) except: self["testversion"].setText(("Version no load")) def readmac(self, result, retval,extra_args=None): (statecallback) = extra_args if self.macConsole is not None: if retval == 0: self.macConsole = None content =result.split() self["mactext"].setText(("MAC : "+content[10])) def getmacaddr(self): try: cmd = "ip -o addr" self.macConsole = Console() self.macConsole.ePopen(cmd, self.readmac) # self["stattext"].setText((macaddr)) except: return def TestAction(self): print "line - ",self["testlist"].getCurrent()[1] index = self["testlist"].getCurrent()[1] result = 0 if index==0: self.Test0() elif index==1: self.Test1() elif index>2 and index<7: self.TestTune(index) elif index==7: self.Test6() elif index==8: self.Test7() elif index==9: self.Test8() elif index==10: self.Test9() elif index == 2: self.Test10() # elif index == 11: # self.Test11() # elif index ==12: # self.Test12() # elif index==13: # self.Test13() elif index==10: self.Test14() elif index==11: self.Test15() def Test0(self): result = 0 checktab=0 try: mtab = open('/etc/mtab','r') while(1): disk = mtab.readline().split(' ') if len(disk) < 2: break if disk[1].startswith('/media/hdd'): checktab+=1 elif disk[1].startswith('/media/sdb1'): checktab+=10 if checktab==11: break except: checktab = 0 if checktab==0: self.session.open( MessageBox, _("Sata & extend hdd test error"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" return elif checktab < 11: self.session.open( MessageBox, _("one hdd test error"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" return try: if fileExists("/media/sdb1"): dummy=open("/media/sdb1/dummy03","w") dummy.write("complete") dummy.close() dummy=open("/media/sdb1/dummy03","r") if dummy.readline()=="complete": print "complete" else: result = 1 dummy.close() system("rm /media/sdb1/dummy03") else: result = 1 except: result = 1 try: if fileExists("/media/hdd"): dummy=open("/media/hdd/dummy03","w") dummy.write("complete") dummy.close() dummy=open("/media/hdd/dummy03","r") if dummy.readline()=="complete": print "complete" else: result += 1 dummy.close() system("rm /media/hdd/dummy03") else: result += 1 except: result += 1 if result ==0: self.session.open( MessageBox, _("Sata & extend hdd test pass"), MessageBox.TYPE_INFO) self.rlist[self["testlist"].getCurrent()[1]]="pass" elif result == 1: self.session.open( MessageBox, _("one hdd test error"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" else: self.session.open( MessageBox, _("Sata & extend hdd test error"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" def Test1(self): self.session.openWithCallback(self.displayresult ,FrontTest) def displayresult(self): global fronttest if fronttest == 1: self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.rlist[self["testlist"].getCurrent()[1]]="fail" INTERNAL_PID_STATUS_NOOP = 0 INTERNAL_PID_STATUS_WAITING = 1 INTERNAL_PID_STATUS_SUCCESSFUL = 2 INTERNAL_PID_STATUS_FAILED = 3 def TestTune(self,index): if self.oldref is None: eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0") serviceHandler = eServiceCenter.getInstance() servicelist = serviceHandler.list(eref) if not servicelist is None: ref = servicelist.getNext() else: ref = self.getCurrentSelection() print "servicelist none" else: ref = self.oldref self.session.nav.stopService() # try to disable foreground service if index==3: ref.setData(0,1) ref.setData(1,0x6D3) ref.setData(2,0x3) ref.setData(3,0xA4) ref.setData(4,0xA00000) self.session.nav.playService(ref) self.avswitch.setColorFormat(0) self.avswitch.setAspectRatio(0) elif index==4: ref.setData(0,0x19) ref.setData(1,0x83) ref.setData(2,0x6) ref.setData(3,0x85) ref.setData(4,0x640000) self.session.nav.playService(ref) self.avswitch.setColorFormat(1) self.avswitch.setAspectRatio(6) elif index==5: # self.camstep = 1 # self.camtimer.start(100,True) ref.setData(0,1) ref.setData(1,0x6D3) ref.setData(2,0x3) ref.setData(3,0xA4) ref.setData(4,0x820000) self.session.nav.playService(ref) self.avswitch.setColorFormat(2) self.avswitch.setAspectRatio(0) elif index==6: self.camstep = 1 self.camtimer.start(100,True) ref.setData(0,0x19) ref.setData(1,0x83) ref.setData(2,0x6) ref.setData(3,0x85) ref.setData(4,0xC00000) self.session.nav.playService(ref) self.avswitch.setColorFormat(0) self.avswitch.setAspectRatio(6) self.tuningtimer.start(2000,True) self.tunemsgtimer.start(3000, True) def cam_state(self): if self.camstep == 1: slot = 0 state = eDVBCI_UI.getInstance().getState(slot) print '-1-stat',state if state > 0: self.camstep=2 self.camtimer.start(100,True) else: self.session.nav.stopService() self.session.open( MessageBox, _("NO_CAM1_NOT_INSERTED"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" self.tunemsgtimer.stop() # self.rlist[index]="fail" # self["resultlist"].updateList(self.rlist) elif self.camstep == 2: slot = 0 appname = eDVBCI_UI.getInstance().getAppName(slot) print 'appname',appname if appname is None: self.session.nav.stopService() self.session.open( MessageBox, _("NO_GET_APPNAME"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" self.tunemsgtimer.stop() else: self.camstep=3 self.camtimer.start(100,True) elif self.camstep==3: slot = 1 state = eDVBCI_UI.getInstance().getState(slot) print '-2-stat',state if state > 0: self.camstep=4 self.camtimer.start(100,True) else: self.session.nav.stopService() self.session.open( MessageBox, _("NO_CAM2_NOT_INSERTED"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" self.tunemsgtimer.stop() # self.rlist[index]="fail" # self["resultlist"].updateList(self.rlist) elif self.camstep == 4: slot = 1 appname = eDVBCI_UI.getInstance().getAppName(slot) print 'appname',appname if appname is None: self.session.nav.stopService() self.session.open( MessageBox, _("NO_GET_APPNAME"), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" self.tunemsgtimer.stop() else: self.setSource() self.camstep = 5 self.session.open( MessageBox, _("CAM OK!"), MessageBox.TYPE_INFO,2) def setSource(self): filename = ("/proc/stb/tsmux/ci0_input") fd = open(filename,'w') fd.write('B') fd.close() # filename = ("/proc/stb/tsmux/ci1_input") # fd = open(filename,'w') # fd.write('CI0') # fd.close() fd=open("/proc/stb/tsmux/input1","w") fd.write("CI0") fd.close() print "CI loop test!!!!!!!!!!!!!!" def resetSource(self): fd=open("/proc/stb/tsmux/input1","w") fd.write("B") fd.close() print "CI loop test end!!!!!!!!!!!!!!" def tunemsg(self): self.tuningtimer.stop() self.session.openWithCallback(self.tuneback, MessageBox, _("%s ok?" %(self["testlist"].getCurrent()[0])), MessageBox.TYPE_YESNO) def tuneback(self,yesno): self.session.nav.stopService() # try to disable foreground service if yesno: self.rlist[self["testlist"].getCurrent()[1]]="pass" if self.tunerlock == 0: self.rlist[self["testlist"].getCurrent()[1]]="fail" elif self["testlist"].getCurrent()[1] == 5 and self.camstep < 5: self.rlist[self["testlist"].getCurrent()[1]]="fail" else: self.rlist[self["testlist"].getCurrent()[1]]="fail" self.resetSource() self["resultlist"].updateList(self.rlist) def Test6(self): self.avswitch.setInput("SCART") sleep(2) self.session.openWithCallback(self.check6, MessageBox, _("Scart loop ok?"), MessageBox.TYPE_YESNO) def check6(self,yesno): if yesno: self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.rlist[self["testlist"].getCurrent()[1]]="fail" self.avswitch.setInput("ENCODER") def check7(self): global rstest if rstest == 1: self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.rlist[self["testlist"].getCurrent()[1]]="fail" def Test7(self): self.session.openWithCallback(self.check7,RS232Test) def Agingmode(self): self.session.openWithCallback(self.checkaging,AgingTest) def checkaging(self): global Agingresult if(Agingresult ==1): self["testlist"].moveToIndex(11) self.Test14() self["testlist"].moveToIndex(12) # self["testlist"].instance.moveSelection(self["testlist"].instance.moveDown) def Test8(self): try: result = 0 mtab = open('/etc/mtab','r') while(1): disk = mtab.readline().split(' ') if len(disk) < 2: break if disk[1].startswith('/media/hdd'): continue elif disk[1].startswith('/media/sdb1'): continue elif disk[1].startswith('/media/sd'): result=result +1 if result < 0 : result = 0 if result == 3: self.session.open( MessageBox, _("USB test pass %d devices"%result), MessageBox.TYPE_INFO) self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d"%(3-result)), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" except: if result < 0 : result = 0 if result == 3: self.session.open( MessageBox, _("USB test pass %d devices"%result), MessageBox.TYPE_INFO) self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d"%(3-result)), MessageBox.TYPE_ERROR) self.rlist[self["testlist"].getCurrent()[1]]="fail" def Test9(self): self.session.openWithCallback(self.macresult ,MacConfig) def macresult(self): global ethtest if ethtest == 1: self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.rlist[self["testlist"].getCurrent()[1]]="fail" self.getmacaddr() def MemTest(self, which): index = which result = 0 if index==0: result = eMemtest.getInstance().dramtest() elif index==1: result = eMemtest.getInstance().flashtest() result = 0 # temp else: result = eMemtest.getInstance().dramtest() result = eMemtest.getInstance().flashtest() result = 0 # temp index = index+10 if result == 0: print index,self.rlist[index] self.rlist[index]="pass" else: print index,self.rlist[index] self.rlist[index]="fail" self["resultlist"].updateList(self.rlist) def scciresult(self): global smartcardtest if smartcardtest == 1: self.rlist[self["testlist"].getCurrent()[1]]="pass" else: self.rlist[self["testlist"].getCurrent()[1]]="fail" def Test10(self): self.session.openWithCallback(self.scciresult ,SmartCartTest) def Test11(self): self.MemTest(1) def Test12(self): self.MemTest(2) def Test13(self): self.MemTest(3) def Test14(self): try: system("rm -R /etc/enigma2") system("cp -R /usr/share/enigma2/defaults /etc/enigma2") self.rlist[self["testlist"].getCurrent()[1]]="pass" self["resultlist"].updateList(self.rlist) except: self.rlist[self["testlist"].getCurrent()[1]]="fail" self["resultlist"].updateList(self.rlist) self.session.open( MessageBox, _("Factory reset fail"), MessageBox.TYPE_ERROR) def Test15(self): self.session.openWithCallback(self.shutdown ,MessageBox, _("Do you want to shut down?"), MessageBox.TYPE_YESNO) def shutdown(self, yesno): if yesno : from os import _exit system("/usr/bin/showiframe /boot/backdrop.mvi") _exit(1) else: return def keyCancel(self): print "exit" self.close()