Пример #1
0
 def restartGUI(self, answer):
     if answer is True:
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self.close()
         #self.session.open(TryQuitMainloop, 3)
     else:
         self.close()
Пример #2
0
	def bH_close_end(self):
		from Components.PluginComponent import plugins
		from Tools.Directories import SCOPE_PLUGINS
		plugins.firstRun = True
		plugins.clearPluginList()
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #3
0
	def save(self):
		self.saveAll()
		if not config.plugins.epgsearch.showinplugins.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
				if plugin.name == _("EPGSearch"):
					plugins.removePlugin(plugin)

		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #4
0
	def keySave(self):
		self.saveAll()
		if not config.plugins.imdb.showinplugins.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
				if plugin.name == _("IMDb Details"):
					plugins.removePlugin(plugin)

		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #5
0
	def runFinished(self, retval):
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		system("rm -f /tmp/" + u.filename);
		self['conn'].setText(_("Addon: %s\ninstalled succesfully!") % u.filename)
		self.readTmp()
		if fileExists('/tmp/.restartE2'):
			system('rm -f /tmp/.restartE2')
			msg = 'Enigma2 will be now hard restarted to complete package installation.\nDo You want restart enigma2 now?'
			box = self.session.openWithCallback(self.restartEnigma2, MessageBox, msg , MessageBox.TYPE_YESNO)
			box.setTitle('Restart enigma')
Пример #6
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.setTitle(_("Add/remove plugin"))
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.session = session
     self.list = []
     self["list"] = PluginList(self.list)
     self.updateList()
     self["actions"] = ActionMap(["WizardActions"], {"ok": self.save, "back": self.close}, -1)
     self.onExecBegin.append(self.checkWarnings)
Пример #7
0
	def requestClose(self):
		if self.plugins_changed:
			plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		if self.reload_settings:
			self["text"].setText(_("Reloading bouquets and services..."))
			eDVBDB.getInstance().reloadBouquets()
			eDVBDB.getInstance().reloadServicelist()
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.container.appClosed.remove(self.runFinished)
		self.container.dataAvail.remove(self.dataAvail)
		self.close()
Пример #8
0
	def keyGo(self):
		config.plugins.OSD3DSetup.mode.value = self.mode.value
		config.plugins.OSD3DSetup.znorm.value = int(self.znorm.value) - 50
		config.plugins.OSD3DSetup.menuext.value = self.menuext.value
		config.plugins.OSD3DSetup.auto.value = self.auto.value
		config.plugins.OSD3DSetup.toggle.value = self.toggle.value
		config.plugins.OSD3DSetup.prompt.value = self.prompt.value
		config.plugins.OSD3DSetup.save()
		#refresh menus to reflect current settings
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #9
0
	def keySave(self):
		self.saveAll()

		for pl in pluginlist:
			if not pl[0].value:
				for plugin in plugins.getPlugins(pl[1].where):
					if plugin is pl[1]:
						plugins.removePlugin(plugin)

		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #10
0
	def runFinished(self, retval):
		if fileExists('/tmp/' + u.filename):
			remove("/tmp/" + u.filename)
		self['conn'].text = _("Addon installed succesfully!")
		if (u.pluginType == 'Plugins') or (u.pluginType == 'Plugin'):
			self['conn'].text = _("Reload Plugins list\nPlease Wait...")
			plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
			self['conn'].text = _("Addon installed succesfully!")
			msg = _("Enigma2 will be now hard restarted to complete package installation.") + "\n" + _("Do you want restart enigma2 now?")
			box = self.session.openWithCallback(self.restartEnigma2, MessageBox, msg , MessageBox.TYPE_YESNO)
			box.setTitle(_('Restart Enigma2'))
Пример #11
0
	def runFinished(self, retval):
		system("rm -f /tmp/" + u.filename)
		if (u.pluginType == 'Settings') or (u.pluginType == 'e2Settings'):
			u.reloadSetting()
		elif (u.pluginType == 'Plugins') or (u.pluginType == 'e2Plugins'):
			plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self['conn'].setText(_("Addon installed succesfully!"))
		if fileExists('/tmp/.restartE2'):
			system('rm -f /tmp/.restartE2')
			msg = _('Enigma2 will be now hard restarted to complete package installation.\nDo You want restart enigma2 now?')
			box = self.session.openWithCallback(self.restartEnigma2, MessageBox, msg , MessageBox.TYPE_YESNO)
			box.setTitle(_('Restart Enigma2'))
Пример #12
0
 def runFinished(self, retval):
     if fileExists('/tmp/' + u.filename):
         remove('/tmp/' + u.filename)
     if u.pluginType == 'Plugins' or u.pluginType == 'Plugin':
         self['conn'].text = _('Reload Plugins list\nPlease Wait...')
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self['conn'].text = _('Addon installed succesfully!')
         msg = _('Enigma2 will be now hard restarted to complete package installation.') + '\n' + _('Do you want restart enigma2 now?')
         box = self.session.openWithCallback(self.restartEnigma2, MessageBox, msg, MessageBox.TYPE_YESNO)
         box.setTitle(_('Restart Enigma2'))
     else:
         self['conn'].text = _('Addon installed succesfully!')
