Пример #1
0
	def getText(self):
		service = self.source.service
		info = service and service.info()
		if not info:
			return ""
			camd = None
			
		# OoZooN 	
                if fileExists("/tmp/cam.info"):		
                   try:
			camdlist = open("/tmp/cam.info", "r")
		   except:
			return None
			
		# Domica	
		elif fileExists("/etc/active_emu.list"):
		   try:
			camdlist = open("/etc/active_emu.list", "r")
		   except:
			return None
		else:
                   camdlist = None
		
		if camdlist is not None:
			for current in camdlist:
				camd = current
			camdlist.close()
			return camd
		else:
			return ""
	def __init__(self, session):
		self.skin = magicBackupPanel_Step3_Skin
		Screen.__init__(self, session)
		self['status'] = MultiPixmap()
		self['status'].setPixmapNum(0)
		self['label'] = Label('')
		self.mylist = ['Libraries', 'Firmwares', 'Binaries', 'SoftCams', 'Scripts', 'Bootlogos', 'Uninstall files', 'General Settings', 'Cron', 'Settings Channels Bouquets', 'Openvpn', 'Satellites Terrestrial', 'Plugins', 'END']
		self.mytmppath = '/media/hdd/'
		if fileExists('/etc/magic/.magicbackup_location'):
			fileExists('/etc/magic/.magicbackup_location')
			f = open('/etc/magic/.magicbackup_location', 'r')
			self.mytmppath = f.readline().strip()
			f.close()
		else:
			fileExists('/etc/magic/.magicbackup_location')
		self.mytmppath += 'magicbackup_location'
		self.activityTimer = eTimer()
		self.activityTimer.timeout.get().append(self.updatepix)
		self.onShow.append(self.startShow)
		self.onClose.append(self.delTimer)
		system('rm -rf ' + self.mytmppath)
		system('mkdir ' + self.mytmppath)
		system('mkdir ' + self.mytmppath + '/etc')
		system('mkdir ' + self.mytmppath + '/lib')
		system('mkdir ' + self.mytmppath + '/usr')
		system('mkdir ' + self.mytmppath + '/scripts')
		system('mkdir ' + self.mytmppath + '/media')
		system('mkdir ' + self.mytmppath + '/media/hdd')
		system('mkdir ' + self.mytmppath + '/media/usb')
		system('mkdir ' + self.mytmppath + '/media/usb2')
		system('mkdir ' + self.mytmppath + '/media/usb3')
		configfile.save()
	def backuP(self):
		m = checkkernel()
		if m == 1:
		    check = False
		    if fileExists('/proc/mounts'):
			    fileExists('/proc/mounts')
			    f = open('/proc/mounts', 'r')
			    for line in f.readlines():
				    if line.find('/media/cf') != -1:
					    check = True
					    continue
				    if line.find('/media/usb') != -1:
					    check = True
					    continue
				    if line.find('/media/usb2') != -1:
					    check = True
					    continue
				    if line.find('/media/usb3') != -1:
					    check = True
					    continue
				    if line.find('/media/card') != -1:
					    check = True
					    continue
				    if line.find('/hdd') != -1:
					    check = True
					    continue
			    f.close()
		    else:
			    fileExists('/proc/mounts')
		    if check == False:
			    self.session.open(MessageBox, _('Sorry, there is not any connected devices in your STB.\nPlease connect HDD or USB to store/restore Your magic Backup!'), MessageBox.TYPE_INFO)
		    else:
			    self.session.openWithCallback(self.myclose, magicBackupPanel_Step2)
		else:
		  self.session.open(MessageBox, _('Sorry: Wrong image in flash found. You have to install in flash magic Image'), MessageBox.TYPE_INFO, 3)
Пример #4
0
    def KeyYellow(self):
        if self.moni_state == 0:
            self.moniShow()
        mytext = ''
        count = 0
        if fileExists('/proc/stat'):
            f = open('/proc/stat', 'r')
            for line in f.readlines():
                if line.find('intr') != -1:
                    continue
                if line.find('cpu0') != -1:
                    continue
                mytext += line

            f.close()
        if fileExists('/proc/stat'):
            f = open('/proc/cpuinfo', 'r')
            for line in f.readlines():
                parts = line.strip().split(':')
                if len(parts) > 1:
                    strview = parts[0].strip()
                    strview2 = ''
                    if len(parts) == 3:
                        strview2 = ' ' + parts[2]
                    mytext += strview + ':  ' + parts[1] + strview2 + '\n'
                    count += 1
                if count == 9:
                    break

            f.close()
        self['moni2'].setText(mytext)
	def updateList(self):
		(mycf, myusb, myusb2, myusb3, mysd, myhdd) = ('', '', '', '', '', '',)
		myoptions = []
		if fileExists('/proc/mounts'):
			fileExists('/proc/mounts')
			f = open('/proc/mounts', 'r')
			for line in f.readlines():
				if line.find('/media/cf') != -1:
					mycf = '/media/cf/'
					continue
				if line.find('/media/usb') != -1:
					myusb = '/media/usb/'
					continue
				if line.find('/media/usb2') != -1:
					myusb2 = '/media/usb2/'
					continue
				if line.find('/media/usb3') != -1:
					myusb3 = '/media/usb3/'
					continue				      
				if line.find('/media/card') != -1:
					mysd = '/media/card/'
					continue
				if line.find('/hdd') != -1:
					myhdd = '/media/hdd/'
					continue
			f.close()
		else:
			fileExists('/proc/mounts')
		if mycf:
			mycf
			self.list.append((_("CF card mounted in:        ") +mycf, mycf))
		else:
			mycf
		if myusb:
			myusb
			self.list.append((_("USB device mounted in:     ") +myusb, myusb))
		else:
			myusb
		if myusb2:
			myusb2
			self.list.append((_("USB 2 device mounted in:   ") +myusb2, myusb2))
		else:
			myusb2
		if myusb3:
			myusb3
			self.list.append((_("USB 3 device mounted in:   ") +myusb3, myusb3))
		else:
			myusb3
		if mysd:
			mysd
			self.list.append((_("SD card mounted in:         ") +mysd, mysd))
		else:
			mysd
		if myhdd:
			myhdd
			self.list.append((_("HDD mounted in:               ") +myhdd, myhdd))
		else:
			myhdd

		self["config"].setList(self.list)
Пример #6
0
    def updateList(self):
        mycf = myusb = mysd = myhdd = ''
        myoptions = []
        if fileExists('/proc/mounts'):
            f = open('/proc/mounts', 'r')
            for line in f.readlines():
                if line.find('/media/cf') != -1:
                    mycf = '/media/cf/'
                elif line.find('/media/usb') != -1:
                    myusb = '/media/usb/'
                elif line.find('/media/card') != -1:
                    mysd = '/media/card/'
                elif line.find('/hdd') != -1:
                    myhdd = '/media/hdd/'

            f.close()
        if mycf:
            myoptions.append((mycf, mycf))
        if myusb:
            myoptions.append((myusb, myusb))
        if mysd:
            myoptions.append((mysd, mysd))
        if myhdd:
            myoptions.append((myhdd, myhdd))
        self.list = []
        self.myepg_path = NoSave(ConfigSelection(choices=myoptions))
        if fileExists('/etc/bhpersonalbackup'):
            f = open('/etc/bhpersonalbackup', 'r')
            self.myepg_path.value = f.readline().strip()
            f.close()
        epg_path = getConfigListEntry(_('Path to save Personal Backup'), self.myepg_path)
        self.list.append(epg_path)
        self['config'].list = self.list
        self['config'].l.setList(self.list)
Пример #7
0
 def prepare(self):
     if fileExists(self.srcfile, 'r') and fileExists(self.destfile, 'r'):
         fsize1 = path.getsize(self.srcfile)
         fsize2 = path.getsize(self.destfile)
         self.srcsize = fsize1 + fsize2
         self.ProgressTimer.start(7500, True)
     self.toolbox.ptsFrontpanelActions('start')
Пример #8
0
	def updateList(self, ret=None):
		self.list = []
		self.cihelper_ci0 = NoSave(ConfigYesNo(default='True'))
		if fileExists('/dev/ci1'):
			self.cihelper_ci1 = NoSave(ConfigYesNo(default='True'))
		else:
			self.cihelper_ci1 = ConfigNothing()

		if fileExists('/etc/cihelper.conf'):
			f = open('/etc/cihelper.conf', 'r')
			for line in f.readlines():
				line = line.strip()
				if line.startswith('ENABLE_CI0='):
					if line[11:] == 'no':
						self.cihelper_ci0.value = False
					else:
						self.cihelper_ci0.value = True
					cihelper_ci0x = getConfigListEntry(_("Enable CIHelper for SLOT CI0") + ":", self.cihelper_ci0)
					self.list.append(cihelper_ci0x)
				elif line.startswith('ENABLE_CI1='):
					if line[11:] == 'no':
						self.cihelper_ci1.value = False
					else:
						self.cihelper_ci1.value = True
					if fileExists('/dev/ci1'):
						cihelper_ci1x = getConfigListEntry(_("Enable CIHelper for SLOT CI1") + ":", self.cihelper_ci1)
						self.list.append(cihelper_ci1x)
			f.close()
		self['config'].list = self.list
		self['config'].l.setList(self.list)
Пример #9
0
	def saveCIHelper(self):
		if fileExists('/etc/cihelper.conf'):
			inme = open('/etc/cihelper.conf', 'r')
			out = open('/etc/cihelper.conf.tmp', 'w')
			for line in inme.readlines():
				line = line.replace('\n', '')
				if line.startswith('ENABLE_CI0='):
					if not self.cihelper_ci0.value:
						line = 'ENABLE_CI0=no'
					else:
						line = 'ENABLE_CI0=yes'
				elif line.startswith('ENABLE_CI1='):
					if not self.cihelper_ci1.value:
						line = 'ENABLE_CI1=no'
					else:
						line = 'ENABLE_CI1=yes'
				out.write((line + '\n'))
			out.close()
			inme.close()
		else:
			open('/tmp/CIHelper.log', "a").write(_("Sorry CIHelper Config is Missing") + '\n')
			self.session.open(MessageBox, _("Sorry CIHelper Config is Missing"), MessageBox.TYPE_INFO)
			self.close()
		if fileExists('/etc/cihelper.conf.tmp'):
			rename('/etc/cihelper.conf.tmp', '/etc/cihelper.conf')
		self.myStop()
Пример #10
0
	def P_boxinfo(self, request):
		info = getInfo()
		model = info["boxtype"]
		if model in ("et9000", "et9200", "et9500"):
			model = "et9x00"
		elif model in ("et5000", "et6000", "et6x00"):
			model = "et5x00"
		elif model == "et4000":
			model = "et4x00"
		elif model == "xp1000":
			model = "xp1000"
		elif model.startswith("vu"):
			model = model.replace("vu", "")
		elif model in ("bska", "bxzb"):
			model = "nbox_white"
		elif model in ("bsla", "bzzb"):
			model = "nbox"
		elif model == "sagemcom88":
			model = "esi88"
		if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")):
			info["boximage"] = model + ".jpg"
		else:
			info["boximage"] = "unknown.jpg"
		if model in ("tf7700hdpvr", "topf", "TF 7700 HDPVR"):
			info["model"] = "TF 7700 HDPVR"
			if fileExists(getPublicPath("/images/boxes/topf.jpg")):
				info["boximage"] = "topf.jpg"
		return info
Пример #11
0
	def updateService(self):
		import process
		p = process.ProcessList()
		cihelper_process = str(p.named('cihelper')).strip('[]')
		self['labrun'].hide()
		self['labstop'].hide()
		self['labactive'].hide()
		self['labdisabled'].hide()
		self.my_cihelper_active = False
		self.my_cihelper_run = False
		if fileExists('/etc/rcS.d/S50cihelper.sh') or fileExists('/etc/rc4.d/S50cihelper.sh'):
			self['labdisabled'].hide()
			self['labactive'].show()
			self.my_cihelper_active = True
			autostartstatus_summary = self['autostart'].text + ' ' + self['labactive'].text
		else:
			self['labactive'].hide()
			self['labdisabled'].show()
			autostartstatus_summary = self['autostart'].text + ' ' + self['labdisabled'].text
		if cihelper_process:
			self.my_cihelper_run = True
		if self.my_cihelper_run:
			self['labstop'].hide()
			self['labrun'].show()
			self['key_green'].setText(_("Stop"))
			status_summary= self['status'].text + ' ' + self['labstop'].text
		else:
			self['labstop'].show()
			self['labrun'].hide()
			self['key_green'].setText(_("Start"))
			status_summary= self['status'].text + ' ' + self['labstop'].text

		if fileExists('/etc/cihelper.conf'):
			f = open('/etc/cihelper.conf', 'r')
			for line in f.readlines():
				line = line.strip()
				if line.startswith('ENABLE_CI0='):
					if line[11:] == 'no':
						self['ci0active'].hide()
						self['ci0inactive'].show()
					else:
						self['ci0active'].show()
						self['ci0inactive'].hide()
				elif fileExists('/dev/ci1'):
					if line.startswith('ENABLE_CI1='):
						if line[11:] == 'no':
							self['ci1active'].hide()
							self['ci1inactive'].show()
						else:
							self['ci1active'].show()
							self['ci1inactive'].hide()
				else:
					self['ci1active'].hide()
					self['ci1inactive'].hide()
					self['ci1'].hide()
				f.close()
		title = _("CIHelper Setup")

		for cb in self.onChangedEntry:
			cb(title, status_summary, autostartstatus_summary)
Пример #12
0
 def keyOk(self):
     item = self['list'].getCurrent()
     selected = item[0][0]
     if selected == _('Download EGAMI Addons'):
         staturl = 'http://enigma-spark.com/egami/catalog_enigma2.xml'
         downfile = '/tmp/.catalog.xml'
         if fileExists(downfile):
             os.remove(downfile)
         self.session.openWithCallback(self.EGConnectionCallback, EGConnectionAnimation, staturl, downfile)
     elif selected == _('Download Plugins'):
         self.session.open(PluginDownloadBrowser, 0)
     elif selected == _('User Server Addons'):
         if fileExists('/etc/user_addon.txt'):
             urlfile = file('/etc/user_addon.txt', 'r')
             linieurl = urlfile.read()
             urlfile.close()
             self.session.open(EG_PrzegladaczAddonow, linieurl)
         else:
             plik = 'There is no user_addon.txt file in /etc with server url!'
             self.session.open(MessageBox, _(plik), MessageBox.TYPE_INFO, timeout=5)
     elif selected == _('Install Tar.gz and IPK Addons'):
         self.session.open(EG_Manual_installation)
     elif selected == _('Remove Plugins'):
         self.session.open(PluginDownloadBrowser, 1)
     elif selected == _('Remove EGAMI addons'):
         self.session.open(EGAddonRemove)
