示例#1
0
    def save(self):
        for x in self['config'].list:
            if len(x) > 1:
                x[1].save()

        configfile.save()
        self.close()
示例#2
0
文件: plugin.py 项目: kingvuplus/b-p2
 def __init__(self, session):
     Screen.__init__(self, session)
     self['connect'] = MultiPixmap()
     self['connect'].setPixmapNum(0)
     self['lab1'] = Label('')
     self.mylist = ['Libraries',
      'Binaries',
      'Cams',
      'Scripts',
      'Bootlogos',
      'Uninstall files',
      'General Settings',
      'Cron',
      'Settings Channels Bouquets',
      'Openvpn',
      'Satellites Terrestrial',
      'Plugins',
      'END']
     self.mytmppath = '/media/hdd/'
     if fileExists('/etc/bhpersonalbackup'):
         f = open('/etc/bhpersonalbackup', 'r')
         self.mytmppath = f.readline().strip()
         f.close()
     self.mytmppath += 'bhbackuptmp'
     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 + '/usr')
     configfile.save()
	def _saveConfiguration(self):
		epgrefresh.services = (set(self.services[0]), set(self.services[1]))
		epgrefresh.saveConfiguration()

		for x in self["config"].list:
			x[1].save()		
		configfile.save()
示例#4
0
	def save(self):
		for x in self["config"].list:
			x[1].save()
		configfile.save()
		self.createConvertor()
		self.mbox = self.session.open(MessageBox,(_("Configuration is saved")), MessageBox.TYPE_INFO, timeout = 3 )
		self.close()
示例#5
0
	def save(self):
		from Components.PluginComponent import plugins
		plugins.reloadPlugins()
		for i in self["config"].list:
			i[1].save()
		configfile.save()
		self.mbox = self.session.open(MessageBox,(_("configuration is saved")), MessageBox.TYPE_INFO, timeout = 4 )
示例#6
0
    def save(self):
        for x in self["config"].list:
            if len(x) > 1:
                x[1].save()

        configfile.save()
        self.exit()
	def cancel(self):
		global disableHDDread
		if config.plugins.FanControl.LogPath.value[-1:] != "/":
			config.plugins.FanControl.LogPath.value += "/"
		NeuStart = False
		if os.path.exists("/usr/lib/enigma2/python/Components/FanControl.py"):
			if not isDMMdisabled() and config.plugins.FanControl.DisableDMM.value:
				disableDMM()
				NeuStart = True
			if isDMMdisabled() and not config.plugins.FanControl.DisableDMM.value:
				enableDMM()
				NeuStart = True
		if config.plugins.FanControl.CheckHDDTemp.value == "auto" and config.plugins.FanControl.CheckHDDTemp.value != self.HDDmode:
			disableHDDread = True
		if config.plugins.FanControl.MonitorInExtension.value != self.MonitorMode:
			NeuStart = True

		for x in self["config"].list:
			x[1].save()

		if NeuStart:
			configfile.save()
			restartbox = self.session.openWithCallback(self.restartGUI,MessageBox,_("GUI needs a restart to apply the changes.\nDo you want to Restart the GUI now?"), MessageBox.TYPE_YESNO)
			restartbox.setTitle(_("Restart GUI now?"))
		else:
			self.close(False,self.session)
示例#8
0
    def saveAll(self):
        if config.av.videoport.value == 'Scart':
            config.av.autores.setValue('disabled')
        for x in self['config'].list:
            x[1].save()

        configfile.save()
	def save(self):
		for x in self["config"].list:
			x[1].save()

		configfile.save()
		initVFD()
		self.close()
示例#10
0
    def connectDevice(self):
        config.plugins.MetrixConnect.PIN.save()
        config.plugins.MetrixConnect.save()
        configfile.save()
        pin = config.plugins.MetrixConnect.PIN.value
        self['help'].setText(_('Please wait...'))
        try:
            data = metrixCore.connectDevice(pin)
            dom = parseString(data)
            for design in dom.getElementsByTagName('entry'):
                status = str(design.getAttributeNode('status').nodeValue)
                try:
                    username = str(design.getAttributeNode('username').nodeValue)
                    auth_token = str(design.getAttributeNode('auth_token').nodeValue)
                    auth_id = str(design.getAttributeNode('auth_id').nodeValue)
                except:
                    pass

            if status == 'success':
                if username == '':
                    self['help'].setText(_('Accept device and press connect.'))
                else:
                    config.plugins.MetrixConnect.username.value = username
                    config.plugins.MetrixConnect.auth_token.value = auth_id
                    config.plugins.MetrixConnect.auth_id.value = auth_token
                    config.plugins.MetrixConnect.save()
                    configfile.save()
                    self.close()
            elif status == 'error':
                self['help'].setText(_('Error. Verify your PIN!'))
        except Exception as e:
            print '[MyMetrix] ' + str(e)
            traceback.print_exc()
            self['help'].setText(_('Error connecting to OpenStore!'))
示例#11
0
	def pluginsRestore_Finished(self, result, retval, extra_args=None):
		config.misc.restorewizardrun.setValue(True)
		config.misc.restorewizardrun.save()
		configfile.save()
		self.didPluginRestore = True
		self.NextStep = 'reboot'
		self.buildListRef.close(True)
示例#12
0
 def run(self):
     config.osd.dst_left.save()
     config.osd.dst_width.save()
     config.osd.dst_top.save()
     config.osd.dst_height.save()
     configfile.save()
     self.close()
示例#13
0
	def JobStart(self):
		self.selectedFiles = config.backupmanager.backupdirs.value
		if path.exists('/etc/CCcam.cfg') and not '/etc/CCcam.cfg' in self.selectedFiles:
			self.selectedFiles.append('/etc/CCcam.cfg')
		if path.exists('/etc/CCcam.channelinfo') and not '/etc/CCcam.channelinfo' in self.selectedFiles:
			self.selectedFiles.append('/etc/CCcam.channelinfo')
		if path.exists('/etc/CCcam.providers') and not '/etc/CCcam.providers' in self.selectedFiles:
			self.selectedFiles.append('/etc/CCcam.providers')
		if path.exists('/etc/wpa_supplicant.ath0.conf') and '/etc/wpa_supplicant.ath0.conf' not in self.selectedFiles:
			self.selectedFiles.append('/etc/wpa_supplicant.ath0.conf')
		if path.exists('/etc/wpa_supplicant.wlan0.conf') and not '/etc/wpa_supplicant.wlan0.conf' in self.selectedFiles:
			self.selectedFiles.append('/etc/wpa_supplicant.wlan0.conf')
		if path.exists('/etc/auto.network') and not '/etc/auto.network' in self.selectedFiles:
			self.selectedFiles.append('/etc/auto.network')
		if path.exists('/usr/crossepg/crossepg.config') and not '/usr/crossepg/crossepg.config' in self.selectedFiles:
			self.selectedFiles.append('/usr/crossepg/crossepg.config')
		if path.exists('/usr/crossepg/providers') and not '/usr/crossepg/providers' in self.selectedFiles:
			self.selectedFiles.append('/usr/crossepg/providers')
		if path.exists('/usr/lib/sabnzbd') and not '/usr/lib/sabnzbd' in self.selectedFiles:
			self.selectedFiles.append('/usr/lib/sabnzbd')
		if path.exists('/etc/samba') and not '/etc/samba' in self.selectedFiles:
			self.selectedFiles.append('/etc/samba')
		if path.exists('/usr/keys') and not '/etc/CCcam.cfg' in self.selectedFiles:
			self.selectedFiles.append('/usr/keys')

		config.backupmanager.backupdirs.setValue(self.selectedFiles)
		config.backupmanager.backupdirs.save()
		configfile.save()

		try:
			if not path.exists(self.BackupDirectory):
				mkdir(self.BackupDirectory, 0755)
		except Exception, e:
			print str(e)
			print "Device: " + config.backupmanager.backuplocation.value + ", i don't seem to have write access to this device."