Пример #13
0
 def EGAMI_close_end(self):
     from Components.PluginComponent import plugins
     from Tools.Directories import SCOPE_PLUGINS, resolveFilename
     plugins.firstRun = True
     plugins.clearPluginList()
     from Screens.MessageBox import MessageBox
     try:
         mybox = self.session.open(MessageBox, _('EGAMI is speeding up! Please wait...'), MessageBox.TYPE_INFO, 5)
         mybox.setTitle(_('Info'))
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     except:
         self.close()
Пример #14
0
	def quit(self):
		if self.canexit:
			if self.action == self.IPKG_UPGRADE and self.errors == False:
				self.session.openWithCallback(self.reboot, ExtraMessageBox, "A reboot is suggested", "Upgrade completed",
											[ [ "Reboot now", "reboot.png" ],
											[ "Reboot manually later", "cancel.png" ],
											], 1, 1, 0, 10)
			elif self.action == self.IPKG_INSTALL or self.action == self.IPKG_REMOVE:
				plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
				self.close()
			else:
				self.close()
Пример #15
0
 def requestClose(self):
     if self.plugins_changed:
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     if self.reload_settings:
         self["text"].setText(_("Reloading bouquets and services..."))
         self["text"].show()
         eDVBDB.getInstance().reloadBouquets()
         eDVBDB.getInstance().reloadServicelist()
     if self.check_softcams:
         SystemInfo["HasSoftcamInstalled"] = hassoftcaminstalled()
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.container.appClosed.remove(self.runFinished)
     self.container.dataAvail.remove(self.dataAvail)
     self.close()
Пример #16
0
	def keySave(self):
		self.saveAll()
		global imdb_headers
		if config.plugins.imdb.language.value:
			imdb_headers = {'Accept-Language': config.plugins.imdb.language.value}
		else:
			imdb_headers = {}
		if not config.plugins.imdb.showinplugins.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
				if plugin.name == _("IMDb Details"):
					plugins.removePlugin(plugin)

		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #17
0
 def keyOK(self):
     try:
         print '[PlugLoad] is enabling Plugins'
         #system('/jzk/etc/PlugLoad.sh py')
         #Console().ePopen('/jzk/etc/PlugLoad.sh py')
         subprocess_call('/jzk/etc/PlugLoad.sh py', shell=True)
         print '[PlugLoad] is loading Plugins'
         plugins.readPluginList('/usr/lib/enigma2/python/Plugins/')
         if path.exists('/usr/lib/enigma2/python/Plugins/Extensions/WebInterface') is True:
             woWebIf(self.session)
         self.session.open(MessageBox, _('The plugins were reloaded successfully!'), MessageBox.TYPE_INFO, timeout=3)
         self.close()
     except:
         print_exc()
Пример #18
0
 def requestClose(self):
     if self.plugins_changed:
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     if self.reload_settings:
         self["text"].setText(_("Reloading bouquets and services..."))
         eDVBDB.getInstance().reloadBouquets()
         eDVBDB.getInstance().reloadServicelist()
         from Components.ParentalControl import parentalControl
         parentalControl.open()
         refreshServiceList()
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.container.appClosed.remove(self.runFinished)
     self.container.dataAvail.remove(self.dataAvail)
     self.close()