Пример #13
0
	def update(self):
		self.timer.stop()
		time_min = 0
		now = time.localtime(time.time())
		if config.plugins.epanel.checkepgfile.value:
			if not fileExists("%sepg.dat" % config.plugins.epanel.direct.value):
				if fileExists("%sepgtmp/epg.dat.gz" % config.plugins.epanel.direct.value):
					self.restore_epgfile()
		if (config.plugins.epanel.auto.value == "yes" and config.plugins.epanel.timedwn.value[0] == now.tm_hour and config.plugins.epanel.timedwn.value[1] == now.tm_min and int(config.plugins.epanel.weekday.value) == int(now.tm_wday)):
			self.dload()
		if config.plugins.epanel.autosave.value is not '0':
			if min > int(config.plugins.epanel.autosave.value) and config.plugins.epanel.timedwn.value[1] != now.tm_min:
				global min
				min = 0
				self.save_load_epg()
				if config.plugins.epanel.autobackup.value:
					self.autobackup()
			else:
				global min
				min += 1
		if config.plugins.epanel.onoff.value is '1':
			time_min = int(config.plugins.epanel.time.value)
			if time_min == 30:
				time_min = 30
			else:
				time_min = time_min * 60
			if min_ntp > time_min:
				global min_ntp
				min_ntp = 0
				self.ntd_time_update()
			else:
				global min_ntp
				min_ntp += 1
		self.timer.start(60000, True)
Пример #14
0
	def loadProject(self, filename):
		#try:
			if not fileExists(filename):
				self.error = "xml file not found!"
				#raise AttributeError
			file = open(filename, "r")
			data = file.read().decode("utf-8").replace('&',"&").encode("ascii",'xmlcharrefreplace')
			file.close()
			projectfiledom = xml.dom.minidom.parseString(data)
			for node in projectfiledom.childNodes[0].childNodes:
			  print "node:", node
			  if node.nodeType == xml.dom.minidom.Element.nodeType:
			    if node.tagName == 'settings':
				self.xmlAttributesToConfig(node, self.settings)
			    elif node.tagName == 'titles':
				self.xmlGetTitleNodeRecursive(node)
				
			for key in self.filekeys:
				val = self.settings.dict()[key].getValue()
				if not fileExists(val):
					self.error += "\n%s '%s' not found" % (key, val)
		#except AttributeError:
		  	#print "loadProject AttributeError", self.error
			#self.error += (" in project '%s'") % (filename)
			#return False
			return True
Пример #15
0
    def downloadInfo(self):
        os.system('rm /tmp/AddonInfo.txt')
        if not self.infoFile.endswith('/'):
            os.system('wget -q ' + self.infoFile + ' -O /tmp/AddonInfo.txt')
        if fileExists('/tmp/AddonInfo.txt'):
            infoFile = open('/tmp/AddonInfo.txt', 'r')
            theText = infoFile.read()
            infoFile.close()
            os.system('rm /tmp/AddonInfo.txt')
            self['text'].setText(theText)
        else:
            self['text'].setText(_('No further information available.'))
        try:
            self.imageFile, width, height = self.imageFile.split('|')
        except:
            width = 48
            height = 48

        width = int(width)
        height = int(height)
        os.system('rm /tmp/AddonInfo.png')
        if not self.imageFile.endswith('/'):
            os.system('wget -q ' + self.imageFile + ' -O /tmp/AddonInfo.png')
        if fileExists('/tmp/AddonInfo.png'):
            self['image'].instance.setPixmapFromFile('/tmp/AddonInfo.png')
            pixSize = (width, height)
            self['image'].show()
            os.system('rm /tmp/AddonInfo.png')
Пример #16
0
 def _cleanedUp(self):
     if fileExists(self.filePath):
         try: os_remove(self.filePath)
         except: printDBG('Problem with removing old buffering file')
     if fileExists(self.GST_FLV_DEMUX_IS_DEMUXING_INFINITE_FILE):
         try: os_remove(self.GST_FLV_DEMUX_IS_DEMUXING_INFINITE_FILE)
         except: printDBG('Problem with removing gstreamer flag file [%s]' % self.GST_FLV_DEMUX_IS_DEMUXING_INFINITE_FILE)
Пример #17
0
def countFrontpanelLEDs():
    leds = 0
    if fileExists("/proc/stb/fp/led_set_pattern"):
        leds += 1
    while fileExists("/proc/stb/fp/led%d_pattern" % leds):
        leds += 1
    return leds
Пример #18
0
	def doRestorePlugins1(self):
		print '[RestoreWizard] Stage 3: Check Kernel'
		if fileExists('/tmp/backupkernelversion') and fileExists('/tmp/backupimageversion'):
			imageversion = file('/tmp/backupimageversion').read()
			kernelversion = file('/tmp/backupkernelversion').read()
			print 'Backup Image:', imageversion
			print 'Current Image:', about.getVersionString()
			print 'Backup Kernel:', kernelversion
			print 'Current Kernel:', about.getKernelVersionString()
			if kernelversion == about.getKernelVersionString() and imageversion in (about.getVersionString()):
				print '[RestoreWizard] Stage 3: Kernel and image ver OK'
				self.doRestorePluginsTest()
			else:
				print '[RestoreWizard] Stage 3: Kernel or image ver Differant'
				if self.didSettingsRestore:
					self.NextStep = 'reboot'
				else:
					self.NextStep = 'noplugins'
				self.buildListRef.close(True)
		else:
			print '[RestoreWizard] Stage 3: No Kernel to check'
			if self.didSettingsRestore:
				self.NextStep = 'reboot'
			else:
				self.NextStep = 'noplugins'
			self.buildListRef.close(True)
Пример #19
0
    def updateVpn(self):
        rc = system('ps > /tmp/nvpn.tmp')
        self['labrun'].hide()
        self['labstop'].hide()
        self['labactive'].setText(_('Inactive'))
        self['key_yellow'].setText(_('Set Active'))
        self.my_vpn_active = False
        self.my_vpn_run = False
        if fileExists('/etc/default/openvpn'):
            self['labactive'].setText(_('Active/Autostart enabled'))
            self['key_yellow'].setText(_('Deactivate'))
            self.my_vpn_active = True
        if fileExists('/tmp/nvpn.tmp'):
            f = open('/tmp/nvpn.tmp', 'r')
            for line in f.readlines():
                if line.find('openvpn') != -1:
                    self.my_vpn_run = True

            f.close()
            os_remove('/tmp/nvpn.tmp')
        if self.my_vpn_run == True:
            self['labstop'].hide()
            self['labrun'].show()
            self['key_red'].setText(_('Restart'))
        else:
            self['labstop'].show()
            self['labrun'].hide()
            self['key_red'].setText(_('Start'))
Пример #20
0
	def install(self):
		skinpath = "/usr/share/enigma2/"
		pluginpath = "/usr/lib/enigma2/python/Plugins/Extensions/"
		componentspath = "/usr/lib/enigma2/python/Components/"
		if fileExists("/tmp/version")\
			and fileExists("/tmp/plugin.py")\
			and fileExists("/tmp/ruSetupCyberLCD.mo")\
			and fileExists("/tmp/deSetupCyberLCD.mo")\
			and fileExists("/tmp/skin_solo4k.xml")\
			and fileExists("/tmp/skin_uno4k.xml")\
			and fileExists("/tmp/skin_ultimo4k.xml")\
			and fileExists("/tmp/AlwaysTrue.py")\
			and fileExists("/tmp/AnimatedWeatherPixmap.py")\
			and fileExists("/tmp/PiconUni.py"):
			os.system("cp /tmp/version %sSetupCyberLCD/version" % (pluginpath))
	# install plugin
			os.system("cp /tmp/plugin.py %sSetupCyberLCD/plugin.py" % (pluginpath))
			os.system("cp /tmp/ruSetupCyberLCD.mo %sSetupCyberLCD/locale/ru/LC_MESSAGES/SetupCyberLCD.mo" % (pluginpath))
			os.system("cp /tmp/deSetupCyberLCD.mo %sSetupCyberLCD/locale/de/LC_MESSAGES/SetupCyberLCD.mo" % (pluginpath))
	# install skin
			os.system("cp /tmp/skin_default.xml %sCyberLCD/skin_default.xml" % (skinpath))
			os.system("cp /tmp/skin_solo4k.xml %sCyberLCD/skin_solo4k.xml" % (skinpath))
			os.system("cp /tmp/skin_uno4k.xml %sCyberLCD/skin_uno4k.xml" % (skinpath))
			os.system("cp /tmp/skin_ultimo4k.xml %sCyberLCD/skin_ultimo4k.xml" % (skinpath))
	# install converter
			os.system("cp /tmp/AlwaysTrue.py %sConverter/AlwaysTrue.py" % (componentspath))
			os.system("cp %sWeatherMSN/components/MSNWeather2.py %sConverter/MSNWeather2.py" % (pluginpath, componentspath))
	# install renderer
			os.system("cp /tmp/AnimatedWeatherPixmap.py %sRenderer/AnimatedWeatherPixmap.py" % (componentspath))
			os.system("cp /tmp/PiconUni.py %sRenderer/PiconUni.py" % (componentspath))
	# end
			self.session.openWithCallback(self.restart, MessageBox,_("Do you want to restart the GUI now ?"), MessageBox.TYPE_YESNO)
		else:
			self.default()
Пример #21
0
    def makeUnikalFileName(fileName, withTmpFileName=True, addDateToFileName=False):
        # if this function is called
        # no more than once per second
        # date and time (with second)
        # is sufficient to provide a unique name
        from time import gmtime, strftime

        date = strftime("%Y-%m-%d_%H:%M:%S_", gmtime())

        if not addDateToFileName:
            tries = 10
            for idx in range(tries):
                if idx > 0:
                    uniqueID = str(idx + 1) + ". "
                else:
                    uniqueID = ""
                newFileName = os.path.dirname(fileName) + os.sep + uniqueID + os.path.basename(fileName)
                if fileExists(newFileName):
                    continue
                if withTmpFileName:
                    tmpFileName = os.path.dirname(fileName) + os.sep + "." + uniqueID + os.path.basename(fileName)
                    if fileExists(tmpFileName):
                        continue
                    return newFileName, tmpFileName
                else:
                    return newFileName

        newFileName = os.path.dirname(fileName) + os.sep + date.replace(":", ".") + os.path.basename(fileName)
        if withTmpFileName:
            tmpFileName = os.path.dirname(fileName) + os.sep + "." + date.replace(":", ".") + os.path.basename(fileName)
            return newFileName, tmpFileName
        else:
            return newFileName
Пример #22
0
	def remove_img(self, answer):
		if fileExists("/tmp/nfiflasher_image.tar.bz2"):
			remove("/tmp/nfiflasher_image.tar.bz2")
		if fileExists(self.imagefilename):
			remove(self.imagefilename)
		self.downloading(False)
		self.switchList(self.LIST_SOURCE)
Пример #23
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if open("/proc/stb/info/model",'r').read().strip() == "Gigablue":
			ret['box'] = "gigablue"
		if fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip()
		elif fileExists("/proc/stb/info/boxtype"):
			ret['box'] = open("/proc/stb/info/boxtype").read().strip()
			
		if ret["box"] == "duo" or ret["box"] == "solo" or ret["box"] == "uno":
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] == "et9x00" or ret["box"] == "et9000" or ret["box"] == "et9200":
			ret["remote"] = "et9x00"
		elif ret["box"] == "et5x00" or ret["box"] == "et5000" or ret["box"] == "et6000":
			ret["remote"] = "et5x00"
		elif ret["box"] == "gigablue":
			ret["remote"] = "gigablue"
		else:
			ret["remote"] = "dmm"
		
		return ret
		
Пример #24
0
	def buildMenu(self, mlist):
		keys = ["red", "green", "yellow", "blue", "1", "2", "3", "4", "5", "6", "7", "8", "9", "0", ""]
		menuentries = []
		k = 0
		for t in mlist:
			res = [ t ]
			if t.startswith("--"):
				png = resolveFilename(SCOPE_ACTIVE_SKIN, "div-h.png")
				if fileExists(png):
					png = LoadPixmap(png)
				if png is not None:
					x, y, w, h = skin.parameters.get("ChoicelistDash",(0, 2*f, 800*f, 2*f))
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP, x, y, w, h, png))
					x, y, w, h = skin.parameters.get("ChoicelistName",(45*f, 2*f, 800*f, 25*f))
					res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, t[2:]))
					png2 = resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/key_" + keys[k] + ".png")
					if fileExists(png2):
						png2 = LoadPixmap(png2)
					if png2 is not None:
						x, y, w, h = skin.parameters.get("ChoicelistIcon",(5*f, 0, 35*f, 25*f))
						res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, x, y, w, h, png2))
			else:
				x, y, w, h = skin.parameters.get("ChoicelistName",(45*f, 2*f, 800*f, 25*f))
				res.append((eListboxPythonMultiContent.TYPE_TEXT, x, y, w, h, 0, RT_HALIGN_LEFT, t))
				png2 = resolveFilename(SCOPE_ACTIVE_SKIN, "buttons/key_" + keys[k] + ".png")
				if fileExists(png2):
					png2 = LoadPixmap(png2)
				if png2 is not None:
					x, y, w, h = skin.parameters.get("ChoicelistIcon",(5*f, 0, 35*f, 25*f))
					res.append((eListboxPythonMultiContent.TYPE_PIXMAP_ALPHATEST, x, y, w, h, png2))
			menuentries.append(res)
			if k < len(keys) - 1:
				k += 1
		return menuentries
	def runAnim(self, id):
		global total
		animokicon = False
		if fileExists('%s/%s' % (self.path, id)):
			pathanimicon = '%s/%s/a' % (self.path, id)
			path = '%s/%s' % (self.path, id)
			dir_work = os.listdir(path)
			total = len(dir_work)
			self.slideicon = total
			animokicon = True
		else:
			if fileExists('%s/NA' % self.path):
				pathanimicon = '%s/NA/a' % self.path
				path = '%s/NA'  % self.path
				dir_work = os.listdir(path)
				total = len(dir_work)
				self.slideicon = total
				animokicon = True
		if animokicon == True:
			self.picsicon = []
			for x in range(self.slideicon):
				self.picsicon.append(LoadPixmap(pathanimicon + str(x) + '.png'))
			self.timericon = eTimer()
			self.timericon.callback.append(self.timerEvent)
			self.timericon.start(100, True)
Пример #26
0
	def menu(self):
		options = [
			(_("Import from Timer"), self.importFromTimer),
			(_("Import from EPG"), self.importFromEPG),
		]
		try:
			cur = self['list'].getCurrent()
			event = cur[0]
		except:
			event = None
		if event:
			options.append((_("Zap to selected service"), self.zapToSelectedService))
		if autoTimerAvailable:
			options.extend((
				(_("Import from AutoTimer"), self.importFromAutoTimer),
				(_("Save search as AutoTimer"), self.addAutoTimer),
				(_("Export selected as AutoTimer"), self.exportAutoTimer),
			))
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/TMDb/plugin.pyo"):
			options.append((_("Search for TMDb info"), self.opentmdb))
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/IMDb/plugin.py"):
			options.append((_("Open selected in IMDb"), self.openImdb))
		history = config.plugins.epgsearch.history.value
		if len(history) > 0:
			options.append((_("Clear history"), self.ClearHistory))
		options.append((_("Timers list"), self.openTimerslist))
		options.append((_("Setup"), self.setup))

		self.session.openWithCallback(
			self.menuCallback,
			ChoiceBox,
			list = options
		)
Пример #27
0
	def install(self):
		if len(self.devices) == 0:
			return
			
		index = self["menu"].getIndex()
		if index == None:
			index = 0
		
		if len(self.devices[index].getPackage()) == 0 or smstack.checkIfPending(self.devices[index].getPackage()):
			return
			
		if fileExists("/usr/lib/opkg/info/%s.control" % self.devices[index].getPackage()):
			smstack.add(SMStack.REMOVE, self.devices[index].getPackage())
			self.devices[index].setStatus(2)
		else:
			smstack.add(SMStack.UPDATE, "")
			api = SAPCL()
			firmwares = api.getUsbFirmwares(self.devices[index].getPackage())
			for firmware in firmwares["firmwares"]:
				if not fileExists("/usr/lib/opkg/info/%s.control" % firmware["firmware-name"]):
					smstack.add(SMStack.INSTALL, firmware["firmware-name"])
			smstack.add(SMStack.INSTALL_WITH_REBOOT, self.devices[index].getPackage())
			self.devices[index].setStatus(3)
			
		self.drawList()