示例#14
0
	def apply(self):
		for x in self["config"].list:
			x[1].save()
		configfile.save()
		if self.prev_manual_resolution_ext_menu != config.plugins.autoresolution.manual_resolution_ext_menu.value:
			self.refreshPlugins()
		self.close()
示例#15
0
	def KeyDefault(self):
		for x in self["config"].list:
			if x[0] != 'Encoder':
				x[1].setValue(x[1].default)
				x[1].save()
			configfile.save()
		self.createSetup()
示例#16
0
	def __init__(self):
		if NavigationInstance.instance is not None:
			raise NavigationInstance.instance

		NavigationInstance.instance = self
		self.ServiceHandler = eServiceCenter.getInstance()

		import Navigation as Nav
		Nav.navcore = self

		self.pnav = pNavigation()
		self.pnav.m_event.get().append(self.dispatchEvent)
		self.pnav.m_record_event.get().append(self.dispatchRecordEvent)
		self.event = [ ]
		self.record_event = [ ]
		self.currentlyPlayingServiceReference = None
		self.currentlyPlayingServiceOrGroup = None
		self.currentlyPlayingService = None
		self.RecordTimer = RecordTimer.RecordTimer()
		self.__wasTimerWakeup = getFPWasTimerWakeup()
		startup_to_standby = config.usage.startup_to_standby.value
		wakeup_time_type = config.misc.prev_wakeup_time_type.value
		if self.__wasTimerWakeup:
			RecordTimer.RecordTimerEntry.setWasInDeepStandby()
		if config.misc.RestartUI.value:
			config.misc.RestartUI.value = False
			config.misc.RestartUI.save()
			configfile.save()
		elif startup_to_standby == "yes" or self.__wasTimerWakeup and config.misc.prev_wakeup_time.value and ((wakeup_time_type == 0 or wakeup_time_type == 1) or ( wakeup_time_type == 3 and startup_to_standby == "except")):
			if not Screens.Standby.inTryQuitMainloop:
				Notifications.AddNotification(Screens.Standby.Standby)
		if config.misc.prev_wakeup_time.value:
			config.misc.prev_wakeup_time.value = 0
			config.misc.prev_wakeup_time.save()
			configfile.save()
    def save(self):

        width = int(config.plugins.MyMetrixLiteOther.SkinDesignOLHwidth.value)
        height = int(config.plugins.MyMetrixLiteOther.SkinDesignOLHheight.value)
        posx = int(config.plugins.MyMetrixLiteOther.SkinDesignOLHposx.value)
        posy = int(config.plugins.MyMetrixLiteOther.SkinDesignOLHposy.value)
        if (posx + width) > 1280:
            width = width - (posx + width - 1280)
            config.plugins.MyMetrixLiteOther.SkinDesignOLHwidth.setValue(width)
        if (posy + height) > 720:
            height = height - (posy + height - 720)
            config.plugins.MyMetrixLiteOther.SkinDesignOLHheight.setValue(height)

        width = int(config.plugins.MyMetrixLiteOther.SkinDesignOLVwidth.value)
        height = int(config.plugins.MyMetrixLiteOther.SkinDesignOLVheight.value)
        posx = int(config.plugins.MyMetrixLiteOther.SkinDesignOLVposx.value)
        posy = int(config.plugins.MyMetrixLiteOther.SkinDesignOLVposy.value)
        if (posx + width) > 1280:
            width = width - (posx + width - 1280)
            config.plugins.MyMetrixLiteOther.SkinDesignOLVwidth.setValue(width)
        if (posy + height) > 720:
            height = height - (posy + height - 720)
            config.plugins.MyMetrixLiteOther.SkinDesignOLVheight.setValue(height)

        for x in self["config"].list:
            if len(x) > 1:
                x[1].save()
            else:
                pass

        configfile.save()
        self.exit()
示例#18
0
	def doBackup(self):
		configfile.save()
		try:
			if (path.exists(self.backuppath) == False):
				makedirs(self.backuppath)

# iq [
			self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value )

#			self.backupdirs = ""
#			from os import path as os_path
#			for backupdir in config.plugins.configurationbackup.backupdirs.value:
#				if os_path.exists(backupdir):
#					self.backupdirs = self.backupdirs + " " + backupdir
			self.addSkinToBackupDirs()
# ]
			if path.exists(self.fullbackupfilename):
				dt = str(date.fromtimestamp(stat(self.fullbackupfilename).st_ctime))
				self.newfilename = self.backuppath + "/" + dt + '-' + self.backupfile
				if path.exists(self.newfilename):
					remove(self.newfilename)
				rename(self.fullbackupfilename,self.newfilename)
			if self.finished_cb:
				self.session.openWithCallback(self.finished_cb, Console, title = _("Backup is running..."), cmdlist = ["tar -czvf /tmp/" + self.backupfile + " " + self.backupdirs, "mv /tmp/" + self.backupfile + " " + self.fullbackupfilename, "sync"], finishedCallback = self.backupFinishedCB,closeOnSuccess = True)
			else:
				self.session.open(Console, title = _("Backup is running..."), cmdlist = ["tar -czvf /tmp/" + self.backupfile + " " + self.backupdirs, "mv /tmp/" + self.backupfile + " " + self.fullbackupfilename, "sync"], finishedCallback = self.backupFinishedCB, closeOnSuccess = True)
		except OSError:
			if self.finished_cb:
				self.session.openWithCallback(self.finished_cb, MessageBox, _("Sorry your backup destination is not writeable.\nPlease choose an other one."), MessageBox.TYPE_INFO, timeout = 10 )
			else:
				self.session.openWithCallback(self.backupErrorCB,MessageBox, _("Sorry your backup destination is not writeable.\nPlease choose an other one."), MessageBox.TYPE_INFO, timeout = 10 )
示例#19
0
	def doBackup(self):
		configfile.save()
		try:
			if path.exists(self.backuppath) == False:
				makedirs(self.backuppath)
			self.backupdirs = ' '.join( config.plugins.configurationbackup.backupdirs.value )
			if not "/tmp/installed-list.txt" in self.backupdirs:
				self.backupdirs = self.backupdirs + " /tmp/installed-list.txt"
			if not "/tmp/changed-configfiles.txt" in self.backupdirs:
				self.backupdirs = self.backupdirs + " /tmp/changed-configfiles.txt"

			cmd1 = "opkg list-installed | egrep 'enigma2-plugin-|task-base|packagegroup-base' > /tmp/installed-list.txt"
			cmd2 = "opkg list-changed-conffiles > /tmp/changed-configfiles.txt"
			cmd3 = "tar -czvf " + self.fullbackupfilename + " " + self.backupdirs
			cmd = [cmd1, cmd2, cmd3]
			if path.exists(self.fullbackupfilename):
				dt = str(date.fromtimestamp(stat(self.fullbackupfilename).st_ctime))
				self.newfilename = self.backuppath + "/" + dt + '-' + self.backupfile
				if path.exists(self.newfilename):
					remove(self.newfilename)
				rename(self.fullbackupfilename,self.newfilename)
			if self.finished_cb:
				self.session.openWithCallback(self.finished_cb, Console, title = _("Backup is running..."), cmdlist = cmd,finishedCallback = self.backupFinishedCB,closeOnSuccess = True)
			else:
				self.session.open(Console, title = _("Backup is running..."), cmdlist = cmd,finishedCallback = self.backupFinishedCB, closeOnSuccess = True)
		except OSError:
			if self.finished_cb:
				self.session.openWithCallback(self.finished_cb, MessageBox, _("Sorry, your backup destination is not writeable.\nPlease select a different one."), MessageBox.TYPE_INFO, timeout = 10 )
			else:
				self.session.openWithCallback(self.backupErrorCB,MessageBox, _("Sorry, your backup destination is not writeable.\nPlease select a different one."), MessageBox.TYPE_INFO, timeout = 10 )