Пример #19
0
	def Save(self):
		self.saveAll()
		if not config.plugins.autotimer.show_in_plugins.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
				if plugin.name == "AutoTimer":
					plugins.removePlugin(plugin)

		if not config.plugins.autotimer.show_in_extensionsmenu.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_EXTENSIONSMENU):
				if plugin.name == "AutoTimer":
					plugins.removePlugin(plugin)
				
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #20
0
 def EGAMI_close_end(self):
     from Components.PluginComponent import plugins
     from Tools.Directories import SCOPE_PLUGINSresolveFilename
     plugins.firstRun = True
     plugins.clearPluginList()
     from Screens.MessageBox import MessageBox
     try:
         mybox = self.session.open(
             MessageBox, _('EGAMI is speeding up! Please wait...'),
             MessageBox.TYPE_INFO, 5)
         mybox.setTitle(_('Info'))
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     except:
         self.close()
	def Save(self):
		self.saveAll()
		if not config.plugins.autotimer.show_in_plugins.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
				if plugin.name == "AutoTimer":
					plugins.removePlugin(plugin)

		if not config.plugins.autotimer.show_in_extensionsmenu.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_EXTENSIONSMENU):
				if plugin.name == "AutoTimer":
					plugins.removePlugin(plugin)
				
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close()
Пример #22
0
    def run(self):
        cmd = ""
        if config.egwizard.enablehbbtv.value is True:
            cmd += "opkg install --force-overwrite tslib-conf libts-1.0-0 libsysfs2 libgmp10 libmpfr4 vuplus-opera-browser-util enigma2-plugin-extensions-inihbbtv;"
        else:
            cmd += "opkg remove --force-depends tslib-conf libts-1.0-0 libsysfs2 libgmp10 libmpfr4 vuplus-opera-browser-util enigma2-plugin-extensions-inihbbtv;"

        if config.egwizard.enable3gmodems.value is True:
            cmd += "opkg install --force-overwrite enigma2-plugin-systemplugins-3gmodemmanager;"
        else:
            cmd += "opkg remove --force-depends ppp usbmodeswitch usbmodeswitch-data wvdial wvstreams libwvutils4.6 libwvstreams-extras libuniconf4.6 kernel-module-ppp-async kernel-module-ppp-deflate kernel-module-ppp-synctty kernel-module-ppp-generic kernel-module-slhc kernel-module-usbserial kernel-module-cdc-acm kernel-module-ppp-mppe kernel-module-pppoe kernel-module-pppox kernel-module-option kernel-module-bsd-comp usbutils enigma2-plugin-systemplugins-3gmodemmanager;"

        if config.egwizard.firmwaremicom.value is True:
            cmd += "opkg install --force-overwrite enigma2-plugin-systemplugins-micomupgrade;"
        else:
            cmd += "opkg remove --force-depends enigma2-plugin-systemplugins-micomupgrade;"

        if config.egwizard.enableDLNAServer.value is True:
            cmd += "opkg install --force-overwrite minidlna;"
        else:
            cmd += "opkg remove --force-depends minidlna;"

        if config.egwizard.enableDLNABrowser.value is True:
            cmd += "opkg install --force-overwrite djmount;"
        else:
            cmd += "opkg remove --force-depends djmount;"

        if config.egwizard.enableWifiDrivers is True:
            cmd += "opkg install --force-overwrite enigma2-plugin-drivers-network-usb-ath9k-htc enigma2-plugin-drivers-network-usb-carl9170 enigma2-plugin-drivers-network-usb-rt2800 enigma2-plugin-drivers-network-usb-rt2500 enigma2-plugin-drivers-network-usb-rtl8187 enigma2-plugin-drivers-network-usb-smsc75xx enigma2-plugin-drivers-network-usb-zd1211rw enigma2-plugin-drivers-network-usb-rtl8192cu enigma2-plugin-drivers-network-usb-rt73 enigma2-plugin-drivers-network-usb-r8712u;"
        else:
            cmd += "opkg remove --force-depends enigma2-plugin-drivers-network-usb-ath9k-htc enigma2-plugin-drivers-network-usb-carl9170 enigma2-plugin-drivers-network-usb-rt2800 enigma2-plugin-drivers-network-usb-rt2500 enigma2-plugin-drivers-network-usb-rtl8187 enigma2-plugin-drivers-network-usb-smsc75xx enigma2-plugin-drivers-network-usb-zd1211rw enigma2-plugin-drivers-network-usb-rtl8192cu enigma2-plugin-drivers-network-usb-rt73 enigma2-plugin-drivers-network-usb-r8712u;"

        if config.egwizard.enableDvbtDrivers is True:
            cmd += "opkg install --force-overwrite enigma2-plugin-drivers-dvb-usb-af9035 enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-dvb-usb-af9015 enigma2-plugin-drivers-dvb-usb-it913x enigma2-plugin-drivers-dvb-usb-pctv452e enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-usbserial enigma2-plugin-drivers-dvb-usb-dw2102 enigma2-plugin-drivers-dvb-usb-as102;"
        else:
            cmd += "opkg remove --force-depends enigma2-plugin-drivers-dvb-usb-af9035 enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-dvb-usb-af9015 enigma2-plugin-drivers-dvb-usb-it913x enigma2-plugin-drivers-dvb-usb-pctv452e enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-usbserial enigma2-plugin-drivers-dvb-usb-dw2102 enigma2-plugin-drivers-dvb-usb-as102;"

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

        config.egwizard.save()
        self.session.open(Console,
                          title=_("Please wait configuring OpenNFR Image"),
                          cmdlist=[cmd],
                          finishedCallback=None,
                          closeOnSuccess=True)
        plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))

        self.close()
Пример #23
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.setTitle(_("Add/remove plugin"))
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.session = session
     self.list = []
     self["pluginlist"] = PluginList(self.list)
     #self.updateList()
     self.pluginlist = []
     self["actions"] = ActionMap(["WizardActions"], {
         "ok": self.save,
         "back": self.close
     }, -1)
     self.onExecBegin.append(self.checkWarnings)
     self.onShown.append(self.updateList)
Пример #24
0
 def runFinished(self, retval):
     if fileExists('/tmp/' + u.filename):
         remove('/tmp/' + u.filename)
     if u.pluginType == 'Plugins' or u.pluginType == 'Plugin':
         self['conn'].text = _('Reload Plugins list\nPlease Wait...')
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self['conn'].text = _('Addon installed succesfully!')
         msg = _(
             'Enigma2 will be now hard restarted to complete package installation.'
         ) + '\n' + _('Do you want restart enigma2 now?')
         box = self.session.openWithCallback(self.restartEnigma2,
                                             MessageBox, msg,
                                             MessageBox.TYPE_YESNO)
         box.setTitle(_('Restart Enigma2'))
     else:
         self['conn'].text = _('Addon installed succesfully!')