Пример #28
0
    def check_for_NFO(self, nfifile=None):
        print "check_for_NFO", self["filelist"].getFilename(), self["filelist"].getCurrentDirectory()
        self["infolabel"].text = ""
        self["key_green"].text = ""

        if nfifile is None:
            if self["filelist"].getFilename() is None:
                return
            if self["filelist"].getCurrentDirectory() is not None:
                self.nfifile = self["filelist"].getCurrentDirectory() + self["filelist"].getFilename()
        else:
            self.nfifile = nfifile

        if self.nfifile.upper().endswith(".NFI"):
            self["key_green"].text = _("Flash")
            nfofilename = self.nfifile[0:-3] + "nfo"
            print nfofilename, fileExists(nfofilename)
            if fileExists(nfofilename):
                nfocontent = open(nfofilename, "r").read()
                print "nfocontent:", nfocontent
                self["infolabel"].text = nfocontent
                pos = nfocontent.find("MD5:")
                if pos > 0:
                    self.md5sum = nfocontent[pos + 5 : pos + 5 + 32] + "  " + self.nfifile
                else:
                    self.md5sum = ""
            else:
                self["infolabel"].text = _("No details for this image file") + (self["filelist"].getFilename() or "")
                self.md5sum = ""
Пример #29
0
def findFile(serviceName):
	path = "picon"
	piconsize = int(config.usage.servicelist_show_picon.value)
	if path == "picon":
		normal_path = config.usage.servicelist_picon_dir.value + "/"
		opt_path = None
		if piconsize == 50:
			opt_path = config.usage.servicelist_picon_dir.value + "_50x30/"
		elif piconsize == 100:
			opt_path = config.usage.servicelist_picon_dir.value + "_100x60/"
		for path in (opt_path, normal_path):
			if path and serviceName:
				pngname = path + serviceName + ".png"
				if fileExists(pngname):
					return pngname
	for searchpath in searchPaths:
		piconpath = path
		if piconsize == 50:
			piconpath = path + "_50x30"
		elif piconsize == 100:
			piconpath = path + "_100x60"
		if piconsize > 0:
			pngname = (searchpath % piconpath) + serviceName + ".png"
			if fileExists(pngname):
				return pngname
		pngname = (searchpath % path) + serviceName + ".png"
		if fileExists(pngname):
			return pngname
	return ""
Пример #30
0
	def CCCconn(self):
		self.activityTimer.stop()
		url = "http://127.0.0.1:8081/reader0"
		cmd = 'wget -O /tmp/cpanel.tmp ' + url
		rc = system(cmd)
		strview = ''
		if fileExists('/tmp/cpanel.tmp'):
			fileExists('/tmp/cpanel.tmp')
			f = open('/tmp/cpanel.tmp', 'r')
			for line in f.readlines():
				line = line.strip()
				line = line.replace('\n', '')
				line = line.replace('MainStatistics', 'Reader /dev/sci0')
				line = line.replace('R0[tuxbox]', '\n\n')
				line = line.replace('CAID', '\n\nCAID')
				line = line.replace('Back', '\n\n')
				line = line.replace('<br/>', '\n')
				line = line.replace('<br><br><br><br>', '\n\n')
				line = line.replace('</br>', '\n')
				line = sub('<br(\\s+/)?>', '\n', line)
				line = sub('<(.*?)>', '', line)
				strview += line
			f.close()
			system('rm -f /tmp/cpanel.tmp')
		else:
			fileExists('/tmp/cpanel.tmp')
			mybox = self.session.open(MessageBox, 'Sorry. Connection to Wicardd refused.\nCheck that Wicardd is running and your webinfo settings.', MessageBox.TYPE_INFO)
			mybox.setTitle('Info')
		self['Linconn'].hide()
		if strview.find('Version:') != -1:
			pos = strview.find('Version:')
			strview = '\nWelcome to Wicardd Info Plugin v. 0.2.\n\nWicardd ' + strview[pos:]
		self['infotext'].setText(strview)
Пример #31
0
	def checkStreamServerSeek(self):
		streamServerSeekInstalled = "False"
		if fileExists("/usr/lib/enigma2/python/Plugins/Extensions/StreamServerSeek/plugin.pyo"):
			streamServerSeekInstalled = "True"
		print "streamServerSeekInstalled", streamServerSeekInstalled
		return streamServerSeekInstalled
Пример #32
0
def loadSingleSkinData(desktop, skin, path_prefix):
    """loads skin data like colors, windowstyle etc."""
    assert skin.tag == "skin", "root element in skin must be 'skin'!"
    for c in skin.findall("output"):
        id = c.attrib.get('id')
        if id:
            id = int(id)
        else:
            id = 0
        if id == 0:  # framebuffer
            for res in c.findall("resolution"):
                get_attr = res.attrib.get
                xres = get_attr("xres")
                if xres:
                    xres = int(xres)
                else:
                    xres = 720
                yres = get_attr("yres")
                if yres:
                    yres = int(yres)
                else:
                    yres = 576
                bpp = get_attr("bpp")
                if bpp:
                    bpp = int(bpp)
                else:
                    bpp = 32
                #print "Resolution:", xres,yres,bpp
                from enigma import gMainDC
                gMainDC.getInstance().setResolution(xres, yres)
                desktop.resize(eSize(xres, yres))
                if bpp != 32:
                    # load palette (not yet implemented)
                    pass

    for c in skin.findall("colors"):
        for color in c.findall("color"):
            get_attr = color.attrib.get
            name = get_attr("name")
            color = get_attr("value")
            if name and color:
                colorNames[name] = parseColor(color)
                #print "Color:", name, color
            else:
                raise SkinError("need color and name, got %s %s" %
                                (name, color))

    for c in skin.findall("fonts"):
        for font in c.findall("font"):
            get_attr = font.attrib.get
            filename = get_attr("filename", "<NONAME>")
            name = get_attr("name", "Regular")
            scale = get_attr("scale")
            if scale:
                scale = int(scale)
            else:
                scale = 100
            is_replacement = get_attr("replacement") and True or False
            render = get_attr("render")
            if render:
                render = int(render)
            else:
                render = 0
            resolved_font = resolveFilename(SCOPE_FONTS,
                                            filename,
                                            path_prefix=path_prefix)
            if not fileExists(
                    resolved_font
            ):  #when font is not available look at current skin path
                skin_path = resolveFilename(SCOPE_CURRENT_SKIN, filename)
                if fileExists(skin_path):
                    resolved_font = skin_path
            addFont(resolved_font, name, scale, is_replacement, render)
            #print "Font: ", resolved_font, name, scale, is_replacement

    for c in skin.findall("subtitles"):
        from enigma import eWidget, eSubtitleWidget
        scale = ((1, 1), (1, 1))
        for substyle in c.findall("sub"):
            get_attr = substyle.attrib.get
            font = parseFont(get_attr("font"), scale)
            col = get_attr("foregroundColor")
            if col:
                foregroundColor = parseColor(col)
                haveColor = 1
            else:
                foregroundColor = gRGB(0xFFFFFF)
                haveColor = 0
            col = get_attr("borderColor")
            if col:
                borderColor = parseColor(col)
            else:
                borderColor = gRGB(0)
            borderwidth = get_attr("borderWidth")
            if borderwidth is None:
                # default: use a subtitle border
                borderWidth = 3
            else:
                borderWidth = int(borderwidth)
            face = eSubtitleWidget.__dict__[get_attr("name")]
            eSubtitleWidget.setFontStyle(face, font, haveColor,
                                         foregroundColor, borderColor,
                                         borderWidth)

    for windowstyle in skin.findall("windowstyle"):
        style = eWindowStyleSkinned()
        id = windowstyle.attrib.get("id")
        if id:
            id = int(id)
        else:
            id = 0
        #print "windowstyle:", id

        # defaults
        font = gFont("Regular", 20)
        offset = eSize(20, 5)

        for title in windowstyle.findall("title"):
            get_attr = title.attrib.get
            offset = parseSize(get_attr("offset"), ((1, 1), (1, 1)))
            font = parseFont(get_attr("font"), ((1, 1), (1, 1)))

        style.setTitleFont(font)
        style.setTitleOffset(offset)
        #print "  ", font, offset

        for borderset in windowstyle.findall("borderset"):
            bsName = str(borderset.attrib.get("name"))
            for pixmap in borderset.findall("pixmap"):
                get_attr = pixmap.attrib.get
                bpName = get_attr("pos")
                filename = get_attr("filename")
                if filename and bpName:
                    png = loadPixmap(
                        resolveFilename(SCOPE_SKIN_IMAGE,
                                        filename,
                                        path_prefix=path_prefix), desktop)
                    style.setPixmap(eWindowStyleSkinned.__dict__[bsName],
                                    eWindowStyleSkinned.__dict__[bpName], png)
                #print "  borderset:", bpName, filename

        for color in windowstyle.findall("color"):
            get_attr = color.attrib.get
            colorType = get_attr("name")
            color = parseColor(get_attr("color"))
            try:
                style.setColor(eWindowStyleSkinned.__dict__["col" + colorType],
                               color)
            except:
                raise SkinError("Unknown color %s" % (colorType))
                #pass

            #print "  color:", type, color

        x = eWindowStyleManager.getInstance()
        x.setStyle(id, style)
Пример #33
0
def skin_user_skinname():
	name = "skin_user_" + config.skin.primary_skin.value[:config.skin.primary_skin.value.rfind('/')] + ".xml"
	filename = resolveFilename(SCOPE_CONFIG, name)
	if fileExists(filename):
		return name
	return None
Пример #34
0
def loadSingleSkinData(desktop, skin, path_prefix):
	"""loads skin data like colors, windowstyle etc."""
	assert skin.tag == "skin", "root element in skin must be 'skin'!"
	for c in skin.findall("output"):
		id = c.attrib.get('id')
		if id:
			id = int(id)
		else:
			id = 0
		if id == 0: # framebuffer
			for res in c.findall("resolution"):
				get_attr = res.attrib.get
				xres = get_attr("xres")
				if xres:
					xres = int(xres)
				else:
					xres = 720
				yres = get_attr("yres")
				if yres:
					yres = int(yres)
				else:
					yres = 576
				bpp = get_attr("bpp")
				if bpp:
					bpp = int(bpp)
				else:
					bpp = 32
				#print "Resolution:", xres,yres,bpp
				from enigma import gMainDC
				gMainDC.getInstance().setResolution(xres, yres)
				desktop.resize(eSize(xres, yres))
				if bpp != 32:
					# load palette (not yet implemented)
					pass
				if yres >= 1080:
					parameters["FileListName"] = (68,4,1000,34)
					parameters["FileListIcon"] = (7,4,52,37)
					parameters["FileListMultiName"] = (90,3,1000,32)
					parameters["FileListMultiIcon"] = (45, 4, 30, 30)
					parameters["FileListMultiLock"] = (2,0,36,36)
					parameters["ChoicelistDash"] = (0,3,1000,30)
					parameters["ChoicelistName"] = (68,3,1000,30)
					parameters["ChoicelistIcon"] = (7,0,52,38)
					parameters["PluginBrowserName"] = (180,8,38)
					parameters["PluginBrowserDescr"] = (180,42,25)
					parameters["PluginBrowserIcon"] = (15,8,150,60)
					parameters["PluginBrowserDownloadName"] = (120,8,38)
					parameters["PluginBrowserDownloadDescr"] = (120,42,25)
					parameters["PluginBrowserDownloadIcon"] = (15,0,90,76)
					parameters["ServiceInfo"] = (0,0,450,50)
					parameters["ServiceInfoLeft"] = (0,0,450,45)
					parameters["ServiceInfoRight"] = (450,0,1000,45)
					parameters["SelectionListDescr"] = (45,3,1000,32)
					parameters["SelectionListLock"] = (0,2,36,36)
					parameters["ConfigListSeperator"] = 500
					parameters["VirtualKeyboard"] = (68,68)
					parameters["PartnerBoxEntryListName"] = (8,2,225,38)
					parameters["PartnerBoxEntryListIP"] = (180,2,225,38)
					parameters["PartnerBoxEntryListPort"] = (405,2,150,38)
					parameters["PartnerBoxEntryListType"] = (615,2,150,38)
					parameters["PartnerBoxTimerServicename"] = (0,0,45)
					parameters["PartnerBoxTimerName"] = (0,42,30)
					parameters["PartnerBoxE1TimerTime"] = (0,78,255,30)
					parameters["PartnerBoxE1TimerState"] = (255,78,255,30)
					parameters["PartnerBoxE2TimerTime"] = (0,78,225,30)
					parameters["PartnerBoxE2TimerState"] = (225,78,225,30)
					parameters["PartnerBoxE2TimerIcon"] = (1050,8,20,20)
					parameters["PartnerBoxE2TimerIconRepeat"] = (1050,38,20,20)
					parameters["PartnerBoxBouquetListName"] = (0,0,45)
					parameters["PartnerBoxChannelListName"] = (0,0,45)
					parameters["PartnerBoxChannelListTitle"] = (0,42,30)
					parameters["PartnerBoxChannelListTime"] = (0,78,225,30)
					parameters["HelpMenuListHlp"] = (0,0,900,42)
					parameters["HelpMenuListExtHlp0"] = (0,0,900,39)
					parameters["HelpMenuListExtHlp1"] = (0,42,900,30)
					parameters["AboutHddSplit"] = 1
					parameters["DreamexplorerName"] = (62,0,1200,38)
					parameters["DreamexplorerIcon"] = (15,4,30,30)
					parameters["PicturePlayerThumb"] = (30,285,45,300,30,25)
					parameters["PlayListName"] = (38,2,1000,34)
					parameters["PlayListIcon"] = (7,7,24,24)
					parameters["SHOUTcastListItem"] = (30,27,35,96,35,33,60,32)

	for skininclude in skin.findall("include"):
		filename = skininclude.attrib.get("filename")
		if filename:
			skinfile = resolveFilename(SCOPE_CURRENT_SKIN, filename, path_prefix=path_prefix)
			if not fileExists(skinfile):
				skinfile = resolveFilename(SCOPE_SKIN_IMAGE, filename, path_prefix=path_prefix)
			if fileExists(skinfile):
				print "[Skin] Loading include:", skinfile
				loadSkin(skinfile)

	for c in skin.findall('switchpixmap'):
		for pixmap in c.findall('pixmap'):
			get_attr = pixmap.attrib.get
			name = get_attr('name')
			if not name:
				raise SkinError('[Skin] pixmap needs name attribute')
			filename = get_attr('filename')
			if not filename:
				raise SkinError('[Skin] pixmap needs filename attribute')
			resolved_png = resolveFilename(SCOPE_CURRENT_SKIN, filename, path_prefix=path_prefix)
			if fileExists(resolved_png):
				switchPixmap[name] = resolved_png
			else:
				raise SkinError('[Skin] switchpixmap pixmap filename="%s" (%s) not found' % (filename, resolved_png))

 	for c in skin.findall("colors"):
		for color in c.findall("color"):
			get_attr = color.attrib.get
			name = get_attr("name")
			color = get_attr("value")
			if name and color:
				colorNames[name] = parseColor(color)
				#print "Color:", name, color
			else:
				raise SkinError("need color and name, got %s %s" % (name, color))

	for c in skin.findall("fonts"):
		for font in c.findall("font"):
			get_attr = font.attrib.get
			filename = get_attr("filename", "<NONAME>")
			name = get_attr("name", "Regular")
			scale = get_attr("scale")
			if scale:
				scale = int(scale)
			else:
				scale = 100
			is_replacement = get_attr("replacement") and True or False
			render = get_attr("render")
			if render:
				render = int(render)
			else:
				render = 0
			resolved_font = resolveFilename(SCOPE_FONTS, filename, path_prefix=path_prefix)
			if not fileExists(resolved_font): #when font is not available look at current skin path
				skin_path = resolveFilename(SCOPE_CURRENT_SKIN, filename)
				if fileExists(skin_path):
					resolved_font = skin_path
			addFont(resolved_font, name, scale, is_replacement, render)
			#print "Font: ", resolved_font, name, scale, is_replacement
		for alias in c.findall("alias"):
			get = alias.attrib.get
			try:
				name = get("name")
				font = get("font")
				size = int(get("size"))
				height = int(get("height", size)) # to be calculated some day
				width = int(get("width", size))
				global fonts
				fonts[name] = (font, size, height, width)
			except Exception, ex:
				print "[Skin] Bad font alias", ex