示例#20
0
def installPackage(url,force=False,silent=False,id=0,build=0):
	downloadDir = '/tmp/openstore/'
	if not os.path.exists(downloadDir):
		os.makedirs(downloadDir)
	metrixTools.log("Installing package "+url,None,"OpenStore")
	packagefile = metrixTools.downloadFile(url,downloadDir + 'package.ipk',forceOverwrite=True)
	packagename = getPackageName(downloadDir,"package.ipk")
	if force:
		cmdStatus = runCommand("opkg install --force-overwrite '"+packagefile+"'")
	else:
		cmdStatus = runCommand("opkg install '"+packagefile+"'")
	if cmdStatus[0] == True:
		if not id == 0:
			metrixDefaults.cfgset(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id,"id",id)
			try:
				metrixDefaults.cfgset(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id,"name",packagename)
			except:
				pass
			metrixDefaults.cfgset(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id,"build",build)
			metrixDefaults.cfgset(metrixDefaults.CONFIG_INSTALLEDPACKAGES,id,"url",url)
		config.plugins.MetrixUpdater.Reboot.value = 1
		config.plugins.MetrixUpdater.save()    
		configfile.save()
		if not silent:
			metrixConnector.showInfo(_("Package successfully installed!"))
		return True
	else:
		if not silent:
			metrixConnector.showInfo(_("Error installing Package!"),MessageBox.TYPE_ERROR)
		return False
	if os.path.exists(downloadDir):
		os.removedirs(downloadDir)
	syncPackages()
示例#21
0
文件: mytest.py 项目: OpenDMM/enigma2
	def doInstantiateDialog(self, screen, arguments, kwargs, desktop):
		# create dialog
		z = None
		if "zPosition" in kwargs:
			z = kwargs["zPosition"]
			del kwargs["zPosition"]
		try:
			dlg = self.create(screen, arguments, **kwargs)
		except Exception as e:
			print 'EXCEPTION IN DIALOG INIT CODE, ABORTING:'
			print '-'*60
			print_exc(file=stdout)
			if isinstance(e, SkinError):
				print "SKIN ERROR", e
				print "defaulting to standard skin..."
				config.skin.primary_skin.value = "skin.xml"
				config.skin.primary_skin.save()
				configfile.save()
			quitMainloop(5)
			print '-'*60

		if dlg is None:
			return

		# read skin data
		readSkin(dlg, None, dlg.skinName, desktop)

		# create GUI view of this dialog
		assert desktop is not None
		if z != None:
			dlg.setZPosition(z)
		dlg.setDesktop(desktop)
		dlg.applySkin()

		return dlg
示例#22
0
    def close_archive_screen(self):
        if not config.plugins.archivCZSK.preload.getValue():
            self.__addons.clear()
            self.__repositories.clear()
            ArchivCZSK.__loaded = False

        # We dont need worker thread anymore so we stop it
        Task.stopWorkerThread()

        # finally save all cfg changes - edit by shamman
        configfile.save()

        # clear tmp content by shamman
        filelist = [ f for f in os.listdir("/tmp") if f.endswith(".url") ]
        for f in filelist:
            try:
                os.remove(os.path.join('/tmp', f))
            except OSError:
                continue
        filelist = [ f for f in os.listdir("/tmp") if f.endswith(".png") ]
        for f in filelist:
            try:
                os.remove(os.path.join('/tmp', f))
            except OSError:
                continue
        shutil.rmtree("/tmp/archivCZSK", True)

        if config.plugins.archivCZSK.clearMemory.getValue():
            try:
                with open("/proc/sys/vm/drop_caches", "w") as f:
                    f.write("1")
            except IOError as e:
                print 'cannot drop caches : %s' % str(e)
示例#23
0
	def __init__(self):
		if NavigationInstance.instance is not None:
			raise NavigationInstance.instance

		NavigationInstance.instance = self
		self.ServiceHandler = eServiceCenter.getInstance()

		import Navigation as Nav
		Nav.navcore = self

		self.pnav = pNavigation()
		self.pnav.m_event.get().append(self.dispatchEvent)
		self.pnav.m_record_event.get().append(self.dispatchRecordEvent)
		self.event = [ ]
		self.record_event = [ ]
		self.currentlyPlayingServiceReference = None
		self.currentlyPlayingServiceOrGroup = None
		self.currentlyPlayingService = None
		self.RecordTimer = RecordTimer.RecordTimer()
		self.__wasTimerWakeup = getFPWasTimerWakeup()
		if self.__wasTimerWakeup:
			RecordTimer.RecordTimerEntry.setWasInDeepStandby()
		if config.misc.RestartUI.value:
			config.misc.RestartUI.value = False
			config.misc.RestartUI.save()
			configfile.save()
		elif config.usage.startup_to_standby.value or self.__wasTimerWakeup:
			Notifications.AddNotification(Screens.Standby.Standby)
 def platformDetect(self):
     printDBG("IPTVSetupImpl.platformDetect")
     self.setInfo(_("Detection of the platform."), _("Plugin can be run on one of the following platforms: sh4, mipsel, i686, arm."))
     if 'j00zekFork' in globals():
         from Plugins.Extensions.IPTVPlayer.j00zekScripts.j00zekToolSet import getPlatform
         platform = getPlatform()
         if platform != 'unknown':
             self.platform = platform
             config.plugins.iptvplayer.plarform.value = self.platform
             printDBG("IPTVSetupImpl.j00zekFork platform[%s]" % self.platform)
             config.plugins.iptvplayer.plarform.save()
             configfile.save()
             self.setOpenSSLVersion()
             return
     cmdTabs = []
     for platform in self.supportedPlatforms:
         platformtesterPath = resolveFilename(SCOPE_PLUGINS, "Extensions/IPTVPlayer/bin/%s/platformtester" % platform)
         try: os_chmod(platformtesterPath, 0777)
         except: printExc()
         cmdTabs.append(platformtesterPath + "  2>&1 ")
     def _platformValidator(code, data):
         printDBG("IPTVSetupImpl._platformValidator")
         if "Test platform OK" in data: return True,False
         else: return False,True
     self.workingObj = CCmdValidator(self.platformDetectFinished, _platformValidator, cmdTabs)
     self.workingObj.start()
示例#25
0
	def keyGo(self):
		if self.content:
			for token in self.content:
				if(token[0] == "bitrate"):
					token[1] = str(int(config.plugins.transcodingsetup.bitrate.value) / 1000)

				if(token[0] == "size"):
					if config.plugins.transcodingsetup.resolution.value == "720x480":
						token[1] = "480p"
					elif config.plugins.transcodingsetup.resolution.value == "720x576":
						token[1] = "576p"
					elif config.plugins.transcodingsetup.resolution.value == "1280x720":
						token[1] = "720p"

			try:
				f = open(TRANSCODING_CONFIG, "w")
				for token in self.content:
					f.write("%s = %s\n" % (token[0], token[1]))
				f.close()
			except:
				pass

		config.plugins.transcodingsetup.port.save()
		config.plugins.transcodingsetup.bitrate.save()
		config.plugins.transcodingsetup.resolution.save()
		config.plugins.transcodingsetup.framerate.save()
		config.plugins.transcodingsetup.aspectratio.save()
		config.plugins.transcodingsetup.interlaced.save()
		if SystemInfo["HasH265Encoder"]:
			config.plugins.transcodingsetup.vcodec.save()
		configfile.save()

		self.close()
 def changePin(self, pin = None, start = False):
     # 'PUT_OLD_PIN', 'PUT_NEW_PIN', 'CONFIRM_NEW_PIN'
     if True == start:
         self.changingPinState = 'PUT_OLD_PIN'
         self.session.openWithCallback(self.changePin, IPTVPinWidget, title=_("Enter old pin"))
     else:
         if pin == None: return
         if 'PUT_OLD_PIN' == self.changingPinState:
             if pin == config.plugins.iptvplayer.pin.value:
                 self.changingPinState = 'PUT_NEW_PIN'
                 self.session.openWithCallback(self.changePin, IPTVPinWidget, title=_("Enter new pin"))
             else:
                 self.session.open(MessageBox, _("Pin incorrect!"), type=MessageBox.TYPE_INFO, timeout=5)
         elif 'PUT_NEW_PIN' == self.changingPinState:
             self.newPin = pin
             self.changingPinState = 'CONFIRM_NEW_PIN'
             self.session.openWithCallback(self.changePin, IPTVPinWidget, title=_("Confirm new pin"))
         elif 'CONFIRM_NEW_PIN' == self.changingPinState:
             if self.newPin == pin:
                 config.plugins.iptvplayer.pin.value = pin
                 config.plugins.iptvplayer.pin.save()
                 configfile.save()
                 self.session.open(MessageBox, _("Pin has been changed."), type=MessageBox.TYPE_INFO, timeout=5)
             else:
                 self.session.open(MessageBox, _("Confirmation error."), type=MessageBox.TYPE_INFO, timeout=5)