Пример #25
0
	def save(self):
		#print "saving"
		self.updateTimer.stop()
		self.saveAll()
		if not config.plugins.xmltvimport.showinplugins.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_PLUGINMENU):
				if plugin.name == _("XMLTV-Importer"):
					plugins.removePlugin(plugin)

		if not config.plugins.xmltvimport.showinextensions.value:
			for plugin in plugins.getPlugins(PluginDescriptor.WHERE_EXTENSIONSMENU):
				if plugin.name == _("XMLTV-Importer"):
					plugins.removePlugin(plugin)
				
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.close(True,self.session)
Пример #26
0
	def requestClose(self):
		if self.plugins_changed:
			plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		if self.reload_settings:
			self["text"].setText(_("Reloading bouquets and services..."))
			eDVBDB.getInstance().reloadBouquets()
			eDVBDB.getInstance().reloadServicelist()
			from Components.ParentalControl import parentalControl
			parentalControl.open()
			refreshServiceList()
		if self.check_softcams:
			SystemInfo["HasSoftcamInstalled"] = hassoftcaminstalled()
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.container.appClosed.remove(self.runFinished)
		self.container.dataAvail.remove(self.dataAvail)
		self.close()
Пример #27
0
 def run(self):
     try:
         print '[PlugLoad] is enabling Plugins'
         #Console().ePopen('/jzk/etc/PlugLoad.sh py')
         #system('/jzk/etc/PlugLoad.sh py')
         subprocess_call('/usr/lib/enigma2/python/Plugins/Extensions/PlugLoad/PlugLoad.sh py', shell=True)
         print '[PlugLoad] is loading Plugins'
         plugins.readPluginList('/usr/lib/enigma2/python/Plugins/')
         if path.exists('/usr/lib/enigma2/python/Plugins/Extensions/WebInterface') is True:
             woWebIf(self.session)
         with open("/proc/sys/vm/drop_caches", "w") as f: f.write("1\n")
         Console().ePopen('(/bin/run-parts /jzk/cron/post_E2) &')
         #system('(/bin/run-parts /jzk/cron/post_E2) &')
         #subprocess_call('(/bin/run-parts /jzk/cron/post_GUI) &', shell=True) odpalone przez vfd
     except:
         print '[PlugLoad] exception handled'
         print_exc()
Пример #28
0
    def run(self):
	cmd = ""
	if config.egwizard.enablehbbtv.value is True:
		cmd += "opkg install --force-overwrite tslib-conf libts-1.0-0 libsysfs2 libgmp10 libmpfr4 vuplus-opera-browser-util enigma2-plugin-extensions-inihbbtv;"
	else:
		cmd += "opkg remove --force-depends tslib-conf libts-1.0-0 libsysfs2 libgmp10 libmpfr4 vuplus-opera-browser-util enigma2-plugin-extensions-inihbbtv;"

	if config.egwizard.enable3gmodems.value is True:
		cmd += "opkg install --force-overwrite enigma2-plugin-systemplugins-3gmodemmanager;"
	else:
		cmd += "opkg remove --force-depends ppp usbmodeswitch usbmodeswitch-data wvdial wvstreams libwvutils4.6 libwvstreams-extras libuniconf4.6 kernel-module-ppp-async kernel-module-ppp-deflate kernel-module-ppp-synctty kernel-module-ppp-generic kernel-module-slhc kernel-module-usbserial kernel-module-cdc-acm kernel-module-ppp-mppe kernel-module-pppoe kernel-module-pppox kernel-module-option kernel-module-bsd-comp usbutils enigma2-plugin-systemplugins-3gmodemmanager;"

	if config.egwizard.firmwaremicom.value is True:
		cmd += "opkg install --force-overwrite enigma2-plugin-systemplugins-micomupgrade;"
	else:
		cmd += "opkg remove --force-depends enigma2-plugin-systemplugins-micomupgrade;"
		
	if config.egwizard.enableDLNAServer.value is True:
		cmd += "opkg install --force-overwrite minidlna;"
	else:
		cmd += "opkg remove --force-depends minidlna;"
		
	if config.egwizard.enableDLNABrowser.value is True:
		cmd += "opkg install --force-overwrite djmount;"
	else:
		cmd += "opkg remove --force-depends djmount;"
		
	if config.egwizard.enableWifiDrivers is True:
		cmd += "opkg install --force-overwrite enigma2-plugin-drivers-network-usb-ath9k-htc enigma2-plugin-drivers-network-usb-carl9170 enigma2-plugin-drivers-network-usb-rt2800 enigma2-plugin-drivers-network-usb-rt2500 enigma2-plugin-drivers-network-usb-rtl8187 enigma2-plugin-drivers-network-usb-smsc75xx enigma2-plugin-drivers-network-usb-zd1211rw enigma2-plugin-drivers-network-usb-rtl8192cu enigma2-plugin-drivers-network-usb-rt73 enigma2-plugin-drivers-network-usb-r8712u;"
	else:
		cmd += "opkg remove --force-depends enigma2-plugin-drivers-network-usb-ath9k-htc enigma2-plugin-drivers-network-usb-carl9170 enigma2-plugin-drivers-network-usb-rt2800 enigma2-plugin-drivers-network-usb-rt2500 enigma2-plugin-drivers-network-usb-rtl8187 enigma2-plugin-drivers-network-usb-smsc75xx enigma2-plugin-drivers-network-usb-zd1211rw enigma2-plugin-drivers-network-usb-rtl8192cu enigma2-plugin-drivers-network-usb-rt73 enigma2-plugin-drivers-network-usb-r8712u;"
	  
	if config.egwizard.enableDvbtDrivers is True:
		cmd += "opkg install --force-overwrite enigma2-plugin-drivers-dvb-usb-af9035 enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-dvb-usb-af9015 enigma2-plugin-drivers-dvb-usb-it913x enigma2-plugin-drivers-dvb-usb-pctv452e enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-usbserial enigma2-plugin-drivers-dvb-usb-dw2102 enigma2-plugin-drivers-dvb-usb-as102;"
	else:
		cmd += "opkg remove --force-depends enigma2-plugin-drivers-dvb-usb-af9035 enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-dvb-usb-af9015 enigma2-plugin-drivers-dvb-usb-it913x enigma2-plugin-drivers-dvb-usb-pctv452e enigma2-plugin-drivers-dvb-usb-dib0700 enigma2-plugin-drivers-usbserial enigma2-plugin-drivers-dvb-usb-dw2102 enigma2-plugin-drivers-dvb-usb-as102;"
		
        for x in self['config'].list:
            x[1].save()

	config.egwizard.save()
	#os.system(cmd)
	self.session.open(Console, title = _("Please wait configuring EGAMI Image"), cmdlist = [cmd], finishedCallback = None, closeOnSuccess = True)
	plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
	#self.session.open(InstallWizardIpkgUpdater, _('Please wait configuring EGAMI Image'), IpkgComponent.CMD_INSTALL, {'package': cmd})
        self.close()