Пример #35
0
# we do our best to always select the "right" value
# skins are loaded in order of priority: skin with
# highest priority is loaded last, usually the user-provided
# skin.

# currently, loadSingleSkinData (colors, bordersets etc.)
# are applied one-after-each, in order of ascending priority.
# the dom_skin will keep all screens in descending priority,
# so the first screen found will be used.

# example: loadSkin("nemesis_greenline/skin.xml")
config.skin = ConfigSubsection()
DEFAULT_SKIN = SystemInfo["HasFullHDSkinSupport"] and "PLi-FullNightHD/skin.xml" or "PLi-HD/skin.xml"
# on SD hardware, PLi-HD will not be available
if not fileExists(resolveFilename(SCOPE_SKIN, DEFAULT_SKIN)):
	# in that case, fallback to Magic (which is an SD skin)
	DEFAULT_SKIN = "Magic/skin.xml"
	if not fileExists(resolveFilename(SCOPE_SKIN, DEFAULT_SKIN)):
		DEFAULT_SKIN = "skin.xml"
config.skin.primary_skin = ConfigText(default=DEFAULT_SKIN)

profile("LoadSkin")
res = None
name = skin_user_skinname()
if name:
	res = addSkin(name, SCOPE_CONFIG)
if not name or not res:
	addSkin('skin_user.xml', SCOPE_CONFIG)

# some boxes lie about their dimensions
Пример #36
0
    def changed(self, what):
        self.poll_interval = 2000
        self.poll_enabled = True
        if self.instance:
            pngname = ''
            if (what[0] != self.CHANGED_CLEAR):
                cfgfile = "/tmp/ecm.info"
                sname = ""
                service = self.source.service
                if service:
                    info = (service and service.info())

                    if info:
                        caids = info.getInfoObject(iServiceInformation.sCAIDs)

                        try:
                            f = open(cfgfile, "r")
                            content = f.read()
                            f.close()
                        except:
                            content = ""
                    contentInfo = content.split("\n")
                    for line in contentInfo:
                        if ("using" in line):
                            sname = "CCcam"
                        elif ("source" in line):
                            sname = "Mgcamd"
                        elif ("reader" in line):
                            sname = "OScam"
                        elif ("response time" in line):
                            sname = "Wicardd"
                        elif ("decode" in line):
                            sname = "Gbox"
                        elif ("CAID" in line):
                            sname = "Camd3"

                        if caids:
                            if (len(caids) > 0):
                                for caid in caids:
                                    caid = self.int2hex(caid)
                                    if (len(caid) == 3):
                                        caid = ("0%s" % caid)
                                    caid = caid[:2]
                                    caid = caid.upper()
                                    if (caid != "") and (sname == ""):
                                        sname = "Unknown"

                pngname = self.nameCache.get(sname, '')
                if (pngname == ''):
                    pngname = self.findPicon(sname)
                    if (pngname != ''):
                        self.nameCache[sname] = pngname

            if (pngname == ''):
                pngname = self.nameCache.get('Fta', '')
                if (pngname == ''):
                    pngname = self.findPicon('Fta')
                    if (pngname == ''):
                        tmp = resolveFilename(SCOPE_CURRENT_SKIN,
                                              'picon_default.png')
                        if fileExists(tmp):
                            pngname = tmp
                        else:
                            pngname = resolveFilename(
                                SCOPE_SKIN_IMAGE,
                                'skin_default/picon_default.png')
                        self.nameCache['default'] = pngname

            if (self.pngname != pngname):
                self.pngname = pngname

                self.instance.setPixmapFromFile(self.pngname)
Пример #37
0
	def makeMenu(self, output):
		try:
			parser = etree.HTMLParser(remove_blank_text=True, remove_comments=True)
			htmltree = etree.fromstring(output, parser)

			for forum in htmltree.findall('.//li[@data-categoryid]'):
				#forum_title_element = forum.find('.//h2[@class="ipsType_sectionTitle ipsType_reset ipsType_blendLinks cForumTitle"]')
				#forum_title = etree.tostring(forum_title_element, method='text').strip()

				for subforum in forum.findall('.//li[@data-forumid]'):
					subforum_element = subforum.find('.//h4[@class="ipsDataItem_title ipsType_large"]')
					subforum_title = etree.tostring(subforum_element, method='text').strip()
					link = subforum_element[0].get('href')

					last_post_element = subforum.find('.//ul[@class]/li/a[@class="ipsType_break ipsContained"]')
					if last_post_element is not None:
						last_post_title = last_post_element.get('title').encode('utf8')
					else:
						last_post_title = _('No posts here yet')

					date_element = subforum.find('.//time[@datetime]')
					if last_post_element is not None:
						date = date_element.get('datetime')
					else:
						date = ''

					user_element = subforum.xpath('.//ul[@class]/li[starts-with(text(),"By")]/a')
					if len(user_element) == 1:
						user = user_element[0].text.encode('utf8').strip()
					else:
						user = ''

					x = ''
					res = [x]
					line = eEnv.resolve('${libdir}/enigma2/python/Plugins/Extensions/OpenXtaReader/pic/line_white.png')
					if fileExists(line):
						res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 0), size=(600, 1), png=loadPNG(line)))
						res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 49), size=(600, 1), png=loadPNG(line)))
					res.append(MultiContentEntryText(pos=(45, 1), size=(555, 24), font=0, backcolor=1447446, color=16777215, backcolor_sel=1447446, color_sel=15022127, flags=RT_HALIGN_LEFT, text=subforum_title))
					res.append(MultiContentEntryText(pos=(45, 25), size=(340, 24), font=0, backcolor=1447446, color=16777215, backcolor_sel=1447446, color_sel=15022127, flags=RT_HALIGN_LEFT, text=last_post_title))
					res.append(MultiContentEntryText(pos=(385, 25), size=(105, 24), font=0, backcolor=1447446, color=16777215, backcolor_sel=1447446, color_sel=15022127, flags=RT_HALIGN_LEFT, text=convertDate(date)))
					res.append(MultiContentEntryText(pos=(490, 25), size=(110, 24), font=0, backcolor=1447446, color=16777215, backcolor_sel=1447446, color_sel=15022127, flags=RT_HALIGN_LEFT, text=user))
					if convertDate(date) == _('Today'):
						png = eEnv.resolve('${libdir}/enigma2/python/Plugins/Extensions/OpenXtaReader/pic/forum_new-48.png')
						if fileExists(png):
							res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 2), size=(44, 44), backcolor=1447446, backcolor_sel=1447446, png=loadPNG(png)))
					else:
						png = eEnv.resolve('${libdir}/enigma2/python/Plugins/Extensions/OpenXtaReader/pic/forum_old-48.png')
						if fileExists(png):
							res.append(MultiContentEntryPixmapAlphaTest(pos=(0, 2), size=(44, 44), backcolor=1447446, backcolor_sel=1447446, png=loadPNG(png)))

					self.menulink.append(link)
					self.menuentries.append(res)

		except etree.Error as e:
			print 'OpenXtaReader Exception: ', e

		self['menu'].l.setList(self.menuentries)
		self['menu'].l.setItemHeight(50)
		self['menu'].show()
		self.ready = True
Пример #38
0
    def StartImageInNeoBoot(self):
        if getImageNeoBoot() != 'Flash':
            if fileExists('%sImageBoot/%s/.control_ok' %
                          (getNeoLocation(), getImageNeoBoot())):
                system('touch /tmp/.control_ok ')
            else:
                system('touch %sImageBoot/%s/.control_boot_new_image ' %
                       (getNeoLocation(), getImageNeoBoot()))

        system(
            'chmod 755 /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
        )
        self.sel = self['list'].getCurrent()
        if self.sel:
            self.sel = self.sel[2]
        if self.sel == 0:
            if fileExists('/media/InternalFlash/etc/init.d/neobootmount.sh'):
                os.system(
                    'rm -f /media/InternalFlash/etc/init.d/neobootmount.sh;')
            if not fileExists('/bin/busybox.nosuid'):
                os.system('ln -sf "busybox" "/bin/busybox.nosuid" ')
#################_____mips___##########################

#VUPLUS MIPS vu_dev_mtd1.sh
            if getBoxHostName() == 'vuultimo' or getBoxHostName(
            ) == 'bm750' or getBoxHostName() == 'vuduo' or getBoxHostName(
            ) == 'vuuno' or getBoxHostName() == 'vusolo' or getBoxHostName(
            ) == 'vuduo':
                if not fileExists('%sImagesUpload/.kernel/%s.vmlinux.gz' %
                                  (getNeoLocation(), getBoxHostName())):
                    self.myclose2(
                        _('Error - in the location %sImagesUpload/.kernel/ \nkernel file not found flash kernel vmlinux.gz '
                          % getNeoLocation()))
                else:
                    if getImageNeoBoot() == 'Flash':
                        if fileExists('/.multinfo'):
                            cmd = "echo -e '\n\n%s '" % _(
                                '...............NeoBoot  REBOOT...............\nPlease wait, in a moment the decoder will be restarted...'
                            )
                            cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'
                        elif not fileExists('/.multinfo'):
                            cmd = "echo -e '\n\n%s '" % _(
                                '...............NEOBOOT >> Reboot...............\nPlease wait, in a moment the decoder will be restarted...'
                            )
                            cmd1 = 'ln -sfn /sbin/init.sysvinit /sbin/init; /etc/init.d/reboot'

                    elif getImageNeoBoot() != 'Flash':
                        if not fileExists('/.multinfo'):

                            if fileExists('' + getNeoLocation() +
                                          'ImageBoot/' + getImageNeoBoot() +
                                          '/boot/' + getBoxHostName() +
                                          '.vmlinux.gz'):
                                cmd = "echo -e '\n\n%s '" % _(
                                    '...............NEOBOOT-REBOOT...............\nPlease wait, in a moment the decoder will be restarted...'
                                )
                                cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'

                            elif not fileExists(
                                    '%sImageBoot/%s/boot/%s.vmlinux.gz' %
                                (getNeoLocation(), getImageNeoBoot(),
                                 getBoxHostName())):
                                cmd = "echo -e '\n\n%s '" % _(
                                    '...............NEOBOOT > REBOOT...............\nPlease wait, in a moment the decoder will be restarted...'
                                )
                                cmd1 = 'ln -sfn /sbin/neoinitmipsvu /sbin/init; /etc/init.d/reboot'

                        elif fileExists('/.multinfo'):
                            if not fileExists(
                                    '%sImageBoot/%s/boot/%s.vmlinux.gz' %
                                (getNeoLocation(), getImageNeoBoot(),
                                 getBoxHostName())):
                                cmd = "echo -e '\n\n%s '" % _(
                                    '...............NEOBOOT_REBOOT...............\nPlease wait, in a moment the decoder will be restarted...'
                                )
                                cmd1 = 'flash_eraseall /dev/mtd1; sleep 2; nandwrite -p /dev/mtd1 %sImagesUpload/.kernel/%s.vmlinux.gz; /etc/init.d/reboot' % (
                                    getNeoLocation(), getBoxHostName())

                            elif fileExists(
                                    '%sImageBoot/%s/boot/%s.vmlinux.gz' %
                                (getNeoLocation(), getImageNeoBoot(),
                                 getBoxHostName())):
                                cmd = "echo -e '\n\n%s '" % _(
                                    '...............REBOOT now...............\nPlease wait, in a moment the decoder will be restarted...'
                                )
                                cmd1 = '/usr/lib/enigma2/python/Plugins/Extensions/NeoBoot/files/kernel.sh'

                    self.session.open(Console, _('NeoBoot MIPS....'),
                                      [cmd, cmd1])
                    self.close()

            else:
                os.system('echo "Flash "  >> ' + getNeoLocation() +
                          'ImageBoot/.neonextboot')
                self.messagebox = self.session.open(
                    MessageBox,
                    _('It looks like it that multiboot does not support this STB.'
                      ), MessageBox.TYPE_INFO, 8)
                self.close()
Пример #39
0
 def changed(self, what):
     self.poll_interval = 2000
     self.poll_enabled = True
     if self.instance:
         pngname = ''
         if what[0] != self.CHANGED_CLEAR:
             text = 'none'
             if fileExists('/etc/CurrentBhCamName'):
                 f = open('/etc/CurrentBhCamName', 'r')
                 line = f.readline()
                 text = line.strip()
                 f.close()
             elif fileExists('/var/etc/client'):
                 f = open('/var/etc/client', 'r')
                 line = f.readline()
                 text = line.strip()
                 f.close()
             elif fileExists('/tmp/.emu.info'):
                 f = open('/tmp/.emu.info', 'r')
                 line = f.readline()
                 text = line.strip()
                 f.close()
             elif fileExists('/etc/active_emu.list'):
                 f = open('/etc/active_emu.list', 'r')
                 line = f.readline()
                 text = line.strip()
                 f.close()
             elif fileExists('/tmp/egami.inf'):
                 f = open('/tmp/egami.inf', 'r')
                 line = f.readline()
                 text = line.strip()
                 f.close()
             elif fileExists('/etc/init.d/softcam'):
                 f = open('/etc/init.d/softcam', 'r')
                 line = f.readline()
                 text = line.strip()
                 f.close()
             elif config.NFRSoftcam.actcam.value:
                 if config.NFRSoftcam.actcam.value != "none":
                     camdlist = config.NFRSoftcam.actcam.value.split()
                 else:
                     camdlist = 'none'
                 for line in camdlist:
                     if 'mgcamd' in line.lower() and 'oscam' in line.lower(
                     ):
                         text = 'oscammgcamd'
                         break
                     if 'cccam' in line.lower() and 'oscam' in line.lower():
                         text = 'oscamcccam'
                         break
                     elif 'mgcamd' in line.lower():
                         text = 'mgcamd'
                     elif 'oscam' in line.lower():
                         text = 'oscam'
                     elif 'wicard' in line.lower():
                         text = 'wicardd'
                     elif 'cccam' in line.lower():
                         text = 'cccam'
                     elif 'camd3' in line.lower():
                         text = 'camd3'
                     elif 'evocamd' in line.lower():
                         text = 'evocamd'
                     elif 'newcs' in line.lower():
                         text = 'newcs'
                     elif 'rqcamd' in line.lower():
                         text = 'rqcamd'
                     elif 'gbox' in line.lower():
                         text = 'gbox'
                     elif 'mpcs' in line.lower():
                         text = 'mpcs'
                     elif 'sbox' in line.lower():
                         text = 'sbox'
                     else:
                         text = 'unknow'
             pngname = self.nameCache.get(text, '')
             if pngname == '':
                 pngname = self.findEmu(text)
                 if pngname != '':
                     self.nameCache[text] = pngname
         if pngname == '':
             pngname = self.nameCache.get('default', '')
             if pngname == '':
                 pngname = self.findEmu('picon_default')
                 if pngname == '':
                     tmp = resolveFilename(SCOPE_CURRENT_SKIN,
                                           'picon_default.png')
                     if fileExists(tmp):
                         pngname = tmp
                     else:
                         pngname = resolveFilename(
                             SCOPE_SKIN_IMAGE,
                             'skin_default/picon_default.png')
                 self.nameCache['default'] = pngname
         if self.pngname != pngname:
             self.pngname = pngname
             self.instance.setPixmapFromFile(self.pngname)
