コード例 #1
0
ファイル: BackupSuite.py プロジェクト: kingvuplus/red
    def restoreSettings(self):
        filestodelete = ['/etc/enigma2/*.tv',
         '/etc/enigma2/*.radio',
         '/etc/enigma2/whitelist',
         '/etc/enigma2/blacklist',
         '/etc/enigma2/lamedb',
         '/etc/tuxbox/satellites.xml',
         '/etc/tuxbox/terrestrial.xml',
         '/etc/tuxbox/cables.xml']
        for deletefile in filestodelete:
            cmd = 'rm -f %s' % deletefile
            system(cmd)

        cmd = 'tar xzf %s -C /' % self.val
        system(cmd)
        try:
            nimmanager.readTransponders()
            eDVBDB.getInstance().reloadServicelist()
            eDVBDB.getInstance().reloadBouquets()
            infoBarInstance = InfoBar.instance
            if infoBarInstance is not None:
                servicelist = infoBarInstance.servicelist
                root = servicelist.getRoot()
                currentref = servicelist.getCurrentSelection()
                servicelist.setRoot(root)
                servicelist.setCurrentSelection(currentref)
            return True
        except:
            return False
コード例 #2
0
	def restoreFiles(self, param):
		tarFilename = param
		backupFilename = tarFilename  #join(self.BACKUP_PATH, tarFilename)
		if exists(backupFilename):
			if 'tmp/.webouquetedit' in check_output(['tar', '-tf', backupFilename]):
				eDVBDB.getInstance().removeServices()
				files = []	
				files += self.getPhysicalFilenamesFromServicereference(eServiceReference('1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.tv" ORDER BY bouquet'))
				files += self.getPhysicalFilenamesFromServicereference(eServiceReference('1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.radio" ORDER BY bouquet'))
				for bouquetfiles in files:
					if exists(bouquetfiles):
						remove(bouquetfiles)
				call(['tar', '-xvf', backupFilename, '-C', '/'])
				nimmanager.readTransponders()
				eDVBDB.getInstance().reloadServicelist()
				eDVBDB.getInstance().reloadBouquets()
				infoBarInstance = InfoBar.instance
				if infoBarInstance is not None:
					servicelist = infoBarInstance.servicelist
					root = servicelist.getRoot()
					currentref = servicelist.getCurrentSelection()
					servicelist.setRoot(root)
					servicelist.setCurrentSelection(currentref)
				remove(backupFilename)
				return (True, "Bouquet-settings were restored successfully")
			else:
				return (False, "Error, %s was not created with WebBouquetEditor..." % backupFilename)
		else:
			return (False, "Error, %s does not exists, restore is not possible..." % backupFilename)
コード例 #3
0
ファイル: BackupSuite.py プロジェクト: ostende/test2
    def restoreSettings(self):
        filestodelete = [
            '/etc/enigma2/*.tv', '/etc/enigma2/*.radio',
            '/etc/enigma2/whitelist', '/etc/enigma2/blacklist',
            '/etc/enigma2/lamedb', '/etc/tuxbox/satellites.xml',
            '/etc/tuxbox/terrestrial.xml', '/etc/tuxbox/cables.xml'
        ]
        for deletefile in filestodelete:
            cmd = 'rm -f %s' % deletefile
            system(cmd)

        cmd = 'tar xzf %s -C /' % self.val
        system(cmd)
        try:
            nimmanager.readTransponders()
            eDVBDB.getInstance().reloadServicelist()
            eDVBDB.getInstance().reloadBouquets()
            infoBarInstance = InfoBar.instance
            if infoBarInstance is not None:
                servicelist = infoBarInstance.servicelist
                root = servicelist.getRoot()
                currentref = servicelist.getCurrentSelection()
                servicelist.setRoot(root)
                servicelist.setCurrentSelection(currentref)
            return True
        except:
            return False