示例#27
0
 def keySave(self):
     config.misc.remotecontrol_text_support.save()
     configfile.save()
     if self.codestartup != config.plugins.remotecontrolcode.systemcode.value:
         print "<RemoteControlCode> Selected System Code : ", config.plugins.remotecontrolcode.systemcode.value
         ret = self.setSystemCode(int(config.plugins.remotecontrolcode.systemcode.value))
         if ret == -1:
             self.restoreCode()
             self.session.openWithCallback(
                 self.close, MessageBox, _("FILE NOT EXIST : /proc/stb/fp/remote_code"), MessageBox.TYPE_ERROR
             )
         else:
             self.session.openWithCallback(
                 self.MessageBoxConfirmCodeCallback,
                 MessageBoxConfirmCode,
                 _("Please change your remote mode")
                 + "\n"
                 + _("Press and hold '2' & '7' until red LED is solid, then press 'Help', then press '000")
                 + config.plugins.remotecontrolcode.systemcode.value
                 + "'\n"
                 + _("Then choose 'Keep' within seconds"),
                 MessageBox.TYPE_YESNO,
                 timeout=60,
                 default=False,
             )
     else:
         self.close()
示例#28
0
文件: Menu.py 项目: Huevos/enigma2
 def menuClosedWithConfigFlush(self, *res):
     global menu_path
     menu_path = ""
     global full_menu_path
     full_menu_path = ""
     configfile.save()
     self.menuClosed(*res)
示例#29
0
	def run(self):
		if self.avahiselect.value == "ip":
			config.usage.remote_fallback.value = "http://%d.%d.%d.%d:%d" % (tuple(self.ip.value) + (self.port.value,))
		elif self.avahiselect.value != "url":
			config.usage.remote_fallback.value = self.avahiselect.value
		if self.avahiselect_seperate.value == "ip":
			config.usage.remote_fallback_import_url.value = "http://%d.%d.%d.%d:%d" % (tuple(self.ip_seperate.value) + (self.port_seperate.value,))
		elif self.avahiselect_seperate.value == "same":
			config.usage.remote_fallback_import_url.value = ""
		elif self.avahiselect_seperate.value != "url":
			config.usage.remote_fallback_import_url.value = self.avahiselect_seperate.value
		if config.usage.remote_fallback_import_url.value == config.usage.remote_fallback.value:
			config.usage.remote_fallback_import_url.value = ""
		config.usage.remote_fallback_enabled.save()
		config.usage.remote_fallback_import.save()
		config.usage.remote_fallback_import_url.save()
		config.usage.remote_fallback_import_restart.save()
		config.usage.remote_fallback_import_standby.save()
		config.usage.remote_fallback_extension_menu.save()
		config.usage.remote_fallback_ok.save()
		config.usage.remote_fallback_nok.save()
		config.usage.remote_fallback.save()
		config.usage.remote_fallback_external_timer.save()
		config.usage.remote_fallback_openwebif_customize.save()
		config.usage.remote_fallback_openwebif_userid.save()
		config.usage.remote_fallback_openwebif_password.save()
		config.usage.remote_fallback_openwebif_port.save()
		configfile.save()
		if not self.remote_fallback_prev and config.usage.remote_fallback_import.value:
			ImportChannels()
		self.close(False)
示例#30
0
    def saveAll(self):
        for x in self['config'].list:
            x[1].save()

        configfile.save()
        if config.pluginfilter.userfeed.value != 'http://':
            CreateFeedConfig()
示例#31
0
 def saveAndReloadNimConfig(self):
     config.Nims[self.feid].save()
     configfile.save()
     configfile.load()
     nimmanager.sec.update()
示例#32
0
 def saveAll(self):
     for x in self["config"].list:
         x[1].save()
     configfile.save()
     if config.pluginfilter.userfeed.getValue() != "http://":
         CreateFeedConfig()
示例#33
0
def runScreenTest():
    config.misc.startCounter.value += 1

    profile("readPluginList")
    plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))

    profile("Init:Session")
    nav = Navigation()
    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)

    #	eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number
    #		,(	["1:0:1:24:4:85:C00000:0:0:0:"], #service_list
    #			["PREMIERE"], #provider_list,
    #			[] #caid_list
    #		));

    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)

    config.misc.epgcache_filename.addNotifier(setEPGCachePath)

    runNextScreen(session, screensToRun)

    profile("Init:VolumeControl")
    vol = VolumeControl(session)
    profile("Init:PowerKey")
    power = PowerKey(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("RunReactor")
    profile_final()
    runReactor()

    config.misc.startCounter.save()

    profile("wakeup")
    from time import time, strftime, localtime
    from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime
    #get currentTime
    nowTime = time()
    wakeupList = [
        x for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0),
                    (session.nav.RecordTimer.getNextZapTime(isWakeup=True),
                     1), (plugins.getNextWakeupTime(), 2)) if x[0] != -1
    ]
    wakeupList.sort()
    if wakeupList:
        from time import strftime
        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:
            wptime = startTime[0] - 240
        if not config.misc.useTransponderTime.value:
            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)

    profile("stopService")
    session.nav.stopService()
    profile("nav shutdown")
    session.nav.shutdown()

    profile("configfile.save")
    configfile.save()
    from Screens import InfoBarGenerics
    InfoBarGenerics.saveResumePoints()

    return 0
示例#34
0
 def keyGo(self):
     for x in self["config"].list:
         x[1].save()
     configfile.save()
     self.close()
示例#35
0
 def saveAll(self):
     for x in self["config"].list:
         x[1].save()
     configfile.save()