Пример #40
0
	def onFileAction(self, dirsource, dirtarget):
		filename = dirsource.getFilename()
		self.SOURCELIST = dirsource
		self.TARGETLIST = dirtarget
		sourceDir = dirsource.getCurrentDirectory()
		if not sourceDir.endswith("/"):
			sourceDir = sourceDir + "/"
		testFileName = filename.lower()
		filetype = os.path.splitext(testFileName)[1]
		longname = sourceDir + filename
		print "[Filebrowser]:", filename, sourceDir, testFileName
		if not fileExists(longname):
			self.session.open(MessageBox, _("File not found: %s") % longname, type=MessageBox.TYPE_ERROR)
			return
		if filetype == ".ipk":
			self.session.openWithCallback(self.onFileActionCB, ipkMenuScreen, self.SOURCELIST, self.TARGETLIST)
		elif filetype == ".ts":
			fileRef = eServiceReference(eServiceReference.idDVB, eServiceReference.noFlags, longname)
			self.session.open(MoviePlayer, fileRef)
		elif filetype in MOVIE_EXTENSIONS:
			fileRef = eServiceReference(eServiceReference.idServiceMP3, eServiceReference.noFlags, longname)
			self.session.open(MoviePlayer, fileRef)
		elif filetype in DVD_EXTENSIONS:
			if DVDPlayerAvailable:
				self.session.open(DVD.DVDPlayer, dvd_filelist=[longname])
		elif filetype in AUDIO_EXTENSIONS:
			self.play_music(self.SOURCELIST)
		elif filetype == ".rar" or re.search('\.r\d+$', filetype):
			self.session.openWithCallback(self.onFileActionCB, RarMenuScreen, self.SOURCELIST, self.TARGETLIST)
		elif testFileName.endswith(".tar.gz") or filetype in (".tgz", ".tar"):
			self.session.openWithCallback(self.onFileActionCB, TarMenuScreen, self.SOURCELIST, self.TARGETLIST)
		elif filetype == ".gz":  # Must follow test for .tar.gz
			self.session.openWithCallback(self.onFileActionCB, GunzipMenuScreen, self.SOURCELIST, self.TARGETLIST)
		elif filetype == ".zip":
			self.session.openWithCallback(self.onFileActionCB, UnzipMenuScreen, self.SOURCELIST, self.TARGETLIST)
		elif filetype in IMAGE_EXTENSIONS:
			if self.SOURCELIST.getSelectionIndex() != 0:
				self.session.openWithCallback(
					self.cbShowPicture,
					ImageViewer,
					self.SOURCELIST.getFileList(),
					self.SOURCELIST.getSelectionIndex(),
					self.SOURCELIST.getCurrentDirectory(),
					filename
				)
		elif filetype in (".sh", ".py", ".pyo"):
			self.run_script(self.SOURCELIST, self.TARGETLIST)
		elif filetype == ".mvi":
			self.file_name = longname
			self.tmp_file = '/tmp/grab_%s_mvi.png' %filename[:-4]
			choice = [(_("No"), "no"),
					(_("Show as Picture (press any key to close)"), "show")]
			savetext = ''
			stat = os.statvfs('/tmp/')
			if stat.f_bavail * stat.f_bsize > 1000000:
				choice.append((_("Show as Picture and save as file ('%s')")%self.tmp_file , "save"))
				savetext = _(" or save additional the picture to a file")
			self.session.openWithCallback(self.mviFileCB, MessageBox, _("Show '%s' as picture%s?\nThe current service must interrupted!") %(longname,savetext), simple=True, list=choice)
		elif filetype in TEXT_EXTENSIONS or config.plugins.filecommander.unknown_extension_as_text.value:
			try:
				xfile = os.stat(longname)
			except OSError as oe:
				self.session.open(MessageBox, _("%s: %s") % (longname, oe.strerror), type=MessageBox.TYPE_ERROR)
				return
			if (xfile.st_size < 1000000):
				self.session.open(vEditor, longname)
				self.onFileActionCB(True)
		else:
			try:
				found_viewer = openFile(self.session, guess_type(longname)[0], longname)
			except TypeError, e:
				found_viewer = False
			if not found_viewer:
				self.session.open(MessageBox, _("No viewer installed for this file type: %s") % filename, type=MessageBox.TYPE_ERROR, timeout=5, close_on_any_key=True)
Пример #41
0
def getNumVideoDecoders():
    idx = 0
    while fileExists("/dev/dvb/adapter0/video%d" % (idx), 'f'):
        idx += 1
    return idx
Пример #42
0
 def ZoomOff(self):
     self.zoomrate = 0
     self.zoomin = 1
     if fileExists("/proc/stb/vmpeg/0/zoomrate"):
         open("/proc/stb/vmpeg/0/zoomrate", "w").write(str(0))
Пример #43
0
from Screens.MessageBox import MessageBox
from Screens.InfoBar import MoviePlayer
from Tools.Directories import fileExists
from enigma import ePoint, iPlayableService
from Source.Timer import xTimer
from Tools import Notifications
from Components.Sources.ServiceEvent import ServiceEvent
from MoviePreview import MoviePreview
from Components.Label import Label
from Components.Pixmap import Pixmap
from Components.ServiceEventTracker import ServiceEventTracker
from Source.Globals import pluginPresent, isDreamOS
from Version import __version__

playerChoice = None
if fileExists("/etc/grautec/dm8000/tft_dm8000.ko"):
    TFT_8000_Present = True
else:
    TFT_8000_Present = False


def cutlist_changed(self):
    if playerChoice and playerChoice.isPlaying():
        self.cutlist = []  # we need to update the property
    self.cutlist = self.source.cutlist or []


from Components.Renderer.PositionGauge import PositionGauge
PositionGauge.cutlist_changed = cutlist_changed

Пример #44
0
 def startShow(self):
     if BhU_check_proc_version():
         self.bhv += 1
     if fileExists('/usr/bin/blackholesocker'):
         self.bhv += 2
     self.activityTimer.start(10)
Пример #45
0
	def changeDir(self, directory, select = None):
		self.list = []

		# if we are just entering from the list of mount points:
		if self.current_directory is None:
			if directory and self.showMountpoints:
				self.current_mountpoint = self.getMountpointLink(directory)
			else:
				self.current_mountpoint = None
		self.current_directory = directory
		directories = []
		files = []

		if directory is None and self.showMountpoints: # present available mountpoints
			for p in harddiskmanager.getMountedPartitions():
				path = os.path.join(p.mountpoint, "")
				if path not in self.inhibitMounts and not self.inParentDirs(path, self.inhibitDirs):
					self.list.append(MultiFileSelectEntryComponent(name = p.description, absolute = path, isDir = True))
			files = [ ]
			directories = [ ]
		elif directory is None:
			files = [ ]
			directories = [ ]
		elif self.useServiceRef:
			root = eServiceReference("2:0:1:0:0:0:0:0:0:0:" + directory)
			if self.additional_extensions:
				root.setName(self.additional_extensions)
			serviceHandler = eServiceCenter.getInstance()
			list = serviceHandler.list(root)

			while 1:
				s = list.getNext()
				if not s.valid():
					del list
					break
				if s.flags & s.mustDescent:
					directories.append(s.getPath())
				else:
					files.append(s)
			directories.sort()
			files.sort()
		else:
			if fileExists(directory):
				try:
					files = os.listdir(directory)
				except:
					files = []
				files.sort()
				tmpfiles = files[:]
				for x in tmpfiles:
					if os.path.isdir(directory + x):
						directories.append(directory + x + "/")
						files.remove(x)

		if directory is not None and self.showDirectories and not self.isTop:
			if directory == self.current_mountpoint and self.showMountpoints:
				self.list.append(MultiFileSelectEntryComponent(name = "<" +_("List of storage devices") + ">", absolute = None, isDir = True))
			elif (directory != "/") and not (self.inhibitMounts and self.getMountpoint(directory) in self.inhibitMounts):
				self.list.append(MultiFileSelectEntryComponent(name = "<" +_("Parent directory") + ">", absolute = '/'.join(directory.split('/')[:-2]) + '/', isDir = True))

		if self.showDirectories:
			for x in directories:
				if not (self.inhibitMounts and self.getMountpoint(x) in self.inhibitMounts) and not self.inParentDirs(x, self.inhibitDirs):
					name = x.split('/')[-2]
					alreadySelected = (x in self.selectedFiles) or (os.path.normpath(x) in self.selectedFiles)
					self.list.append(MultiFileSelectEntryComponent(name = name, absolute = x, isDir = True, selected = alreadySelected))

		if self.showFiles:
			for x in files:
				if self.useServiceRef:
					path = x.getPath()
					name = path.split('/')[-1]
				else:
					path = directory + x
					name = x
				if (self.matchingPattern is None) or self.matchingPattern.search(path):
					alreadySelected = False
					for entry in self.selectedFiles:
						if os.path.basename(entry) == x:
							alreadySelected = True
					self.list.append(MultiFileSelectEntryComponent(name = name, absolute = x , isDir = False, selected = alreadySelected))

		self.l.setList(self.list)

		if select is not None:
			i = 0
			self.moveToIndex(0)
			for x in self.list:
				p = x[0][0]
				
				if isinstance(p, eServiceReference):
					p = p.getPath()
				
				if p == select:
					self.moveToIndex(i)
				i += 1
Пример #46
0
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance(
).canMeasureFrontendInputPower()


def countFrontpanelLEDs():
    leds = 0
    if fileExists("/proc/stb/fp/led_set_pattern"):
        leds += 1

    while fileExists("/proc/stb/fp/led%d_pattern" % leds):
        leds += 1

    return leds


SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists(
    "/dev/dbox/lcd0")
SystemInfo["OledDisplay"] = fileExists("/dev/dbox/oled0")
SystemInfo["LcdDisplay"] = fileExists("/dev/dbox/lcd0")
SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
SystemInfo["WOL"] = fileExists("/proc/stb/fp/wol")
SystemInfo["HDMICEC"] = (
    path.exists("/dev/hdmi_cec")
    or path.exists("/dev/misc/hdmi_cec0")) and fileExists(
        "/usr/lib/enigma2/python/Plugins/SystemPlugins/HdmiCEC/plugin.pyo")
SystemInfo["SABSetup"] = fileExists(
    "/usr/lib/enigma2/python/Plugins/SystemPlugins/SABnzbd/plugin.pyo")
SystemInfo["SeekStatePlay"] = False
SystemInfo["GraphicLCD"] = getBoxType() == "vuultimo"
Пример #47
0
 def setScrollspeed(self, value):
     if fileExists("/proc/stb/lcd/scroll_delay"):
         print 'setLCDScrollspeed', value
         f = open("/proc/stb/lcd/scroll_delay", "w")
         f.write(str(value))
         f.close()
Пример #48
0
def autostart(reason, *args, **kwargs):
	if reason == 0:
		if hasattr(PluginComponent, 'pluginSort_baseAddPlugin'):
			print("[PluginSort] Something went wrong as our autostart handler was called multiple times for startup, printing traceback and ignoring.")
			import traceback, sys
			traceback.print_stack(limit=5, file=sys.stdout)
		else:
			PluginComponent.pluginSort_baseAddPlugin = PluginComponent.addPlugin
			PluginComponent.addPlugin = PluginComponent_addPlugin

			# we use a copy for installed plugins because we might change the 'where'-lists
			plugins.installedPluginList = plugins.pluginList[:]
			def PluginComponent__setattr__(self, key, value):
				if key == 'installedPluginList': return
				else: self.__dict__[key] = value
			PluginComponent.__setattr__ = PluginComponent__setattr__

			if hasattr(plugins, 'pluginHider_baseGetPlugins'):
				pluginlist = plugins.pluginHider_baseGetPlugins([PluginDescriptor.WHERE_PLUGINMENU, PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_MOVIELIST, PluginDescriptor.WHERE_EVENTINFO])
			else:
				pluginlist = plugins.getPlugins([PluginDescriptor.WHERE_PLUGINMENU, PluginDescriptor.WHERE_EXTENSIONSMENU, PluginDescriptor.WHERE_MOVIELIST, PluginDescriptor.WHERE_EVENTINFO])

			# "fix" weight of plugins already added to list, future ones will be fixed automatically
			fixed = []
			for plugin in pluginlist:
				if plugin in fixed: continue # skip double entries

				# create individual entries for multiple wheres, this is potentially harmful!
				if len(plugin.where) > 1:
					# remove all entries except for a potential autostart one (highly unlikely to mix autostart with one of the above, but you never know :D)
					if PluginDescriptor.WHERE_AUTOSTART in plugin.where:
						plugin.where.remove(PluginDescriptor.WHERE_AUTOSTART)
						hadAutostart = True
					else:
						hadAutostart = False
					plugins.removePlugin(plugin)
					plugins.addPlugin(plugin) # this is our own addPlugin now, which automatically creates copies

					# HACK: re-add autostart entry to internal list inside PluginComponent
					if hadAutostart:
						plugin.where = [ PluginDescriptor.WHERE_AUTOSTART ]
						plugins.pluginList.append(plugin)

				# we're keeping the entry, just fix the weight
				else:
					newWeight = pluginWeights.get(plugin)
					print("[PluginSort] Fixing weight for %s (was %d, now %d)" % (plugin.name, plugin.weight, newWeight))
					plugin.weight = newWeight

				fixed.append(plugin)

			# let movieepg fix extensions list sorting if installed, else do this ourselves
			if not fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/MovieEPG/plugin.py")):
				def InfoBarPlugins_getPluginList(self, *args, **kwargs):
					l = InfoBarPlugins.pluginSort_baseGetPluginList(self, *args, **kwargs)
					try:
						l.sort(key=lambda e: (e[0][1].args[0].weight, e[2]))
					except Exception as e:
						print("[PluginSort] Failed to sort extensions", e)
					return l

				InfoBarPlugins.pluginSort_baseGetPluginList = InfoBarPlugins.getPluginList
				InfoBarPlugins.getPluginList = InfoBarPlugins_getPluginList


			PluginBrowser.PluginBrowser = SortingPluginBrowser
	else:
		if hasattr(PluginComponent, 'pluginSort_baseAddPlugin'):
			PluginComponent.addPlugin = PluginComponent.pluginSort_baseAddPlugin
			del PluginComponent.pluginSort_baseAddPlugin
		if hasattr(InfoBarPlugins, 'pluginSort_baseGetPluginList'):
			InfoBarPlugins.getPluginList = InfoBarPlugins.pluginSort_baseGetPluginList
			del InfoBarPlugins.pluginSort_baseGetPluginList
		PluginBrowser.PluginBrowser = OriginalPluginBrowser