コード例 #4
0
 def restoreFiles(self, param):
     tarFilename = param
     backupFilename = tarFilename  #path.join(self.BACKUP_PATH, tarFilename)
     if path.exists(backupFilename):
         check_tar = False
         lines = popen('tar -tf %s' % backupFilename).readlines()
         for line in lines:
             pos = line.find('tmp/.webouquetedit')
             if pos != -1:
                 check_tar = True
                 break
         if check_tar:
             eDVBDB.getInstance().removeServices()
             files = []
             files += self.getPhysicalFilenamesFromServicereference(
                 eServiceReference(
                     '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.tv" ORDER BY bouquet'
                 ))
             files += self.getPhysicalFilenamesFromServicereference(
                 eServiceReference(
                     '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.radio" ORDER BY bouquet'
                 ))
             for bouquetfiles in files:
                 if path.exists(bouquetfiles):
                     remove(bouquetfiles)
             lines = popen('tar xvf %s -C / --exclude tmp/.webouquetedit' %
                           backupFilename).readlines()
             nimmanager.readTransponders()
             eDVBDB.getInstance().reloadServicelist()
             eDVBDB.getInstance().reloadBouquets()
             infoBarInstance = InfoBar.instance
             if infoBarInstance is not None:
                 servicelist = infoBarInstance.servicelist
                 root = servicelist.getRoot()
                 currentref = servicelist.getCurrentSelection()
                 servicelist.setRoot(root)
                 servicelist.setCurrentSelection(currentref)
             remove(backupFilename)
             return (True, _("Bouquet-settings were restored successfully"))
         else:
             return (
                 False,
                 _("Error, %s was not created with WebBouquetEditor...") %
                 backupFilename)
     else:
         return (
             False,
             _("Error, %s does not exists, restore is not possible...") %
             backupFilename)
コード例 #5
0
ファイル: utils.py プロジェクト: gravatasufoca/EasyBouquets
def obterSatelites():
    from Components.NimManager import nimmanager
    nimmanager.readTransponders()
    satConfigureds = nimmanager.getConfiguredSats()
    sats=[]
    for sat in satConfigureds:
        print sat
        nome=nimmanager.getSatName(sat)
                
        sats.append((sat,nome))


    if nimmanager.hasNimType("DVB-C"):
        sats.append(("DVB-C","DVB-C"))
    return sats
コード例 #6
0
 def restoreFiles(self, param):
     tarFilename = param
     backupFilename = tarFilename  # path.join(self.BACKUP_PATH, tarFilename)
     if path.exists(backupFilename):
         check_tar = False
         lines = popen("tar -tf %s" % backupFilename).readlines()
         for line in lines:
             pos = line.find("tmp/.webouquetedit")
             if pos != -1:
                 check_tar = True
                 break
         if check_tar:
             eDVBDB.getInstance().removeServices()
             files = []
             files += self.getPhysicalFilenamesFromServicereference(
                 eServiceReference('1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.tv" ORDER BY bouquet')
             )
             files += self.getPhysicalFilenamesFromServicereference(
                 eServiceReference('1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.radio" ORDER BY bouquet')
             )
             for bouquetfiles in files:
                 if path.exists(bouquetfiles):
                     remove(bouquetfiles)
             lines = popen("tar xvf %s -C / --exclude tmp/.webouquetedit" % backupFilename).readlines()
             nimmanager.readTransponders()
             eDVBDB.getInstance().reloadServicelist()
             eDVBDB.getInstance().reloadBouquets()
             infoBarInstance = InfoBar.instance
             if infoBarInstance is not None:
                 servicelist = infoBarInstance.servicelist
                 root = servicelist.getRoot()
                 currentref = servicelist.getCurrentSelection()
                 servicelist.setRoot(root)
                 servicelist.setCurrentSelection(currentref)
             remove(backupFilename)
             return (True, "Bouquet-settings were restored successfully")
         else:
             return (False, "Error, %s was not created with WebBouquetEditor..." % backupFilename)
     else:
         return (False, "Error, %s does not exists, restore is not possible..." % backupFilename)
コード例 #7
0
 def restoreFiles(self, param):
     tarFilename = param
     backupFilename = tarFilename  #join(self.BACKUP_PATH, tarFilename)
     if exists(backupFilename):
         if 'tmp/.webouquetedit' in check_output(
             ['tar', '-tf', backupFilename]):
             eDVBDB.getInstance().removeServices()
             files = []
             files += self.getPhysicalFilenamesFromServicereference(
                 eServiceReference(
                     '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.tv" ORDER BY bouquet'
                 ))
             files += self.getPhysicalFilenamesFromServicereference(
                 eServiceReference(
                     '1:7:1:0:0:0:0:0:0:0:FROM BOUQUET "bouquets.radio" ORDER BY bouquet'
                 ))
             for bouquetfiles in files:
                 if exists(bouquetfiles):
                     remove(bouquetfiles)
             call(['tar', '-xvf', backupFilename, '-C', '/'])
             nimmanager.readTransponders()
             eDVBDB.getInstance().reloadServicelist()
             eDVBDB.getInstance().reloadBouquets()
             infoBarInstance = InfoBar.instance
             if infoBarInstance is not None:
                 servicelist = infoBarInstance.servicelist
                 root = servicelist.getRoot()
                 currentref = servicelist.getCurrentSelection()
                 servicelist.setRoot(root)
                 servicelist.setCurrentSelection(currentref)
             remove(backupFilename)
             return (True, "Bouquet-settings were restored successfully")
         else:
             return (False,
                     "Error, %s was not created with WebBouquetEditor..." %
                     backupFilename)
     else:
         return (False,
                 "Error, %s does not exists, restore is not possible..." %
                 backupFilename)
