1 from Screens.Screen import Screen
2 from Screens.MessageBox import MessageBox
3 from Plugins.Plugin import PluginDescriptor
4 from Components.MenuList import MenuList
5 from Tools.Directories import fileExists
6 from Components.ServiceList import ServiceList
7 from Components.ActionMap import ActionMap,NumberActionMap
8 from Components.config import config
9 from os import system,access,F_OK,R_OK,W_OK
10 from Components.Label import Label
11 from Components.AVSwitch import AVSwitch
12 from time import sleep
13 from Components.Console import Console
14 from enigma import eTimer
15 from Components.HTMLComponent import HTMLComponent
16 from Components.GUIComponent import GUIComponent
17 from enigma import eListboxPythonStringContent, eListbox, gFont, eServiceCenter, eDVBResourceManager
18 from enigma import eServiceReference
19 from enigma import eMemtest
20 from enigma import eSctest
21 from enigma import eDVBDB
22 from Components.NimManager import nimmanager
23 from enigma import eDVBCI_UI,eDVBCIInterfaces
25 class TestResultList(HTMLComponent, GUIComponent):
26 def __init__(self, source):
27 GUIComponent.__init__(self)
28 self.l = eListboxPythonStringContent()
30 self.l.setList(self.list)
34 def postWidgetCreate(self, instance):
35 self.instance.setSelectionEnable(0)
36 self.instance.setContent(self.l)
38 def updateList(self,list):
41 class FactoryTest(Screen):
43 <screen position="120,125" size="440,400" title="Test Menu" >
44 <widget name="testlist" position="10,0" size="340,350" />
45 <widget name="resultlist" position="370,0" size="60,350" />
46 <widget name="testdate" position="20,350" size="150,25" font="Regular;22" />
47 <widget name="testversion" position="20,375" size="150,25" font="Regular;22" />
48 <widget name="mactext" position="180,350" size="230,25" font="Regular;22" />
50 def __init__(self, session):
52 self["actions"] = NumberActionMap(["OkCancelActions","WizardActions","NumberActions","ColorActions"],
56 "ok": self.TestAction,
57 "testexit": self.keyCancel,
58 "agingstart": self.Agingmode,
61 "0": self.numberaction,
62 "1": self.numberaction,
63 "2": self.numberaction,
64 "3": self.numberaction,
65 "4": self.numberaction,
66 "5": self.numberaction,
67 "6": self.numberaction,
68 "7": self.numberaction,
69 "8": self.numberaction,
70 "9": self.numberaction,
71 "red": self.shutdownaction,
74 Screen.__init__(self, session)
75 TESTPROGRAM_DATE = "2010-06-11"
76 TESTPROGRAM_VERSION = "Version 00.01"
81 self["testdate"]=Label((TESTPROGRAM_DATE))
82 self["testversion"]=Label(("Loading version..."))
83 self["mactext"]=Label(("Loading mac address..."))
84 nimConfig = nimmanager.getNimConfig(0)
85 nimConfig.configMode.slot_id=0
86 nimConfig.configMode.value= "simple"
87 nimConfig.diseqcMode.value="diseqc_a_b"
88 nimConfig.diseqcA.value="160"
89 nimConfig.diseqcB.value="100"
91 nimConfig = nimmanager.getNimConfig(1)
92 nimConfig.configMode.slot_id=1
93 nimConfig.configMode.value= "simple"
94 nimConfig.diseqcMode.value="diseqc_a_b"
95 nimConfig.diseqcA.value="130"
96 nimConfig.diseqcB.value="192"
97 nimmanager.sec.update()
99 system("cp /usr/lib/enigma2/python/Plugins/SystemPlugins/FactoryTest/testdb /etc/enigma2/lamedb")
100 db = eDVBDB.getInstance()
101 db.reloadServicelist()
106 tlist.append((" 0. Sata & extend hdd test",self.satetestIndex))
108 tlist.append((" 1. USB test",self.usbtestIndex))
109 self.fronttestIndex=2
110 tlist.append((" 2. Front test",self.fronttestIndex))
111 self.smarttestIndex=3
112 tlist.append((" 3. Smartcard test",self.smarttestIndex))
113 self.tuner1_1testIndex=4
114 tlist.append((" 4. T1 H 22K x 4:3 CVBS",self.tuner1_1testIndex))
115 self.tuner1_2testIndex=5
116 tlist.append((" 5. T1 V 22k o 16:9 RGB",self.tuner1_2testIndex))
117 self.tuner2_1testIndex=6
118 tlist.append((" 6. T2 H 22k x 4:3 YC",self.tuner2_1testIndex))
119 self.tuner2_2testIndex=7
120 tlist.append((" 7. T2 V 22k o 16:9 CVBS CAM",self.tuner2_2testIndex))
121 self.scarttestIndex=8
122 tlist.append((" 8. VCR Scart loop",self.scarttestIndex))
123 self.rs232testIndex=9
124 tlist.append((" 9. RS232 test",self.rs232testIndex))
125 self.ethernettestIndex=10
126 tlist.append(("10. Ethernet & mac test",self.ethernettestIndex))
127 # tlist.append(("11. DRAM test",11))
128 # tlist.append(("12. Flash test",12))
129 # tlist.append(("13. DRAM+Flash test",13))
130 self.fdefaultIndex=11
131 tlist.append(("11. Factory default",self.fdefaultIndex))
132 self.shutdownIndex=12
133 tlist.append(("12. Shutdown",self.shutdownIndex))
134 elif self.model == 1:
135 # tlist.append((" 0. Sata & extend hdd test",self.satetestIndex=0))
136 self.satetestIndex = -1
137 self.scarttestIndex = -1
142 tlist.append((" 0. USB test",self.usbtestIndex))
143 self.fronttestIndex=1
144 tlist.append((" 1. Front test",self.fronttestIndex))
145 self.smarttestIndex=2
146 tlist.append((" 2. Smartcard test",self.smarttestIndex))
147 self.tuner1_1testIndex=3
148 tlist.append((" 3. T1 H 22K x 4:3 CVBS",self.tuner1_1testIndex))
149 self.tuner1_2testIndex=4
150 tlist.append((" 4. T1 V 22k o 16:9 RGB CAM",self.tuner1_2testIndex))
151 self.tuner2_2testIndex=4
152 # tlist.append((" 6. T2 H 22k x 4:3 YC",self.tuner2_1testIndex=6))
153 # tlist.append((" 7. T2 V 22k o 16:9 CVBS CAM",self.tuner2_2testIndex=7))
154 # tlist.append((" 8. VCR Scart loop",self.scarttestIndex=8))
155 self.rs232testIndex=5
156 tlist.append((" 5. RS232 test",self.rs232testIndex))
157 self.ethernettestIndex=6
158 tlist.append((" 6. Ethernet & mac test",self.ethernettestIndex))
159 # tlist.append(("11. DRAM test",11))
160 # tlist.append(("12. Flash test",12))
161 # tlist.append(("13. DRAM+Flash test",13))
163 tlist.append((" 7. Factory default",self.fdefaultIndex))
165 tlist.append((" 8. Shutdown",self.shutdownIndex))
166 self.menulength= len(tlist)-1
167 self["testlist"] = MenuList(tlist)
169 # for x in range(15):
170 # for x in range(12):
171 for x in range(self.menulength):
172 self.rlist.append((".."))
173 self["resultlist"] = TestResultList(self.rlist)
174 self.NetworkState = 0
177 self.avswitch = AVSwitch()
178 self.memTest = eMemtest()
179 self.scTest= eSctest()
185 self.servicelist = ServiceList()
186 self.oldref = session.nav.getCurrentlyPlayingServiceReference()
187 print "oldref",self.oldref
188 session.nav.stopService() # try to disable foreground service
190 self.tunemsgtimer = eTimer()
191 self.tunemsgtimer.callback.append(self.tunemsg)
194 self.camtimer = eTimer()
195 self.camtimer.callback.append(self.cam_state)
200 self.tuningtimer = eTimer()
201 self.tuningtimer.callback.append(self.updateStatus)
204 self.satatimer = eTimer()
205 self.satatimer.callback.append(self.sataCheck)
207 def getModelInfo(self):
208 info = open("/proc/stb/info/version").read()
212 elif info[:2] == "12":
222 if self["testlist"].getCurrent()[1]==0:
223 self["testlist"].moveToIndex(self.menulength)
225 self["testlist"].up()
231 if self["testlist"].getCurrent()[1]==(self.menulength):
232 self["testlist"].moveToIndex(0)
234 self["testlist"].down()
236 def numberaction(self, number):
240 self["testlist"].moveToIndex(index)
243 def updateStatus(self):
244 index = self["testlist"].getCurrent()[1]
245 if index ==self.tuner1_1testIndex or index==self.tuner1_2testIndex:
247 result = eSctest.getInstance().getFrontendstatus(0)
250 result = eSctest.getInstance().getFrontendstatus(1)
252 if self.agingmode == 1:
254 result = eSctest.getInstance().getFrontendstatus(0)
257 if index == self.tuner1_2testIndex or index==self.tuner2_2testIndex:
262 print "eSctest.getInstance().getFrontendstatus - %d"%result
265 self.tunemsgtimer.stop()
266 self.session.nav.stopService()
267 self.session.open( MessageBox, _("Tune%d %s Locking Fail..."%(tunno,hv)), MessageBox.TYPE_ERROR)
268 if self.agingmode==0:
269 self.rlist[self["testlist"].getCurrent()[1]]="fail"
273 if self.agingmode==1:
274 self.session.openWithCallback(self.checkaging,AgingTest)
276 def getversion(self):
278 fd = open("/proc/stb/info/version","r")
280 self["testversion"].setText(("Version %s"%version))
282 self["testversion"].setText(("Version no load"))
285 def readmac(self, result, retval,extra_args=None):
286 (statecallback) = extra_args
287 if self.macConsole is not None:
289 self.macConsole = None
290 content =result.splitlines()
291 macline = content[3].split()
292 mac = macline[5]+":"+macline[6]+":"+macline[7]+":"+macline[8]+":"+macline[9]+":"+macline[10]
293 self["mactext"].setText(("MAC : "+mac))
295 def getmacaddr(self):
297 cmd = "nanddump -b -o -l 64 -p /dev/mtd4"
298 self.macConsole = Console()
299 self.macConsole.ePopen(cmd, self.readmac)
303 def TestAction(self):
305 # tlist.append((" 0. Sata & extend hdd test",self.satetestIndex=0))
306 # tlist.append((" 1. USB test",self.usbtestIndex=1))
307 # tlist.append((" 2. Front test",self.fronttestIndex=2))
308 # tlist.append((" 3. Smartcard test",self.smarttestIndex=3))
309 # tlist.append((" 4. T1 H 22K x 4:3 CVBS",self.tuner1_1testIndex=4))
310 # tlist.append((" 5. T1 V 22k o 16:9 RGB",self.tuner1_2testIndex=5))
311 # tlist.append((" 6. T2 H 22k x 4:3 YC",self.tuner2_1testIndex=6))
312 # tlist.append((" 7. T2 V 22k o 16:9 CVBS CAM",self.tuner2_2testIndex=7))
313 # tlist.append((" 8. VCR Scart loop",self.scarttestIndex=8))
314 # tlist.append((" 9. RS232 test",self.rs232testIndex=9))
315 # tlist.append(("10. Ethernet & mac test",self.ethernettestIndex=10))
316 # tlist.append(("11. DRAM test",11))
317 # tlist.append(("12. Flash test",12))
318 # tlist.append(("13. DRAM+Flash test",13))
319 # tlist.append(("11. Factory default",self.fdefaultIndex=11))
320 # tlist.append(("12. Shutdown",self.shutdownIndex=12))
324 print "line - ",self["testlist"].getCurrent()[1]
325 index = self["testlist"].getCurrent()[1]
327 if index==self.satetestIndex:
329 elif index==self.fronttestIndex:
331 elif index>=self.tuner1_1testIndex and index<=self.tuner2_2testIndex:
333 elif index==self.scarttestIndex:
335 elif index==self.rs232testIndex:
337 elif index==self.usbtestIndex:
339 elif index==self.ethernettestIndex:
341 elif index == self.smarttestIndex:
349 elif index==self.fdefaultIndex:
351 # elif index==self.shutdownIndex:
354 def shutdownaction(self):
355 if self["testlist"].getCurrent()[1] == self.shutdownIndex:
361 self.satatimer.start(100,True)
364 # print "try", self.satatry
365 if self.satatry == 0:
368 self.rlist[self["testlist"].getCurrent()[1]]="try %d"%self.satatry
369 self["resultlist"].updateList(self.rlist)
375 mtab = open('/etc/mtab','r')
377 disk = mtab.readline().split(' ')
380 if disk[1].startswith('/media/hdd'):
382 elif disk[1].startswith('/media/sdb1'):
391 self.session.open( MessageBox, _("Sata & extend hdd test error"), MessageBox.TYPE_ERROR)
392 self.rlist[self["testlist"].getCurrent()[1]]="fail"
394 self.satatimer.start(1100,True)
398 self.session.open( MessageBox, _("one hdd test error"), MessageBox.TYPE_ERROR)
399 self.rlist[self["testlist"].getCurrent()[1]]="fail"
401 self.satatimer.start(1100,True)
405 if fileExists("/media/sdb1"):
406 if access("/media/sdb1",F_OK|R_OK|W_OK):
407 dummy=open("/media/sdb1/dummy03","w")
408 dummy.write("complete")
410 dummy=open("/media/sdb1/dummy03","r")
411 if dummy.readline()=="complete":
416 system("rm /media/sdb1/dummy03")
424 if fileExists("/media/hdd"):
425 if access("/media/hdd",F_OK|R_OK|W_OK):
426 dummy=open("/media/hdd/dummy03","w")
427 dummy.write("complete")
429 dummy=open("/media/hdd/dummy03","r")
430 if dummy.readline()=="complete":
435 system("rm /media/hdd/dummy03")
444 self.session.open( MessageBox, _("Sata & extend hdd test pass"), MessageBox.TYPE_INFO)
445 self.rlist[self["testlist"].getCurrent()[1]]="pass"
448 self.session.open( MessageBox, _("one hdd test error"), MessageBox.TYPE_ERROR)
449 self.rlist[self["testlist"].getCurrent()[1]]="fail"
451 self.satatimer.start(1100,True)
454 self.session.open( MessageBox, _("Sata & extend hdd test error"), MessageBox.TYPE_ERROR)
455 self.rlist[self["testlist"].getCurrent()[1]]="fail"
457 self.satatimer.start(1100,True)
461 self.session.openWithCallback(self.displayresult ,FrontTest)
462 elif self.model == 1:
463 self.session.openWithCallback(self.displayresult ,FrontTest_solo)
465 def displayresult(self):
468 self.rlist[self["testlist"].getCurrent()[1]]="pass"
470 self.rlist[self["testlist"].getCurrent()[1]]="fail"
472 INTERNAL_PID_STATUS_NOOP = 0
473 INTERNAL_PID_STATUS_WAITING = 1
474 INTERNAL_PID_STATUS_SUCCESSFUL = 2
475 INTERNAL_PID_STATUS_FAILED = 3
477 def TestTune(self,index):
478 if self.oldref is None:
479 eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
480 serviceHandler = eServiceCenter.getInstance()
481 servicelist = serviceHandler.list(eref)
482 if not servicelist is None:
483 ref = servicelist.getNext()
485 ref = self.getCurrentSelection()
486 print "servicelist none"
489 self.session.nav.stopService() # try to disable foreground service
490 if index==self.tuner1_1testIndex:
495 ref.setData(4,0xA00000)
496 self.session.nav.playService(ref)
497 self.avswitch.setColorFormat(0)
498 self.avswitch.setAspectRatio(0)
499 elif index==self.tuner1_2testIndex:
502 self.camtimer.start(100,True)
504 ref.setData(1,0x1325)
507 ref.setData(4,0x64af79)
508 # ref.setData(0,0x19)
509 # ref.setData(1,0x83)
511 # ref.setData(3,0x85)
512 # ref.setData(4,0x640000)
513 self.session.nav.playService(ref)
514 self.avswitch.setColorFormat(1)
515 self.avswitch.setAspectRatio(6)
516 elif index==self.tuner2_1testIndex:
518 # self.camtimer.start(100,True)
523 ref.setData(4,0x820000)
524 self.session.nav.playService(ref)
525 self.avswitch.setColorFormat(2)
526 self.avswitch.setAspectRatio(0)
527 elif index==self.tuner2_2testIndex:
529 self.camtimer.start(100,True)
530 # ref.setData(0,0x19)
531 # ref.setData(1,0x83)
533 # ref.setData(3,0x85)
534 # ref.setData(4,0xC00000)
535 # ikseong - for 22000 tp ( /home/ikseong/share/lamedb_ORF)
537 ref.setData(1,0x1325)
540 ref.setData(4,0xC00000)
541 self.session.nav.playService(ref)
542 self.avswitch.setColorFormat(0)
543 self.avswitch.setAspectRatio(6)
544 self.tuningtimer.start(2000,True)
545 self.tunemsgtimer.start(3000, True)
548 if self.camstep == 1:
550 state = eDVBCI_UI.getInstance().getState(slot)
551 print '-1-stat',state
554 self.camtimer.start(100,True)
556 self.session.nav.stopService()
557 self.session.open( MessageBox, _("CAM1_NOT_INSERTED\nPress exit!"), MessageBox.TYPE_ERROR)
558 self.rlist[self["testlist"].getCurrent()[1]]="fail"
559 self.tunemsgtimer.stop()
560 # self.rlist[index]="fail"
561 # self["resultlist"].updateList(self.rlist)
562 elif self.camstep == 2:
564 appname = eDVBCI_UI.getInstance().getAppName(slot)
565 print 'appname',appname
567 self.session.nav.stopService()
568 self.session.open( MessageBox, _("NO_GET_APPNAME\nPress exit!"), MessageBox.TYPE_ERROR)
569 self.rlist[self["testlist"].getCurrent()[1]]="fail"
570 self.tunemsgtimer.stop()
573 self.camtimer.start(100,True)
574 elif self.camstep==3:
576 state = eDVBCI_UI.getInstance().getState(slot)
577 print '-2-stat',state
580 self.camtimer.start(100,True)
582 self.session.nav.stopService()
583 self.session.open( MessageBox, _("CAM2_NOT_INSERTED\nPress exit!"), MessageBox.TYPE_ERROR)
584 self.rlist[self["testlist"].getCurrent()[1]]="fail"
585 self.tunemsgtimer.stop()
586 # self.rlist[index]="fail"
587 # self["resultlist"].updateList(self.rlist)
588 elif self.camstep == 4:
590 appname = eDVBCI_UI.getInstance().getAppName(slot)
591 print 'appname',appname
593 self.session.nav.stopService()
594 self.session.open( MessageBox, _("NO_GET_APPNAME\nPress exit!"), MessageBox.TYPE_ERROR)
595 self.rlist[self["testlist"].getCurrent()[1]]="fail"
596 self.tunemsgtimer.stop()
600 # self.session.open( MessageBox, _("CAM OK!"), MessageBox.TYPE_INFO,2)
602 # ikseong - for 22000 tp
604 filename = ("/proc/stb/tsmux/ci0_input")
605 fd = open(filename,'w')
609 # filename = ("/proc/stb/tsmux/ci1_input")
610 # fd = open(filename,'w')
613 fd=open("/proc/stb/tsmux/input1","w")
614 # fd=open("/proc/stb/tsmux/input0","w")
617 print "CI loop test!!!!!!!!!!!!!!"
619 def resetSource(self):
620 fd=open("/proc/stb/tsmux/input1","w")
623 print "CI loop test end!!!!!!!!!!!!!!"
626 self.tuningtimer.stop()
627 self.session.openWithCallback(self.tuneback, MessageBox, _("%s ok?" %(self["testlist"].getCurrent()[0])), MessageBox.TYPE_YESNO)
629 def tuneback(self,yesno):
630 self.session.nav.stopService() # try to disable foreground service
632 self.rlist[self["testlist"].getCurrent()[1]]="pass"
633 if self.tunerlock == 0:
634 self.rlist[self["testlist"].getCurrent()[1]]="fail"
635 elif self["testlist"].getCurrent()[1] == 7 and self.camstep < 5:
636 self.rlist[self["testlist"].getCurrent()[1]]="fail"
638 self.rlist[self["testlist"].getCurrent()[1]]="fail"
639 if self["testlist"].getCurrent()[1] == 6:
640 self.avswitch.setColorFormat(0)
642 self["resultlist"].updateList(self.rlist)
645 self.avswitch.setInput("SCART")
647 self.session.openWithCallback(self.check6, MessageBox, _("Scart loop ok?"), MessageBox.TYPE_YESNO)
649 def check6(self,yesno):
651 self.rlist[self["testlist"].getCurrent()[1]]="pass"
653 self.rlist[self["testlist"].getCurrent()[1]]="fail"
654 self.avswitch.setInput("ENCODER")
659 self.rlist[self["testlist"].getCurrent()[1]]="pass"
661 self.rlist[self["testlist"].getCurrent()[1]]="fail"
664 self.session.openWithCallback(self.check7,RS232Test)
669 if self.oldref is None:
670 eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
671 serviceHandler = eServiceCenter.getInstance()
672 servicelist = serviceHandler.list(eref)
673 if not servicelist is None:
674 ref = servicelist.getNext()
676 ref = self.getCurrentSelection()
677 print "servicelist none"
680 self.session.nav.stopService() # try to disable foreground service
682 ref.setData(1,0x1325)
685 ref.setData(4,0x64af79)
687 # ref.setData(1,0x6D3)
689 # ref.setData(3,0xA4)
690 # ref.setData(4,0xA00000)
691 self.session.nav.playService(ref)
692 self.avswitch.setColorFormat(0)
693 self.avswitch.setAspectRatio(0)
694 self.tuningtimer.start(2000,True)
697 def checkaging(self):
700 self["testlist"].moveToIndex(self.fdefaultIndex)
702 self["testlist"].moveToIndex(self.shutdownIndex)
704 # self["testlist"].instance.moveSelection(self["testlist"].instance.moveDown)
712 mtab = open('/etc/mtab','r')
714 disk = mtab.readline().split(' ')
717 if disk[1].startswith('/media/hdd'):
719 elif disk[1].startswith('/media/sdb1'):
721 elif disk[1].startswith('/media/sd'):
727 self.session.open( MessageBox, _("USB test pass %d devices\nPress OK!"%result), MessageBox.TYPE_INFO)
728 self.rlist[self["testlist"].getCurrent()[1]]="pass"
730 self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d\nPress EXIT!"%(3-result)), MessageBox.TYPE_ERROR)
731 self.rlist[self["testlist"].getCurrent()[1]]="fail"
736 self.session.open( MessageBox, _("USB test pass %d devices\nPress OK!"%result), MessageBox.TYPE_INFO)
737 self.rlist[self["testlist"].getCurrent()[1]]="pass"
739 self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d\nPress EXIT!"%(3-result)), MessageBox.TYPE_ERROR)
740 self.rlist[self["testlist"].getCurrent()[1]]="fail"
744 mtab = open('/etc/mtab','r')
746 disk = mtab.readline().split(' ')
749 if disk[1].startswith('/media/'):
755 self.session.open( MessageBox, _("USB test pass %d devices\nPress OK!"%result), MessageBox.TYPE_INFO)
756 self.rlist[self["testlist"].getCurrent()[1]]="pass"
758 self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d\nPress EXIT!"%(2-result)), MessageBox.TYPE_ERROR)
759 self.rlist[self["testlist"].getCurrent()[1]]="fail"
764 self.session.open( MessageBox, _("USB test pass %d devices\nPress OK!"%result), MessageBox.TYPE_INFO)
765 self.rlist[self["testlist"].getCurrent()[1]]="pass"
767 self.session.open( MessageBox, _("USB test error : Success-%d"%result+" Fail-%d\nPress EXIT!"%(2-result)), MessageBox.TYPE_ERROR)
768 self.rlist[self["testlist"].getCurrent()[1]]="fail"
773 # system("/etc/init.d/networking stop")
774 system("ifconfig eth0 192.168.0.10")
775 # system("/etc/init.d/networking start")
776 cmd1 = "ping -c 1 192.168.0.100"
777 self.PingConsole = Console()
778 self.PingConsole.ePopen(cmd1, self.checkNetworkStateFinished,self.NetworkStatedataAvail)
780 def checkNetworkStateFinished(self, result, retval,extra_args):
781 (statecallback) = extra_args
782 if self.PingConsole is not None:
784 self.PingConsole = None
785 content = result.splitlines()
786 # print 'content',content
787 x = content[4].split()
797 def NetworkStatedataAvail(self,data):
802 # self.session.open( MessageBox, _("Ping test pass"), MessageBox.TYPE_INFO,2)
803 self.session.openWithCallback(self.openMacConfig ,MessageBox, _("Ping test pass"), MessageBox.TYPE_INFO,2)
808 self.session.open( MessageBox, _("Ping test fail\nPress exit"), MessageBox.TYPE_ERROR)
814 def openMacConfig(self, ret=False):
815 self.session.openWithCallback(self.macresult ,MacConfig)
820 self.rlist[self.ethernettestIndex]="pass"
821 # self.rlist[self["testlist"].getCurrent()[1]]="pass"
823 self.rlist[self.ethernettestIndex]="fail"
824 # self.rlist[self["testlist"].getCurrent()[1]]="fail"
828 def MemTest(self, which):
832 result = eMemtest.getInstance().dramtest()
834 result = eMemtest.getInstance().flashtest()
837 result = eMemtest.getInstance().dramtest()
838 result = eMemtest.getInstance().flashtest()
844 print index,self.rlist[index]
845 self.rlist[index]="pass"
847 print index,self.rlist[index]
848 self.rlist[index]="fail"
849 self["resultlist"].updateList(self.rlist)
851 def scciresult(self):
853 if smartcardtest == 1:
854 self.rlist[self["testlist"].getCurrent()[1]]="pass"
856 self.rlist[self["testlist"].getCurrent()[1]]="fail"
859 self.session.openWithCallback(self.scciresult ,SmartCardTest)
873 system("rm -R /etc/enigma2")
874 system("cp -R /usr/share/enigma2/defaults /etc/enigma2")
875 self.rlist[self["testlist"].getCurrent()[1]]="pass"
876 self["resultlist"].updateList(self.rlist)
878 self.rlist[self["testlist"].getCurrent()[1]]="fail"
879 self["resultlist"].updateList(self.rlist)
880 self.session.open( MessageBox, _("Factory reset fail"), MessageBox.TYPE_ERROR)
883 self.session.openWithCallback(self.shutdown ,MessageBox, _("Do you want to shut down?"), MessageBox.TYPE_YESNO)
885 def shutdown(self, yesno):
888 system("/usr/bin/showiframe /boot/backdrop.mvi")
900 class MacConfig(Screen):
902 <screen position="100,250" size="520,100" title="Mac Config" >
903 <eLabel text="Mac Address " position="10,15" size="200,40" font="Regular;30" />
904 <widget name="text" position="230,15" size="230,40" font="Regular;30" />
905 <widget name="text1" position="470,15" size="40,40" font="Regular;30" />
906 <eLabel text=" " position="5,55" zPosition="-1" size="510,5" backgroundColor="#02e1e8e6" />
907 <widget name="stattext" position="30,75" size="400,25" font="Regular;20" />
910 def __init__(self, session):
911 self["actions"] = ActionMap(["DirectionActions","OkCancelActions"],
914 "left": self.keyleft,
915 "right": self.keyright,
916 "cancel": self.keyCancel,
919 Screen.__init__(self, session)
923 self.macaddr = "000000000000"
924 self.NetworkState = 0
925 self["text"]=Label((self.macaddr))
926 self["text1"]= Label(("< >"))
927 self["stattext"]= Label((""))
935 def loadmacaddr(self):
939 mtab = open('/etc/mtab','r')
941 disk = mtab.readline().split(' ')
944 if disk[1].startswith('/media/sd') or disk[1].startswith('/media/hdd'):
945 print 'try..',disk[1]
946 if fileExists(disk[1]+"/macinfo.txt"):
947 self.macfd = open(disk[1]+"/macinfo.txt","r+")
950 self["text"].setText(("cannot read usb!!"))
951 self["text1"].setText((" "))
952 self["stattext"].setText((" Press Exit Key."))
956 macaddr=self.macfd.readline().split(":")
957 self.macaddr=macaddr[1]+macaddr[2]+macaddr[3]+macaddr[4]+macaddr[5]+macaddr[6]
959 self.NetworkState = 1
961 self["text"].setText(("cannot read usb!!"))
962 self["text1"].setText((" "))
963 self["stattext"].setText((" Press Exit Key."))
965 # self.session.open( MessageBox, _("Mac address fail"), MessageBox.TYPE_ERROR)
967 def readmac(self, result, retval,extra_args=None):
968 (statecallback) = extra_args
969 if self.macConsole is not None:
971 self.macConsole = None
972 content =result.splitlines()
973 macline = content[3].split()
974 mac = macline[5]+":"+macline[6]+":"+macline[7]+":"+macline[8]+":"+macline[9]+":"+macline[10]
975 self["stattext"].setText(("now : "+mac))
977 def getmacaddr(self):
978 if self.NetworkState==0:
981 cmd = "nanddump -b -o -l 64 -p /dev/mtd4"
982 self.macConsole = Console()
983 self.macConsole.ePopen(cmd, self.readmac)
988 if self.NetworkState==0 or self.pingok<1:
990 macaddress = long(self.macaddr,16)-1
992 macaddress = 0xffffffffffff
993 self.macaddr = "%012x"%macaddress
997 if self.NetworkState==0 or self.pingok<1:
999 macaddress = long(self.macaddr,16)+1
1000 if macaddress > 0xffffffffffff:
1002 self.macaddr = "%012x"%macaddress
1005 def displaymac(self):
1006 macaddr= self.macaddr
1007 self["text"].setText(("%02x:%02x:%02x:%02x:%02x:%02x"%(int(macaddr[0:2],16),int(macaddr[2:4],16),int(macaddr[4:6],16),int(macaddr[6:8],16),int(macaddr[8:10],16),int(macaddr[10:12],16))))
1010 if self.NetworkState==0 or self.pingok<1:
1013 macaddr = self.macaddr
1014 #make_mac_sector 00-99-99-99-00-00 > /tmp/mac.sector
1015 #flash_eraseall /dev/mtd4
1016 #nandwrite /dev/mtd4 /tmp/mac.sector -p
1017 cmd = "make_mac_sector %02x-%02x-%02x-%02x-%02x-%02x > /tmp/mac.sector"%(int(macaddr[0:2],16),int(macaddr[2:4],16),int(macaddr[4:6],16),int(macaddr[6:8],16),int(macaddr[8:10],16),int(macaddr[10:12],16))
1019 system("flash_eraseall /dev/mtd4")
1020 system("nandwrite /dev/mtd4 /tmp/mac.sector -p")
1021 macaddress = long(macaddr,16)+1
1022 if macaddress > 0xffffffffffff:
1024 macaddr = "%012x"%macaddress
1025 macwritetext = "MAC:%02x:%02x:%02x:%02x:%02x:%02x"%(int(macaddr[0:2],16),int(macaddr[2:4],16),int(macaddr[4:6],16),int(macaddr[6:8],16),int(macaddr[8:10],16),int(macaddr[10:12],16))
1027 self.macfd.write(macwritetext)
1028 self.macaddr = macaddr
1031 self.session.open( MessageBox, _("Mac address fail"), MessageBox.TYPE_ERROR)
1036 def keyCancel(self):
1037 if self.pingok == -1:
1048 class ScCiTest(Screen):
1050 <screen position="120,225" size="440,200" title="CI Smartcard Test" >
1051 <widget name="testlist" position="10,0" size="340,120" />
1052 <widget name="resultlist" position="370,0" size="60,120" />
1053 <eLabel text=" " position="5,125" zPosition="-1" size="430,5" backgroundColor="#02e1e8e6" />
1054 <widget name="text" position="10,140" size="420,50" font="Regular;25" />
1057 def __init__(self, session):
1058 self["actions"] = ActionMap(["DirectionActions","OkCancelActions"],
1063 "cancel": self.keyCancel,
1066 Screen.__init__(self, session)
1068 tlist.append(("Smartcard 1 Test",0))
1069 tlist.append(("Smartcard 2 Test",1))
1070 tlist.append(("CI 1 Test",2))
1071 tlist.append(("CI 2 Test",3))
1072 self["testlist"] = MenuList(tlist)
1075 self.rlist.append((".."))
1076 self["resultlist"] = TestResultList(self.rlist)
1078 self.removecard = eTimer()
1079 self.removecard.callback.append(self.remove_card)
1080 self["text"]=Label(("Press OK Key"))
1081 self.camstate= eTimer()
1082 self.camstate.callback.append(self.cam_state)
1086 def keyCancel(self):
1088 print "result ", self.result
1095 self["text"].setText(_("Press OK Key"))
1096 self["testlist"].instance.moveSelection(self["testlist"].instance.moveUp)
1099 self["text"].setText(_("Press OK Key"))
1100 self["testlist"].instance.moveSelection(self["testlist"].instance.moveDown)
1103 print "line - ",self["testlist"].getCurrent()[1]
1104 index = self["testlist"].getCurrent()[1]
1106 if index==0 or index==1:
1107 self["text"].setText(_("Insert Card?"))
1109 elif index ==2 or index==3:
1110 self["text"].setText(_("Insert Cam"))
1116 self.camstate.start(1000,True)
1118 def setSource(self, cislot):
1119 filename = ("/proc/stb/tsmux/ci%d_input"%cislot)
1120 fd = open(filename,'w')
1124 def setInputSource(self, cislot):
1125 fd=open("/proc/stb/tsmux/input0","w")
1132 def resetSource(self):
1133 fd=open("/proc/stb/tsmux/input0","w")
1136 # fd = open("/proc/stb/tsmux/ci0_input","w")
1139 # fd = open("/proc/stb/tsmux/ci1_input","w")
1143 def channelstart(self):
1144 ref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
1149 ref.setData(4,0x640000)
1150 self.session.nav.playService(ref)
1152 def channelstop(self):
1153 self.session.nav.stopService() # try to disable foreground service
1155 def cam_state(self):
1156 index = self["testlist"].getCurrent()[1]
1161 print 'cam_state', self.camstep,self.camtry
1162 if self.camstep == 1:
1163 state = eDVBCI_UI.getInstance().getState(slot)
1168 self["text"].setText(_("Getting Cam name...."))
1169 self.camstate.start(5000,True)
1173 self.camstate.start(1000,True)
1175 self.session.open( MessageBox, _("NO_NOT_INSERTED"), MessageBox.TYPE_ERROR)
1176 self.rlist[index]="fail"
1177 self["resultlist"].updateList(self.rlist)
1179 elif self.camstep == 2:
1180 appname = eDVBCI_UI.getInstance().getAppName(slot)
1181 print 'appname',appname
1185 self.camstate.start(1000,True)
1187 self.session.open( MessageBox, _("NO_GET_APPNAME"), MessageBox.TYPE_ERROR)
1188 self.rlist[index]="fail"
1189 self["resultlist"].updateList(self.rlist)
1191 self["text"].setText(_("Get Cam name : %s"%appname+". \n Remove Cam!"))
1193 self.setInputSource(slot)
1194 self.setSource(slot)
1197 self.camstate.start(1000,True)
1198 elif self.camstep==3:
1199 state = eDVBCI_UI.getInstance().getState(slot)
1203 self.result += (1<<index)
1205 self.rlist[index]="pass"
1206 self["text"].setText(_("Press OK Key"))
1207 self["resultlist"].updateList(self.rlist)
1215 self.camstate.start(1000,True)
1218 self.session.open( MessageBox, _("NO_REMOVE_CAM"), MessageBox.TYPE_ERROR)
1219 self.rlist[index]="fail"
1220 self["resultlist"].updateList(self.rlist)
1222 def check_smart_card(self,which):
1226 result = eSctest.getInstance().check_smart_card("/dev/sci0")
1228 result = eSctest.getInstance().check_smart_card("/dev/sci1")
1238 self.session.open( MessageBox, _("1:NO_DEV_FOUND"), MessageBox.TYPE_ERROR)
1240 self.session.open( MessageBox, _("1:SC_NOT_INSERTED"), MessageBox.TYPE_ERROR)
1242 self.session.open( MessageBox, _("1:SC_NOT_VALID_ATR"), MessageBox.TYPE_ERROR)
1244 self.session.open( MessageBox, _("1:SC_READ_TIMEOUT"), MessageBox.TYPE_ERROR)
1245 self.rlist[which]="fail"
1246 self["resultlist"].updateList(self.rlist)
1249 def remove_card(self):
1250 index = self["testlist"].getCurrent()[1]
1252 result = eSctest.getInstance().eject_smart_card("/dev/sci0")
1254 result = eSctest.getInstance().eject_smart_card("/dev/sci1")
1255 print 'remove result' ,result
1257 self.rlist[index]="pass"
1258 self.result += (1<<index)
1261 self.session.open( MessageBox, _("2:NO_DEV_FOUND"), MessageBox.TYPE_ERROR)
1263 self.session.open( MessageBox, _("2:SC_NOT_INSERTED"), MessageBox.TYPE_ERROR)
1265 self.session.open( MessageBox, _("2:SC_NOT_VALID_ATR"), MessageBox.TYPE_ERROR)
1267 self.session.open( MessageBox, _("2:SC_NOT_REMOVED"), MessageBox.TYPE_ERROR)
1268 self.rlist[index]="fail"
1269 self["resultlist"].updateList(self.rlist)
1270 self["text"].setText(_("Press OK Key"))
1275 def ScTest(self, yesno):
1278 index = self["testlist"].getCurrent()[1]
1279 result = self.check_smart_card(index)
1281 self.removecard.start(100,True)
1282 self["text"].setText(_("Read Ok. Remove Card!"))
1288 class SmartCardTest(Screen):
1290 <screen position="300,240" size="160,120" title="SmartCard Test" >
1291 <widget name="text" position="10,10" size="140,100" font="Regular;22" />
1294 def __init__(self, session):
1295 self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
1297 "cancel": self.keyCancel,
1298 "ok" : self.keyCancel
1301 Screen.__init__(self, session)
1302 # self["text"]=Label(("Press Key LEFT"))
1303 self["text"]=Label(("Testing Smartcard 1..."))
1305 self.smartcardtimer = eTimer()
1306 self.smartcardtimer.callback.append(self.check_smart_card)
1307 self.smartcardtimer.start(100,True)
1308 self.closetimer = eTimer()
1309 self.closetimer.callback.append(self.close)
1311 global smartcardtest
1317 def check_mode(self):
1319 fd = open("/proc/stb/info/version","r")
1321 if int(version,16) <= 0x1200A3:
1325 if int(version,16) < 0x130000:
1327 elif int(version,16) > 0x140000:
1332 def check_smart_card(self):
1333 global smartcardtest
1334 index = self.smartcard
1337 if self.Testmode==0:
1338 result = eSctest.getInstance().check_smart_card("/dev/sci0")
1340 result = eSctest.getInstance().n_check_smart_card("/dev/sci0")
1342 if self.Testmode==0:
1343 result = eSctest.getInstance().check_smart_card("/dev/sci1")
1345 result = eSctest.getInstance().n_check_smart_card("/dev/sci1")
1353 if(index== 0 and self.model== 0):
1355 self["text"].setText(_("Testing Smartcard 2..."))
1356 self.smartcardtimer.start(100,True)
1358 elif (index==1 or self.model==1):
1360 # self.session.open( MessageBox, _("Smart Card OK!!"), MessageBox.TYPE_INFO,2)
1362 self["text"].setText(_("Smart Card OK!!"))
1363 self.closetimer.start(2000,True)
1364 self.smartcardtimer.stop()
1365 # self.session.openWithCallback(self.check6, MessageBox, _("Scart loop ok?"), MessageBox.TYPE_INFO)
1368 # self.session.open( MessageBox, _("%d:NO_DEV_FOUND"%(index+1)), MessageBox.TYPE_ERROR)
1369 # elif result == -2:
1370 # self.session.open( MessageBox, _("%d:SC_NOT_INSERTED"%(index+1)), MessageBox.TYPE_ERROR)
1371 # elif result == -3:
1372 # self.session.open( MessageBox, _("%d:SC_NOT_VALID_ATR"%(index+1)), MessageBox.TYPE_ERROR)
1373 # elif result == -5:
1374 # self.session.open( MessageBox, _("%d:SC_READ_TIMEOUT"%(index+1)), MessageBox.TYPE_ERROR)
1376 self["text"].setText(_("Smart Card 1 Error!\nerrorcode=%d"%result))
1378 self["text"].setText(_("Smart Card 2 Error!\nerrorcode=%d"%result))
1379 self.closetimer.start(2000,True)
1380 self.smartcardtimer.stop()
1383 def keyCancel(self):
1390 class FrontTest(Screen):
1392 <screen position="260,240" size="200,180" title="Front Test" >
1393 <widget name="text" position="10,10" size="180,160" font="Regular;22" />
1396 def __init__(self, session):
1397 self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
1401 "down":self.keyDown,
1402 "cancel": self.keyCancel,
1405 Screen.__init__(self, session)
1406 self["text"]=Label(("Wheel LEFT"))
1409 self.fronttimer= eTimer()
1410 self.fronttimer.callback.append(self.FrontAnimate)
1411 self.frontturnonoff = 0
1412 eSctest.getInstance().VFD_Open()
1413 self.keytimeout = eTimer()
1414 self.keytimeout.callback.append(self.KeyTimeOut)
1415 self.keytimeout.start(5000,True)
1417 def KeyTimeOut(self):
1419 self["text"].setText(("Wheel LEFT ERROR"))
1420 elif self.step ==2 :
1421 self["text"].setText(("Wheel RIGHT ERROR"))
1422 elif self.step == 3:
1423 self["text"].setText(("Wheel BUTTON ERROR"))
1427 def keyCancel(self):
1429 self.fronttimer.stop()
1430 eSctest.getInstance().VFD_Close()
1439 self.keytimeout.stop()
1440 self.keytimeout.start(5000,True)
1442 self["text"].setText(_("Press Front Wheel"))
1446 self.keytimeout.stop()
1447 self.keytimeout.start(5000,True)
1449 self["text"].setText(_("Wheel RIGHT"))
1455 self.keytimeout.stop()
1457 self.fronttimer.start(1000,True)
1458 self["text"].setText(("Front Test OK!\nPress Exit Key"))
1459 # elif self.step==4:
1461 # self.fronttimer.stop()
1462 # eSctest.getInstance().VFD_Close()
1466 def FrontAnimate(self):
1467 if (self.frontturnonoff==0):
1468 eSctest.getInstance().turnon_VFD()
1469 self.frontturnonoff = 1
1471 self.frontturnonoff = 0
1472 eSctest.getInstance().turnoff_VFD()
1473 self.fronttimer.start(1000,True)
1476 class FrontTest_solo(Screen):
1478 <screen position="260,240" size="200,180" title="Front Test" >
1479 <widget name="text" position="10,10" size="180,160" font="Regular;22" />
1482 def __init__(self, session):
1483 self["actions"] = ActionMap(["DirectionActions", "OkCancelActions","GlobalActions"],
1486 "cancel": self.keyCancel,
1487 "left": self.keyleft,
1488 "right": self.keyright,
1489 "power_down": self.keypower,
1490 "volumeUp": self.keyvolup,
1491 "volumeDown": self.keyvoldown,
1494 Screen.__init__(self, session)
1495 self["text"]=Label(("Press Front STANDBY"))
1498 self.fronttimer= eTimer()
1499 self.fronttimer.callback.append(self.FrontAnimate)
1500 self.frontturnonoff = 0
1501 eSctest.getInstance().VFD_Open()
1502 self.keytimeout = eTimer()
1503 self.keytimeout.callback.append(self.KeyTimeOut)
1504 self.keytimeout.start(5000,True)
1506 def KeyTimeOut(self):
1508 self["text"].setText(("Front STANDBY ERROR\nPress exit!"))
1509 elif self.step == 2 :
1510 self["text"].setText(("Front CH - ERROR\nPress exit!"))
1511 elif self.step == 3:
1512 self["text"].setText(("Front CH + ERROR\nPress exit!"))
1513 elif self.step == 4 :
1514 self["text"].setText(("Front VOL - ERROR\nPress exit!"))
1515 elif self.step == 5:
1516 self["text"].setText(("Front VOL + ERROR\nPress exit!"))
1523 self.keytimeout.stop()
1524 self.keytimeout.start(5000,True)
1526 self["text"].setText(_("Press Front CH -"))
1530 self.keytimeout.stop()
1531 self.keytimeout.start(5000,True)
1533 self["text"].setText(_("Press Front VOL -"))
1537 self.keytimeout.stop()
1538 self.keytimeout.start(5000,True)
1540 self["text"].setText(_("Press Front CH +"))
1544 self.keytimeout.stop()
1546 self.fronttimer.start(1000,True)
1547 self["text"].setText(_("Front LED OK?\n\nyes-ok\nno-exit"))
1548 # self["text"].setText(("Front Test OK!\nPress Exit Key"))
1550 def keyvoldown(self):
1552 self.keytimeout.stop()
1553 self.keytimeout.start(5000,True)
1555 self["text"].setText(_("Press Front VOL +"))
1557 def checkled(self, yesno):
1564 def keyCancel(self):
1566 self.fronttimer.stop()
1567 eSctest.getInstance().VFD_Close()
1573 self.fronttimer.stop()
1574 eSctest.getInstance().VFD_Close()
1579 def FrontAnimate(self):
1580 if (self.frontturnonoff==0):
1581 eSctest.getInstance().turnon_VFD()
1582 self.frontturnonoff = 1
1584 self.frontturnonoff = 0
1585 eSctest.getInstance().turnoff_VFD()
1586 self.fronttimer.start(1000,True)
1595 class RS232Test(Screen):
1597 <screen position="300,240" size="160,100" title="RS232 Test" >
1598 <widget name="text" position="10,10" size="140,80" font="Regular;22" />
1601 def __init__(self, session):
1602 self["actions"] = ActionMap(["DirectionActions", "OkCancelActions"],
1604 "cancel": self.keyCancel,
1607 Screen.__init__(self, session)
1608 self["text"]=Label(("Press \"Enter\" Key"))
1609 self.timer = eTimer()
1610 self.timer.callback.append(self.checkrs232)
1611 self.timer.start(100, True)
1613 def checkrs232(self):
1616 rs=open('/dev/ttyS0','r')
1618 r,w,e = select.select(rd, [], [], 10)
1633 def keyCancel(self):
1638 class AgingTest(Screen):
1640 <screen position="200,240" size="250,100" title="Aging Test" >
1641 <widget name="text1" position="10,10" size="230,40" font="Regular;22" />
1642 <widget name="text2" position="10,50" size="230,40" font="Regular;22" />
1645 def __init__(self, session):
1646 self["actions"] = ActionMap(["WizardActions","GlobalActions"],
1648 "agingend": self.keyEnd,
1649 "agingfinish": self.keyFinish,
1650 "volumeUp": self.nothing,
1651 "volumeDown": self.nothing,
1652 "volumeMute": self.nothing,
1655 Screen.__init__(self, session)
1656 self["text1"]=Label(("Exit - Press Pause Key"))
1657 self["text2"]=Label(("Reset - Press Stop Key"))
1658 # self.servicelist = ServiceList()
1659 # self.oldref = session.nav.getCurrentlyPlayingServiceReference()
1660 # print "oldref",self.oldref
1661 # session.nav.stopService() # try to disable foreground service
1664 self.tuningtimer = eTimer()
1665 self.tuningtimer.callback.append(self.updateStatus)
1666 # self.tuningtimer.start(2000,True)
1669 def updateStatus(self):
1670 result = eSctest.getInstance().getFrontendstatus(0)
1673 print "eSctest.getInstance().getFrontendstatus - %d"%result
1676 self.session.nav.stopService()
1677 self.session.open( MessageBox, _("Tune 1 Ver Locking Fail..."), MessageBox.TYPE_ERROR)
1682 self.session.nav.stopService()
1683 self.session.open( MessageBox, _("Tune 1 Ver Error %d..."%result), MessageBox.TYPE_ERROR)
1690 if self.oldref is None:
1691 eref = eServiceReference("1:0:19:1324:3EF:1:C00000:0:0:0")
1692 serviceHandler = eServiceCenter.getInstance()
1693 servicelist = serviceHandler.list(eref)
1694 if not servicelist is None:
1695 ref = servicelist.getNext()
1697 ref = self.getCurrentSelection()
1698 print "servicelist none"
1701 self.session.nav.stopService() # try to disable foreground service
1706 ref.setData(4,0x640000)
1707 self.session.nav.playService(ref)
1712 self.session.nav.stopService() # try to disable foreground service
1715 def keyFinish(self):
1718 self.session.nav.stopService() # try to disable foreground service
1730 def main(session, servicelist, **kwargs):
1734 Servicelist = servicelist
1735 bouquets = Servicelist.getBouquetList()
1737 bouquetSel = Session.openWithCallback(cleanup, FactoryTest)
1739 #def Plugins(**kwargs):
1740 # return PluginDescriptor(name=_("Factory Test"), description="Test App for Factory", where = PluginDescriptor.WHERE_EXTENSIONSMENU, fnc=main)