Пример #49
0
 def setShowoutputresolution(self, value):
     if fileExists("/proc/stb/lcd/show_outputresolution"):
         print 'setLCDShowoutputresolution', value
         f = open("/proc/stb/lcd/show_outputresolution", "w")
         f.write(value)
         f.close()
Пример #50
0
def InitLcd():
    if getBoxType() in ('xpeedlxpro', 'zgemmai55', 'sf98', 'et7x00mini',
                        'xpeedlxcs2', 'xpeedlxcc', 'e4hd', 'e4hdhybrid',
                        'mbmicro', 'beyonwizt2', 'amikomini', 'dynaspark',
                        'amiko8900', 'sognorevolution', 'arguspingulux',
                        'arguspinguluxmini', 'arguspinguluxplus',
                        'sparkreloaded', 'sabsolo', 'sparklx', 'gis8120',
                        'gb800se', 'gb800solo', 'gb800seplus', 'gbultrase',
                        'gbipbox', 'tmsingle', 'tmnano2super', 'iqonios300hd',
                        'iqonios300hdv2', 'optimussos1plus', 'optimussos1',
                        'vusolo', 'et4x00', 'et5x00', 'et6x00', 'et7000',
                        'mixosf7', 'mixoslumi', 'gbx1', 'gbx3'):
        detected = False
    else:
        detected = eDBoxLCD.getInstance().detected()
    SystemInfo["Display"] = detected
    config.lcd = ConfigSubsection()

    if fileExists("/proc/stb/lcd/mode"):
        f = open("/proc/stb/lcd/mode", "r")
        can_lcdmodechecking = f.read().strip().split(" ")
        f.close()
    else:
        can_lcdmodechecking = False
    SystemInfo["LCDMiniTV"] = can_lcdmodechecking

    if SystemInfo["StandbyLED"]:

        def standbyLEDChanged(configElement):
            file = open("/proc/stb/power/standbyled", "w")
            file.write(configElement.value and "on" or "off")
            file.close()

        config.usage.standbyLED = ConfigYesNo(default=True)
        config.usage.standbyLED.addNotifier(standbyLEDChanged)

    if detected:
        ilcd = LCD()
        if can_lcdmodechecking:

            def setLCDModeMinitTV(configElement):
                try:
                    f = open("/proc/stb/lcd/mode", "w")
                    f.write(configElement.value)
                    f.close()
                except:
                    pass

            def setMiniTVFPS(configElement):
                try:
                    f = open("/proc/stb/lcd/fps", "w")
                    f.write("%d \n" % configElement.value)
                    f.close()
                except:
                    pass

            def setLCDModePiP(configElement):
                pass

            def setLCDScreenshot(configElement):
                ilcd.setScreenShot(configElement.value)

            config.lcd.modepip = ConfigSelection(choices={
                "0": _("off"),
                "5": _("PIP"),
                "7": _("PIP with OSD")
            },
                                                 default="0")
            if config.misc.boxtype.value == 'gbquad' or config.misc.boxtype.value == 'gbquadplus':
                config.lcd.modepip.addNotifier(setLCDModePiP)
            else:
                config.lcd.modepip = ConfigNothing()

            config.lcd.screenshot = ConfigYesNo(default=False)
            config.lcd.screenshot.addNotifier(setLCDScreenshot)

            config.lcd.modeminitv = ConfigSelection(choices={
                "0": _("normal"),
                "1": _("MiniTV"),
                "2": _("OSD"),
                "3": _("MiniTV with OSD")
            },
                                                    default="0")
            config.lcd.fpsminitv = ConfigSlider(default=30, limits=(0, 30))
            config.lcd.modeminitv.addNotifier(setLCDModeMinitTV)
            config.lcd.fpsminitv.addNotifier(setMiniTVFPS)
        else:
            config.lcd.modeminitv = ConfigNothing()
            config.lcd.screenshot = ConfigNothing()
            config.lcd.fpsminitv = ConfigNothing()

        config.lcd.scroll_speed = ConfigSelection(default="300",
                                                  choices=[("500", _("slow")),
                                                           ("300",
                                                            _("normal")),
                                                           ("100", _("fast"))])
        config.lcd.scroll_delay = ConfigSelection(
            default="10000",
            choices=[("10000", "10 " + _("seconds")),
                     ("20000", "20 " + _("seconds")),
                     ("30000", "30 " + _("seconds")),
                     ("60000", "1 " + _("minute")),
                     ("300000", "5 " + _("minutes")),
                     ("noscrolling", _("off"))])

        def setLCDbright(configElement):
            ilcd.setBright(configElement.value)

        def setLCDstandbybright(configElement):
            ilcd.setStandbyBright(configElement.value)

        def setLCDdimbright(configElement):
            ilcd.setDimBright(configElement.value)

        def setLCDdimdelay(configElement):
            ilcd.setDimDelay(configElement.value)

        def setLCDcontrast(configElement):
            ilcd.setContrast(configElement.value)

        def setLCDinverted(configElement):
            ilcd.setInverted(configElement.value)

        def setLCDflipped(configElement):
            ilcd.setFlipped(configElement.value)

        def setLCDmode(configElement):
            ilcd.setMode(configElement.value)

        def setLCDpower(configElement):
            ilcd.setPower(configElement.value)

        def setfblcddisplay(configElement):
            ilcd.setfblcddisplay(configElement.value)

        def setLCDshowoutputresolution(configElement):
            ilcd.setShowoutputresolution(configElement.value)

        def setLCDrepeat(configElement):
            ilcd.setRepeat(configElement.value)

        def setLCDscrollspeed(configElement):
            ilcd.setScrollspeed(configElement.value)

        if fileExists("/proc/stb/lcd/symbol_hdd"):
            f = open("/proc/stb/lcd/symbol_hdd", "w")
            f.write("0")
            f.close()
        if fileExists("/proc/stb/lcd/symbol_hddprogress"):
            f = open("/proc/stb/lcd/symbol_hddprogress", "w")
            f.write("0")
            f.close()

        def setLEDnormalstate(configElement):
            ilcd.setLEDNormalState(configElement.value)

        def setLEDdeepstandby(configElement):
            ilcd.setLEDDeepStandbyState(configElement.value)

        def setLEDblinkingtime(configElement):
            ilcd.setLEDBlinkingTime(configElement.value)

        standby_default = 0

        if not ilcd.isOled():
            config.lcd.contrast = ConfigSlider(default=5, limits=(0, 20))
            config.lcd.contrast.addNotifier(setLCDcontrast)
        else:
            config.lcd.contrast = ConfigNothing()
            standby_default = 1

        if getBoxType() in ('mixosf5', 'mixosf5mini', 'gi9196m', 'gi9196lite',
                            'zgemmas2s', 'zgemmash1', 'zgemmash2', 'zgemmass',
                            'zgemmahs', 'zgemmah2s', 'zgemmah2h', 'spycat'):
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 4))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 4))
            config.lcd.bright = ConfigSlider(default=4, limits=(0, 4))
        else:
            config.lcd.standby = ConfigSlider(default=standby_default,
                                              limits=(0, 10))
            config.lcd.dimbright = ConfigSlider(default=standby_default,
                                                limits=(0, 10))
            config.lcd.bright = ConfigSlider(default=5, limits=(0, 10))
        config.lcd.dimbright.addNotifier(setLCDdimbright)
        config.lcd.dimbright.apply = lambda: setLCDdimbright(config.lcd.
                                                             dimbright)
        config.lcd.dimdelay = ConfigSelection(default="0",
                                              choices=[
                                                  ("5", "5 " + _("seconds")),
                                                  ("10", "10 " + _("seconds")),
                                                  ("15", "15 " + _("seconds")),
                                                  ("20", "20 " + _("seconds")),
                                                  ("30", "30 " + _("seconds")),
                                                  ("60", "1 " + _("minute")),
                                                  ("120", "2 " + _("minutes")),
                                                  ("300", "5 " + _("minutes")),
                                                  ("0", _("off"))
                                              ])
        config.lcd.dimdelay.addNotifier(setLCDdimdelay)
        config.lcd.standby.addNotifier(setLCDstandbybright)
        config.lcd.standby.apply = lambda: setLCDstandbybright(config.lcd.
                                                               standby)
        config.lcd.bright.addNotifier(setLCDbright)
        config.lcd.bright.apply = lambda: setLCDbright(config.lcd.bright)
        config.lcd.bright.callNotifiersOnSaveAndCancel = True

        config.lcd.invert = ConfigYesNo(default=False)
        config.lcd.invert.addNotifier(setLCDinverted)

        config.lcd.flip = ConfigYesNo(default=False)
        config.lcd.flip.addNotifier(setLCDflipped)

        if getBoxType() in ('mixosf5', 'mixosf5mini', 'gi9196m', 'gi9196lite'):
            config.lcd.scrollspeed = ConfigSlider(default=150,
                                                  increment=10,
                                                  limits=(0, 500))
            config.lcd.scrollspeed.addNotifier(setLCDscrollspeed)
            config.lcd.repeat = ConfigSelection([("0", _("None")),
                                                 ("1", _("1X")),
                                                 ("2", _("2X")),
                                                 ("3", _("3X")),
                                                 ("4", _("4X")),
                                                 ("500", _("Continues"))], "3")
            config.lcd.repeat.addNotifier(setLCDrepeat)
            config.lcd.hdd = ConfigNothing()
            config.lcd.mode = ConfigNothing()
        elif fileExists("/proc/stb/lcd/scroll_delay") and not getBoxType() in (
                'ixussone', 'ixusszero'):
            config.lcd.hdd = ConfigSelection([("0", _("No")), ("1", _("Yes"))],
                                             "1")
            config.lcd.scrollspeed = ConfigSlider(default=150,
                                                  increment=10,
                                                  limits=(0, 500))
            config.lcd.scrollspeed.addNotifier(setLCDscrollspeed)
            config.lcd.repeat = ConfigSelection([("0", _("None")),
                                                 ("1", _("1X")),
                                                 ("2", _("2X")),
                                                 ("3", _("3X")),
                                                 ("4", _("4X")),
                                                 ("500", _("Continues"))], "3")
            config.lcd.repeat.addNotifier(setLCDrepeat)
            config.lcd.mode = ConfigSelection([("0", _("No")),
                                               ("1", _("Yes"))], "1")
            config.lcd.mode.addNotifier(setLCDmode)
        else:
            config.lcd.mode = ConfigNothing()
            config.lcd.repeat = ConfigNothing()
            config.lcd.scrollspeed = ConfigNothing()
            config.lcd.hdd = ConfigNothing()

        if fileExists("/proc/stb/power/vfd") or fileExists(
                "/proc/stb/lcd/vfd"):
            config.lcd.power = ConfigSelection([("0", _("No")),
                                                ("1", _("Yes"))], "1")
            config.lcd.power.addNotifier(setLCDpower)
        else:
            config.lcd.power = ConfigNothing()

        if fileExists("/proc/stb/fb/sd_detach"):
            config.lcd.fblcddisplay = ConfigSelection([("1", _("No")),
                                                       ("0", _("Yes"))], "1")
            config.lcd.fblcddisplay.addNotifier(setfblcddisplay)
        else:
            config.lcd.fblcddisplay = ConfigNothing()

        if fileExists("/proc/stb/lcd/show_outputresolution"):
            config.lcd.showoutputresolution = ConfigSelection(
                [("0", _("No")), ("1", _("Yes"))], "1")
            config.lcd.showoutputresolution.addNotifier(
                setLCDshowoutputresolution)
        else:
            config.lcd.showoutputresolution = ConfigNothing()

        if getBoxType() == 'vuultimo':
            config.lcd.ledblinkingtime = ConfigSlider(default=5,
                                                      increment=1,
                                                      limits=(0, 15))
            config.lcd.ledblinkingtime.addNotifier(setLEDblinkingtime)
            config.lcd.ledbrightnessdeepstandby = ConfigSlider(default=1,
                                                               increment=1,
                                                               limits=(0, 15))
            config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightnessdeepstandby.addNotifier(setLEDdeepstandby)
            config.lcd.ledbrightnessdeepstandby.apply = lambda: setLEDdeepstandby(
                config.lcd.ledbrightnessdeepstandby)
            config.lcd.ledbrightnessstandby = ConfigSlider(default=1,
                                                           increment=1,
                                                           limits=(0, 15))
            config.lcd.ledbrightnessstandby.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightnessstandby.apply = lambda: setLEDnormalstate(
                config.lcd.ledbrightnessstandby)
            config.lcd.ledbrightness = ConfigSlider(default=3,
                                                    increment=1,
                                                    limits=(0, 15))
            config.lcd.ledbrightness.addNotifier(setLEDnormalstate)
            config.lcd.ledbrightness.apply = lambda: setLEDnormalstate(
                config.lcd.ledbrightness)
            config.lcd.ledbrightness.callNotifiersOnSaveAndCancel = True
        else:

            def doNothing():
                pass

            config.lcd.ledbrightness = ConfigNothing()
            config.lcd.ledbrightness.apply = lambda: doNothing()
            config.lcd.ledbrightnessstandby = ConfigNothing()
            config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
            config.lcd.ledbrightnessdeepstandby = ConfigNothing()
            config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
            config.lcd.ledblinkingtime = ConfigNothing()
    else:

        def doNothing():
            pass

        config.lcd.contrast = ConfigNothing()
        config.lcd.bright = ConfigNothing()
        config.lcd.standby = ConfigNothing()
        config.lcd.bright.apply = lambda: doNothing()
        config.lcd.standby.apply = lambda: doNothing()
        config.lcd.power = ConfigNothing()
        config.lcd.fblcddisplay = ConfigNothing()
        config.lcd.mode = ConfigNothing()
        config.lcd.repeat = ConfigNothing()
        config.lcd.scrollspeed = ConfigNothing()
        config.lcd.scroll_speed = ConfigSelection(choices=[("300",
                                                            _("normal"))])
        config.lcd.scroll_delay = ConfigSelection(choices=[("noscrolling",
                                                            _("off"))])
        config.lcd.showoutputresolution = ConfigNothing()
        config.lcd.ledbrightness = ConfigNothing()
        config.lcd.ledbrightness.apply = lambda: doNothing()
        config.lcd.ledbrightnessstandby = ConfigNothing()
        config.lcd.ledbrightnessstandby.apply = lambda: doNothing()
        config.lcd.ledbrightnessdeepstandby = ConfigNothing()
        config.lcd.ledbrightnessdeepstandby.apply = lambda: doNothing()
        config.lcd.ledblinkingtime = ConfigNothing()

    config.misc.standbyCounter.addNotifier(standbyCounterChanged,
                                           initial_call=False)