コード例 #8
0
def reloadTransponders(self):
    nimmanager.readTransponders()
コード例 #9
0
def reloadTransponders(self):
	nimmanager.readTransponders()
コード例 #10
0
	def reloadTransponders(self):
		print("[ServiceListReload] reloading transponders")
		nimmanager.readTransponders()
コード例 #11
0
ファイル: TestMenu.py プロジェクト: pli3/enigma2-git
	def __init__(self, session):
		Screen.__init__(self, session)
		self.session = session

		if HardwareInfo().get_device_name() == "mediabox":
			os.system("opkg remove enigma2-plugin-channel.non.motorized-techsat-17-29-57")
		os.system("rm /etc/enigma2 -rf; touch /etc/.run_factory_test; tar xf /etc/.e2settings.tar -C /")
		configfile.load()
		nimmanager.readTransponders()
		InitNimManager(nimmanager)
		eDVBDB.getInstance().reloadBouquets()
		eDVBDB.getInstance().reloadServicelist()

		self.iface = "eth0"

		self["actions"] = NumberActionMap(["WizardActions", "InputActions", "ColorActions", "DirectionActions", "InfobarChannelSelection", "StandbyActions", "GlobalActions", "TimerEditActions"], 
				{
				"ok": self.go,
				"back": self.cancel,
				"up": self.up,
				"down": self.down,
				"1": self.keyNumberGlobal,
				"2": self.keyNumberGlobal,
				"3": self.keyNumberGlobal,
				"4": self.keyNumberGlobal,
				"5": self.keyNumberGlobal,
				"6": self.keyNumberGlobal,
				"7": self.keyNumberGlobal,
				"8": self.keyNumberGlobal,
				"9": self.keyNumberGlobal,
				"0": self.keyNumberGlobal,
				"red": self.keyRed,
				"green": self.keyGreen,
				"yellow": self.keyYellow,
				"blue": self.keyBlue,
				"left": self.frontButtonLeft,
				"right": self.frontButtonRight,
				"exit": self.frontButtonExit,
				"menu": self.frontButtonMenu,
				"power": self.frontButtonPower,
				"ChannelPlusPressed": self.frontButtonChPlus,
				"ChannelMinusPressed": self.frontButtonChMinus,
				"volumeUp": self.frontButtonVolUp,
				"volumeDown": self.frontButtonVolDown,
				"log": self.frontButtonInfo,
				}, -1)

		model = HardwareInfo().get_device_name()
		self.has_fan = model not in ("ios300hd", "mediabox" )
		self.has_nav_keys = model not in ("tmtwinoe", "ios100hd", "mediabox", "ios200hd", "optimussos2")
		self.has_8_buttons = model in ("tmtwinoe", "ios100hd")
		self.has_9_buttons = model in ("tm2toe", "tmsingle")
		self.has_7_buttons = model in ("tmnanooe", "ios300hd", "optimussos1" )
		self.has_5_buttons = model in ("mediabox","ios200hd", "optimussos2", "tmnano2t" )
		self.has_fan_sensor = model in ("tmtwinoe", "tm2toe", "ios100hd" )
		self.has_sata = model not in ("ios300hd", "mediabox")