Пример #29
0
    def save(self):
        #print "saving"
        self.updateTimer.stop()
        self.saveAll()
        if not config.plugins.xmltvimport.showinplugins.value:
            for plugin in plugins.getPlugins(
                    PluginDescriptor.WHERE_PLUGINMENU):
                if plugin.name == _("XMLTV-Importer"):
                    plugins.removePlugin(plugin)

        if not config.plugins.xmltvimport.showinextensions.value:
            for plugin in plugins.getPlugins(
                    PluginDescriptor.WHERE_EXTENSIONSMENU):
                if plugin.name == _("XMLTV-Importer"):
                    plugins.removePlugin(plugin)

        plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
        self.close(True, self.session)
Пример #30
0
 def removeIPK(self, yesno):
     if yesno:
         mysel = self['remove'].getCurrent()
         mysel2 = '/usr/uninstall/' + mysel + '.del'
         if fileExists(mysel2):
             os.system('chmod 777 ' + mysel2)
             os.system(mysel2)
         else:
             mysel2 = '/usr/uninstall/Remove' + mysel + '.del'
             os.system('chmod 777 ' + mysel2)
             os.system(mysel2)
         infoBox = self.session.open(MessageBox, _('Addon removed!'), MessageBox.TYPE_INFO)
         infoBox.setTitle(_('Remove Package'))
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self.populateSL()
     else:
         infoBox = self.session.open(MessageBox, _('Addon NOT removed!'), MessageBox.TYPE_INFO)
         infoBox.setTitle(_('Remove Package'))
Пример #31
0
 def ipkgCallback(self, event, param):
     if event == IpkgComponent.EVENT_DONE:
         if self.index == InstallWizard.STATE_UPDATE:
             config.misc.installwizard.ipkgloaded.value = True
         elif self.index == InstallWizard.STATE_CHOISE_CHANNELLIST:
             if self.state == 0:
                 self.ipkg.startCmd(IpkgComponent.CMD_INSTALL, self.pkg)
                 self.state = 1
                 return
         elif self.index == InstallWizard.STATE_CHOISE_SETTINGPLUGIN:
             if self.state == 0:
                 self.ipkg.startCmd(IpkgComponent.CMD_INSTALL, self.pkg)
                 self.state = 1
                 return
             config.misc.installwizard.channellistdownloaded.value = True
             eDVBDB.getInstance().reloadBouquets()
             eDVBDB.getInstance().reloadServicelist()
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self.close()
Пример #32
0
	def cmdDone(self, result):
		if self.current["cmd"] == self.INSTALL or self.current["cmd"] == self.REMOVE:
			plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
			
		if result == 0:
			print "Cmd '%s' done" % self.current["systemcmd"]
			self.current["status"] = self.DONE
			self.current["message"] = "Done (%s)" % time.strftime("%d/%m/%Y at %H:%M")
		else:
			print "Error on cmd '%s' (return code %d)" % (self.current["systemcmd"], result)
			self.current["status"] = self.ERROR
			self.current["message"] = "Error!"
		
		self.doCallbacks()
		if self.current["callback"]:
			self.current["callback"]()
			
		self.current = None
		self.processNextCommand()
Пример #33
0
 def keyOK(self):
     try:
         print '[PlugLoad] is enabling Plugins'
         #system('/jzk/etc/PlugLoad.sh py')
         #Console().ePopen('/jzk/etc/PlugLoad.sh py')
         subprocess_call('/jzk/etc/PlugLoad.sh py', shell=True)
         print '[PlugLoad] is loading Plugins'
         plugins.readPluginList('/usr/lib/enigma2/python/Plugins/')
         if path.exists(
                 '/usr/lib/enigma2/python/Plugins/Extensions/WebInterface'
         ) is True:
             woWebIf(self.session)
         self.session.open(MessageBox,
                           _('The plugins were reloaded successfully!'),
                           MessageBox.TYPE_INFO,
                           timeout=3)
         self.close()
     except:
         print_exc()