Пример #51
0
def loadSingleSkinData(desktop, skin, path_prefix):
    """loads skin data like colors, windowstyle etc."""
    assert skin.tag == "skin", "root element in skin must be 'skin'!"
    for c in skin.findall("output"):
        id = c.attrib.get('id')
        if id:
            id = int(id)
        else:
            id = 0
        if id == 0:  # framebuffer
            for res in c.findall("resolution"):
                get_attr = res.attrib.get
                xres = get_attr("xres")
                if xres:
                    xres = int(xres)
                else:
                    xres = 720
                yres = get_attr("yres")
                if yres:
                    yres = int(yres)
                else:
                    yres = 576
                bpp = get_attr("bpp")
                if bpp:
                    bpp = int(bpp)
                else:
                    bpp = 32
                #print "Resolution:", xres,yres,bpp
                from enigma import gMainDC
                gMainDC.getInstance().setResolution(xres, yres)
                desktop.resize(eSize(xres, yres))
                if bpp != 32:
                    # load palette (not yet implemented)
                    pass

    for skininclude in skin.findall("include"):
        filename = skininclude.attrib.get("filename")
        if filename:
            skinfile = resolveFilename(SCOPE_ACTIVE_SKIN,
                                       filename,
                                       path_prefix=path_prefix)
            if not fileExists(skinfile):
                skinfile = resolveFilename(SCOPE_SKIN_IMAGE,
                                           filename,
                                           path_prefix=path_prefix)
            if fileExists(skinfile):
                print "[SKIN] loading include:", skinfile
                loadSkin(skinfile)

    for c in skin.findall("colors"):
        for color in c.findall("color"):
            get_attr = color.attrib.get
            name = get_attr("name")
            color = get_attr("value")
            if name and color:
                colorNames[name] = parseColor(color)
                #print "Color:", name, color
            else:
                raise SkinError("need color and name, got %s %s" %
                                (name, color))

    for c in skin.findall("parameters"):
        for parameter in c.findall("parameter"):
            get = parameter.attrib.get
            try:
                name = get("name")
                value = get("value")
                if name.find('Font') != -1:
                    font = value.split(";")
                    if isinstance(font, list) and len(font) == 2:
                        parameters[name] = (str(font[0]), int(font[1]))
                else:
                    parameters[name] = map(int, value.split(","))
            except Exception, ex:
                print "[SKIN] bad parameter", ex
Пример #52
0
 def setRepeat(self, value):
     if fileExists("/proc/stb/lcd/scroll_repeats"):
         print 'setLCDRepeat', value
         f = open("/proc/stb/lcd/scroll_repeats", "w")
         f.write(value)
         f.close()
Пример #53
0
    def getText(self):
        textvalue = ""
        server = ""
        service = self.source.service
        if service:
            info = service and service.info()
            if info:
                if info.getInfoObject(iServiceInformation.sCAIDs):
                    self.poll_interval = self.my_interval
                    self.poll_enabled = True
                    ecm_info = self.ecmfile()
                    # crypt2
                    if self.type == self.CRYPT2:
                        if fileExists("/tmp/ecm.info"):
                            try:
                                caid = "%0.4X" % int(ecm_info.get("caid", ""),
                                                     16)
                                return "%s" % self.systemTxtCaids.get(caid[:2])
                            except:
                                return 'NoCrypt'
                        else:
                            return 'NoCrypt'
                    # CURCAM
                    if self.type == self.CURCAM:
                        if fileExists("/tmp/ecm.info"):
                            try:
                                ccam = ecm_info.get("using", "")
                                return ccam
                            except:
                                return 'No-Emu'
                        else:
                            return 'No-Emu'
                    if ecm_info:
                        # caid
                        caid = "%0.4X" % int(ecm_info.get("caid", ""), 16)
                        if self.type == self.CAID:
                            return caid
                        # crypt
                        if self.type == self.CRYPT:
                            return "%s" % self.systemTxtCaids.get(caid[:2])
                        #pid
                        try:
                            pid = "%0.4X" % int(ecm_info.get("pid", ""), 16)
                        except:
                            pid = ""
                        if self.type == self.PID:
                            return pid
                        # oscam
                        try:
                            prov = "%0.6X" % int(ecm_info.get("prov", ""), 16)
                        except:
                            prov = ecm_info.get("prov", "")
                        if self.type == self.PROV:
                            return prov
                        ecm_time = ecm_info.get("ecm time", "")
                        if self.type == self.DELAY:
                            return ecm_time
                        #protocol
                        protocol = ecm_info.get("protocol", "")
                        #port
                        port = ecm_info.get("port", "")
                        # source
                        source = ecm_info.get("source", "")
                        # server
                        server = ecm_info.get("server", "")
                        # hops
                        hops = ecm_info.get("hops", "")
                        #system
                        system = ecm_info.get("system", "")
                        #provider
                        provider = ecm_info.get("provider", "")
                        # reader
                        reader = ecm_info.get("reader", "")
                        if self.type == self.HOST:
                            return server
                        if self.type == self.FORMAT:
                            textvalue = ""
                            params = self.sfmt.split(" ")
                            for param in params:
                                if param != '':
                                    if param[0] != '%':
                                        textvalue += param
                                    #server
                                    elif param == "%S":
                                        textvalue += server
                                    #hops
                                    elif param == "%H":
                                        textvalue += hops
                                    #system
                                    elif param == "%SY":
                                        textvalue += system
                                    #provider
                                    elif param == "%PV":
                                        textvalue += provider
                                    #port
                                    elif param == "%SP":
                                        textvalue += port
                                    #protocol
                                    elif param == "%PR":
                                        textvalue += protocol
                                    #caid
                                    elif param == "%C":
                                        textvalue += caid
                                    #Pid
                                    elif param == "%P":
                                        textvalue += pid
                                    #prov
                                    elif param == "%p":
                                        textvalue += prov
                                    #sOurce
                                    elif param == "%O":
                                        textvalue += source
                                    #Reader
                                    elif param == "%R":
                                        textvalue += reader
                                    #ECM Time
                                    elif param == "%T":
                                        textvalue += ecm_time
                                    elif param == "%t":
                                        textvalue += "\t"
                                    elif param == "%n":
                                        textvalue += "\n"
                                    elif param[1:].isdigit():
                                        textvalue = textvalue.ljust(
                                            len(textvalue) + int(param[1:]))
                                    if len(textvalue) > 0:
                                        if textvalue[-1] != "\t" and textvalue[
                                                -1] != "\n":
                                            textvalue += " "
                            return textvalue[:-1]
                        if self.type == self.ALL:
                            if source == "emu":
                                textvalue = "%s - %s (Caid: %s)" % (
                                    source, self.systemTxtCaids.get(
                                        caid[:2]), caid)
                            #new oscam ecm.info with port parametr
                            elif reader != "" and source == "net" and port != "":
                                textvalue = "%s - Prov: %s, Caid: %s, Reader: %s, %s (%s:%s) - %ss, %s hops" % (
                                    source, prov, caid, reader, protocol,
                                    server, port, ecm_time, hops)
                            elif reader != "" and source == "net":
                                textvalue = "%s - Prov: %s, Caid: %s, Reader: %s, %s (%s) - %ss, %s hops" % (
                                    source, prov, caid, reader, protocol,
                                    server, ecm_time, hops)
                            elif reader != "" and source != "net":
                                textvalue = "%s - Prov: %s, Caid: %s, Reader: %s, %s (local) - %ss, %s hops" % (
                                    source, prov, caid, reader, protocol,
                                    ecm_time, hops)
                            elif server == "" and port == "":
                                textvalue = "%s - Prov: %s, Caid: %s %s - %s" % (
                                    source, prov, caid, protocol, ecm_time)
                            else:
                                try:
                                    textvalue = "%s Prov: %s, Caid: %s %s %s (Src: %s   p:%s) - %s ms, hop%s" % (
                                        source, prov, caid, reader, protocol,
                                        server, port, ecm_time, hops)
                                except:
                                    pass
                    else:
                        if self.type == self.ALL or (
                                self.type == self.FORMAT and
                            (self.sfmt.count("%") > 3)):
                            textvalue = "No parse cannot emu"
                else:
                    if self.type == self.CURCAM:
                        textvalue = "NoEmu"

                    if self.type == self.CRYPT2:
                        textvalue = "Free To Air"

                    if self.type == self.CAID:
                        textvalue = "0000"

                    if self.type == self.PID:
                        textvalue = "0000"

                    if self.type == self.PROV:
                        textvalue = "000000"

                    if self.type == self.DELAY:
                        textvalue = "0.000"

                    if self.type == self.ALL or (self.type == self.FORMAT and
                                                 (self.sfmt.count("%") > 3)):
                        textvalue = "Free To Air"
        return textvalue
Пример #54
0
def IconCheck(session=None, **kwargs):
    if fileExists("/proc/stb/lcd/symbol_network") or fileExists(
            "/proc/stb/lcd/symbol_usb"):
        global networklinkpoller
        networklinkpoller = IconCheckPoller()
        networklinkpoller.start()
Пример #55
0
def loadSingleSkinData(desktop, skin, path_prefix):
	"""loads skin data like colors, windowstyle etc."""
	assert skin.tag == "skin", "root element in skin must be 'skin'!"

	#print "***SKIN: ", path_prefix

	for c in skin.findall("output"):
		id = c.attrib.get('id')
		if id:
			id = int(id)
		else:
			id = 0
		if id == 0: # framebuffer
			for res in c.findall("resolution"):
				xres = int(res.get("xres", "720"))
				yres = int(res.get("yres", "576"))
				bpp = int(res.get("bpp", "32"))
				from enigma import gMainDC
				gMainDC.getInstance().setResolution(xres, yres, bpp)
				desktop.resize(eSize(xres, yres))
				break

	for c in skin.findall("colors"):
		for color in c.findall("color"):
			get_attr = color.attrib.get
			name = get_attr("name")
			color = get_attr("value")
			if name and color:
				colorNames[name] = parseColor(color)
				#print "Color:", name, color
			else:
				raise SkinError("need color and name, got %s %s" % (name, color))

	for c in skin.findall("listboxcontent"):
		for offset in c.findall("offset"):
			get_attr = offset.attrib.get
			name = get_attr("name")
			value = get_attr("value")
			if name and value:
				if name == "left":
					eListboxPythonStringContent.setLeftOffset(parseValue(value))
				elif name == "right":
					eListboxPythonStringContent.setRightOffset(parseValue(value))
				else:
					raise SkinError("got listboxcontent offset '%s'' but 'left' or 'right' is allowed only" % name)
		for font in c.findall("font"):
			get_attr = font.attrib.get
			name = get_attr("name")
			font = get_attr("font")
			if name and font:
				if name == "string":
					eListboxPythonStringContent.setFont(parseFont(font, ((1,1),(1,1))))
				elif name == "config_description":
					eListboxPythonConfigContent.setDescriptionFont(parseFont(font, ((1,1),(1,1))))
				elif name == "config_value":
					eListboxPythonConfigContent.setValueFont(parseFont(font, ((1,1),(1,1))))
				else:
					raise SkinError("got listboxcontent font '%s' but 'string', 'config_description' or 'config_value' is allowed only" % name)
		for value in c.findall("value"):
			get_attr = value.attrib.get
			name = get_attr("name")
			value = get_attr("value")
			if name and value:
				if name == "string_item_height":
					eListboxPythonStringContent.setItemHeight(parseValue(value))
				elif name == "config_item_height":
					eListboxPythonConfigContent.setItemHeight(parseValue(value))
				else:
					raise SkinError("got listboxcontent value '%s' but 'string_item_height' or 'config_item_height' is allowed only" % name)

	for c in skin.findall("fonts"):
		for font in c.findall("font"):
			get_attr = font.attrib.get
			filename = get_attr("filename", "<NONAME>")
			name = get_attr("name", "Regular")
			scale = get_attr("scale")
			if scale:
				scale = int(scale)
			else:
				scale = 100
			is_replacement = get_attr("replacement") and True or False
			resolved_font = resolveFilename(SCOPE_FONTS, filename, path_prefix=path_prefix)
			if not fileExists(resolved_font): #when font is not available look at current skin path
				skin_path = resolveFilename(SCOPE_CURRENT_SKIN, filename)
				if fileExists(skin_path):
					resolved_font = skin_path
			addFont(resolved_font, name, scale, is_replacement)
			#print "Font: ", resolved_font, name, scale, is_replacement

	for c in skin.findall("subtitles"):
		from enigma import eSubtitleWidget
		scale = ((1,1),(1,1))
		for substyle in c.findall("sub"):
			get_attr = substyle.attrib.get
			font = parseFont(get_attr("font"), scale)
			col = get_attr("foregroundColor")
			if col:
				foregroundColor = parseColor(col)
				haveColor = 1
			else:
				foregroundColor = gRGB(0xFFFFFF)
				haveColor = 0
			col = get_attr("shadowColor")
			if col:
				shadowColor = parseColor(col)
			else:
				shadowColor = gRGB(0)
			shadowOffset = parsePosition(get_attr("shadowOffset"), scale)
			face = eSubtitleWidget.__dict__[get_attr("name")]
			eSubtitleWidget.setFontStyle(face, font, haveColor, foregroundColor, shadowColor, shadowOffset)

	for windowstyle in skin.findall("windowstyle"):
		style = eWindowStyleSkinned()
		id = windowstyle.attrib.get("id")
		if id:
			id = int(id)
		else:
			id = 0
		#print "windowstyle:", id

		# defaults
		font = gFont("Regular", 20)
		offset = eSize(20, 5)

		for title in windowstyle.findall("title"):
			get_attr = title.attrib.get
			offset = parseSize(get_attr("offset"), ((1,1),(1,1)))
			font = parseFont(get_attr("font"), ((1,1),(1,1)))

		style.setTitleFont(font);
		style.setTitleOffset(offset)
		#print "  ", font, offset

		for borderset in windowstyle.findall("borderset"):
			bsName = str(borderset.attrib.get("name"))
			for pixmap in borderset.findall("pixmap"):
				get_attr = pixmap.attrib.get
				bpName = get_attr("pos")
				if "filename" in pixmap.attrib:
					filename = get_attr("filename")
					if filename and bpName:
						png = loadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, filename, path_prefix=path_prefix), desktop)
						style.setPixmap(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], png)
				elif "color" in pixmap.attrib:
					color = parseColor(get_attr("color"))
					size = int(get_attr("size"))
					Log.w("%s: %s @ %s" %(bpName, color.argb(), size))
					style.setColorBorder(eWindowStyleSkinned.__dict__[bsName], eWindowStyleSkinned.__dict__[bpName], color, size)

		for color in windowstyle.findall("color"):
			get_attr = color.attrib.get
			colorType = get_attr("name")
			color = parseColor(get_attr("color"))
			try:
				style.setColor(eWindowStyleSkinned.__dict__["col" + colorType], color)
			except:
				raise SkinError("Unknown color %s" % (colorType))

		for listfont in windowstyle.findall("listfont"):
			get_attr = listfont.attrib.get
			fontType = get_attr("type")
			fontSize = int(get_attr("size"))
			fontFace = get_attr("font")
			try:
				Log.i("########### ADDING %s: %s" %(fontType, fontSize))
				style.setListFont(eWindowStyleSkinned.__dict__["listFont" + fontType], fontSize, fontFace)
			except:
				raise SkinError("Unknown listFont %s" % (fontType))

		x = eWindowStyleManager.getInstance()
		x.setStyle(id, style)

	for windowstylescrollbar in skin.findall("windowstylescrollbar"):
		style = eWindowStyleScrollbar()
		id = windowstylescrollbar.attrib.get("id")
		if id:
			id = int(id)
		else:
			id = 4
		for value in windowstylescrollbar.findall("value"):
			get_attr = value.attrib.get
			vType = get_attr("name")
			v = get_attr("value")
			if vType == "BackgroundPixmapTopHeight":
				style.setBackgroundPixmapTopHeight(int(v))
			elif vType == "BackgroundPixmapBottomHeight":
				style.setBackgroundPixmapBottomHeight(int(v))
			elif vType == "ValuePixmapTopHeight":
				style.setValuePixmapTopHeight(int(v))
			elif vType == "ValuePixmapBottomHeight":
				style.setValuePixmapBottomHeight(int(v))
			elif vType == "ScrollbarWidth":
				style.setScrollbarWidth(int(v))
			elif vType == "ScrollbarBorderWidth":
				style.setScrollbarBorderWidth(int(v))
		for pixmap in windowstylescrollbar.findall("pixmap"):
			get_attr = pixmap.attrib.get
			vType = get_attr("name")
			filename = get_attr("filename")
			if filename:
				if vType == "BackgroundPixmap":
					png = loadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, filename, path_prefix=path_prefix), desktop)
					style.setBackgroundPixmap(png)
				elif vType == "ValuePixmap":
					png = loadPixmap(resolveFilename(SCOPE_SKIN_IMAGE, filename, path_prefix=path_prefix), desktop)
					style.setValuePixmap(png)
		x = eWindowStyleManager.getInstance()
		x.setStyle(id, style)

	for components in skin.findall("components"):
		for component in components.findall("component"):
			componentSizes.apply(component.attrib)
			for template in component.findall("template"):
				componentSizes.addTemplate(component.attrib, template.text)

	for l in skin.findall("layouts"):
		for layout in l.findall("layout"):
			layouts.apply(layout)