示例#36
0
def runScreenTest():
	config.misc.startCounter.value += 1

	profile("readPluginList")
	plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))

	profile("Init:Session")
	nav = Navigation(config.misc.nextWakeup.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
			session.open(RestoreScreen, runRestore = True)
		else:
			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 boxtype in ('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') or getBrandOEM() in ('fulan') or getMachineBuild() in ('dags7362' , 'dags73625', 'dags5'):
		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)

	if not RestoreSettings:
		config.usage.shutdownOK.setValue(False)
		config.usage.shutdownOK.save()
		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 getBrandOEM() == 'gigablue':
	if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().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)

	#recordtimer
	if session.nav.isRecordTimerImageStandard:	#check RecordTimer instance
		tmp = session.nav.RecordTimer.getNextRecordingTime(getNextStbPowerOn = True)
		nextRecordTime = tmp[0]
		nextRecordTimeInStandby = tmp[1]
	else:
		nextRecordTime = session.nav.RecordTimer.getNextRecordingTime()
		nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto()
	#zaptimer
	nextZapTime = session.nav.RecordTimer.getNextZapTime()
	nextZapTimeInStandby = 0
	#powertimer
	tmp = session.nav.PowerTimer.getNextPowerManagerTime(getNextStbPowerOn = True)
	nextPowerTime = tmp[0]
	nextPowerTimeInStandby = tmp[1]
	#plugintimer
	tmp = plugins.getNextWakeupTime(getPluginIdent = True)
	nextPluginTime = tmp[0]
	nextPluginIdent = tmp[1] #"pluginname | pluginfolder"
	tmp = tmp[1].lower()
	#start in standby, depending on plugin type
	if "epgrefresh" in tmp:
		nextPluginName = "EPGRefresh"
		nextPluginTimeInStandby = 1
	elif "vps" in tmp:
		nextPluginName = "VPS"
		nextPluginTimeInStandby = 1
	elif "serienrecorder" in tmp:
		nextPluginName = "SerienRecorder"
		nextPluginTimeInStandby = 0 # plugin function for deep standby from standby not compatible (not available)
	elif "elektro" in tmp:
		nextPluginName = "Elektro"
		nextPluginTimeInStandby = 1
	elif "minipowersave" in tmp:
		nextPluginName = "MiniPowersave"
		nextPluginTimeInStandby = 1
	elif "enhancedpowersave" in tmp:
		nextPluginName = "EnhancedPowersave"
		nextPluginTimeInStandby = 1
	else:
		#default for plugins
		nextPluginName = nextPluginIdent
		nextPluginTimeInStandby = 0

	wakeupList = [
		x for x in ((nextRecordTime, 0, nextRecordTimeInStandby),
					(nextZapTime, 1, nextZapTimeInStandby),
					(nextPowerTime, 2, nextPowerTimeInStandby),
					(nextPluginTime, 3, nextPluginTimeInStandby))
		if x[0] != -1
	]
	wakeupList.sort()

	print "="*100
	if wakeupList and wakeupList[0][0] > 0:
		startTime = wakeupList[0]
		# wakeup time before timer begins
		wptime = startTime[0] - (config.workaround.wakeuptime.value * 60)
		if (wptime - nowTime) < 120: # no time to switch box back on
			wptime = int(nowTime) + 120  # so switch back on in 120 seconds

		#check for plugin-, zap- or power-timer to enable the 'forced' record-timer wakeup
		forceNextRecord = 0
		setStandby = startTime[2]
		if startTime[1] != 0 and nextRecordTime > 0:
			#when next record starts in 15 mins
			if abs(nextRecordTime - startTime[0]) <= 900:
				setStandby = forceNextRecord = 1
			#by vps-plugin
			elif startTime[1] == 3 and nextPluginName == "VPS":
				setStandby = forceNextRecord = 1

		if startTime[1] == 3:
			nextPluginName = " (%s)" % nextPluginName
		else:
			nextPluginName = ""
		print "[mytest.py] set next wakeup type to '%s'%s %s" % ({0:"record-timer",1:"zap-timer",2:"power-timer",3:"plugin-timer"}[startTime[1]], nextPluginName, {0:"and starts normal",1:"and starts in standby"}[setStandby])
		if forceNextRecord:
			print "[mytest.py] set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag"
		print "[mytest.py] set next wakeup time to", strftime("%a, %Y/%m/%d %H:%M:%S", localtime(wptime))
		#set next wakeup
		setFPWakeuptime(wptime)
		#set next standby only after shutdown in deep standby
		if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45:
			setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec (not for plugin-timer, here is no standby), 1=standby, 2=no standby, when before was not in deep-standby
		config.misc.nextWakeup.value = "%d,%d,%d,%d,%d,%d" % (wptime,startTime[0],startTime[1],setStandby,nextRecordTime,forceNextRecord)
	else:
		config.misc.nextWakeup.value = "-1,-1,0,0,-1,0"
		if not boxtype.startswith('azboxm'): #skip for Azbox (mini)ME - setting wakeup time to past reboots box 
			setFPWakeuptime(int(nowTime) - 3600) #minus one hour -> overwrite old wakeup time
		print "[mytest.py] no set next wakeup time"
	config.misc.nextWakeup.save()
	print "="*100

	profile("stopService")
	session.nav.stopService()
	profile("nav shutdown")
	session.nav.shutdown()

	profile("configfile.save")
	configfile.save()
	from Screens import InfoBarGenerics
	InfoBarGenerics.saveResumePoints()

	return 0
示例#37
0
	def saveAll(self):
		if config.av.videoport.value == 'Scart':
			config.av.autores.setValue('disabled')
		for x in self["config"].list:
			x[1].save()
		configfile.save()
示例#38
0
 def markDone(self):
     self.hw.saveMode(self.port, self.mode, self.rate)
     config.misc.videowizardenabled.value = 0
     config.misc.videowizardenabled.save()
     configfile.save()
示例#39
0
 def save(self):
     config.plugins.MyMetrix.Color.save()
     configfile.save()
     self.close()
示例#40
0
	def Save_Settings2(self, cam_name):
		#// Save Came Name to Settings file
		config.softcam.actCam2.setValue(cam_name)
		config.softcam.save()
		configfile.save()
示例#41
0
	def saveConfig(self):
		self.config.save()
		configfile.save()
		for f in self.onConfigChanged:
			f()