Пример #34
0
 def removeIPK(self, yesno):
     if yesno:
         mysel = self['remove'].getCurrent()
         mysel2 = '/usr/uninstall/' + mysel + '.del'
         if fileExists(mysel2):
             os.system('chmod 777 ' + mysel2)
             os.system(mysel2)
         else:
             mysel2 = '/usr/uninstall/Remove' + mysel + '.del'
             os.system('chmod 777 ' + mysel2)
             os.system(mysel2)
         infoBox = self.session.open(MessageBox, _('Addon removed!'),
                                     MessageBox.TYPE_INFO)
         infoBox.setTitle(_('Remove Package'))
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self.populateSL()
     else:
         infoBox = self.session.open(MessageBox, _('Addon NOT removed!'),
                                     MessageBox.TYPE_INFO)
         infoBox.setTitle(_('Remove Package'))
Пример #35
0
    def cmdDone(self, result):
        if self.current["cmd"] == self.INSTALL or self.current[
                "cmd"] == self.REMOVE:
            plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))

        if result == 0:
            print "Cmd '%s' done" % self.current["systemcmd"]
            self.current["status"] = self.DONE
            self.current["message"] = "Done (%s)" % time.strftime(
                "%d/%m/%Y at %H:%M")
        else:
            print "Error on cmd '%s' (return code %d)" % (
                self.current["systemcmd"], result)
            self.current["status"] = self.ERROR
            self.current["message"] = "Error!"

        self.doCallbacks()
        if self.current["callback"]:
            self.current["callback"]()

        self.current = None
        self.processNextCommand()
Пример #36
0
 def run(self):
     try:
         print '[PlugLoad] is enabling Plugins'
         #Console().ePopen('/jzk/etc/PlugLoad.sh py')
         #system('/jzk/etc/PlugLoad.sh py')
         subprocess_call(
             '/usr/lib/enigma2/python/Plugins/Extensions/PlugLoad/PlugLoad.sh py',
             shell=True)
         print '[PlugLoad] is loading Plugins'
         plugins.readPluginList('/usr/lib/enigma2/python/Plugins/')
         if path.exists(
                 '/usr/lib/enigma2/python/Plugins/Extensions/WebInterface'
         ) is True:
             woWebIf(self.session)
         with open("/proc/sys/vm/drop_caches", "w") as f:
             f.write("1\n")
         Console().ePopen('(/bin/run-parts /jzk/cron/post_E2) &')
         #system('(/bin/run-parts /jzk/cron/post_E2) &')
         #subprocess_call('(/bin/run-parts /jzk/cron/post_GUI) &', shell=True) odpalone przez vfd
     except:
         print '[PlugLoad] exception handled'
         print_exc()
Пример #37
0
 def installFinished(self):
     # was ist eigentlich passiert? Aktualisiere...
     self["list"].instance.hide()
     try:
         f = open(
             "/usr/lib/opkg/info/" +
             self["list"].l.getCurrentSelection()[0].name + ".control", "r")
         addoncontent = f.read()
         f.close()
     except:
         addoncontent = ""
     name = ""
     version = ""
     description = ""
     addoncontentInfo = addoncontent.split("\n")
     for line in addoncontentInfo:
         if line.startswith("Package: "):
             name = line[9:]
         if line.startswith("Version: "):
             version = line[9:]
         if line.startswith("Description: "):
             description = line[13:]
     if name != "" and version != "":
         for aa in self.pluginlist:
             if aa.name == name:
                 if version == self["list"].l.getCurrentSelection(
                 )[0].version:
                     aa.status = 1
                 else:
                     aa.status = 2
     else:
         for aa in self.pluginlist:
             if aa.name == self["list"].l.getCurrentSelection()[0].name:
                 aa.status = 0
     self.updateList()
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self["list"].instance.show()
Пример #38
0
 def keyOK(self):
     for x in self["config"].list:
         x[1].save()
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.close()
Пример #39
0
def runScreenTest():
	config.misc.startCounter.value += 1

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

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

# iq - [
	if os.path.exists("/etc/.run_factory_test"):
		from Screens.TestMenu import TestMenu
		screensToRun.append((-100, TestMenu))
# ]
	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.isNextRecordAfterEventActionAuto()),
					(session.nav.RecordTimer.getNextZapTime(), 1),
					(plugins.getNextWakeupTime(), 2))
		if x[0] != -1
	]
	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.isNextRecordTimerAfterEventActionAuto.value = recordTimerWakeupAuto
	config.misc.isNextRecordTimerAfterEventActionAuto.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
Пример #40
0
 def closeAndReload(self):
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.close()
Пример #41
0
def languageChanged():
	plugins.clearPluginList()
	plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
Пример #42
0
def updateExtensions(configElement):
    plugins.clearPluginList()
    plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
Пример #43
0
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
Пример #44
0
	def installFinished(self):
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.container.appClosed.remove(self.runFinished)
		self.container.dataAvail.remove(self.dataAvail)
		self.close()
Пример #45
0
def languageChanged():
	plugins.clearPluginList()
	plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