Пример #56
0
# example: loadSkin("nemesis_greenline/skin.xml")
config.skin = ConfigSubsection()

# on SD hardware, ViX Night HD will not be available

config.defaultskinSetup = ConfigSubsection()
config.defaultskinSetup.steps = ConfigSelection([
    ('default Utopia', _("default Utopia")),
    ('default SmokeR', _("default SmokeR"))
])
if config.defaultskinSetup.steps.value == "default SmokeR":
    DEFAULT_SKIN = "NFR_Skin/skin.xml"
elif config.defaultskinSetup.steps.value == "default Utopia":
    DEFAULT_SKIN = "skin_default/skin.xml"

if not fileExists(resolveFilename(SCOPE_SKIN, DEFAULT_SKIN)):
    # in that case, fallback to Magic (which is an SD skin)
    DEFAULT_SKIN = "NFR_Skin/skin.xml"

config.skin.primary_skin = ConfigText(default=DEFAULT_SKIN)

DEFAULT_DISPLAY_SKIN = "skin_display.xml"
config.skin.display_skin = ConfigText(default=DEFAULT_DISPLAY_SKIN)


def getSkinPath():
    primary_skin_path = config.skin.primary_skin.value.replace('skin.xml', '')
    if not primary_skin_path.endswith('/'):
        primary_skin_path = primary_skin_path + '/'
    return primary_skin_path
Пример #57
0
    def render(self, request):
        action = "download"
        if "action" in request.args:
            action = request.args["action"][0]

        if "file" in request.args:
            filename = unquote(request.args["file"][0]).decode(
                'utf-8', 'ignore').encode('utf-8')

            if not os.path.exists(filename):
                return "File '%s' not found" % (filename)

            name = "stream"
            if "name" in request.args:
                name = request.args["name"][0]
            if action == "stream":
                response = "#EXTM3U\n#EXTVLCOPT--http-reconnect=true\n#EXTINF:-1,%s\nhttp://%s:%s/file?action=download&file=%s" % (
                    name, request.getRequestHostname(),
                    config.OpenWebif.port.value, quote(filename))
                request.setHeader("Content-Disposition:",
                                  'attachment;filename="%s.m3u"' % name)
                request.setHeader("Content-Type:", "audio/mpegurl")
                return response
            elif action == "delete":
                request.setResponseCode(http.OK)
                return "TODO: DELETE FILE: %s" % (filename)
            elif action == "download":
                request.setHeader(
                    "Content-Disposition:",
                    "attachment;filename=\"%s\"" % (filename.split('/')[-1]))
                rfile = static.File(filename,
                                    defaultType="application/octet-stream")
                return rfile.render(request)
            else:
                return "wrong action parameter"

        if "dir" in request.args:
            path = request.args["dir"][0]

            if "pattern" in request.args:
                pattern = request.args["pattern"][0]
            else:
                pattern = None

            directories = []
            files = []
            if fileExists(path):
                try:
                    files = listdir(path)
                except:
                    files = []

                files.sort()
                tmpfiles = files[:]
                for x in tmpfiles:
                    if os_path.isdir(path + x):
                        directories.append(path + x + "/")
                        files.remove(x)

                data = []
                data.append({
                    "result": True,
                    "dirs": directories,
                    "files": files
                })

                request.setHeader("content-type", "text/plain")
                request.write(json.dumps(data))
                request.finish()
                return server.NOT_DONE_YET
            else:
                return "path %s not exits" % (path)
Пример #58
0
	def findPicon(self, serviceName):
		for path in self.searchPaths:
			pngname = (path % self.path) + serviceName + ".png"
			if fileExists(pngname):
				return pngname
		return ""
Пример #59
0
    def getText(self):
        service = self.source.service
        info = service and service.info()
        if not service:
            return None
        camd = ""
        emu = server = ""
        serlist = camdlist = None
        nameemu = []
        nameser = []
        if not info:
            return ""
        # Alternative SoftCam Manager
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/AlternativeSoftCamManager/plugin.pyo"
        ):
            try:
                if config.plugins.AltSoftcam.actcam.value is not None:
                    return config.plugins.AltSoftcam.actcam.value
            except:
                return None
        # E-Panel
#		elif fileExists("/usr/lib/enigma2/python/Plugins/Extensions/epanel/plugin.pyo"):
#			try:
#				if config.plugins.epanel.activeemu.value is not None:
#					return config.plugins.epanel.activeemu.value
#			except:
#				return None
# PKT
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/PKT/plugin.pyo"):
            try:
                if config.plugins.emuman.cam.value is not None:
                    return config.plugins.emuman.cam.value
            except:
                return None
        # GlassSysUtil
        elif fileExists("/tmp/ucm_cam.info"):
            try:
                return open("/tmp/ucm_cam.info").read()
            except:
                return None
        # TS-Panel
        elif fileExists("/etc/startcam.sh"):
            try:
                for line in open("/etc/startcam.sh"):
                    if "script" in line:
                        return "%s" % line.split('/')[-1].split()[0][:-3]
            except:
                return None
        # VTI
        elif fileExists("/tmp/.emu.info"):
            try:
                for line in open("/tmp/.emu.info"):
                    return line.strip('\n')
            except:
                return None
        # BlackHole
        elif fileExists("/etc/CurrentBhCamName"):
            try:
                return open("/etc/CurrentBhCamName").read()
            except:
                return None
        # Domica
        elif fileExists("/etc/active_emu.list"):
            try:
                return open("/etc/active_emu.list").read()
            except:
                return None
        # Egami old
        elif os.path.isfile("/etc/CurrentEGCamName"):
            try:
                return open("/etc/CurrentEGCamName").read()
            except:
                return None
        # Egami
        elif fileExists("/tmp/egami.inf"):
            try:
                for line in open("/tmp/egami.inf"):
                    item = line.split(":", 1)
                    if item[0] == "Current emulator":
                        return item[1].strip()
            except:
                return None
        # OoZooN
        elif fileExists("/tmp/cam.info"):
            try:
                return open("/tmp/cam.info").read()
            except:
                return None
        # Merlin2
        elif fileExists("/etc/clist.list"):
            try:
                return open("/etc/clist.list").read()
            except:
                return None
        # HDMU
        elif fileExists("/etc/.emustart"):
            try:
                for line in open("/etc/.emustart"):
                    return line.split()[0].split('/')[-1]
            except:
                return None
        # GP3
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Bp/geminimain/lib/libgeminimain.so"
        ):
            try:
                from Plugins.Bp.geminimain.plugin import GETCAMDLIST
                from Plugins.Bp.geminimain.lib import libgeminimain
                camdl = libgeminimain.getPyList(GETCAMDLIST)
                cam = None
                for x in camdl:
                    if x[1] == 1:
                        cam = x[2]
                return cam
            except:
                return None
        # Pli & ATV
        elif fileExists("/etc/init.d/softcam") or fileExists(
                "/etc/init.d/cardserver"):
            try:
                for line in open("/etc/init.d/softcam"):
                    if 'echo' in line:
                        nameemu.append(line)
                camdlist = "%s" % nameemu[1].split('"')[1]
            except:
                pass
            try:
                for line in open("/etc/init.d/cardserver"):
                    if 'echo' in line:
                        nameser.append(line)
                serlist = "%s" % nameser[1].split('"')[1]
            except:
                pass
            if serlist is not None and camdlist is not None:
                return ("%s %s" % (serlist, camdlist))
            elif camdlist is not None:
                return "%s" % camdlist
            elif serlist is not None:
                return "%s" % serlist
            return ""
        else:
            return None

        if serlist is not None:
            try:
                cardserver = ""
                for current in serlist.readlines():
                    cardserver = current
                serlist.close()
            except:
                pass
        else:
            cardserver = " "

        if camdlist is not None:
            try:
                emu = ""
                for current in camdlist.readlines():
                    emu = current
                camdlist.close()
            except:
                pass
        else:
            emu = " "

        return "%s %s" % (cardserver.split('\n')[0], emu.split('\n')[0])
Пример #60
0
def MPcallbackFunc(answer):
    if EMsession is None:
        return
    answer = answer and answer[1]
    if answer == "PLAYMOVIES":
        if InfoBar_instance:
            InfoBar_instance.showMovies()
    elif answer == "RADIO":
        if config.usage.e1like_radio_mode.value:
            askBM = []
            askBM.append((_("TV-mode"), "TM"))
            askBM.append((_("Radio-mode"), "RM"))
            askBM.append((_("Nothing"), "NO"))
            EMsession.openWithCallback(TvRadioCallback,
                                       ChoiceBox,
                                       title="EasyMedia...",
                                       list=askBM)
        else:
            if InfoBar_instance:
                InfoBar_instance.showRadio()
    elif answer == "BOOKMARKS":
        tmpBookmarks = config.movielist.videodirs
        myBookmarks = tmpBookmarks and tmpBookmarks.value[:] or []
        if len(myBookmarks) > 0:
            askBM = []
            for s in myBookmarks:
                askBM.append((s, s))
            EMsession.openWithCallback(BookmarksCallback,
                                       ChoiceBox,
                                       title=_("Select bookmark..."),
                                       list=askBM)
    elif answer == "PICTURES":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/PicturePlayer/plugin.pyo"
        ):
            from Plugins.Extensions.PicturePlayer.plugin import picshow
            EMsession.open(picshow)
        else:
            EMsession.open(MessageBox,
                           text=_('Picture-player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MUSIC":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/MerlinMusicPlayer/plugin.pyo"
        ) and (config.plugins.easyMedia.music.value == "merlinmp"):
            from Plugins.Extensions.MerlinMusicPlayer.plugin import MerlinMusicPlayerFileList
            servicelist = None
            EMsession.open(MerlinMusicPlayerFileList, servicelist)
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/MediaPlayer/plugin.pyo"
        ) and (config.plugins.easyMedia.music.value == "mediaplayer"):
            from Plugins.Extensions.MediaPlayer.plugin import MediaPlayer
            EMsession.open(MediaPlayer)
        else:
            EMsession.open(MessageBox,
                           text=_('No Music-Player installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "FILES":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/Tuxcom/plugin.pyo"
        ) and (config.plugins.easyMedia.files.value == "tuxcom"):
            from Plugins.Extensions.Tuxcom.plugin import TuxComStarter
            EMsession.open(TuxComStarter)
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/DreamExplorer/plugin.pyo"
        ) and (config.plugins.easyMedia.files.value == "dreamexplorer"):
            from Plugins.Extensions.DreamExplorer.plugin import DreamExplorerII
            EMsession.open(DreamExplorerII)
        elif fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/Filebrowser/plugin.pyo"
        ) and (config.plugins.easyMedia.files.value == "filebrowser"):
            from Plugins.Extensions.Filebrowser.plugin import FilebrowserScreen
            EMsession.open(FilebrowserScreen)
        else:
            EMsession.open(MessageBox,
                           text=_('No File-Manager installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "WEATHER":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/WeatherPlugin/plugin.pyo"
        ):
            from Plugins.Extensions.WeatherPlugin.plugin import MSNWeatherPlugin
            EMsession.open(MSNWeatherPlugin)
        else:
            EMsession.open(MessageBox,
                           text=_('Weather Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "DVD":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/DVDPlayer/plugin.pyo"
        ):
            from Plugins.Extensions.DVDPlayer.plugin import DVDPlayer
            EMsession.open(DVDPlayer)
        else:
            EMsession.open(MessageBox,
                           text=_('DVDPlayer Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MYTUBE":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/MyTube/plugin.pyo"
        ):
            from Plugins.Extensions.MyTube.plugin import *
            MyTubeMain(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('MyTube Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "INTERNETRADIO":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/InternetRadio/plugin.pyo"
        ):
            from Plugins.Extensions.InternetRadio.InternetRadioScreen import InternetRadioScreen
            EMsession.open(InternetRadioScreen)
        else:
            EMsession.open(MessageBox,
                           text=_('SHOUTcast Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "ZDF":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/ZDFMediathek/plugin.pyo"
        ):
            from Plugins.Extensions.ZDFMediathek.plugin import ZDFMediathek
            EMsession.open(ZDFMediathek)
        else:
            EMsession.open(MessageBox,
                           text=_('ZDFmediathek Plugin is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "VLC":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/VlcPlayer/plugin.pyo"
        ):
            from Plugins.Extensions.VlcPlayer.plugin import *
            main(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('VLC Player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "IDREAM":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/MerlinMusicPlayer/plugin.pyo"
        ):
            from Plugins.Extensions.MerlinMusicPlayer.plugin import iDreamMerlin
            servicelist = None
            EMsession.open(iDreamMerlin, servicelist)
        else:
            EMsession.open(MessageBox,
                           text=_('Merlin iDream is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "MYVIDEO":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/MyVideoPlayer/plugin.pyo"
        ):
            from Plugins.Extensions.MyVideoPlayer.plugin import Vidtype
            EMsession.open(Vidtype)
        else:
            EMsession.open(MessageBox,
                           text=_('MyVideo Player is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "VIDEODB":
        if fileExists(
                "/usr/lib/enigma2/python/Plugins/Extensions/VideoDB/plugin.pyo"
        ):
            from Plugins.Extensions.VideoDB.plugin import main as vdbmain
            vdbmain(EMsession)
        else:
            EMsession.open(MessageBox,
                           text=_('VideoDB is not installed!'),
                           type=MessageBox.TYPE_ERROR)
    elif answer == "TIMERS":
        from Screens.TimerEdit import TimerEditList
        EMsession.open(TimerEditList)
    elif answer is not None and "++++" in answer:
        plugToRun = answer[4:]
        try:
            inpf = open(
                ("/usr/lib/enigma2/python/Plugins/Extensions/EasyMedia/" +
                 plugToRun + ".plug"), 'rb')
            runPlug = pickle.load(inpf)
            inpf.close()
            runPlug(session=EMsession)
        except:
            EMsession.open(MessageBox,
                           text=(plugToRun + " not found!"),
                           type=MessageBox.TYPE_WARNING)