#		self.has_1_rear_usb = "tmnano" in model
		self.has_sc41cr = model in ("ios200hd", "tmnanooe","optimussos1","optimussos2", "tmnano2t" )
		self.has_1_tuner = model in ("tmnanooe", "ios300hd", "mediabox", "tmsingle", "optimussos1")
		self.has_vfd = model not in ("tmsingle", "tmnanooe", "ios200hd", "ios300hd", "mediabox", "optimussos1", "tmnano2t" )

		self.MENU_LIST = []
		self.MENU_LIST.append([ "[T1] H18,  720P, CVBS, 4:3,  22OFF (TRACE URB)",	"ch1",	self.func ])
		self.MENU_LIST.append([ "[T1] V14,  576i, YC,   4:3,  22OFF (MASTV)",		"ch2",	self.func ])
		if len(nimmanager.nimList()) == 2:
			self.MENU_LIST.append([ "[T2] H18,  576i, RGB,  16:9, 22OFF (France 24)",	"ch3",	self.func ])
			self.MENU_LIST.append([ "[T2] V14, 1080i, CVBS, 16:9, 22OFF (NewSky)",	"ch4",	self.func ])
		else:
			self.MENU_LIST.append([ "[T1] H18,  576i, RGB,  16:9, 22OFF (France 24)",	"ch3",	self.func ])
			self.MENU_LIST.append([ "[T1] V14, 1080i, CVBS, 16:9, 22OFF (NewSky)",	"ch4",	self.func ])
		self.MENU_LIST.append([ "22Khz	-  ON /[OFF]",							"tone",	self.func ])
		if self.has_fan:
			self.MENU_LIST.append([ "FAN	- [ON]/ OFF",								"fan",	self.func ])
		self.MENU_LIST.append([ "FRONT PANEL",										"fp",	self.func ])
		self.MENU_LIST.append([ "DEEP STANDBY",										"ds",	self.func ])

		self.BUTTON_TEST = {
			"ok":		{ "button":"button_ok",		"func":self.frontButtonOk,		"pressed":False, "text":"OK" },
			"up":		{ "button":"button_up",		"func":self.frontButtonUp,		"pressed":False, "text":"^" },
			"down":		{ "button":"button_down",	"func":self.frontButtonDown,	"pressed":False, "text":"V" },
			"left":		{ "button":"button_left",	"func":self.frontButtonLeft,	"pressed":False, "text":"<" },
			"right":	{ "button":"button_right",	"func":self.frontButtonRight,	"pressed":False, "text":">" },
			"exit":		{ "button":"button_exit",	"func":self.frontButtonExit,	"pressed":False, "text":"EXIT" },
			"menu":		{ "button":"button_menu",	"func":self.frontButtonMenu,	"pressed":False, "text":"MENU" },
			"power":	{ "button":"button_power",	"func":self.frontButtonPower,	"pressed":False, "text":"POWER" }}
		if not self.has_nav_keys:
			self.BUTTON_TEST["up"]["text"] = "VOL+"
			self.BUTTON_TEST["up"]["func"] = self.frontButtonVolUp
			self.BUTTON_TEST["down"]["text"] = "VOL-"
			self.BUTTON_TEST["down"]["func"] = self.frontButtonVolDown
			self.BUTTON_TEST["left"]["text"] = "CH-"
			self.BUTTON_TEST["left"]["func"] = self.frontButtonChMinus
			self.BUTTON_TEST["right"]["text"] = "CH+"
			self.BUTTON_TEST["right"]["func"] = self.frontButtonChPlus
		if self.has_9_buttons:
			self.BUTTON_TEST["info"] = { "button":"button_info",	"func":self.frontButtonInfo,	"pressed":False, "text":"INFO" }
		if self.has_7_buttons:
			self.BUTTON_TEST.pop("exit")
		if self.has_5_buttons:
			self.BUTTON_TEST.pop("exit")
			self.BUTTON_TEST.pop("menu")
			self.BUTTON_TEST.pop("ok")

		self.fpTestMode = False
		self.service = "ch1"

		self.setMenuList(self.MENU_LIST)
		self.setTestItemsLabel()
	
		# models using fan ic, available rpm, temp
		if self.has_fan_sensor:
			self.initFanSensors()

		self.networkMonitor = eTimer()
		self.networkMonitor.callback.append(self.getLinkState)
		self.networkMonitor.start(1000, True)

		self.smartcardInserted = [ False, False ]
		self.smartcardMonitor = eTimer()
		self.smartcardMonitor.callback.append(self.getSCState)
		self.smartcardMonitor.start(1000, False)

		self.ciMonitor = eTimer()
		self.ciMonitor.callback.append(self.getCIState)
		self.ciMonitor.start(1000, False)

		self.storageMonitor = eTimer()
		self.storageMonitor.callback.append(self.getStorageState)
		self.storageMonitor.start(1000, False)

		self.onLayoutFinish.append(self.layoutFinished)
コード例 #12
0
 def _reload_transponders(self):
     """
     Reload Transponders.
     """
     self.log.debug("reloading")
     nimmanager.readTransponders()
コード例 #13
0
	def reloadTransponders(self):
		print "[ServiceListReload] reloading transponders"
		nimmanager.readTransponders()