示例#42
0
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:
            session.open(screen, *args)

    runNextScreen(session, screensToRun)

    profile("Init:VolumeControl")
    vol = VolumeControl(session)
    profile("Init:PowerKey")
    power = PowerKey(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()
    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 getBrandOEM() == 'gigablue':
                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 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 getBrandOEM() == 'gigablue':
                wptime = startTime[
                    0] + 120  # Gigaboxes already starts 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
示例#43
0
 def markDone(self):
     config.misc.videowizardenabled.value = 0
     config.misc.videowizardenabled.save()
     configfile.save()
示例#44
0
 def saveSelection(self):
     self.selectedFiles = self["list"].getSelectedList()
     self.previouslySent = self["list"].getSelectedList()
     config.logmanager.sentfiles.setValue(self.selectedFiles)
     config.logmanager.sentfiles.save()
     configfile.save()
 def restartSTB(self):
     configfile.save()
     self.session.open(EosCamManager)
     self.close()
示例#46
0
 def mergeConfig(self, directory, name, merge=True):
     if os.path.isfile(directory + name):
         config.loadFromFile(directory + name, base_file=False)
         configfile.save()
     self.installNext()
示例#47
0
	def saveUpdateAvailable(self, product):
		config.plugins.MetrixUpdater.UpdateAvailable.value = 1
		config.plugins.MetrixUpdater.save()    
		configfile.save()
示例#48
0
 def buildList(self, action):
     if self.NextStep is 'reboot':
         quitMainloop(2)
     elif self.NextStep is 'settingsquestion' or self.NextStep is 'settingsrestore' or self.NextStep is 'pluginsquestion' or self.NextStep is 'pluginsrestoredevice' or self.NextStep is 'end' or self.NextStep is 'noplugins':
         self.buildListfinishedCB(False)
     elif self.NextStep is 'settingrestorestarted':
         self.Console.ePopen(
             "tar -xzvf " + self.fullbackupfilename +
             " tmp/ExtraInstalledPlugins tmp/backupkernelversion tmp/backupimageversion -C /",
             self.settingsRestore_Started)
         self.buildListRef = self.session.openWithCallback(
             self.buildListfinishedCB,
             MessageBox,
             _("Please wait while the system gathers information..."),
             type=MessageBox.TYPE_INFO,
             enable_input=False,
             wizard=True)
         self.buildListRef.setTitle(_("Restore wizard"))
     elif self.NextStep is 'plugindetection':
         print '[RestoreWizard] Stage 2: Restoring plugins'
         self.Console.ePopen(
             "tar -xzvf " + self.fullbackupfilename +
             " tmp/ExtraInstalledPlugins tmp/backupkernelversion tmp/backupimageversion -C /",
             self.pluginsRestore_Started)
         self.buildListRef = self.session.openWithCallback(
             self.buildListfinishedCB,
             MessageBox,
             _("Please wait while the system gathers information..."),
             type=MessageBox.TYPE_INFO,
             enable_input=False,
             wizard=True)
         self.buildListRef.setTitle(_("Restore wizard"))
     elif self.NextStep is 'pluginrestore':
         if self.feeds == 'OK':
             print '[RestoreWizard] Stage 6: Feeds OK, Restoring Plugins'
             print '[RestoreWizard] Console command: ', 'opkg install ' + self.pluginslist + ' ' + self.pluginslist2
             self.Console.ePopen(
                 "opkg install " + self.pluginslist + ' ' +
                 self.pluginslist2, self.pluginsRestore_Finished)
             self.buildListRef = self.session.openWithCallback(
                 self.buildListfinishedCB,
                 MessageBox,
                 _("Please wait while plugins restore completes..."),
                 type=MessageBox.TYPE_INFO,
                 enable_input=False,
                 wizard=True)
             self.buildListRef.setTitle(_("Restore wizard"))
         elif self.feeds == 'DOWN':
             print '[RestoreWizard] Stage 6: Feeds Down'
             config.misc.restorewizardrun.setValue(True)
             config.misc.restorewizardrun.save()
             configfile.save()
             self.didPluginRestore = True
             self.NextStep = 'reboot'
             self.buildListRef = self.session.openWithCallback(
                 self.buildListfinishedCB,
                 MessageBox,
                 _("Sorry the feeds are down for maintenance. Please try using Backup manager to restore plugins later."
                   ),
                 type=MessageBox.TYPE_INFO,
                 timeout=30,
                 wizard=True)
             self.buildListRef.setTitle(_("Restore wizard"))
         elif self.feeds == 'BAD':
             print '[RestoreWizard] Stage 6: No Network'
             config.misc.restorewizardrun.setValue(True)
             config.misc.restorewizardrun.save()
             configfile.save()
             self.didPluginRestore = True
             self.NextStep = 'reboot'
             self.buildListRef = self.session.openWithCallback(
                 self.buildListfinishedCB,
                 MessageBox,
                 _("Your %s %s is not connected to the Internet. Please try using Backup manager to restore plugins later."
                   ) % (getMachineBrand(), getMachineName()),
                 type=MessageBox.TYPE_INFO,
                 timeout=30,
                 wizard=True)
             self.buildListRef.setTitle(_("Restore wizard"))
         elif self.feeds == 'ERROR':
             self.NextStep = 'pluginrestore'
             self.buildListRef = self.session.openWithCallback(
                 self.buildListfinishedCB,
                 MessageBox,
                 _("A background update check is in progress, please try again."
                   ),
                 type=MessageBox.TYPE_INFO,
                 timeout=10,
                 wizard=True)
             self.buildListRef.setTitle(_("Restore wizard"))
示例#49
0
	def menuClosedWithConfigFlush(self, *res):
		configfile.save()
		self.menuClosed(*res)
示例#50
0
文件: mytest.py 项目: oostende/egami3
def runScreenTest():
    config.misc.startCounter.value += 1
    config.misc.startCounter.save()
    if config.usage.async_plug_load.value and os.path.isfile(
            '/usr/lib/enigma2/python/Plugins/SystemPlugins/EGAMIPluginSpeedUp/plugin.pyo'
    ):
        profile('readBaseList')
        plugins.loadBasePlugins(resolveFilename(SCOPE_PLUGINS))
    else:
        profile('readPluginList')
        enigma.pauseInit()
        plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
        enigma.resumeInit()
    profile('Init:Session')
    nav = Navigation(config.misc.nextWakeup.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:
            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)

    runNextScreen(session, screensToRun)
    profile('Init:VolumeControl')
    vol = VolumeControl(session)
    profile('Init:PowerKey')
    power = PowerKey(session)
    if boxtype in (
            'ustym4kpro', 'sf8008', 'clap4k', '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 (
                'dags7362', 'dags73625', 'dags5'):
        profile('VFDSYMBOLS')
        import Components.VfdSymbols
        Components.VfdSymbols.SymbolsCheck(session)
    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\t\t(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()
    configfile.save()
    runReactor()
    print '[mytest.py] normal shutdown'
    config.misc.startCounter.save()
    config.usage.shutdownOK.setValue(True)
    config.usage.shutdownOK.save()
    profile('wakeup')
    nowTime = time()
    if not config.misc.SyncTimeUsing.value == '0' or boxtype.startswith(
            'gb') or getBrandOEM().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)
    if session.nav.isRecordTimerImageStandard:
        tmp = session.nav.RecordTimer.getNextRecordingTime(
            getNextStbPowerOn=True)
        nextRecordTime = tmp[0]
        nextRecordTimeInStandby = tmp[1]
    else:
        nextRecordTime = session.nav.RecordTimer.getNextRecordingTime()
        nextRecordTimeInStandby = session.nav.RecordTimer.isNextRecordAfterEventActionAuto(
        )
    nextZapTime = session.nav.RecordTimer.getNextZapTime()
    nextZapTimeInStandby = 0
    tmp = session.nav.PowerTimer.getNextPowerManagerTime(
        getNextStbPowerOn=True)
    nextPowerTime = tmp[0]
    nextPowerTimeInStandby = tmp[1]
    tmp = plugins.getNextWakeupTime(getPluginIdent=True)
    nextPluginTime = tmp[0]
    nextPluginIdent = tmp[1]
    tmp = tmp[1].lower()
    if 'epgrefresh' in tmp:
        nextPluginName = 'EPGRefresh'
        nextPluginTimeInStandby = 1
    elif 'vps' in tmp:
        nextPluginName = 'VPS'
        nextPluginTimeInStandby = 1
    elif 'serienrecorder' in tmp:
        nextPluginName = 'SerienRecorder'
        nextPluginTimeInStandby = 0
    elif 'elektro' in tmp:
        nextPluginName = 'Elektro'
        nextPluginTimeInStandby = 1
    elif 'minipowersave' in tmp:
        nextPluginName = 'MiniPowersave'
        nextPluginTimeInStandby = 1
    elif 'enhancedpowersave' in tmp:
        nextPluginName = 'EnhancedPowersave'
        nextPluginTimeInStandby = 1
    else:
        nextPluginName = nextPluginIdent
        nextPluginTimeInStandby = 0
    wakeupList = [
        x for x in ((nextRecordTime, 0, nextRecordTimeInStandby),
                    (nextZapTime, 1, nextZapTimeInStandby),
                    (nextPowerTime, 2, nextPowerTimeInStandby),
                    (nextPluginTime, 3, nextPluginTimeInStandby)) if x[0] != -1
    ]
    wakeupList.sort()
    print '=' * 100
    if wakeupList and wakeupList[0][0] > 0:
        startTime = wakeupList[0]
        wptime = startTime[0] - config.workaround.wakeuptime.value * 60
        if wptime - nowTime < 120:
            wptime = int(nowTime) + 120
        forceNextRecord = 0
        setStandby = startTime[2]
        if startTime[1] != 0 and nextRecordTime > 0:
            if abs(nextRecordTime - startTime[0]) <= 900:
                setStandby = forceNextRecord = 1
            elif startTime[1] == 3 and nextPluginName == 'VPS':
                setStandby = forceNextRecord = 1
        if startTime[1] == 3:
            nextPluginName = ' (%s)' % nextPluginName
        else:
            nextPluginName = ''
        print "[mytest.py] set next wakeup type to '%s'%s %s" % (
            {
                0: 'record-timer',
                1: 'zap-timer',
                2: 'power-timer',
                3: 'plugin-timer'
            }[startTime[1]], nextPluginName, {
                0: 'and starts normal',
                1: 'and starts in standby'
            }[setStandby])
        if forceNextRecord:
            print "[mytest.py] set from 'vps-plugin' or just before a 'record-timer' starts, set 'record-timer' wakeup flag"
        print '[mytest.py] set next wakeup time to', strftime(
            '%a, %Y/%m/%d %H:%M:%S', localtime(wptime))
        setFPWakeuptime(wptime)
        if Screens.Standby.quitMainloopCode != 1 and Screens.Standby.quitMainloopCode != 45:
            setStandby = 2
        config.misc.nextWakeup.value = '%d,%d,%d,%d,%d,%d,%d' % (
            int(nowTime), wptime, startTime[0], startTime[1], setStandby,
            nextRecordTime, forceNextRecord)
    else:
        config.misc.nextWakeup.value = '%d,-1,-1,0,0,-1,0' % int(nowTime)
        if not boxtype.startswith('azboxm'):
            setFPWakeuptime(int(nowTime) - 3600)
        print '[mytest.py] no set next wakeup time'
    config.misc.nextWakeup.save()
    print '=' * 100
    profile('stopService')
    session.nav.stopService()
    profile('nav shutdown')
    session.nav.shutdown()
    profile('configfile.save')
    configfile.save()
    from Screens import InfoBarGenerics
    InfoBarGenerics.saveResumePoints()
    return 0
示例#51
0
    def backupsettings(self, retval):

        if retval:

            if SystemInfo["canMultiBoot"]:
                self.multibootslot = retval[0]
                doBackup = retval[1] == "with backup"
            else:
                doBackup = retval == "with backup"

            BACKUP_SCRIPT = "/usr/lib/enigma2/python/Plugins/Extensions/AutoBackup/settings-backup.sh"

            def findmedia(destination):
                def avail(path):
                    if not (SystemInfo["HasMMC"]
                            and '/mmc' in path) and not os.path.islink(path):
                        try:
                            statvfs = os.statvfs(path)
                            return (statvfs.f_bavail * statvfs.f_frsize) / (
                                1 << 20) >= 500 and path
                        except:
                            pass

                for path in [destination] + getNonNetworkMediaMounts():
                    if avail(path):
                        return path

            self.destination = findmedia(
                os.path.isfile(BACKUP_SCRIPT)
                and config.plugins.autobackup.where.value or "/media/hdd")

            if self.destination:

                destination = "/".join([self.destination, 'downloaded_images'])
                self.zippedimage = "://" in self.source and "/".join(
                    [destination, self.imagename]) or self.source
                self.unzippedimage = "/".join(
                    [destination,
                     '%s.unzipped' % self.imagename[:-4]])

                if os.path.isfile(destination):
                    os.remove(destination)
                if not os.path.isdir(destination):
                    os.mkdir(destination)

                if doBackup:
                    if os.path.isfile(BACKUP_SCRIPT):
                        self["info"].setText(
                            _("Backing up to: %s") % self.destination)
                        configfile.save()
                        if config.plugins.autobackup.epgcache.value:
                            eEPGCache.getInstance().save()
                        self.containerbackup = Console()
                        self.containerbackup.ePopen(
                            "%s%s'%s' %s" %
                            (BACKUP_SCRIPT,
                             config.plugins.autobackup.autoinstall.value
                             and " -a " or " ", self.destination,
                             int(config.plugins.autobackup.prevbackup.value)),
                            self.backupsettingsDone)
                    else:
                        self.session.openWithCallback(
                            self.startDownload,
                            MessageBox,
                            _("Unable to backup settings as the AutoBackup plugin is missing, do you want to continue?"
                              ),
                            default=False,
                            simple=True)
                else:
                    self.startDownload()
            else:
                self.session.openWithCallback(
                    self.abort,
                    MessageBox,
                    _("Could not find suitable media - Please insert a media (e.g. USB stick) and try again!"
                      ),
                    type=MessageBox.TYPE_ERROR,
                    simple=True)
        else:
            self.abort()
 def keySave(self):
     config.autobouquetsmaker.keepbouquets.save()
     configfile.save()
     self.close()
示例#53
0
 def keyGreen(self):
     if MODEL_NAME == "osmega" and not os.path.exists(
             "/etc/rc0.d/K99stop_fan"):
         os.system(
             "echo -e '#!/bin/sh\n\n\necho off > /proc/stb/fp/fan\n\nexit 0' > /etc/rc0.d/K99stop_fan && chmod 755 /etc/r0.d/K99stop_fan"
         )
     timehddsleep = config.usage.hdd_standby.value
     timeset = config.plugins.extrafancontrol.timeset.value
     mode = config.plugins.extrafancontrol.mode.value
     if self.fanspeedcontrol is None:
         self.FAN.usealttime.value = False
     elif self.FAN.speedstandby.value == "equal":
         self.FAN.standbyfanspeed.value = self.FAN.fanspeed.value
     if not self.internal_hdd:
         self.FAN.hdddevice.value = "all"
         self.FAN.hddwatch.value = "none"
         self.FAN.interval_tempwatcher.value = "60"
         self.FAN.hddsleep.value = False
         self.FAN.hddtemp.value = 0
     if not self.isTBoardtemp:
         self.FAN.syswatch.value = "none"
         self.FAN.systemtemp.value = 0
         self.FAN.cputemp.value = 0
         self.FAN.usealttime.value = False
     if mode == timeset:
         if self.fanspeedcontrol is None:
             self.FAN.timeset.value = "none"
             self.FAN.usealtfanspeed.value = False
     if mode == "off" or mode == "standby":
         self.FAN.timeset.value = "none"
         self.FAN.usealtfanspeed.value = False
     if mode != "off":
         self.FAN.hddwatch.value = "none"
         self.FAN.hddsleep.value = False
         self.FAN.hddtemp.value = 0
         self.FAN.syswatch.value = "none"
         self.FAN.systemtemp.value = 0
         self.FAN.cputemp.value = 0
         self.FAN.usealttime.value = False
     if mode == "off" and self.FAN.hddwatch.value != "none":
         if not self.internal_hdd:
             self.session.open(
                 MessageBox,
                 _("You may not use this mode!\nNot found an internal hard drive!"
                   ),
                 MessageBox.TYPE_INFO,
                 timeout=5)
             self.FAN.hddwatch.value = "none"
             self.FAN.hddsleep.value = False
             self.FAN.hddtemp.value = 0
             self.createSetup()
             return
     if self.FAN.timeset.value != "none" and self.FAN.timestartoff.value == self.FAN.timeendoff.value:
         self.session.open(
             MessageBox,
             _("Start time equal end time.\nYou may not use this time settings!"
               ),
             MessageBox.TYPE_INFO,
             timeout=5)
         self.FAN.timeset.value = "none"
         self.createSetup()
         return
     if self.FAN.hddwatch.value == "sleep" and timehddsleep == "0" and self.FAN.hddsleep.value:
         self.session.open(
             MessageBox,
             _("Harddisk setup 'Standby after' disabled\nYou may not use this mode!"
               ),
             MessageBox.TYPE_INFO,
             timeout=5)
         self.FAN.hddwatch.value = "none"
         self.FAN.hddsleep.value = False
         self.FAN.hddtemp.value = 0
         self.createSetup()
         return
     if self.fanspeedcontrol is not None and (
             self.FAN.syswatch.value != "none" or self.FAN.hddwatch.value !=
             "none") and self.FAN.usealttime.value:
         if self.FAN.alt_timestart.value == self.FAN.alt_timeend.value:
             self.session.open(
                 MessageBox,
                 _("Start time equal end time.\nYou may not use this time settings!"
                   ),
                 MessageBox.TYPE_INFO,
                 timeout=5)
             self.FAN.usealttime.value = False
             self.createSetup()
             return
     if mode == "off":
         if self.FAN.hddwatch.value != "none":
             self.FAN.syswatch.value = "none"
             self.FAN.systemtemp.value = 0
             self.FAN.cputemp.value = 0
         elif self.FAN.syswatch.value != "none":
             self.FAN.hddwatch.value = "none"
             self.FAN.hddsleep.value = False
             self.FAN.hddtemp.value = 0
     if not os.path.exists("/usr/sbin/hddtemp"):
         self.FAN.menuhdd.value = False
     if tempwatcher and (self.prev_hdddevice != self.FAN.hdddevice.value
                         and self.FAN.hddwatch.value == "temp") or (
                             self.prev_interval_tempwatcher !=
                             self.FAN.interval_tempwatcher.value):
         tempwatcher.reloadHddTemp(devices=self.FAN.hdddevice.value,
                                   updatetime=int(
                                       self.FAN.interval_tempwatcher.value))
     if self.prev_menuhdd != self.FAN.menuhdd.value:
         self.refreshPlugins()
     if MODEL_NAME.startswith("et"):
         self.FAN.alt_auto.value = False
     self.FAN.save()
     configfile.save()
     if fanmanager is not None:
         fanmanager.fanModeChanged(None)
     self.close()
示例#54
0
 def keyGo(self):
     config.plugins.MisPlsLcnScan.save()
     configfile.save()
     self.startScan()
示例#55
0
def runScreenTest():
    config.misc.startCounter.value += 1

    profile("Init:Session")
    nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value)
    session = Session(desktop=getDesktop(0),
                      summary_desktop=getDesktop(1),
                      navigation=nav)

    from Components.ScreenAnimations import ScreenAnimations
    ScreenAnimations().loadDefault()

    from Screens.Toast import ToastManager
    session.toastManager = ToastManager(session)

    CiHandler.setSession(session)

    from Screens.PackageRestoreWizard import PackageRestoreCheck
    PackageRestoreCheck(session)

    screensToRun = [
        p.__call__ for p in plugins.getPlugins(PluginDescriptor.WHERE_WIZARD)
    ]

    profile("wizards")
    screensToRun += wizardManager.getWizards()

    screensToRun.append((100, Screens.InfoBar.InfoBar))

    screensToRun.sort()

    queryFunc_conn = ePythonConfigQuery.getQueryFuncSignal().connect(
        configfile.getResolvedKey)

    #	eDVBCIInterfaces.getInstance().setDescrambleRules(0 # Slot Number
    #		,(	["1:0:1:24:4:85:C00000:0:0:0:"], #service_list
    #			["PREMIERE"], #provider_list,
    #			[] #caid_list
    #		));

    def runNextScreen(session, screensToRun, *result):
        if result:
            quitMainloop(*result)
            return

        if screensToRun:
            screen = screensToRun[0][1]
            args = screensToRun[0][2:]

            if screensToRun:
                session.openWithCallback(
                    boundFunction(runNextScreen, session, screensToRun[1:]),
                    screen, *args)
            else:
                session.open(screen, *args)

    config.misc.epgcache_outdated_timespan.addNotifier(setOutdatedEPGTimespan)
    config.misc.epgcache_timespan.addNotifier(setEPGCacheTimespan)
    config.misc.epgcache_filename.addNotifier(setEPGCachePath)

    api.setSession(session)

    runNextScreen(session, screensToRun)

    profile("Init:VolumeControl")
    vol = VolumeControl(session)
    profile("Init:PowerKey")
    power = PowerKey(session)

    # we need session.scart to access it from within menu.xml
    session.scart = AutoScartControl(session)

    profile("RunReactor")
    profile_final()
    runReactor()

    session.shutdown = True
    while session.current_dialog:
        if not isinstance(session.current_dialog, Screens.InfoBar.InfoBar):
            session.current_dialog.callback = None
        Screen.close(session.current_dialog)
        session.processDelay()

    config.misc.startCounter.save()

    profile("wakeup")
    from time import time, strftime, localtime
    from Tools.DreamboxHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime
    #get currentTime
    nowTime = time()
    wakeup_on_zaptimers = config.usage.standby_zaptimer_wakeup.value
    wakeupList = [
        x
        for x in ((session.nav.RecordTimer.getNextRecordingTime(), 0,
                   session.nav.RecordTimer.isNextRecordAfterEventActionAuto()),
                  (session.nav.RecordTimer.getNextZapTime(),
                   1), (plugins.getNextWakeupTime(), 2))
        if x[0] != -1 and (x[1] != 1 or wakeup_on_zaptimers)
    ]
    wakeupList.sort()
    recordTimerWakeupAuto = False
    if wakeupList:
        from time import strftime
        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:
            wptime = startTime[0] - 240
        if not config.misc.useTransponderTime.value:
            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]
        config.misc.prev_wakeup_time.value = startTime[0]
        config.misc.prev_wakeup_time_type.value = startTime[1]
        config.misc.prev_wakeup_time_type.save()
    else:
        config.misc.prev_wakeup_time.value = 0
    config.misc.prev_wakeup_time.save()
    config.misc.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto
    config.misc.isNextRecordTimerAfterEventActionAuto.save()

    profile("stopService")
    session.nav.stopService()
    profile("nav shutdown")
    session.nav.shutdown()

    profile("configfile.save")
    configfile.save()

    return 0
 def keySave(self):
     for x in self["config"].list:
         x[1].save()
     configfile.save()
     self.close(self.session, True)
