def __init__(self): Renderer.__init__(self) self.PicLoad = ePicLoad() self.PicLoad.PictureData.get().append(self.updatePicon) self.piconsize = (0,0) self.pngname = "" self.lastPath = None if getBoxType() == 'vuultimo' or getBoxType() == 'quadbox2400' or getMachineProcModel().startswith("ini-90") or getMachineProcModel().startswith("ini-80"): pngname = findLcdPicon("lcd_picon_default") else: pngname = findLcdPicon("picon_default") self.defaultpngname = None if not pngname: if getBoxType() == 'vuultimo' or getBoxType() == 'quadbox2400' or getMachineProcModel().startswith("ini-90") or getMachineProcModel().startswith("ini-80"): tmp = resolveFilename(SCOPE_ACTIVE_SKIN, "lcd_picon_default.png") else: tmp = resolveFilename(SCOPE_ACTIVE_SKIN, "picon_default.png") if pathExists(tmp): pngname = tmp else: if getBoxType() == 'vuultimo' or getBoxType() == 'quadbox2400' or getMachineProcModel().startswith("ini-90") or getMachineProcModel().startswith("ini-80"): pngname = resolveFilename(SCOPE_ACTIVE_SKIN, "lcd_picon_default.png") else: pngname = resolveFilename(SCOPE_ACTIVE_SKIN, "picon_default.png") if os.path.getsize(pngname): self.defaultpngname = pngname
def checkkernel(): mycheck = 0 if getMachineBuild() in ("7000s", "7100s", "g300", "hd2400", "vusolo4k"): return 1 if (os.path.isfile("/proc/stb/info/boxtype") and os.path.isfile("/proc/stb/info/version")): if getMachineProcModel().startswith("ini-10") or getMachineProcModel().startswith("ini-20") or getMachineProcModel().startswith("ini-30") or getMachineProcModel().startswith("ini-50") or getMachineProcModel().startswith("ini-70") or getMachineProcModel().startswith("ini-80") or getMachineProcModel().startswith("ini-90") or getMachineProcModel().startswith("uni") or getMachineProcModel().startswith("yhgd"): if getMachineBuild() in ('inihde', 'inihde2', 'inihdx', 'inihdp', 'blackbox7405'): mycheck = 1 else: mycheck = 0 return mycheck
def blue(self): import boxbranding print "getMachineBuild=%s<" % boxbranding.getMachineBuild() print "getMachineProcModel=%s<" % boxbranding.getMachineProcModel() print "getMachineBrand=%s<" % boxbranding.getMachineBrand() print "getMachineName=%s<" % boxbranding.getMachineName() print "getMachineMtdKernel=%s<" % boxbranding.getMachineMtdKernel() print "getMachineKernelFile=%s<" % boxbranding.getMachineKernelFile() print "getMachineMtdRoot=%s<" % boxbranding.getMachineMtdRoot() print "getMachineRootFile=%s<" % boxbranding.getMachineRootFile() print "getMachineMKUBIFS=%s<" % boxbranding.getMachineMKUBIFS() print "getMachineUBINIZE=%s<" % boxbranding.getMachineUBINIZE() print "getBoxType=%s<" % boxbranding.getBoxType() print "getBrandOEM=%s<" % boxbranding.getBrandOEM() print "getOEVersion=%s<" % boxbranding.getOEVersion() print "getDriverDate=%s<" % boxbranding.getDriverDate() print "getImageVersion=%s<" % boxbranding.getImageVersion() print "getImageBuild=%s<" % boxbranding.getImageBuild() print "getImageDistro=%s<" % boxbranding.getImageDistro() print "getImageFolder=%s<" % boxbranding.getImageFolder() print "getImageFileSystem=%s<" % boxbranding.getImageFileSystem() if self.check_hdd(): self.session.open(doFlashImage, online=False, list=self.list[self.selection], multi=self.multi, devrootfs=self.devrootfs) else: self.close()
def __init__(self, session): Screen.__init__(self, session) self.skinName = 'Standby' self.avswitch = AVSwitch() print 'enter standby' if getMachineProcModel() in 'ini-7012': if path.exists('/proc/stb/lcd/symbol_scrambled'): open('/proc/stb/lcd/symbol_scrambled', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_1080p'): open('/proc/stb/lcd/symbol_1080p', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_1080i'): open('/proc/stb/lcd/symbol_1080i', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_720p'): open('/proc/stb/lcd/symbol_720p', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_576i'): open('/proc/stb/lcd/symbol_576i', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_576p'): open('/proc/stb/lcd/symbol_576p', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_hd'): open('/proc/stb/lcd/symbol_hd', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_dolby_audio'): open('/proc/stb/lcd/symbol_dolby_audio', 'w').write('0') if path.exists('/proc/stb/lcd/symbol_mp3'): open('/proc/stb/lcd/symbol_mp3', 'w').write('0') self['actions'] = ActionMap(['StandbyActions'], {'power': self.Power, 'discrete_on': self.Power}, -1) globalActionMap.setEnabled(False) from Screens.InfoBar import InfoBar self.infoBarInstance = InfoBar.instance self.standbyStopServiceTimer = eTimer() self.standbyStopServiceTimer.callback.append(self.stopService) self.timeHandler = None self.setMute() if SystemInfo['Display'] and SystemInfo['LCDMiniTV']: setLCDModeMinitTV('0') self.paused_service = None self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup() service = self.prev_running_service and self.prev_running_service.toString() if service: if service.rsplit(':', 1)[1].startswith('/'): self.paused_service = True self.infoBarInstance.pauseService() else: self.timeHandler = eDVBLocalTimeHandler.getInstance() if self.timeHandler.ready(): if self.session.nav.getCurrentlyPlayingServiceOrGroup(): self.stopService() else: self.standbyStopServiceTimer.startLongTimer(5) self.timeHandler = None else: self.timeHandler.m_timeUpdated.get().append(self.stopService) if self.session.pipshown: self.infoBarInstance and hasattr(self.infoBarInstance, 'showPiP') and self.infoBarInstance.showPiP() if SystemInfo['ScartSwitch']: self.avswitch.setInput('SCART') else: self.avswitch.setInput('AUX') self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose)
def __init__(self): Renderer.__init__(self) VariableText.__init__(self) if getMachineProcModel().startswith("ini-90"): self.stringlength = 25 else: self.stringlength = 16
def __evUpdatedInfo(self): self.service = self.session.nav.getCurrentService() if getMachineProcModel() in ('ini-7012', 'ini-7012au'): self.Resolution() self.Audio() self.Subtitle() self.ParentalControl() del self.service
def onMountpointRemoved(mountpoint): global searchPaths if getBoxType() == 'vuultimo' or getBoxType() == 'quadbox2400' or getMachineProcModel().startswith("ini-90") or getMachineProcModel().startswith("ini-80"): path = os.path.join(mountpoint, 'usr/share/enigma2/piconlcd') + '/' else: path = os.path.join(mountpoint, 'picon') + '/' try: searchPaths.remove(path) print "[LcdPicon] removed path:", path except: pass
def onMountpointAdded(mountpoint): global searchPaths try: if getBoxType() == 'vuultimo' or getBoxType() == 'quadbox2400' or getMachineProcModel().startswith("ini-90") or getMachineProcModel().startswith("ini-80"): path = os.path.join(mountpoint, 'usr/share/enigma2/piconlcd') + '/' else: path = os.path.join(mountpoint, 'picon') + '/' if os.path.isdir(path) and path not in searchPaths: for fn in os.listdir(path): if fn.endswith('.png'): print "[LcdPicon] adding path:", path searchPaths.append(path) break except Exception, ex: print "[LcdPicon] Failed to investigate %s:" % mountpoint, ex
def check_updates(self): import pygeoip, json try: gi = pygeoip.GeoIP('/usr/lib/python2.7/pygeoip/GeoIP.dat') if getMachineProcModel() in ('ini-1000am', 'ini-2000am', 'ini-8000am'): address_ip = json.load( urlopen('http://httpbin.org/ip'))['origin'] country_code = gi.country_code_by_addr(address_ip) if country_code in 'PL': pass except: pass self.Console = Console() cmd = 'opkg update' self.Console.ePopen(cmd, self.opkg_update_finished)
def checkkernel(): mycheck = 0 if not fileExists('/media/usb'): os.system('mkdir /media/usb') if getMachineBuild() in ('dm7080', 'dm8000', 'vuduo2'): mycheck = 1 return mycheck if os.path.isfile('/proc/stb/info/boxtype') and os.path.isfile( '/proc/stb/info/version'): if getMachineProcModel().startswith('ini-10') or getMachineProcModel( ).startswith('ini-20') or getMachineProcModel().startswith( 'ini-30' ) or getMachineProcModel().startswith('ini-50') or getMachineProcModel( ).startswith('ini-70') or getMachineProcModel().startswith( 'ini-80') or getMachineProcModel().startswith( 'ini-90') or getMachineProcModel().startswith( 'uni') or getMachineProcModel().startswith('yhgd'): if getMachineBuild() in ('inihde', 'inihde2', 'inihdx', 'inihdp', 'blackbox7405'): mycheck = 1 else: mycheck = 0 return mycheck
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) #nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None import hashlib import os from os import path from pathlib import Path import fileinput, sys def md5_update_from_file(filename, hash): assert Path(filename).is_file() with open(str(filename), "rb") as f: for chunk in iter(lambda: f.read(4096), b""): hash.update(chunk) return hash def md5_file(filename): return md5_update_from_file(filename, hashlib.md5()).hexdigest() def md5_update_from_dir(directory, hash): assert Path(directory).is_dir() for path in sorted(Path(directory).iterdir()): hash.update(path.name.encode()) if path.is_file(): hash = md5_update_from_file(path, hash) elif path.is_dir(): hash = md5_update_from_dir(path, hash) return hash def md5_dir(directory): return md5_update_from_dir(directory, hashlib.md5()).hexdigest() sha256hash = () myfilecheck = "/usr/lib/enigma2/python/Plugins/Extensions/Infopanel" sha256save = "/var/lib/opkg/info/enigma2-plugin-extensions-infopanel.sha256" if config.misc.firstrun.value == True: myfile = Path(sha256save) if os.path.isfile(sha256save): os.remove(sha256save) myfile.touch(exist_ok=True) sha256hash = md5_dir(myfilecheck) sha_f = open(sha256save, "a") sha_f.write(sha256hash) sha_f.close() else: if os.path.isfile(sha256save): sha256hash = md5_dir(myfilecheck) try: sha256read = open(sha256save,'r') sha256hash1 = sha256read.read() print("sha256hash1:", sha256hash1) print("sha256hash:", sha256hash) if sha256hash == sha256hash1: print("all ok with Infopanel") else: print("Sorry, but you change our Infopanel so we had to disable it!!") sub_menu_sort = NoSave(ConfigDictionarySet()) sub_menu_sort.value = config.usage.menu_sort_weight.getConfigValue("mainmenu", "submenu") m_weight = sub_menu_sort.getConfigValue('Infopanel', "sort") m_weight1 = sub_menu_sort.getConfigValue('Infopanel', "hidden") sub_menu_sort.changeConfigValue('Infopanel', "hidden", "1") config.usage.menu_sort_weight.save() configfile.save() sha256read.close() except: print("Sorry, but you change our Infopanel so we had to disable it!!") sub_menu_sort = NoSave(ConfigDictionarySet()) sub_menu_sort.value = config.usage.menu_sort_weight.getConfigValue("mainmenu", "submenu") m_weight = sub_menu_sort.getConfigValue('Infopanel', "sort") m_weight1 = sub_menu_sort.getConfigValue('Infopanel', "hidden") sub_menu_sort.changeConfigValue('Infopanel', "hidden", "1") config.usage.menu_sort_weight.save() configfile.save() else: print("Sorry, but you change our Infopanel so we had to disable it!!") sub_menu_sort = NoSave(ConfigDictionarySet()) sub_menu_sort.value = config.usage.menu_sort_weight.getConfigValue("mainmenu", "submenu") m_weight = sub_menu_sort.getConfigValue('Infopanel', "sort") m_weight1 = sub_menu_sort.getConfigValue('Infopanel', "hidden") sub_menu_sort.changeConfigValue('Infopanel', "hidden", "1") config.usage.menu_sort_weight.save() configfile.save() if os.path.exists("/media/hdd/images/config/settings") and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen os.system("rm /media/hdd/images/config/settings") session.open(RestoreScreen, runRestore = True) else: os.system("rm /media/hdd/images/config/settings") screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print(screensToRun) enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): config.easysetup = ConfigSubsection() config.easysetup.restart = ConfigBoolean(default = False) if config.easysetup.restart.value == True: print("restart after Wizard2") config.easysetup.restart.setValue(False) config.easysetup.restart.save() enigma.quitMainloop(3) if result: print("[mytest.py] quitMainloop #3") enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) power.timerstdby() if boxtype in ('alien5', 'osninopro', 'osnino', 'osninoplus', 'alphatriple', 'spycat4kmini', 'tmtwin4k', 'mbmicrov2', 'revo4k', 'force3uhd', 'wetekplay', 'wetekplay2', 'wetekhub', 'dm7020hd', 'dm7020hdv2', 'osminiplus', 'osmega', 'sf3038', 'spycat', 'e4hd', 'e4hdhybrid', 'mbmicro', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixusszero', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3', '9910lx', '9911lx', '9920lx') or getBrandOEM() in ('fulan') or getMachineBuild() in ('u41', 'dags7362', 'dags73625', 'dags5', 'ustym4kpro', 'beyonwizv2', 'viper4k', 'sf8008', 'sf8008m', 'cc1', 'gbmv200'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print("lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value) print("NOK shutdown action=%s" % config.usage.shutdownNOK_action.value) print("bootup action=%s" % config.usage.boot_action.value) if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print("last shutdown = %s" % config.usage.shutdownOK.value) import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() if not RestoreSettings: configfile.save() # kill showiframe if it is running (sh4 hack...) if getMachineBuild() in ('spark', 'spark7162'): os.system("killall -9 showiframe") runReactor() print("[mytest.py] normal shutdown") config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb') or getMachineProcModel().startswith('ini'): print("dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime))) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print("set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime))) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print('recordTimerWakeupAuto',recordTimerWakeupAuto) config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] + 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print("set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60))) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print('PowerTimerWakeupAuto',PowerTimerWakeupAuto) config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
import boxbranding print "getMachineBuild=%s" %boxbranding.getMachineBuild() print "getMachineProcModel=%s" %boxbranding.getMachineProcModel() print "getMachineBrand=%s" %boxbranding.getMachineBrand() print "getMachineName=%s" %boxbranding.getMachineName() print "getMachineMtdKernel=%s" %boxbranding.getMachineMtdKernel() print "getMachineKernelFile=%s" %boxbranding.getMachineKernelFile() print "getMachineMtdRoot=%s" %boxbranding.getMachineMtdRoot() print "getMachineRootFile=%s" %boxbranding.getMachineRootFile() print "getMachineMKUBIFS=%s" %boxbranding.getMachineMKUBIFS() print "getMachineUBINIZE=%s" %boxbranding.getMachineUBINIZE() print "getBoxType=%s" %boxbranding.getBoxType() print "getBrandOEM=%s" %boxbranding.getBrandOEM() print "getOEVersion=%s" %boxbranding.getOEVersion() print "getDriverDate=%s" %boxbranding.getDriverDate() print "getImageVersion=%s" %boxbranding.getImageVersion() print "getImageBuild=%s" %boxbranding.getImageBuild() print "getImageDistro=%s" %boxbranding.getImageDistro() print "getImageFolder=%s" %boxbranding.getImageFolder() print "getImageFileSystem=%s" %boxbranding.getImageFileSystem()
def getImagesList(self): def getImages(path, files): for file in [ x for x in files if os.path.splitext(x)[1] == ".zip" and box in x or ( "openpli" in x and boxname in x) ]: try: if checkimagefiles([ x.split(os.sep)[-1] for x in zipfile.ZipFile(file).namelist() ]): imagetyp = _("Downloaded Images") if 'backup' in file.split(os.sep)[-1]: imagetyp = _("Fullbackup Images") if imagetyp not in self.imagesList: self.imagesList[imagetyp] = {} self.imagesList[imagetyp][file] = { 'link': file, 'name': file.split(os.sep)[-1][:-4] } except: pass if not self.imagesList: box = GetBoxName() boxname = getMachineProcModel().lower() try: import socket socket.getaddrinfo(feedserver, None) for version in sorted(imagecat): newversion = _( "Images %s" ) % version #Oficial, Descargadas, Full backup the_page = "" url = '%s/Alliance/getfirm.php?box=%s' % (feedurl, box) try: req = urllib2.Request(url) response = urllib2.urlopen(req) except urllib2.URLError as e: print "URL ERROR: %s\n%s" % (e, url) continue try: the_page = response.read() except urllib2.HTTPError as e: print "HTTP download ERROR: %s" % e.code continue lines = the_page.split('\n') try: l = lines[0] self.feedurl = l.split("<a href='")[1].split( "openspa-")[0] except: self["info"].setText("BOX: [" + box + "]\n" + _( "No images found for this device. More info in openspa.info" )) list.append("(" + _("No images found for") + " " + box + ")") countimage = [] for line in lines: if line.find(".zip") > -1 and not "recovery" in line: try: self.feedurl = line.split( "<a href='")[1].split("openspa-")[0] except: pass name = line.split(">")[1].split("<")[0] name = name.replace(" (", " ").replace( " - ", " - ").replace(")", "").replace(".zip", " ->") #self.urllist[name]=line.split("<a href='")[1].split("openspa-")[0] countimage.append(name.split(' ->')[0]) if len(countimage) >= 1: self.imagesList[newversion] = {} for image in countimage: self.imagesList[newversion][image] = {} self.imagesList[newversion][image]["name"] = image self.imagesList[newversion][image][ "link"] = '%s%s.zip' % (self.feedurl, image) except socket.error as e: print "FEEDSERVER ERROR: %s" % e for media in ['/media/%s' % x for x in os.listdir('/media')] + ([ '/media/net/%s' % x for x in os.listdir('/media/net') ] if os.path.isdir('/media/net') else []): if os.path.isdir(media): getImages(media, [ os.path.join(media, x) for x in os.listdir(media) if os.path.splitext(x)[1] == ".zip" and box in x or ( "openpli" in x and boxname in x) ]) if "images" in os.listdir(media): media = os.path.join(media, "images") if os.path.isdir(media) and not os.path.islink( media) and not os.path.ismount(media): getImages(media, [ os.path.join(media, x) for x in os.listdir(media) if os.path.splitext(x)[1] == ".zip" and box in x or ("openpli" in x and boxname in x) ]) for dir in [ dir for dir in [ os.path.join(media, dir) for dir in os.listdir(media) ] if os.path.isdir(dir) and os.path.splitext(dir)[1] == ".unzipped" ]: shutil.rmtree(dir) list = [] for catagorie in self.imagesList.keys(): if catagorie in self.expanded: list.append( ChoiceEntryComponent('expanded', ((str(catagorie)), "Expander"))) for image in reversed( sorted(self.imagesList[catagorie].keys(), key=lambda x: x.split(os.sep)[-1])): list.append( ChoiceEntryComponent( 'verticalline', ((str(self.imagesList[catagorie][image]['name'])), str(self.imagesList[catagorie][image]['link'])))) else: for image in self.imagesList[catagorie].keys(): list.append( ChoiceEntryComponent('expandable', ((str(catagorie)), "Expander"))) break if list: self["list"].setList(list) if self.setIndex: self["list"].moveToIndex( self.setIndex if self.setIndex < len(list) else len(list) - 1) if self["list"].l.getCurrentSelection()[0][1] == "Expander": self.setIndex -= 1 if self.setIndex: self["list"].moveToIndex(self.setIndex if self.setIndex < len(list) else len(list) - 1) self.setIndex = 0 self.selectionChanged() else: self.session.openWithCallback( self.close, MessageBox, _("Cannot find images - please try later"), type=MessageBox.TYPE_ERROR, timeout=3)
import boxbranding print "getMachineBuild=%s" % boxbranding.getMachineBuild() print "getMachineProcModel=%s" % boxbranding.getMachineProcModel() print "getMachineBrand=%s" % boxbranding.getMachineBrand() print "getMachineName=%s" % boxbranding.getMachineName() print "getMachineMtdKernel=%s" % boxbranding.getMachineMtdKernel() print "getMachineKernelFile=%s" % boxbranding.getMachineKernelFile() print "getMachineMtdRoot=%s" % boxbranding.getMachineMtdRoot() print "getMachineRootFile=%s" % boxbranding.getMachineRootFile() print "getMachineMKUBIFS=%s" % boxbranding.getMachineMKUBIFS() print "getMachineUBINIZE=%s" % boxbranding.getMachineUBINIZE() print "getBoxType=%s" % boxbranding.getBoxType() print "getBrandOEM=%s" % boxbranding.getBrandOEM() print "getOEVersion=%s" % boxbranding.getOEVersion() print "getDriverDate=%s" % boxbranding.getDriverDate() print "getImageVersion=%s" % boxbranding.getImageVersion() print "getImageBuild=%s" % boxbranding.getImageBuild() print "getImageDistro=%s" % boxbranding.getImageDistro() print "getImageFolder=%s" % boxbranding.getImageFolder() print "getImageFileSystem=%s" % boxbranding.getImageFileSystem()
def getInfo(session=None, need_fullinfo=False): # TODO: get webif versione somewhere! info = {} global STATICBOXINFO if not (STATICBOXINFO is None or need_fullinfo): return STATICBOXINFO info['brand'] = getBoxBrand() info['model'] = getBoxType() info['platform'] = boxbranding.getMachineBuild() try: info['procmodel'] = getBoxProc() except: # noqa: E722 info['procmodel'] = boxbranding.getMachineProcModel() try: info['procmodeltype'] = getBoxProcType() except: # noqa: E722 info['procmodeltype'] = None try: info['lcd'] = getLcd() except: # noqa: E722 info['lcd'] = 0 try: info['grabpip'] = getGrabPip() except: # noqa: E722 info['grabpip'] = 0 cpu = about.getCPUInfoString() info['chipset'] = cpu info['cpubrand'] = about.getCPUBrand() info['socfamily'] = boxbranding.getSoCFamily() info['cpuarch'] = about.getCPUArch() if config.OpenWebif.about_benchmark.value is True: info['cpubenchmark'] = about.getCPUBenchmark() else: info['cpubenchmark'] = _("Disabled in configuration") info['flashtype'] = about.getFlashType() memFree = 0 for line in open("/proc/meminfo", 'r'): parts = line.split(':') key = parts[0].strip() if key == "MemTotal": info['mem1'] = parts[1].strip().replace("kB", _("kB")) elif key in ("MemFree", "Buffers", "Cached"): memFree += int(parts[1].strip().split(' ', 1)[0]) info['mem2'] = "%s %s" % (memFree, _("kB")) info['mem3'] = _("%s free / %s total") % (info['mem2'], info['mem1']) info['uptime'] = about.getBoxUptime() info["webifver"] = OPENWEBIFVER info['imagedistro'] = boxbranding.getImageDistro() info['oever'] = boxbranding.getImageBuild() info['visionversion'] = boxbranding.getVisionVersion() info['visionrevision'] = boxbranding.getVisionRevision() info['visionmodule'] = about.getVisionModule() if fileExists("/etc/openvision/multiboot"): multibootflag = open("/etc/openvision/multiboot", "r").read().strip() if multibootflag == "1": info['multiboot'] = _("Yes") else: info['multiboot'] = _("No") else: info['multiboot'] = _("Yes") info['enigmaver'] = getEnigmaVersionString() info['driverdate'] = about.getDriverInstalledDate() info['kernelver'] = boxbranding.getKernelVersion() info['dvbapitype'] = about.getDVBAPI() info['gstreamerversion'] = about.getGStreamerVersionString(cpu) info['ffmpegversion'] = about.getFFmpegVersionString() info['pythonversion'] = about.getPythonVersionString() try: info['hwserial'] = getHWSerial() except: # noqa: E722 info['hwserial'] = None if (info['hwserial'] is None or info['hwserial'] == "unknown"): info['hwserial'] = about.getCPUSerial() try: info['boxrctype'] = getBoxRCType() except: # noqa: E722 info['boxrctype'] = None if (info['boxrctype'] is None or info['boxrctype'] == "unknown"): if fileExists("/usr/bin/remotecfg"): info['boxrctype'] = _("Amlogic remote") elif fileExists("/usr/sbin/lircd"): info['boxrctype'] = _("LIRC remote") info['ovrctype'] = boxbranding.getRCType() info['ovrcname'] = boxbranding.getRCName() info['ovrcidnum'] = boxbranding.getRCIDNum() info['transcoding'] = boxbranding.getHaveTranscoding() info['multitranscoding'] = boxbranding.getHaveMultiTranscoding() info['displaytype'] = boxbranding.getDisplayType() info['updatedatestring'] = about.getUpdateDateString() info['enigmadebuglvl'] = eGetEnigmaDebugLvl() info['imagearch'] = boxbranding.getImageArch() info['imagefolder'] = boxbranding.getImageFolder() info['imagefilesystem'] = boxbranding.getImageFileSystem() info['feedsurl'] = boxbranding.getFeedsUrl() info['developername'] = boxbranding.getDeveloperName() info['builddatestring'] = about.getBuildDateString() info['imagefpu'] = boxbranding.getImageFPU() info['havemultilib'] = boxbranding.getHaveMultiLib() try: info['fp_version'] = getFPVersion() except: # noqa: E722 info['fp_version'] = None info['tuners'] = [] for i in list(range(0, nimmanager.getSlotCount())): print( "[OpenWebif] -D- tuner '%d' '%s' '%s'" % (i, nimmanager.getNimName(i), nimmanager.getNim(i).getSlotName())) info['tuners'].append({ "name": nimmanager.getNim(i).getSlotName(), "type": nimmanager.getNimName(i) + " (" + nimmanager.getNim(i).getFriendlyType() + ")", "rec": "", "live": "" }) info['ifaces'] = [] ifaces = iNetwork.getConfiguredAdapters() for iface in ifaces: info['ifaces'].append({ "name": iNetwork.getAdapterName(iface), "friendlynic": getFriendlyNICChipSet(iface), "linkspeed": getLinkSpeed(iface), "mac": iNetwork.getAdapterAttribute(iface, "mac"), "dhcp": iNetwork.getAdapterAttribute(iface, "dhcp"), "ipv4method": getIPv4Method(iface), "ip": formatIp(iNetwork.getAdapterAttribute(iface, "ip")), "mask": formatIp(iNetwork.getAdapterAttribute(iface, "netmask")), "v4prefix": sum([ bin(int(x)).count('1') for x in formatIp( iNetwork.getAdapterAttribute(iface, "netmask")).split('.') ]), "gw": formatIp(iNetwork.getAdapterAttribute(iface, "gateway")), "ipv6": getAdapterIPv6(iface)['addr'], "ipmethod": getIPMethod(iface), "firstpublic": getAdapterIPv6(iface)['firstpublic'] }) info['hdd'] = [] for hdd in harddiskmanager.hdd: dev = hdd.findMount() if dev: stat = os.statvfs(dev) free = stat.f_bavail * stat.f_frsize / 1048576. else: free = -1 if free <= 1024: free = "%i %s" % (free, _("MB")) else: free = free / 1024. free = "%.1f %s" % (free, _("GB")) size = hdd.diskSize() * 1000000 / 1048576. if size > 1048576: size = "%.1f %s" % ((size / 1048576.), _("TB")) elif size > 1024: size = "%.1f %s" % ((size / 1024.), _("GB")) else: size = "%d %s" % (size, _("MB")) iecsize = hdd.diskSize() # Harddisks > 1000 decimal Gigabytes are labelled in TB if iecsize > 1000000: iecsize = (iecsize + 50000) // float(100000) / 10 # Omit decimal fraction if it is 0 if (iecsize % 1 > 0): iecsize = "%.1f %s" % (iecsize, _("TB")) else: iecsize = "%d %s" % (iecsize, _("TB")) # Round harddisk sizes beyond ~300GB to full tens: 320, 500, 640, 750GB elif iecsize > 300000: iecsize = "%d %s" % (((iecsize + 5000) // 10000 * 10), _("GB")) # ... be more precise for media < ~300GB (Sticks, SSDs, CF, MMC, ...): 1, 2, 4, 8, 16 ... 256GB elif iecsize > 1000: iecsize = "%d %s" % (((iecsize + 500) // 1000), _("GB")) else: iecsize = "%d %s" % (iecsize, _("MB")) info['hdd'].append({ "model": hdd.model(), "capacity": size, "labelled_capacity": iecsize, "free": free, "mount": dev, "friendlycapacity": _("%s free / %s total") % (free, size + ' ("' + iecsize + '")') }) info['shares'] = [] autofiles = ('/etc/auto.network', '/etc/auto.network_vti') for autofs in autofiles: if fileExists(autofs): method = "autofs" for line in open(autofs).readlines(): if not line.startswith('#'): # Replace escaped spaces that can appear inside credentials with underscores # Not elegant but we wouldn't want to expose credentials on the OWIF anyways tmpline = line.replace("\ ", "_") tmp = tmpline.split() if not len(tmp) == 3: continue name = tmp[0].strip() type = "unknown" if "cifs" in tmp[1]: # Linux still defaults to SMBv1 type = "SMBv1.0" settings = tmp[1].split(",") for setting in settings: if setting.startswith("vers="): type = setting.replace("vers=", "SMBv") elif "nfs" in tmp[1]: type = "NFS" # Default is r/w mode = _("r/w") settings = tmp[1].split(",") for setting in settings: if setting == "ro": mode = _("r/o") uri = tmp[2] parts = [] parts = tmp[2].split(':') if parts[0] == "": server = uri.split('/')[2] uri = uri.strip()[1:] else: server = parts[0] ipaddress = None if server: # Will fail on literal IPs try: # Try IPv6 first, as will Linux if has_ipv6: tmpaddress = None tmpaddress = getaddrinfo(server, 0, AF_INET6) if tmpaddress: ipaddress = "[" + list( tmpaddress)[0][4][0] + "]" # Use IPv4 if IPv6 fails or is not present if ipaddress is None: tmpaddress = None tmpaddress = getaddrinfo(server, 0, AF_INET) if tmpaddress: ipaddress = list(tmpaddress)[0][4][0] except: # noqa: E722 pass friendlyaddress = server if ipaddress is not None and not ipaddress == server: friendlyaddress = server + " (" + ipaddress + ")" info['shares'].append({ "name": name, "method": method, "type": type, "mode": mode, "path": uri, "host": server, "ipaddress": ipaddress, "friendlyaddress": friendlyaddress }) # TODO: fstab info['EX'] = '' if session: try: # gets all current stream clients for images using eStreamServer # TODO: merge eStreamServer and streamList # TODO: get tuner info for streams # TODO: get recoding/timer info if more than one info['streams'] = [] try: from enigma import eStreamServer streamServer = eStreamServer.getInstance() if streamServer is not None: for x in streamServer.getConnectedClients(): servicename = ServiceReference( x[1]).getServiceName() or "(unknown service)" if int(x[2]) == 0: strtype = "S" else: strtype = "T" info['streams'].append({ "ref": x[1], "name": servicename, "ip": x[0], "type": strtype }) except Exception as error: print("[OpenWebif] -D- no eStreamServer %s" % error) recs = NavigationInstance.instance.getRecordings() if recs: # only one stream and only TV from Plugins.Extensions.OpenWebif.controllers.stream import streamList s_name = '' # s_cip = '' print("[OpenWebif] -D- streamList count '%d'" % len(streamList)) if len(streamList) == 1: from Screens.ChannelSelection import service_types_tv # from enigma import eEPGCache # epgcache = eEPGCache.getInstance() serviceHandler = eServiceCenter.getInstance() services = serviceHandler.list( eServiceReference('%s ORDER BY name' % (service_types_tv))) channels = services and services.getContent("SN", True) s = streamList[0] srefs = s.ref.toString() for channel in channels: if srefs == channel[0]: s_name = channel[1] + ' (' + s.clientIP + ')' break print("[OpenWebif] -D- s_name '%s'" % s_name) # only for debug for stream in streamList: srefs = stream.ref.toString() print("[OpenWebif] -D- srefs '%s'" % srefs) sname = '' timers = [] for timer in NavigationInstance.instance.RecordTimer.timer_list: if timer.isRunning() and not timer.justplay: timers.append( removeBad(timer.service_ref.getServiceName())) print("[OpenWebif] -D- timer '%s'" % timer.service_ref.getServiceName()) # TODO: more than one recording if len(timers) == 1: sname = timers[0] if sname == '' and s_name != '': sname = s_name print("[OpenWebif] -D- recs count '%d'" % len(recs)) for rec in recs: feinfo = rec.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: cur_info = feinfo.getTransponderData(True) if cur_info: nr = frontendData['tuner_number'] info['tuners'][nr]['rec'] = getOrbitalText( cur_info) + ' / ' + sname service = session.nav.getCurrentService() if service is not None: sname = service.info().getName() feinfo = service.frontendInfo() frontendData = feinfo and feinfo.getAll(True) if frontendData is not None: cur_info = feinfo.getTransponderData(True) if cur_info: nr = frontendData['tuner_number'] info['tuners'][nr]['live'] = getOrbitalText( cur_info) + ' / ' + sname except Exception as error: info['EX'] = error info['timerpipzap'] = False info['timerautoadjust'] = False try: timer = RecordTimerEntry('', 0, 0, '', '', 0) if hasattr(timer, "pipzap"): info['timerpipzap'] = True if hasattr(timer, "autoadjust"): info['timerautoadjust'] = True except Exception as error: print("[OpenWebif] -D- RecordTimerEntry check %s" % error) STATICBOXINFO = info return info
def __init__(self, session): Screen.__init__(self, session) self.skinName = "Standby" self.avswitch = AVSwitch() print "enter standby" if getMachineProcModel() in ('ini-7012'): if path.exists("/proc/stb/lcd/symbol_scrambled"): open("/proc/stb/lcd/symbol_scrambled", "w").write("0") if path.exists("/proc/stb/lcd/symbol_1080p"): open("/proc/stb/lcd/symbol_1080p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_1080i"): open("/proc/stb/lcd/symbol_1080i", "w").write("0") if path.exists("/proc/stb/lcd/symbol_720p"): open("/proc/stb/lcd/symbol_720p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_576i"): open("/proc/stb/lcd/symbol_576i", "w").write("0") if path.exists("/proc/stb/lcd/symbol_576p"): open("/proc/stb/lcd/symbol_576p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_hd"): open("/proc/stb/lcd/symbol_hd", "w").write("0") if path.exists("/proc/stb/lcd/symbol_dolby_audio"): open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0") if path.exists("/proc/stb/lcd/symbol_mp3"): open("/proc/stb/lcd/symbol_mp3", "w").write("0") self["actions"] = ActionMap( [ "StandbyActions" ], { "power": self.Power, "discrete_on": self.Power }, -1) globalActionMap.setEnabled(False) #mute adc self.setMute() if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off setLCDModeMinitTV("0") self.paused_service = None self.prev_running_service = None if self.session.current_dialog: if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS: #get currently playing service reference self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup() #stop actual played dvb-service self.session.nav.stopService() elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES: self.paused_service = self.session.current_dialog self.paused_service.pauseService() #set input to vcr scart if SystemInfo["ScartSwitch"]: self.avswitch.setInput("SCART") else: self.avswitch.setInput("AUX") if (getBrandOEM() in ('fulan')): open("/proc/stb/hdmi/output", "w").write("off") self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose)
def __init__(self, session): Screen.__init__(self, session) self.skinName = "Standby" self.avswitch = AVSwitch() print "enter standby" if getMachineProcModel() in ('ini-7012'): if path.exists("/proc/stb/lcd/symbol_scrambled"): open("/proc/stb/lcd/symbol_scrambled", "w").write("0") if path.exists("/proc/stb/lcd/symbol_1080p"): open("/proc/stb/lcd/symbol_1080p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_1080i"): open("/proc/stb/lcd/symbol_1080i", "w").write("0") if path.exists("/proc/stb/lcd/symbol_720p"): open("/proc/stb/lcd/symbol_720p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_576i"): open("/proc/stb/lcd/symbol_576i", "w").write("0") if path.exists("/proc/stb/lcd/symbol_576p"): open("/proc/stb/lcd/symbol_576p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_hd"): open("/proc/stb/lcd/symbol_hd", "w").write("0") if path.exists("/proc/stb/lcd/symbol_dolby_audio"): open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0") if path.exists("/proc/stb/lcd/symbol_mp3"): open("/proc/stb/lcd/symbol_mp3", "w").write("0") self["actions"] = ActionMap( [ "StandbyActions" ], { "power": self.Power, "discrete_on": self.Power }, -1) globalActionMap.setEnabled(False) self.standbyTimeUnknownTimer = eTimer() #mute adc self.setMute() if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off setLCDModeMinitTV("0") self.paused_service = None self.prev_running_service = None if self.session.current_dialog: if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS: if localtime(time()).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup(): self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup() self.session.nav.stopService() else: self.standbyTimeUnknownTimer.callback.append(self.stopService) self.standbyTimeUnknownTimer.startLongTimer(60) elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES: self.paused_service = self.session.current_dialog self.paused_service.pauseService() if self.session.pipshown: del self.session.pip self.session.pipshown = False #set input to vcr scart if SystemInfo["ScartSwitch"]: self.avswitch.setInput("SCART") else: self.avswitch.setInput("AUX") self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose)
def runScreenTest(): config.misc.startCounter.value += 1 config.misc.startCounter.save() profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD)] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: # FIXME: This is patently wrong. Getting screen/args would have caused an exception, if screensToRun was false session.open(screen, *args) # FIXME: Both lines can probably be deleted. runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") global Screens Screens.Standby.powerKey = power = PowerKey(session) profile("Init:VideoResolutionKey") resolution = VideoResolutionKey(session) if getBoxType() in ('mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone') or getMachineBuild() in ('inihde', 'inihdx'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() runReactor() profile("wakeup") # get currentTime nowTime = time() if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType().startswith('gb') or getMachineProcModel().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%a %d %b %Y %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto()) ) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already start 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%a %d %b %Y %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%a %d %b %Y %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] + 120 # Gigaboxes already start 2 min. before wakeup time else: wptime = startTime[0] # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%a %d %b %Y %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%a %d %b %Y %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
profile("LOAD:InitBar_Components") from Components.ActionMap import HelpableActionMap from Components.config import config from Components.ServiceEventTracker import ServiceEventTracker, InfoBarBase profile("LOAD:HelpableScreen") from Screens.HelpMenu import HelpableScreen from boxbranding import getMachineProcModel brand = getBoxBrand() model = getBoxType() try: procmodel = getBoxProc() except: procmodel = getMachineProcModel() class InfoBar( InfoBarBase, InfoBarShowHide, InfoBarNumberZap, InfoBarChannelSelection, InfoBarMenu, InfoBarEPG, InfoBarRdsDecoder, InfoBarResolutionSelection, InfoBarAspectSelection, InfoBarInstantRecord, InfoBarAudioSelection, InfoBarRedButton, InfoBarTimerButton, InfoBarVmodeButton, HelpableScreen, InfoBarAdditionalInfo, InfoBarNotifications, InfoBarDish, InfoBarUnhandledKey, InfoBarSubserviceSelection, InfoBarTimeshift, InfoBarSeek, InfoBarCueSheetSupport, InfoBarBuffer, InfoBarSummarySupport, InfoBarTimeshiftState, InfoBarTeletextPlugin, InfoBarExtensions, InfoBarPiP, InfoBarPlugins, InfoBarSubtitleSupport, InfoBarServiceErrorPopupSupport, InfoBarJobman, InfoBarZoom, InfoBarPowersaver, InfoBarHDMI, InfoBarHdmi2, InfoBarHotkey, Screen):
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation( config.misc.isNextRecordTimerAfterEventActionAuto.getValue(), config.misc.isNextPowerTimerAfterEventActionAuto.getValue()) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings" ) and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen os.system("rm /media/hdd/images/config/settings") session.open(RestoreScreen, runRestore=True) else: os.system("rm /media/hdd/images/config/settings") screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() == 'odinm9' or getBoxType() == 'ebox5000' or getBoxType( ) == 'ixussone' or getBoxType() == 'ixusszero' or getMachineProcModel( ).startswith('ini-10') or getMachineProcModel().startswith( 'ini-50') or getMachineProcModel().startswith('ini-70'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() runReactor() config.misc.startCounter.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType( ).startswith('gb') or getMachineProcModel().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[ 0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 #if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[ 0] + 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] #if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
from __future__ import print_function import boxbranding print("getMachineBuild=%s<" %boxbranding.getMachineBuild()) print("getMachineProcModel=%s<" %boxbranding.getMachineProcModel()) print("getMachineBrand=%s<" %boxbranding.getMachineBrand()) print("getMachineName=%s<" %boxbranding.getMachineName()) print("getMachineMtdKernel=%s<" %boxbranding.getMachineMtdKernel()) print("getMachineKernelFile=%s<" %boxbranding.getMachineKernelFile()) print("getMachineMtdRoot=%s<" %boxbranding.getMachineMtdRoot()) print("getMachineRootFile=%s<" %boxbranding.getMachineRootFile()) print("getMachineMKUBIFS=%s<" %boxbranding.getMachineMKUBIFS()) print("getMachineUBINIZE=%s<" %boxbranding.getMachineUBINIZE()) print("getBoxType=%s<" %boxbranding.getBoxType()) print("getBrandOEM=%s<" %boxbranding.getBrandOEM()) print("getOEVersion=%s<" %boxbranding.getOEVersion()) print("getDriverDate=%s<" %boxbranding.getDriverDate()) print("getImageVersion=%s<" %boxbranding.getImageVersion()) print("getImageBuild=%s<" %boxbranding.getImageBuild()) print("getImageDistro=%s<" %boxbranding.getImageDistro()) print("getImageFolder=%s<" %boxbranding.getImageFolder()) print("getImageFileSystem=%s<" %boxbranding.getImageFileSystem()) print("getImageDevBuild=%s<" %boxbranding.getImageDevBuild()) print("getImageType=%s<" %boxbranding.getImageType()) print("getMachineMake=%s<" %boxbranding.getMachineMake()) print("getImageArch=%s<" %boxbranding.getImageArch()) print("getFeedsUrl=%s<" %boxbranding.getFeedsUrl()) print("getDisplayType=%s<" %boxbranding.getDisplayType()) print("getHaveHDMI%s<" %boxbranding.getHaveHDMI()) print("getHaveYUV%s<" %boxbranding.getHaveYUV()) print("getHaveRCA%s<" %boxbranding.getHaveRCA()) print("getHaveAVJACK%s<" %boxbranding.getHaveAVJACK())
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) screensToRun = [p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD)] profile("wizards") screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: # FIXME: This is patently wrong. Getting screen/args would have caused an exception, if screensToRun was false session.open(screen, *args) # FIXME: Both lines can probably be deleted. runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() in ('mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone') or getMachineBuild() in ('inihde', 'inihdx'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() # kill showiframe if it is running (sh4 hack...) os.system("killall -9 showiframe") runReactor() config.misc.startCounter.save() profile("wakeup") # get currentTime nowTime = time() if not config.misc.SyncTimeUsing.getValue() == "0" or getBoxType().startswith('gb') or getMachineProcModel().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto()) ) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already start 2 min. before wakeup time else: wptime = startTime[0] - 240 # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] + 120 # Gigaboxes already start 2 min. before wakeup time else: wptime = startTime[0] # if not config.misc.SyncTimeUsing.value == "0" or getBrandOEM() == 'gigablue': # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
# Embedded file name: /usr/lib/enigma2/python/BoxBrandingTest.py import boxbranding print 'getMachineBuild=%s<' % boxbranding.getMachineBuild() print 'getMachineMake=%s<' % boxbranding.getMachineMake() print 'getMachineProcModel=%s<' % boxbranding.getMachineProcModel() print 'getMachineBrand=%s<' % boxbranding.getMachineBrand() print 'getMachineName=%s<' % boxbranding.getMachineName() print 'getMachineMtdKernel=%s<' % boxbranding.getMachineMtdKernel() print 'getMachineKernelFile=%s<' % boxbranding.getMachineKernelFile() print 'getMachineMtdRoot=%s<' % boxbranding.getMachineMtdRoot() print 'getMachineRootFile=%s<' % boxbranding.getMachineRootFile() print 'getMachineMKUBIFS=%s<' % boxbranding.getMachineMKUBIFS() print 'getMachineUBINIZE=%s<' % boxbranding.getMachineUBINIZE() print 'getBoxType=%s<' % boxbranding.getBoxType() print 'getBrandOEM=%s<' % boxbranding.getBrandOEM() print 'getOEVersion=%s<' % boxbranding.getOEVersion() print 'getDriverDate=%s<' % boxbranding.getDriverDate() print 'getImageVersion=%s<' % boxbranding.getImageVersion() print 'getImageBuild=%s<' % boxbranding.getImageBuild() print 'getImageDevBuild=%s<' % boxbranding.getImageDevBuild() print 'getImageType=%s<' % boxbranding.getImageType() print 'getImageDistro=%s<' % boxbranding.getImageDistro() print 'getImageFolder=%s<' % boxbranding.getImageFolder() print 'getImageFileSystem=%s<' % boxbranding.getImageFileSystem() print 'getImageDevBuild=%s<' % boxbranding.getImageDevBuild() print 'getImageType=%s<' % boxbranding.getImageType() print 'getMachineMake=%s<' % boxbranding.getMachineMake() print 'getImageArch=%s<' % boxbranding.getImageArch() print 'getFeedsUrl=%s<' % boxbranding.getFeedsUrl() print 'getDisplayType=%s<' % boxbranding.getDisplayType() print 'getHaveHDMI=%s<' % boxbranding.getHaveHDMI()
def __init__(self, session): Screen.__init__(self, session) self.skinName = "Standby" self.avswitch = AVSwitch() print "enter standby" if getMachineProcModel() in ('ini-7012'): if path.exists("/proc/stb/lcd/symbol_scrambled"): open("/proc/stb/lcd/symbol_scrambled", "w").write("0") if path.exists("/proc/stb/lcd/symbol_1080p"): open("/proc/stb/lcd/symbol_1080p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_1080i"): open("/proc/stb/lcd/symbol_1080i", "w").write("0") if path.exists("/proc/stb/lcd/symbol_720p"): open("/proc/stb/lcd/symbol_720p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_576i"): open("/proc/stb/lcd/symbol_576i", "w").write("0") if path.exists("/proc/stb/lcd/symbol_576p"): open("/proc/stb/lcd/symbol_576p", "w").write("0") if path.exists("/proc/stb/lcd/symbol_hd"): open("/proc/stb/lcd/symbol_hd", "w").write("0") if path.exists("/proc/stb/lcd/symbol_dolby_audio"): open("/proc/stb/lcd/symbol_dolby_audio", "w").write("0") if path.exists("/proc/stb/lcd/symbol_mp3"): open("/proc/stb/lcd/symbol_mp3", "w").write("0") self["actions"] = ActionMap(["StandbyActions"], { "power": self.Power, "discrete_on": self.Power }, -1) globalActionMap.setEnabled(False) #mute adc self.setMute() self.stopService() if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]: # set LCDminiTV off setLCDModeMinitTV("0") elif SystemInfo["Display"] and SystemInfo["LCDMiniTV4k"]: # set LCDminiTV off setLCDModeMinitTV4k("disable") self.paused_service = None self.prev_running_service = None if self.session.current_dialog: if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS: #get currently playing service reference self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup( ) #stop actual played dvb-service self.session.nav.stopService() elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES: self.paused_service = self.session.current_dialog self.paused_service.pauseService() #set input to vcr scart if SystemInfo["ScartSwitch"]: self.avswitch.setInput("SCART") else: self.avswitch.setInput("AUX") gotoShutdownTime = int(config.usage.standby_to_shutdown_timer.value) print "goto deep2" if gotoShutdownTime: print "goto deep3" self.standbyTimeoutTimer = eTimer() self.standbyTimeoutTimer.callback.append(self.standbyTimeout) self.standbyTimeoutTimer.startLongTimer(gotoShutdownTime) if (getBrandOEM() in ('fulan', 'clap') or getBoxType() in ('sf8008')): open("/proc/stb/hdmi/output", "w").write("off") self.onFirstExecBegin.append(self.__onFirstExecBegin) self.onClose.append(self.__onClose)
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop = enigma.getDesktop(0), summary_desktop = enigma.getDesktop(1), navigation = nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings") and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen os.system("rm /media/hdd/images/config/settings") session.open(RestoreScreen, runRestore = True) else: os.system("rm /media/hdd/images/config/settings") screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback(boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) if getBoxType() == 'odinm9' or getBoxType() == 'ebox5000' or getBoxType() == 'ixussone' or getBoxType() == 'ixusszero' or getMachineProcModel().startswith('ini-10') or getMachineProcModel().startswith('ini-50') or getMachineProcModel().startswith('ini-70'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() # kill showiframe if it is running (sh4 hack...) os.system("killall -9 showiframe") runReactor() config.misc.startCounter.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb') or getMachineProcModel().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto',recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[0] + 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime+60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto',PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
# -*- coding: utf-8 -*- from __future__ import print_function import os import time from Tools.CList import CList from Components.SystemInfo import SystemInfo from Components.Console import Console from Components import Task from Tools.StbHardware import getBoxProc from boxbranding import getMachineMtdRoot, getMachineProcModel import re try: hw_type = getBoxProc() except: hw_type = getMachineProcModel() def readFile(filename): file = open(filename) data = file.read().strip() file.close() return data def getProcMounts(): try: mounts = open("/proc/mounts", 'r') except IOError as ex: print("[Harddisk] Failed to open /proc/mounts", ex) return []
def runScreenTest(): config.misc.startCounter.value += 1 profile("readPluginList") plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) profile("Init:Session") nav = Navigation(config.misc.nextWakeup.value) #nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value, config.misc.isNextPowerTimerAfterEventActionAuto.value) session = Session(desktop=enigma.getDesktop(0), summary_desktop=enigma.getDesktop(1), navigation=nav) CiHandler.setSession(session) profile("wizards") screensToRun = [] RestoreSettings = None if os.path.exists("/media/hdd/images/config/settings" ) and config.misc.firstrun.value: if autorestoreLoop(): RestoreSettings = True from Plugins.SystemPlugins.SoftwareManager.BackupRestore import RestoreScreen os.system("rm /media/hdd/images/config/settings") session.open(RestoreScreen, runRestore=True) else: os.system("rm /media/hdd/images/config/settings") screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() else: if os.path.exists("/media/hdd/images/config/autorestore"): os.system('rm -f /media/hdd/images/config/autorestore') screensToRun = [ p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD) ] screensToRun += wizardManager.getWizards() screensToRun.append((100, InfoBar.InfoBar)) screensToRun.sort() print screensToRun enigma.ePythonConfigQuery.setQueryFunc(configfile.getResolvedKey) def runNextScreen(session, screensToRun, *result): config.easysetup = ConfigSubsection() config.easysetup.restart = ConfigBoolean(default=False) if config.easysetup.restart.value == True: print "restart after Wizard2" config.easysetup.restart.setValue(False) config.easysetup.restart.save() enigma.quitMainloop(3) if result: print "[mytest.py] quitMainloop #3" enigma.quitMainloop(*result) return screen = screensToRun[0][1] args = screensToRun[0][2:] if screensToRun: session.openWithCallback( boundFunction(runNextScreen, session, screensToRun[1:]), screen, *args) else: session.open(screen, *args) if not RestoreSettings: runNextScreen(session, screensToRun) profile("Init:VolumeControl") vol = VolumeControl(session) profile("Init:PowerKey") power = PowerKey(session) power.timerstdby() if boxtype in ( 'alien5', 'osninopro', 'osnino', 'osninoplus', 'alphatriple', 'spycat4kmini', 'tmtwin4k', 'mbmicrov2', 'revo4k', 'force3uhd', 'wetekplay', 'wetekplay2', 'wetekhub', 'dm7020hd', 'dm7020hdv2', 'osminiplus', 'osmega', 'sf3038', 'spycat', 'e4hd', 'e4hdhybrid', 'mbmicro', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixusszero', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3', '9910lx', '9911lx', '9920lx') or getBrandOEM() in ('fulan') or getMachineBuild() in ( 'u41', 'dags7362', 'dags73625', 'dags5', 'ustym4kpro', 'sf8008', 'cc1', 'gbmv200'): profile("VFDSYMBOLS") import Components.VfdSymbols Components.VfdSymbols.SymbolsCheck(session) # we need session.scart to access it from within menu.xml session.scart = AutoScartControl(session) profile("Init:Trashcan") import Tools.Trashcan Tools.Trashcan.init(session) profile("Init:AutoVideoMode") import Screens.VideoMode Screens.VideoMode.autostart(session) profile("RunReactor") profile_final() if boxtype in ('sf8', 'classm', 'axodin', 'axodinc', 'starsatlx', 'genius', 'evo'): f = open("/dev/dbox/oled0", "w") f.write('-E2-') f.close() print "lastshutdown=%s (True = last shutdown was OK)" % config.usage.shutdownOK.value print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.value print "bootup action=%s" % config.usage.boot_action.value if not config.usage.shutdownOK.value and not config.usage.shutdownNOK_action.value == 'normal' or not config.usage.boot_action.value == 'normal': print "last shutdown = %s" % config.usage.shutdownOK.value import Screens.PowerLost Screens.PowerLost.PowerLost(session) config.usage.shutdownOK.setValue(False) config.usage.shutdownOK.save() if not RestoreSettings: configfile.save() # kill showiframe if it is running (sh4 hack...) if getMachineBuild() in ('spark', 'spark7162'): os.system("killall -9 showiframe") runReactor() print "[mytest.py] normal shutdown" config.misc.startCounter.save() config.usage.shutdownOK.setValue(True) config.usage.shutdownOK.save() profile("wakeup") #get currentTime nowTime = time() if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith( 'gb') or getMachineProcModel().startswith('ini'): print "dvb time sync disabled... so set RTC now to current linux time!", strftime( "%Y/%m/%d %H:%M", localtime(nowTime)) setRTCtime(nowTime) wakeupList = [ x for x in ( (session.nav.RecordTimer.getNextRecordingTime(), 0, session.nav.RecordTimer.isNextRecordAfterEventActionAuto()), (session.nav.RecordTimer.getNextZapTime(), 1), (plugins.getNextWakeupTime(), 2), (session.nav.PowerTimer.getNextPowerManagerTime(), 3, session.nav.PowerTimer.isNextPowerManagerAfterEventActionAuto())) if x[0] != -1 ] wakeupList.sort() recordTimerWakeupAuto = False if wakeupList and wakeupList[0][1] != 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 270: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[ 0] - 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] - 240 if startTime[1] == 3: nextPluginName = " (%s)" % nextPluginName #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime)) setFPWakeuptime(wptime) recordTimerWakeupAuto = startTime[1] == 0 and startTime[2] print 'recordTimerWakeupAuto', recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto config.misc.isNextRecordTimerAfterEventActionAuto.save() PowerTimerWakeupAuto = False if wakeupList and wakeupList[0][1] == 3: startTime = wakeupList[0] if (startTime[0] - nowTime) < 60: # no time to switch box back on wptime = nowTime + 30 # so switch back on in 30 seconds else: if getBoxType().startswith("gb"): wptime = startTime[ 0] + 120 # Gigaboxes already starts 2 min. before wakeup time else: wptime = startTime[0] #if not config.misc.SyncTimeUsing.value == "0" or getBoxType().startswith('gb'): # print "dvb time sync disabled... so set RTC now to current linux time!", strftime("%Y/%m/%d %H:%M", localtime(nowTime)) # setRTCtime(nowTime) print "set wakeup time to", strftime("%Y/%m/%d %H:%M", localtime(wptime + 60)) setFPWakeuptime(wptime) PowerTimerWakeupAuto = startTime[1] == 3 and startTime[2] print 'PowerTimerWakeupAuto', PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.value = PowerTimerWakeupAuto config.misc.isNextPowerTimerAfterEventActionAuto.save() profile("stopService") session.nav.stopService() profile("nav shutdown") session.nav.shutdown() profile("configfile.save") configfile.save() from Screens import InfoBarGenerics InfoBarGenerics.saveResumePoints() return 0
idx += 1 return idx SystemInfo["NumVideoDecoders"] = getNumVideoDecoders() 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") or getMachineProcModel().startswith("ini-10") or getMachineProcModel().startswith("ini-30") or getMachineProcModel().startswith("ini-50") or getMachineProcModel().startswith("ini-70") SystemInfo["DeepstandbySupport"] = HardwareInfo().has_deepstandby() 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"] = getMachineProcModel().startswith("ini-90") or getBoxType() == "vuultimo" SystemInfo["Blindscan"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Blindscan/plugin.pyo") SystemInfo["Satfinder"] = fileExists("/usr/lib/enigma2/python/Plugins/SystemPlugins/Satfinder/plugin.pyo") SystemInfo["GBWOL"] = fileExists("/usr/bin/gigablue_wol")