Пример #46
0
def runScreenTest():
    config.misc.startCounter.value += 1
    config.misc.startCounter.save()

    profile("readPluginList")
    enigma.pauseInit()
    plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
    enigma.resumeInit()

    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)

    from enigma import getBoxType
    if SystemInfo in [
            "FirstCheckModel", "SecondCheckModel", "ThirdCheckModel",
            "DifferentLCDSettings"
    ] or getBoxType() in ("alphatriplehd", "tmtwin4k", "osminiplus", "sf3038",
                          "spycat", "et7x00", "ebox5000", "ebox7358",
                          "eboxlumi", "maram9", "sezam5000hd", "mbtwin",
                          "sezam1000hd", "mbmini", "atemio5x00", "beyonwizt3",
                          "dinoboth265", "axashistwin"):
        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("RunReactor")
    profile_final()
    runReactor()

    profile("wakeup")
    from time import strftime, localtime
    from Tools.StbHardware import setFPWakeuptime, setRTCtime
    from Screens.SleepTimerEdit import isNextWakeupTime
    #get currentTime
    nowTime = time()
    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
        from enigma import getBoxBrand
        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 getBoxBrand() == 'gigablue':
                wptime = startTime[
                    0] - 120  # GigaBlue already starts 2 min. before wakeup time
            else:
                wptime = startTime[0] - 240
        if not config.misc.SyncTimeUsing.value == "0" or getBoxBrand(
        ) == 'gigablue':
            print(
                "[mytest] dvb time sync disabled... so set RTC now to current linux time!",
                strftime("%Y/%m/%d %H:%M", localtime(nowTime)))
            setRTCtime(nowTime)
        print("[mytest] 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
Пример #47
0
 def refreshPlugins(self):
     from Components.PluginComponent import plugins
     from Tools.Directories import SCOPE_PLUGINS, resolveFilename
     plugins.clearPluginList()
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
Пример #48
0
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)

	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)

	if enigma.getBoxType() == 'odinm9' or enigma.getBoxType() == 'ventonhdx' or enigma.getBoxType() == 'ebox5000' or enigma.getBoxType() == 'ixussone' or enigma.getBoxType() == 'ixusszero':
		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("RunReactor")
	profile_final()

	if enigma.getBoxType() == 'gb800se' or enigma.getBoxType() == 'gb800solo':
		from enigma import evfd, eConsoleAppContainer
		try:
			cmd = 'vfdctl "    openatv starting e2"'
			container = eConsoleAppContainer()
			container.execute(cmd)
		except:
			evfd.getInstance().vfd_write_string("-E2-")
		evfd.getInstance().vfd_led(str(1))
		
	if enigma.getBoxType() == 'odinm7' or enigma.getBoxType() == 'odinm6' or enigma.getBoxType() == 'xp1000s':
		f = open("/dev/dbox/oled0", "w")
		f.write('-E2-')
		f.close()
		
	print "##################################### BOOTUP ACTIONS ###########################################"
	print "lastshutdown=%s" % config.usage.shutdownOK.getValue()
	print "NOK shutdown action=%s" % config.usage.shutdownNOK_action.getValue()
	print "bootup action=%s" % config.usage.boot_action.getValue()
	if not config.usage.shutdownOK.getValue() and not config.usage.shutdownNOK_action.getValue() == 'normal' or not config.usage.boot_action.getValue() == 'normal':
		print "last shutdown = %s" % config.usage.shutdownOK.getValue()
		import Screens.PowerLost
		Screens.PowerLost.PowerLost(session)

	config.usage.shutdownOK.setValue(False)
	config.usage.shutdownOK.save()
	configfile.save()
	
	runReactor()

	print "normal shutdown"
	config.misc.startCounter.save()
	config.usage.shutdownOK.setValue(True)
	config.usage.shutdownOK.save()

	profile("wakeup")

	from time import time, strftime, localtime
	from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime
	#get currentTime
	nowTime = time()
	if not config.misc.SyncTimeUsing.getValue() == "0" or enigma.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)

	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:
		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 enigma.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 enigma.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:
		from time import strftime
		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 enigma.getBoxType().startswith("gb"):
				wptime = startTime[0] # Gigaboxes already starts 2 min. before wakeup time
			else:
				wptime = startTime[0]
#		if not config.misc.SyncTimeUsing.getValue() == "0" or enigma.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
Пример #49
0
def runScreenTest():
    config.misc.startCounter.value += 1
    config.misc.startCounter.save()

    profile("readPluginList")
    enigma.pauseInit()
    plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
    enigma.resumeInit()

    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("RunReactor")
    profile_final()
    runReactor()

    profile("wakeup")
    from time import time, strftime, localtime
    from Tools.StbHardware import setFPWakeuptime, setRTCtime
    from Screens.SleepTimerEdit import isNextWakeupTime
    #get currentTime
    nowTime = time()
    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:
            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)
        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
Пример #50
0
def runScreenTest():
	config.misc.startCounter.value += 1

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

	profile("Init:Session")
	nav = Navigation(config.misc.isNextRecordTimerAfterEventActionAuto.value)
	session = Session(desktop = getDesktop(0), summary_desktop = 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, Screens.InfoBar.InfoBar))

	screensToRun.sort()

	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:
			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("RunReactor")
	profile_final()
	runReactor()

	config.misc.startCounter.save()

	profile("wakeup")
	from time import time, strftime, localtime
	from Tools.DreamboxHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime
	#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))
		if x[0] != -1
	]
	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.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