示例#57
0
def saveConfigFile():
    config.plugins.icetv.save()
    configfile.save()
	def markDone(self):
		config.misc.firstrun.value = 0
		config.misc.firstrun.save()
		configfile.save()
示例#59
0
def runScreenTest():
	config.misc.startCounter.value += 1
	config.misc.startCounter.save()

	profile("readPluginList")
	plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))

	profile("Init:Session")
	nav = Navigation()
	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:
			session.open(screen, *args)

	config.misc.epgcache_filename.addNotifier(setEPGCachePath)

	runNextScreen(session, screensToRun)

	profile("Init:VolumeControl")
	vol = VolumeControl(session)
	profile("Init:PowerKey")
	power = PowerKey(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()

	runReactor()

	profile("wakeup")

	from time import time, strftime, localtime
	from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime
	from Screens.SleepTimerEdit import isNextWakeupTime
	#get currentTime
	nowTime = time()
	if not config.misc.SyncTimeUsing.value == "0" or boxtype.startswith('gb') or getBrandOEM().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.getNextZapTime(isWakeup=True), 1),
					(plugins.getNextWakeupTime(), 2),
					(isNextWakeupTime(), 3))
		if x[0] != -1
	]
	wakeupList.sort()
	if wakeupList:
		from time import strftime
		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 boxtype.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)
		config.misc.prev_wakeup_time.value = int(startTime[0])
		config.misc.prev_wakeup_time_type.value = startTime[1]
		config.misc.prev_wakeup_time_type.save()
	else:
		config.misc.prev_wakeup_time.value = 0
	config.misc.prev_wakeup_time.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
示例#60
0
            pid = process_num('dmx%d' % x)
            if pid is None:
                break
            if c.sched_setscheduler(pid, SCHED_FIFO, params) == -1:
                print "sched_setscheduler failed for dmx%d" % x
            x += 1


# first, setup a screen
try:
    thread = FixDemuxThread()

    runScreenTest()

    plugins.shutdown()

    from Components.ParentalControl import parentalControl
    parentalControl.save()
except Exception as e:
    print 'EXCEPTION IN PYTHON STARTUP CODE:'
    print '-' * 60
    print_exc(file=stdout)
    if isinstance(e, SkinError):
        print "SKIN ERROR", e
        print "defaulting to standard skin..."
        config.skin.primary_skin.value = "skin.xml"
        config.skin.primary_skin.save()
        configfile.save()
    quitMainloop(5)
    print '-' * 60