Пример #51
0
 def closeRecursive(self):
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     downfile = '/tmp/.catalog.xml'
     if fileExists(downfile):
         os.remove(downfile)
     self.close(True)
Пример #52
0
 def closeAndReload(self):
     plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     self.close()
Пример #53
0
 def doCallBack(self):
     if self.filename.startswith("enigma2-plugin-"):
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
     return
Пример #54
0
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
			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 ('sf3038', 'tomcat', 'nano', 'nanoc', 'et7500', 'mixosf5', 'mixosf7', 'mixoslumi', 'gi9196m', 'maram9', 'ixussone', 'ixussone', 'uniboxhd1', 'uniboxhd2', 'uniboxhd3', 'sezam5000hd', 'mbtwin', 'sezam1000hd', 'mbmini', 'atemio5x00', 'beyonwizt3') or getBrandOEM() in ('fulan'):
		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...)
	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 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.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 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.value == "0" or boxtype.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 config.workaround.deeprecord.value:
				wptime = startTime[0] - 240 # 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
Пример #55
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)

	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)

	if boxtype in ('odinm9', 'et7500', 'ventonhdx', 'maram9', 'ixussone', 'ixussone'):
		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', 'odinm7', 'odinm6', 'xp1000s'):
		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()
	configfile.save()

	runReactor()

	print "[mytest.py] normal shutdown"
	config.misc.startCounter.save()
	config.usage.shutdownOK.setValue(True)
	config.usage.shutdownOK.save()

	profile("wakeup")

	from time import time, strftime, localtime
	from Tools.StbHardware import setFPWakeuptime, getFPWakeuptime, setRTCtime
	#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
	nextPluginTime = plugins.getNextWakeupTime()
	nextPluginTimeInStandby = 1

	wakeupList = [
		x for x in ((nextRecordTime, 0, nextRecordTimeInStandby),
					(nextZapTime, 1, nextZapTimeInStandby),
					(nextPowerTime, 2, nextPowerTimeInStandby),
					(nextPluginTime, 3, nextPluginTimeInStandby))
		#if x[0] != -1 and x[0] >= nowTime - 60 #no startTime[0] in the past (e.g. vps-plugin -> if current time between 'recordtimer begin - vps initial time' is startTime in the past ...)
		if x[0] != -1
	]
	wakeupList.sort()

	# individual wakeup time offset
	if config.workaround.wakeuptimeoffset.value == "standard":
		if boxtype.startswith("gb"):
			wpoffset = -120 # Gigaboxes already starts 2 min. before wakeup time
		else:
			wpoffset = 0
	else:
		wpoffset = int(config.workaround.wakeuptimeoffset.value)

	config.misc.nextWakeup.value = "-1,-1,0,0,-1,0"
	if wakeupList and wakeupList[0][0] > 0:
		startTime = wakeupList[0]
		# wakeup time is 5 min before timer starts + offset
		wptime = startTime[0] - 300 - wpoffset
		if (wptime - nowTime) < 120: # no time to switch box back on
			wptime = int(nowTime) + 120  # so switch back on in 120 seconds

		forceNextRecord = 0
		if startTime[1] != 0 and nextRecordTime > 0:
			#check for plugin-, zap- or power-timer to enable the forced record-timer wakeup - when next record starts in 15 mins
			if abs(nextRecordTime - startTime[0]) <= 900:
				forceNextRecord = 1
			else:
			#check for vps-plugin to enable the record-timer wakeup
				try:
					if config.plugins.vps.allow_wakeup.value:
						if startTime[0] + config.plugins.vps.initial_time.value * 60 == nextRecordTime \
						or startTime[0] - 20 + config.plugins.vps.initial_time.value * 60 == nextRecordTime: #vps using begin time, not start prepare time
							forceNextRecord = 1
				except:
					pass
		setStandby = startTime[2]
		print "="*100
		print "[mytest.py] set next wakeup type to '%s' %s" % ({0:"record-timer",1:"zap-timer",2:"power-timer",3:"plugin-timer"}[startTime[1]],{0:"and starts normal",1:"and starts in standby"}[setStandby])
		if forceNextRecord:
			print "[mytest.py] timer is 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
		#print Screens.Standby.quitMainloopCode
		if Screens.Standby.quitMainloopCode != 1:
			setStandby = 2 # 0=no standby, but get in standby if wakeup to timer start > 60 sec, 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:
		print "[mytest.py] no set next wakeup time"
	print "="*100
	config.misc.nextWakeup.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
Пример #56
0
def runScreenTest():
    config.misc.startCounter.value += 1
    config.misc.startCounter.save()

    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)

    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)

    config.misc.epgcache_filename.addNotifier(setEPGCachePath)

    if not RestoreSettings:
        runNextScreen(session, screensToRun)

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

    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') 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,%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'
        ):  #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
Пример #57
0
 def zamknijMenu(self, *res):
     if len(res) and res[0]:
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self.close(True)
Пример #58
0
	def installFinished(self):
		plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
		self.container.appClosed.remove(self.runFinished)
		self.container.dataAvail.remove(self.dataAvail)
		self.close()
Пример #59
0
 def ipkgCallback(self, event, param):
     if event == IpkgComponent.EVENT_DONE:
         plugins.readPluginList(resolveFilename(SCOPE_PLUGINS))
         self.close()