Ejemplo n.º 1
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret["remotegrabscreenshot"] = getRemoteGrabScreenshot()["remotegrabscreenshot"]
        ret["configsections"] = getConfigsSections()["sections"]
        ret["zapstream"] = getZapStream()["zapstream"]
        ret["showname"] = getShowName()["showname"]
        ret["customname"] = getCustomName()["customname"]
        ret["boxname"] = getBoxName()["boxname"]
        if not ret["boxname"] or not ret["customname"]:
            ret["boxname"] = getInfo()["brand"] + " " + getInfo()["model"]
        ret["box"] = getBoxType()
        ret["remote"] = remote
        from Components.config import config

        if hasattr(eEPGCache, "FULL_DESCRIPTION_SEARCH"):
            ret["epgsearchcaps"] = True
        else:
            ret["epgsearchcaps"] = False
            if config.OpenWebif.webcache.epg_desc_search.value:
                config.OpenWebif.webcache.epg_desc_search.value = False
                config.OpenWebif.webcache.epg_desc_search.save()
        ret["epgsearchtype"] = getEPGSearchType()["epgsearchtype"]
        extras = []
        extras.append({"key": "ajax/settings", "description": _("Settings")})
        if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
            lcd4linux_key = "lcd4linux/config"
            if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
                from Components.Network import iNetwork

                ifaces = iNetwork.getConfiguredAdapters()
                if len(ifaces):
                    ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip")  # use only the first configured interface
                    ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
                try:
                    lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
                    lcd4linux_key = lcd4linux_port + "lcd4linux/config"
                except KeyError:
                    lcd4linux_key = None
            if lcd4linux_key:
                extras.append({"key": lcd4linux_key, "description": _("LCD4Linux Setup")})

        try:
            from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer

            extras.append({"key": "ajax/at", "description": _("AutoTimer")})
        except ImportError:
            pass
        if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")):
            extras.append({"key": "ajax/bqe", "description": _("BouquetEditor")})

        try:
            from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh

            extras.append({"key": "ajax/epgr", "description": _("EPGRefresh")})
        except ImportError:
            pass
        ret["extras"] = extras

        return ret
Ejemplo n.º 2
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if open("/proc/stb/info/model",'r').read().strip() == "Gigablue":
			ret['box'] = "gigablue"
		if fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip()
		elif fileExists("/proc/stb/info/boxtype"):
			ret['box'] = open("/proc/stb/info/boxtype").read().strip()
			
		if ret["box"] == "duo" or ret["box"] == "solo" or ret["box"] == "uno":
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] == "et9x00" or ret["box"] == "et9000" or ret["box"] == "et9200":
			ret["remote"] = "et9x00"
		elif ret["box"] == "et5x00" or ret["box"] == "et5000" or ret["box"] == "et6000":
			ret["remote"] = "et5x00"
		elif ret["box"] == "gigablue":
			ret["remote"] = "gigablue"
		else:
			ret["remote"] = "dmm"
		
		return ret
		
Ejemplo n.º 3
0
	def P_settings(self, request):
		ret = {
			"result": True
		}
		ret['configsections'] = getConfigsSections()['sections']
		if config.OpenWebif.webcache.theme.value:
			if os.path.exists(getPublicPath('themes')):
				ret['themes'] = config.OpenWebif.webcache.theme.choices
			else:
				ret['themes'] = ['original', 'clear']
			ret['theme'] = config.OpenWebif.webcache.theme.value
		else:
			ret['themes'] = []
			ret['theme'] = 'original'
		if config.OpenWebif.webcache.moviedb.value:
			ret['moviedbs'] = config.OpenWebif.webcache.moviedb.choices
			ret['moviedb'] = config.OpenWebif.webcache.moviedb.value
		else:
			ret['moviedbs'] = []
			ret['moviedb'] = 'IMDb'
		ret['zapstream'] = config.OpenWebif.webcache.zapstream.value
		ret['showchannelpicon'] = config.OpenWebif.webcache.showchannelpicon.value
		ret['showchanneldetails'] = config.OpenWebif.webcache.showchanneldetails.value
		ret['allowipkupload'] = config.OpenWebif.allow_upload_ipk.value
		loc = getLocations()
		ret['locations'] = loc['locations']
		if os.path.exists(VIEWS_PATH + "/responsive"):
			ret['responsivedesign'] = config.OpenWebif.responsive_enabled.value
		return ret
Ejemplo n.º 4
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if fileExists("/proc/stb/info/hwmodel"):
			ret['box'] = open("/proc/stb/info/hwmodel").read().strip()
		elif fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip()
		elif fileExists("/proc/stb/info/azmodel"):
			ret['box'] = open("/proc/stb/info/model").read().strip()

			
		if ret["box"] == "ios200hd":
			ret["remote"] = "ios200hd"
		elif ret["box"] == "ios300hd":
			ret["remote"] = "ios300hd"
		elif ret["box"] == "ios100hd":
			ret["remote"] = "ios100hd"
		elif ret["box"] == "tmsingle":
			ret["remote"] = "single"
		elif ret["box"] == "tmsingle1":
			ret["remote"] = "single1"
		elif ret["box"] = "tmsinglemini":
			ret["remote"] = "singlemini"
Ejemplo n.º 5
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if fileExists("/proc/stb/info/model"):
			ret['box'] = open("/proc/stb/info/model").read().strip().lower()
		elif fileExists("/proc/stb/info/model"):
			ret['box'] = open("/proc/stb/info/model").read().strip().lower()
			
		if ret["box"] in ("nbox", "esi88", "adb2850", "adb2849", "dsi87"):
			ret["remote"] = "nbox"
		else:
			ret["remote"] = "dmm"
		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			lcd4linux_key = "lcd4linux/config"
			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
				from Components.config import config
				from Components.Network import iNetwork
				ifaces = iNetwork.getConfiguredAdapters()
				if len(ifaces):
					ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip") # use only the first configured interface
					ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
				try:
					lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
					lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
				except KeyError:
					lcd4linux_key = None
			if lcd4linux_key:
				extras.append({ 'key': lcd4linux_key, 'description': _("LCD4Linux Setup")})

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface
		
#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

		ret['extras'] = extras

		return ret
Ejemplo n.º 6
0
 def P_settings(self, request):
     ret = {"result": True}
     ret["configsections"] = getConfigsSections()["sections"]
     if config.OpenWebif.webcache.theme.value:
         ret["themes"] = config.OpenWebif.webcache.theme.choices
         ret["theme"] = config.OpenWebif.webcache.theme.value
     else:
         ret["themes"] = []
         ret["theme"] = "original"
     ret["zapstream"] = getZapStream()["zapstream"]
     ret["showchannelpicon"] = getShowChPicon()["showchannelpicon"]
     return ret
Ejemplo n.º 7
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret["remotegrabscreenshot"] = getRemoteGrabScreenshot()["remotegrabscreenshot"]
        ret["configsections"] = getConfigsSections()["sections"]
        ret["zapstream"] = getZapStream()["zapstream"]
        ret["box"] = "dmm"
        if fileExists("/proc/stb/info/hwmodel"):
            ret["box"] = open("/proc/stb/info/hwmodel").read().strip()
        elif fileExists("/proc/stb/info/vumodel"):
            ret["box"] = open("/proc/stb/info/vumodel").read().strip()
        elif fileExists("/proc/stb/info/azmodel"):
            ret["box"] = open("/proc/stb/info/model").read().strip()

        if ret["box"] == "ios200hd":
            ret["remote"] = "ios200hd"
        elif ret["box"] == "ios300hd":
            ret["remote"] = "ios300hd"
        elif ret["box"] == "ios100hd":
            ret["remote"] = "ios100hd"
        elif ret["box"] == "tmsingle":
            ret["remote"] = "single"
        elif ret["box"] == "2t":
            ret["remote"] = "2t"
        elif ret["box"] == "twin":
            ret["remote"] = "twin"
        elif ret["box"] == "twinoe":
            ret["remote"] = "twinoe"
        elif ret["box"] == "tmtwinoe":
            ret["remote"] = "tmtwinoe"
        elif ret["box"] == "ultimo":
            ret["remote"] = "vu_ultimo"
        elif ret["box"] == "et9x00" or ret["box"] == "et9000" or ret["box"] == "et9200":
            ret["remote"] = "et9x00"
        elif ret["box"] == "et5x00" or ret["box"] == "et5000" or ret["box"] == "et6000":
            ret["remote"] = "et5x00"
        elif ret["box"] == "gigablue":
            ret["remote"] = "gigablue"
        elif ret["box"] == "me" or ret["box"] == "minime":
            ret["remote"] = "me"
        elif ret["box"] == "premium" or ret["box"] == "premium+":
            ret["remote"] = "premium"
        elif ret["box"] == "elite" or ret["box"] == "ultra":
            ret["remote"] = "elite"
        elif ret["box"] == "ini-3000":
            ret["remote"] = "ini-3000"
        elif ret["box"] == "ini-7000" or ret["box"] == "ini-5000":
            ret["remote"] = "ini-7000"
        else:
            ret["remote"] = "dmm"

        return ret
Ejemplo n.º 8
0
	def P_config(self, request):
		
		def RepresentsInt(s):
			try: 
				int(s)
				return True
			except ValueError:
				return False
		
		setcs = getConfigsSections()
		if request.path == '/api/config':
			return setcs
		else:
			try:
				sect = request.path.split('/')
				if len(sect) == 4:
					cfgs = getConfigs(sect[3])
					resultcfgs = []
					for cfg in cfgs['configs']:
						min = -1
						kv=[]
						data = cfg['data']
						if data.has_key('choices'):
							for ch in data['choices']:
								if type(ch).__name__ == 'tuple' and len(ch)==2 and ch[0] == ch[1]:
									if RepresentsInt(ch[0]):
										kv.append(int(ch[0]))
									else:
										kv=[]
										break
								else:
									kv=[]
									break
						
						if len(kv) > 1:
							if kv[1] == (kv[0]+1):
								min = kv[0]
								max = kv[len(kv)-1]

						if min > -1:
							data['min'] = min
							data['max'] = max
							del data['choices']
							cfg['data'] = data
							resultcfgs.append(cfg)
						else:
							resultcfgs.append(cfg)
					return { 'configs' : resultcfgs }
			except Exception, e:
				#TODO show exception
				pass
Ejemplo n.º 9
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['showname'] = getShowName()['showname']
		ret['customname'] = getCustomName()['customname']
		ret['boxname'] = getBoxName()['boxname']
		if not ret['boxname'] or not ret['customname']:
			ret['boxname'] = getInfo()['brand']+" "+getInfo()['model']
		ret['box'] = getBoxType()
		ret["remote"] = remote

		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			lcd4linux_key = "lcd4linux/config"
			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
				from Components.config import config
				from Components.Network import iNetwork
				ifaces = iNetwork.getConfiguredAdapters()
				if len(ifaces):
					ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip") # use only the first configured interface
					ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
				try:
					lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
					lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
				except KeyError:
					lcd4linux_key = None
			if lcd4linux_key:
				extras.append({ 'key': lcd4linux_key, 'description': _("LCD4Linux Setup")})
		
		try:
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
			extras.append({ 'key': 'ajax/at','description': _('AutoTimer')})
		except ImportError:
			pass
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")):
			extras.append({ 'key': 'ajax/bqe','description': _('BouquetEditor')})
		
		try:
			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
			extras.append({ 'key': 'ajax/epgr','description': _('EPGRefresh')})
		except ImportError:
			pass
		ret['extras'] = extras

		return ret
Ejemplo n.º 10
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if open("/proc/stb/info/model",'r').read().strip().lower() == "gigablue":
			ret['box'] = "gigablue"
		if fileExists("/proc/stb/info/boxtype"):
			ret['box'] = open("/proc/stb/info/boxtype").read().strip().lower()
		elif fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip().lower()
		elif fileExists("/proc/stb/info/azmodel"):
			ret['box'] = open("/proc/stb/info/model").read().strip().lower()
			
		if ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
			ret["remote"] = "et9x00"
		elif ret["box"] in ("et5x00", "et5000", "et6000"):
			ret["remote"] = "et5x00"
		elif ret["box"] in ("et4x00", "et4000"):
			ret["remote"] = "et4x00"
		elif ret["box"] == "gigablue":
			ret["remote"] = "gigablue"
		elif ret["box"] in ("me", "minime"):
			ret["remote"] = "me"
		elif ret["box"] in ("premium", "premium+"):
			ret["remote"] = "premium"
		elif ret["box"] in ("elite", "ultra"):
			ret["remote"] = "elite"
		elif ret["box"] in ("ini-1000", "ini-1000ru"):
			ret["remote"] = "ini-1000"
		elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
			ret["remote"] = "miraclebox"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
			ret["remote"] = "ini-7000"
		elif ret["box"] == "xp1000":
			ret["remote"] = "xp1000"
		else:
			ret["remote"] = "dmm"
		
		return ret
Ejemplo n.º 11
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if fileExists("/proc/stb/info/hwmodel"):
			ret['box'] = open("/proc/stb/info/hwmodel").read().strip()
		elif fileExists("/proc/stb/info/azmodel"):
			ret['box'] = open("/proc/stb/info/model").read().strip()
			
		if ret["box"].startswith("tmsingle"):
			ret["remote"] = "tmsingle"
		elif ret["box"] == "2t" or ret["box"] == "tm2toe" or ret["box"] == "tm2toesr":
			ret["remote"] = "tm2toe"
		elif ret["box"].startswith("tmtwin"):
			ret["remote"] = "tmtwinoe"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] == "et9x00" or ret["box"] == "et9000" or ret["box"] == "et9200":
			ret["remote"] = "et9x00"
		elif ret["box"] == "et5x00" or ret["box"] == "et5000" or ret["box"] == "et6000":
			ret["remote"] = "et5x00"
		elif ret["box"] == "gigablue":
			ret["remote"] = "gigablue"
		elif ret["box"] == "me" or ret["box"] == "minime":
			ret["remote"] = "me"
		elif ret["box"] == "premium" or ret["box"] == "premium+":
			ret["remote"] = "premium"
		elif ret["box"] == "elite" or ret["box"] == "ultra":
			ret["remote"] = "elite"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] == "ini-7000" or ret["box"] == "ini-5000":
			ret["remote"] = "ini-7000"
		elif ret["box"] == "tmnano3tcombo":
		    ret["remote"] = "force1plus"
		elif ret["box"] == "tmnanosem2":
			ret["remote"] = "tmnanosem2"
		elif ret["box"] == "tmnanoseplus":
			ret["remote"] = "tmnanoseplus"
		else:
			ret["remote"] = ret["box"]
		
		return ret
Ejemplo n.º 12
0
	def P_settings(self, request):
		ret = {
			"result": True
		}
		ret['configsections'] = getConfigsSections()['sections']
		if config.OpenWebif.webcache.theme.value:
			if os.path.exists(getPublicPath('themes')):
				ret['themes'] = config.OpenWebif.webcache.theme.choices
			else:
				ret['themes'] = ['original','clear']
			ret['theme'] = config.OpenWebif.webcache.theme.value
		else:
			ret['themes'] = []
			ret['theme'] = 'original'
		ret['zapstream'] = getZapStream()['zapstream']
		ret['showchannelpicon'] = getShowChPicon()['showchannelpicon']
		return ret
Ejemplo n.º 13
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret["remotegrabscreenshot"] = getRemoteGrabScreenshot()["remotegrabscreenshot"]
        ret["configsections"] = getConfigsSections()["sections"]
        ret["zapstream"] = getZapStream()["zapstream"]
        ret["box"] = "dmm"
        if open("/proc/stb/info/model", "r").read().strip() == "Gigablue":
            ret["box"] = "gigablue"
        if fileExists("/proc/stb/info/boxtype"):
            ret["box"] = open("/proc/stb/info/boxtype").read().strip()
        elif fileExists("/proc/stb/info/vumodel"):
            ret["box"] = open("/proc/stb/info/vumodel").read().strip()
        elif fileExists("/proc/stb/info/model"):
            ret["box"] = open("/proc/stb/info/model").read().strip()

        if ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
            ret["remote"] = "vu_normal"
        elif ret["box"] == "ultimo":
            ret["remote"] = "vu_ultimo"
        elif ret["box"] == "et9x00" or ret["box"] == "et9000" or ret["box"] == "et9200":
            ret["remote"] = "et9x00"
        elif ret["box"] == "et5x00" or ret["box"] == "et5000" or ret["box"] == "et6000":
            ret["remote"] = "et5x00"
        elif ret["box"] == "gigablue":
            ret["remote"] = "gigablue"
        elif ret["box"] == "me" or ret["box"] == "minime":
            ret["remote"] = "me"
        elif ret["box"] == "premium" or ret["box"] == "premium+":
            ret["remote"] = "premium"
        elif ret["box"] == "elite" or ret["box"] == "ultra":
            ret["remote"] = "elite"
        elif ret["box"] == "ini-3000":
            ret["remote"] = "ini-3000"
        elif ret["box"] == "ini-7000" or ret["box"] == "ini-5000":
            ret["remote"] = "ini-7000"
        elif ret["box"] == "spark" or ret["box"] == "spark7162":
            ret["remote"] = "spark"
        else:
            ret["remote"] = "dmm"

        return ret
Ejemplo n.º 14
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if open("/proc/stb/info/model",'r').read().strip().lower() == "gigablue":
			ret['box'] = "gigablue"
		if fileExists("/proc/stb/info/boxtype"):
			ret['box'] = open("/proc/stb/info/boxtype").read().strip().lower()
		elif fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip().lower()
		elif fileExists("/proc/stb/info/azmodel"):
			ret['box'] = open("/proc/stb/info/model").read().strip().lower()
			
		if ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
			ret["remote"] = "et9x00"
		elif ret["box"] in ("et5x00", "et5000", "et6000"):
			ret["remote"] = "et5x00"
		elif ret["box"] in ("et4x00", "et4000"):
			ret["remote"] = "et4x00"
		elif ret["box"] == "gigablue":
			ret["remote"] = "gigablue"
		elif ret["box"] in ("me", "minime"):
			ret["remote"] = "me"
		elif ret["box"] in ("premium", "premium+"):
			ret["remote"] = "premium"
		elif ret["box"] in ("elite", "ultra"):
			ret["remote"] = "elite"
		elif ret["box"] in ("ini-1000", "ini-1000ru"):
			ret["remote"] = "ini-1000"
		elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
			ret["remote"] = "miraclebox"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
			ret["remote"] = "ini-7000"
		elif ret["box"] == "xp1000":
			ret["remote"] = "xp1000"
		else:
			ret["remote"] = "dmm"
		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			lcd4linux_key = "lcd4linux/config"
			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
				from Components.config import config
				from Components.Network import iNetwork
				ifaces = iNetwork.getConfiguredAdapters()
				if len(ifaces):
					ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip") # use only the first configured interface
					ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
				try:
					lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
					lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
				except KeyError:
					lcd4linux_key = None
			if lcd4linux_key:
				extras.append({ 'key': lcd4linux_key, 'description': _("LCD4Linux Setup")})

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface
		
#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

		ret['extras'] = extras

		return ret
Ejemplo n.º 15
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"

		if fileExists("/proc/stb/info/hwmodel"):
			file = open("/proc/stb/info/hwmodel")
			model = file.read().strip().lower()
			file.close()
		elif fileExists("/proc/stb/info/boxtype"):
			file = open("/proc/stb/info/boxtype")
			model = file.read().strip().lower()
			file.close()
			if model == "gigablue":
				if fileExists("/proc/stb/info/gbmodel"):
					file = open("/proc/stb/info/gbmodel")
					model = file.read().strip().lower()
					file.close()
		elif fileExists("/proc/stb/info/azmodel"):
			file = open("/proc/stb/info/model")
			model = file.read().strip().lower()
			file.close()
		elif fileExists("/proc/stb/info/vumodel"):
			file = open("/proc/stb/info/vumodel")
			model = file.read().strip().lower()
			file.close()
		else:
			file = open("/proc/stb/info/model")
			model = file.read().strip().lower()
			file.close()

		ret['box'] = model

		if ret["box"] == "tmtwinoe":
			ret["remote"] = "tm"
		elif ret["box"] == "tm2toe":
			ret["remote"] = "tm"
		elif ret["box"] == "tmsingle":
			ret["remote"] = "tm"
		elif ret["box"] == "tmnanooe":
			ret["remote"] = "tm"
		elif ret["box"] in ("ios100hd", "ios200hd", "ios300hd"):
			ret["remote"] = "iqon"
		elif ret["box"] in ("optimussos1", "optimussos2"):
			ret["remote"] = "optimuss"
		elif ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
			ret["remote"] = "et9x00"
		elif ret["box"] in ("et5x00", "et5000", "et6000"):
			ret["remote"] = "et5x00"
		elif ret["box"] in ("et4x00", "et4000"):
			ret["remote"] = "et4x00"
		elif ret["box"] == "et6500":
			ret["remote"] = "et6500"
		elif ret["box"] in ("gb800solo", "gb800se", "gb800ue", "gbquad", "gb800seplus", "gb800ueplus", "gbquadplus"):
			ret["remote"] = "gigablue"
		elif ret["box"] in ("me", "minime"):
			ret["remote"] = "me"
		elif ret["box"] in ("premium", "premium+"):
			ret["remote"] = "premium"
		elif ret["box"] in ("elite", "ultra"):
			ret["remote"] = "elite"
		elif ret["box"] == "enfinity":
			ret["remote"] = "evo_small"
		elif ret["box"] in ("ini-1000de", "ini-9000de"):
			ret["remote"] = "xpeedlx"
		elif ret["box"] in ("ini-1000", "ini-1000ru", "ini-9000ru"):
			ret["remote"] = "ini-1000"
		elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
			ret["remote"] = "miraclebox"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
			ret["remote"] = "ini-7000"
		elif ret["box"] == "sogno-8800hd":
			ret["remote"] = "sogno"
		elif ret["box"] in ("xp1000", "xp1000s"):
			ret["remote"] = "xp1000"
		elif ret["box"] == "odinm9":
			ret["remote"] = "odinm9"
		elif getBoxType() == 'odinm6' or getMachineName() == 'AX-Odin':
			ret["remote"] = "starsatlx"
		elif ret["box"] == "odinm7":
			ret["remote"] = "odinm7"
		elif ret["box"] == "e3hd":
			ret["remote"] = "e3hd"
		elif ret["box"] in ("ebox5000", "ebox5100", "ebox7358"):
			ret["remote"] = "ebox5000"
		elif getBoxType() == 'ixussone':
			ret["remote"] = "ixussone"
		elif getBoxType() == 'ixussduo':
			ret["remote"] = "ixussone"
		elif getBoxType() == 'ixusszero':
			ret["remote"] = "ixusszero"
		elif ret["box"] in ("spark", "spark7162"):
			ret["remote"] = "spark"
		else:
			ret["remote"] = "dmm"
		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			lcd4linux_key = "lcd4linux/config"
			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
				from Components.config import config
				from Components.Network import iNetwork
				ifaces = iNetwork.getConfiguredAdapters()
				if len(ifaces):
					ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip") # use only the first configured interface
					ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
				try:
					lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
					lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
				except KeyError:
					lcd4linux_key = None
			if lcd4linux_key:
				extras.append({ 'key': lcd4linux_key, 'description': _("LCD4Linux Setup")})

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface
		
#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

		ret['extras'] = extras

		return ret
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
#		if open("/proc/stb/info/model",'r').read().strip().lower() == "gigablue":
#			ret['box'] = "gigablue"
		if fileExists("/etc/.box"):
			ret['box'] = open("/etc/.box").read().strip().lower()
		elif fileExists("/proc/stb/info/boxtype"):
			ret['box'] = open("/proc/stb/info/boxtype").read().strip().lower()
		elif fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip().lower()
		elif fileExists("/proc/stb/info/azmodel"):
			ret['box'] = open("/proc/stb/info/azmodel").read().strip().lower()
		elif fileExists("/proc/stb/info/model"):
			ret['box'] = open("/proc/stb/info/model").read().strip().lower()

		if ret["box"] in ("vusolo", "vuduo", "vuuno", "vusolo2", "vuduo2", "vusolose", "solo", "duo", "uno", "solo2", "duo2", "solose"):
			ret["remote"] = "vu_normal"
		elif ret["box"] in ("vuultimo", "ultimo"):
			ret["remote"] = "vu_ultimo"
		elif ret["box"] == "e3hd":
			ret["remote"] = "e3hd"
		elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
			ret["remote"] = "et9x00"
		elif ret["box"] in ("et5x00", "et5000", "et6x00", "et6000"):
			ret["remote"] = "et5x00"
		elif ret["box"] in ("et4x00", "et4000"):
			ret["remote"] = "et4x00"
		elif ret["box"] == "gbquad":
			ret["remote"] = "gigablue"
		elif ret["box"] == "gbquadplus":
			ret["remote"] = "gbquadplus"
		elif ret["box"] == "et6500":
			ret["remote"] = "et6500"
		elif ret["box"] in ("et8x00", "et8000", "et1x000", "et10000"):
			ret["remote"] = "et8000"
		elif ret["box"] in ("formuler1", "formuler3"):
			ret["remote"] = "formuler1"
		elif ret["box"] in ("azboxme", "azboxminime", "me", "minime"):
			ret["remote"] = "me"
		elif ret["box"] in ("optimussos1", "optimussos1plus", "optimussos2", "optimussos2plus"):
			ret["remote"] = "optimuss"
		elif ret["box"] in ("premium", "premium+"):
			ret["remote"] = "premium"
		elif ret["box"] in ("elite", "ultra"):
			ret["remote"] = "elite"
		elif ret["box"] in ("ini-1000", "ini-1000ru"):
			ret["remote"] = "ini-1000"
		elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
			ret["remote"] = "miraclebox"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
			ret["remote"] = "ini-7000"
		elif ret["box"].startswith("spark"):
			ret["remote"] = "spark"
		elif ret["box"] == "xp1000":
			ret["remote"] = "xp1000"
		elif ret["box"].startswith("xpeedlx"):
			ret["remote"] = "xpeedlx"
		elif ret["box"] in ("nbox", "esi88", "adb2850", "adb2849", "dsi87"):
			ret["remote"] = "nbox"
		elif ret["box"].startswith("ixuss"):
			ret["remote"] = ret["box"].replace(" ", "")
		else:
			ret["remote"] = "dmm"
		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			lcd4linux_key = "lcd4linux/config"
			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
				from Components.config import config
				from Components.Network import iNetwork
				ifaces = iNetwork.getConfiguredAdapters()
				if len(ifaces):
					ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip") # use only the first configured interface
					ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
				try:
					lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
					lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
				except KeyError:
					lcd4linux_key = None
			if lcd4linux_key:
				extras.append({ 'key': lcd4linux_key, 'description': _("LCD4Linux Setup")})

# TODO Epgrefresh,BouquetEditor as Webinterface
		
		try:
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
			extras.append({ 'key': 'ajax/at','description': 'AutoTimer'})
		except ImportError:
			pass
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")):
			extras.append({ 'key': 'ajax/bqe','description': 'BouquetEditor'})
		
#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

		ret['extras'] = extras

		return ret
Ejemplo n.º 17
0
    def prepareMainTemplate(self, request):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret['configsections'] = getConfigsSections()['sections']
        ret['showname'] = getShowName()['showname']
        ret['customname'] = getCustomName()['customname']
        ret['boxname'] = getBoxName()['boxname']
        if not ret['boxname'] or not ret['customname']:
            ret['boxname'] = getInfo()['brand'] + " " + getInfo()['model']
        ret['box'] = getBoxType()
        ret["remote"] = remote
        from Components.config import config
        if hasattr(eEPGCache, 'FULL_DESCRIPTION_SEARCH'):
            ret['epgsearchcaps'] = True
        else:
            ret['epgsearchcaps'] = False
        extras = []
        extras.append({'key': 'ajax/settings', 'description': _("Settings")})
        from Components.Network import iNetwork
        ifaces = iNetwork.getConfiguredAdapters()
        if len(ifaces):
            ip_list = iNetwork.getAdapterAttribute(
                ifaces[0], "ip")  # use only the first configured interface
            ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2],
                                  ip_list[3])

        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/LCD4linux/WebSite.pyo")):
            lcd4linux_key = "lcd4linux/config"
            if fileExists(
                    resolveFilename(SCOPE_PLUGINS,
                                    "Extensions/WebInterface/plugin.pyo")):
                try:
                    lcd4linux_port = "http://" + ip + ":" + str(
                        config.plugins.Webinterface.http.port.value) + "/"
                    lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
                except KeyError:
                    lcd4linux_key = None
            if lcd4linux_key:
                extras.append({
                    'key': lcd4linux_key,
                    'description': _("LCD4Linux Setup"),
                    'nw': '1'
                })

        self.oscamconf = self.oscamconfPath()
        if self.oscamconf is not None:
            data = open(self.oscamconf, "r").readlines()
            proto = "http"
            port = None
            for i in data:
                if "httpport" in i.lower():
                    port = i.split("=")[1].strip()
                    if port[0] == '+':
                        proto = "https"
                        port = port[1:]
            if port is not None:
                url = "%s://%s:%s" % (proto, request.getRequestHostname(),
                                      port)
                extras.append({
                    'key': url,
                    'description': _("OSCam Webinterface"),
                    'nw': '1'
                })

        try:
            from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
            extras.append({'key': 'ajax/at', 'description': _('AutoTimer')})
        except ImportError:
            pass

        if fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")):
            extras.append({
                'key': 'ajax/bqe',
                'description': _('BouquetEditor')
            })

        try:
            from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
            extras.append({'key': 'ajax/epgr', 'description': _('EPGRefresh')})
        except ImportError:
            pass

        ret['extras'] = extras
        if config.OpenWebif.webcache.theme.value:
            ret['theme'] = config.OpenWebif.webcache.theme.value
        else:
            ret['theme'] = 'original'
        return ret
Ejemplo n.º 18
0
	def prepareMainTemplate(self, request):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['configsections'] = getConfigsSections()['sections']
		ret['showname'] = getShowName()['showname']
		ret['customname'] = getCustomName()['customname']
		ret['boxname'] = getBoxName()['boxname']
		if not ret['boxname'] or not ret['customname']:
			ret['boxname'] = getInfo()['brand'] + " " + getInfo()['model']
		ret['box'] = getBoxType()
		ret["remote"] = REMOTE
		if hasattr(eEPGCache, 'FULL_DESCRIPTION_SEARCH'):
			ret['epgsearchcaps'] = True
		else:
			ret['epgsearchcaps'] = False
		extras = [{'key': 'ajax/settings', 'description': _("Settings")}]
		ifaces = iNetwork.getConfiguredAdapters()
		if len(ifaces):
			ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip")  # use only the first configured interface
			ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])

			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
				lcd4linux_key = "lcd4linux/config"
				if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
					try:
						lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
						lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
					except:  # noqa: E722
						lcd4linux_key = None
				if lcd4linux_key:
					extras.append({'key': lcd4linux_key, 'description': _("LCD4Linux Setup"), 'nw': '1'})

		self.oscamconf = self.oscamconfPath()
		if self.oscamconf is not None:
			data = open(self.oscamconf, "r").readlines()
			proto = "http"
			port = None
			for i in data:
				if "httpport" in i.lower():
					port = i.split("=")[1].strip()
					if port[0] == '+':
						proto = "https"
						port = port[1:]
			if port is not None:
				url = "%s://%s:%s" % (proto, request.getRequestHostname(), port)
				extras.append({'key': url, 'description': _("OSCam Webinterface"), 'nw': '1'})

		try:
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer  # noqa: F401
			extras.append({'key': 'ajax/at', 'description': _('AutoTimer')})
		except ImportError:
			pass

		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")) or fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/bqe.pyo")):
			extras.append({'key': 'ajax/bqe', 'description': _('BouquetEditor')})

		try:
			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh  # noqa: F401
			extras.append({'key': 'ajax/epgr', 'description': _('EPGRefresh')})
		except ImportError:
			pass

		try:
			# this will currenly only works if NO Webiterface plugin installed
			# TODO: test if webinterface AND openwebif installed
			from Plugins.Extensions.WebInterface.WebChilds.Toplevel import loaded_plugins
			for plugins in loaded_plugins:
				if plugins[0] in ["fancontrol", "iptvplayer"]:
					try:
						extras.append({'key': plugins[0], 'description': plugins[2], 'nw': '2'})
					except KeyError:
						pass
		except ImportError:
			pass

		if os.path.exists('/usr/bin/shellinaboxd') and (fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/terminal.tmpl")) or fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/OpenWebif/controllers/views/ajax/terminal.pyo"))):
			extras.append({'key': 'ajax/terminal', 'description': _('Terminal')})

		ret['extras'] = extras
		theme = 'original'
		if config.OpenWebif.webcache.theme.value:
			theme = config.OpenWebif.webcache.theme.value
		if not os.path.exists(getPublicPath('themes')):
			if not (theme == 'original' or theme == 'clear'):
				theme = 'original'
				config.OpenWebif.webcache.theme.value = theme
				config.OpenWebif.webcache.theme.save()
		ret['theme'] = theme
		ret['webtv'] = os.path.exists(getPublicPath('webtv'))
		return ret
Ejemplo n.º 19
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret['remotegrabscreenshot'] = getRemoteGrabScreenshot(
        )['remotegrabscreenshot']
        ret['configsections'] = getConfigsSections()['sections']
        ret['zapstream'] = getZapStream()['zapstream']
        ret['showname'] = getShowName()['showname']
        ret['customname'] = getCustomName()['customname']
        ret['boxname'] = getBoxName()['boxname']
        if not ret['boxname'] or not ret['customname']:
            ret['boxname'] = getInfo()['brand'] + " " + getInfo()['model']
        ret['box'] = "dmm"
        #		if open("/proc/stb/info/model",'r').read().strip().lower() == "gigablue":
        #			ret['box'] = "gigablue"
        if fileExists("/etc/.box"):
            ret['box'] = open("/etc/.box").read().strip().lower()
        elif fileExists("/proc/stb/info/boxtype"):
            ret['box'] = open("/proc/stb/info/boxtype").read().strip().lower()
        elif fileExists("/proc/stb/info/vumodel"):
            ret['box'] = open("/proc/stb/info/vumodel").read().strip().lower()
        elif fileExists("/proc/stb/info/azmodel"):
            ret['box'] = open("/proc/stb/info/azmodel").read().strip().lower()
        elif fileExists("/proc/stb/info/model"):
            ret['box'] = open("/proc/stb/info/model").read().strip().lower()

        if ret["box"] in ("vusolo", "vuduo", "vuuno", "vusolo2", "vuduo2",
                          "vusolose", "solo", "duo", "uno", "solo2", "duo2",
                          "solose"):
            ret["remote"] = "vu_normal"
        elif ret["box"] in ("vuultimo", "ultimo"):
            ret["remote"] = "vu_ultimo"
        elif ret["box"] == "e3hd":
            ret["remote"] = "e3hd"
        elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
            ret["remote"] = "et9x00"
        elif ret["box"] in ("et5x00", "et5000", "et6x00", "et6000"):
            ret["remote"] = "et5x00"
        elif ret["box"] in ("et4x00", "et4000"):
            ret["remote"] = "et4x00"
        elif ret["box"] == "gbquad":
            ret["remote"] = "gigablue"
        elif ret["box"] == "gbquadplus":
            ret["remote"] = "gbquadplus"
        elif ret["box"] == "et6500":
            ret["remote"] = "et6500"
        elif ret["box"] in ("et8x00", "et8000", "et1x000", "et10000"):
            ret["remote"] = "et8000"
        elif ret["box"] in ("formuler1", "formuler3"):
            ret["remote"] = "formuler1"
        elif ret["box"] in ("azboxme", "azboxminime", "me", "minime"):
            ret["remote"] = "me"
        elif ret["box"] in ("optimussos1", "optimussos1plus", "optimussos2",
                            "optimussos2plus"):
            ret["remote"] = "optimuss"
        elif ret["box"] in ("premium", "premium+"):
            ret["remote"] = "premium"
        elif ret["box"] in ("elite", "ultra"):
            ret["remote"] = "elite"
        elif ret["box"] in ("ini-1000", "ini-1000ru"):
            ret["remote"] = "ini-1000"
        elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
            ret["remote"] = "miraclebox"
        elif ret["box"] == "ini-3000":
            ret["remote"] = "ini-3000"
        elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
            ret["remote"] = "ini-7000"
        elif ret["box"].startswith("spark"):
            ret["remote"] = "spark"
        elif ret["box"] == "xp1000":
            ret["remote"] = "xp1000"
        elif ret["box"].startswith("xpeedlx"):
            ret["remote"] = "xpeedlx"
        elif ret["box"] in ("nbox", "esi88", "adb2850", "adb2849", "dsi87"):
            ret["remote"] = "nbox"
        elif ret["box"] == "hd2400":
            ret["remote"] = "hd2400"
        elif ret["box"].startswith("ixuss"):
            ret["remote"] = ret["box"].replace(" ", "")
        else:
            ret["remote"] = "dmm"
        extras = []
        extras.append({'key': 'ajax/settings', 'description': _("Settings")})
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/LCD4linux/WebSite.pyo")):
            lcd4linux_key = "lcd4linux/config"
            if fileExists(
                    resolveFilename(SCOPE_PLUGINS,
                                    "Extensions/WebInterface/plugin.pyo")):
                from Components.config import config
                from Components.Network import iNetwork
                ifaces = iNetwork.getConfiguredAdapters()
                if len(ifaces):
                    ip_list = iNetwork.getAdapterAttribute(
                        ifaces[0],
                        "ip")  # use only the first configured interface
                    ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2],
                                          ip_list[3])
                try:
                    lcd4linux_port = "http://" + ip + ":" + str(
                        config.plugins.Webinterface.http.port.value) + "/"
                    lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
                except KeyError:
                    lcd4linux_key = None
            if lcd4linux_key:
                extras.append({
                    'key': lcd4linux_key,
                    'description': _("LCD4Linux Setup")
                })

        try:
            from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
            extras.append({'key': 'ajax/at', 'description': _('AutoTimer')})
        except ImportError:
            pass
        if fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")):
            extras.append({
                'key': 'ajax/bqe',
                'description': _('BouquetEditor')
            })

        try:
            from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
            extras.append({'key': 'ajax/epgr', 'description': _('EPGRefresh')})
        except ImportError:
            pass
        ret['extras'] = extras

        return ret
Ejemplo n.º 20
0
 def P_settings(self, request):
     ret = {"result": True}
     ret["configsections"] = getConfigsSections()["sections"]
     return ret
Ejemplo n.º 21
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"

		if fileExists("/proc/stb/info/hwmodel"):
			file = open("/proc/stb/info/hwmodel")
			model = file.read().strip().lower()
			file.close()
		elif fileExists("/proc/stb/info/boxtype"):
			file = open("/proc/stb/info/boxtype")
			model = file.read().strip().lower()
			file.close()
			if model == "gigablue":
				if fileExists("/proc/stb/info/gbmodel"):
					file = open("/proc/stb/info/gbmodel")
					model = file.read().strip().lower()
					file.close()
					if model == "quad":
						model = "gbquad"
				else:
					model = 'gb800solo'
		elif fileExists("/proc/stb/info/azmodel"):
			file = open("/proc/stb/info/model")
			model = file.read().strip().lower()
			file.close()
		elif fileExists("/proc/stb/info/vumodel"):
			file = open("/proc/stb/info/vumodel")
			model = file.read().strip().lower()
			file.close()
		else:
			file = open("/proc/stb/info/model")
			model = file.read().strip().lower()
			file.close()

		ret['box'] = model

		if ret["box"] == "tmtwinoe":
			ret["remote"] = "tm"
		elif ret["box"] == "tm2toe":
			ret["remote"] = "tm"
		elif ret["box"] == "tmsingle":
			ret["remote"] = "tm"
		elif ret["box"] == "tmnanooe":
			ret["remote"] = "tm"
		elif ret["box"] in ("ios100hd", "ios200hd", "ios300hd"):
			ret["remote"] = "iqon"
		elif ret["box"] in ("optimussos1", "optimussos2"):
			ret["remote"] = "optimuss"
		elif ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
			ret["remote"] = "et9x00"
		elif ret["box"] in ("et5x00", "et5000", "et6000"):
			ret["remote"] = "et5x00"
		elif ret["box"] in ("et4x00", "et4000"):
			ret["remote"] = "et4x00"
		elif ret["box"] == "et6500":
			ret["remote"] = "et6500"
		elif ret["box"] in ("gb800solo", "gb800se", "gb800ue", "gbquad", "gb800seplus", "gb800ueplus", "gbquadplus"):
			ret["remote"] = "gigablue"
		elif ret["box"] in ("me", "minime"):
			ret["remote"] = "me"
		elif ret["box"] in ("premium", "premium+"):
			ret["remote"] = "premium"
		elif ret["box"] in ("elite", "ultra"):
			ret["remote"] = "elite"
		elif ret["box"] in ("ini-1000de", "ini-9000de"):
			ret["remote"] = "xpeedlx"
		elif ret["box"] in ("ini-1000", "ini-1000ru", "ini-9000ru"):
			ret["remote"] = "ini-1000"
		elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
			ret["remote"] = "miraclebox"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
			ret["remote"] = "ini-7000"
		elif ret["box"] in ("xp1000", "xp1000s"):
			ret["remote"] = "xp1000"
		elif ret["box"] == "odinm9":
			ret["remote"] = "odinm9"
		elif ret["box"] == 'odinm6':
			ret["remote"] = "starsatlx"
		elif ret["box"] == "odinm7":
			ret["remote"] = "odinm7"
		elif ret["box"] == "e3hd":
			ret["remote"] = "e3hd"
		elif ret["box"] in ("ebox5000", "ebox5100", "ebox7358"):
			ret["remote"] = "ebox5000"
		elif getBoxType() == 'ixusssone':
			ret["remote"] = "ixussone"
		elif getBoxType() == 'ixussduo':
			ret["remote"] = "ixussone"
		elif getBoxType() == 'ixusszero':
			ret["remote"] = "ixusszero"
		elif ret["box"] in ("spark", "spark7162"):
			ret["remote"] = "spark"
		else:
			ret["remote"] = "dmm"
		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			extras.append({ 'key': 'lcd4linux/config','description': _("LCD4Linux Setup")})

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface
		
#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

		ret['extras'] = extras

		return ret
Ejemplo n.º 22
0
	def prepareMainTemplate(self):
		from Components.Network import iNetwork
		ifaces = iNetwork.getConfiguredAdapters()
		if len(ifaces):
				ip_list = iNetwork.getAdapterAttribute(ifaces[0], "ip") # use only the first configured interface
				ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2], ip_list[3])
			
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['showname'] = getShowName()['showname']
		ret['customname'] = getCustomName()['customname']
		ret['boxname'] = getBoxName()['boxname']
		if not ret['boxname'] or not ret['customname']:
			ret['boxname'] = getInfo()['brand']+" "+getInfo()['model']
		ret['box'] = getBoxType()
		ret["remote"] = remote
		from Components.config import config
		if hasattr(eEPGCache, 'FULL_DESCRIPTION_SEARCH'):
			ret['epgsearchcaps'] = True
		else:
			ret['epgsearchcaps'] = False
			if config.ModernWebif.webcache.epg_desc_search.value:
				config.ModernWebif.webcache.epg_desc_search.value = False
				config.ModernWebif.webcache.epg_desc_search.save()
		ret['epgsearchtype'] = getEPGSearchType()['epgsearchtype']
		extras = []
		extras.append({ 'key': 'ajax/settings','description': _("Settings")})
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/LCD4linux/WebSite.pyo")):
			lcd4linux_key = "lcd4linux/config"
			if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/WebInterface/plugin.pyo")):
				try:
					lcd4linux_port = "http://" + ip + ":" + str(config.plugins.Webinterface.http.port.value) + "/"
					lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
				except KeyError:
					lcd4linux_key = None
			if lcd4linux_key:
				extras.append({ 'key': lcd4linux_key, 'description': _("LCD4Linux Setup")})
		
		if fileExists("/usr/keys/oscam_atv/oscam.conf"):
				oscam_atv_config = ConfigParser.ConfigParser()
				oscam_atv_config.readfp(open('/usr/keys/oscam_atv/oscam.conf'))
				oscam_port = oscam_atv_config.get("webif","httpport");
				oscam_link = "http://" + ip + ":" + oscam_port + "/"
				extras.append({ 'key': oscam_link, 'description': _("OSCam Webinterface")})
		
		try:
			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
			extras.append({ 'key': 'ajax/at','description': _('AutoTimer')})
		except ImportError:
			pass
		if fileExists(resolveFilename(SCOPE_PLUGINS, "Extensions/ModernWebif/controllers/views/ajax/bqe.tmpl")):
			extras.append({ 'key': 'ajax/bqe','description': _('BouquetEditor')})
		
		try:
			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
			extras.append({ 'key': 'ajax/epgr','description': _('EPGRefresh')})
		except ImportError:
			pass
		ret['extras'] = extras

		return ret
Ejemplo n.º 23
0
 def P_settings(self, request):
     ret = {"result": True}
     ret['configsections'] = getConfigsSections()['sections']
     return ret
Ejemplo n.º 24
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret['remotegrabscreenshot'] = getRemoteGrabScreenshot(
        )['remotegrabscreenshot']
        ret['configsections'] = getConfigsSections()['sections']
        ret['zapstream'] = getZapStream()['zapstream']
        ret['showname'] = getShowName()['showname']
        ret['customname'] = getCustomName()['customname']
        ret['boxname'] = getBoxName()['boxname']
        if not ret['boxname'] or not ret['customname']:
            ret['boxname'] = getInfo()['brand'] + " " + getInfo()['model']
        ret['box'] = getBoxType()
        ret["remote"] = remote

        extras = []
        extras.append({'key': 'ajax/settings', 'description': _("Settings")})
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/LCD4linux/WebSite.pyo")):
            lcd4linux_key = "lcd4linux/config"
            if fileExists(
                    resolveFilename(SCOPE_PLUGINS,
                                    "Extensions/WebInterface/plugin.pyo")):
                from Components.config import config
                from Components.Network import iNetwork
                ifaces = iNetwork.getConfiguredAdapters()
                if len(ifaces):
                    ip_list = iNetwork.getAdapterAttribute(
                        ifaces[0],
                        "ip")  # use only the first configured interface
                    ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2],
                                          ip_list[3])
                try:
                    lcd4linux_port = "http://" + ip + ":" + str(
                        config.plugins.Webinterface.http.port.value) + "/"
                    lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
                except KeyError:
                    lcd4linux_key = None
            if lcd4linux_key:
                extras.append({
                    'key': lcd4linux_key,
                    'description': _("LCD4Linux Setup")
                })

        try:
            from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
            extras.append({'key': 'ajax/at', 'description': _('AutoTimer')})
        except ImportError:
            pass
        if fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")):
            extras.append({
                'key': 'ajax/bqe',
                'description': _('BouquetEditor')
            })

        try:
            from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
            extras.append({'key': 'ajax/epgr', 'description': _('EPGRefresh')})
        except ImportError:
            pass
        ret['extras'] = extras

        return ret
Ejemplo n.º 25
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret['remotegrabscreenshot'] = getRemoteGrabScreenshot(
        )['remotegrabscreenshot']
        ret['configsections'] = getConfigsSections()['sections']
        ret['zapstream'] = getZapStream()['zapstream']
        ret['box'] = "dmm"

        if fileExists("/proc/stb/info/hwmodel"):
            file = open("/proc/stb/info/hwmodel")
            model = file.read().strip().lower()
            file.close()
        elif fileExists("/proc/stb/info/boxtype"):
            file = open("/proc/stb/info/boxtype")
            model = file.read().strip().lower()
            file.close()
            if model == "gigablue":
                if fileExists("/proc/stb/info/gbmodel"):
                    file = open("/proc/stb/info/gbmodel")
                    model = file.read().strip().lower()
                    file.close()
                    if model == "quad":
                        model = "gbquad"
                else:
                    model = 'gb800solo'
        elif fileExists("/proc/stb/info/azmodel"):
            file = open("/proc/stb/info/model")
            model = file.read().strip().lower()
            file.close()
        elif fileExists("/proc/stb/info/vumodel"):
            file = open("/proc/stb/info/vumodel")
            model = file.read().strip().lower()
            file.close()
        else:
            file = open("/proc/stb/info/model")
            model = file.read().strip().lower()
            file.close()

        ret['box'] = model

        if ret["box"] == "tmtwinoe":
            ret["remote"] = "tm"
        elif ret["box"] == "tm2toe":
            ret["remote"] = "tm"
        elif ret["box"] == "tmsingle":
            ret["remote"] = "tm"
        elif ret["box"] == "tmnanooe":
            ret["remote"] = "tm"
        elif ret["box"] in ("ios100hd", "ios200hd", "ios300hd"):
            ret["remote"] = "iqon"
        elif ret["box"] in ("optimussos1", "optimussos2"):
            ret["remote"] = "optimuss"
        elif ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
            ret["remote"] = "vu_normal"
        elif ret["box"] == "ultimo":
            ret["remote"] = "vu_ultimo"
        elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
            ret["remote"] = "et9x00"
        elif ret["box"] in ("et5x00", "et5000", "et6000"):
            ret["remote"] = "et5x00"
        elif ret["box"] in ("et4x00", "et4000"):
            ret["remote"] = "et4x00"
        elif ret["box"] == "et6500":
            ret["remote"] = "et6500"
        elif ret["box"] in ("gb800solo", "gb800se", "gb800ue", "gbquad",
                            "gb800seplus", "gb800ueplus", "gbquadplus"):
            ret["remote"] = "gigablue"
        elif ret["box"] in ("me", "minime"):
            ret["remote"] = "me"
        elif ret["box"] in ("premium", "premium+"):
            ret["remote"] = "premium"
        elif ret["box"] in ("elite", "ultra"):
            ret["remote"] = "elite"
        elif ret["box"] in ("ini-1000de", "ini-9000de"):
            ret["remote"] = "xpeedlx"
        elif ret["box"] in ("ini-1000", "ini-1000ru", "ini-9000ru"):
            ret["remote"] = "ini-1000"
        elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
            ret["remote"] = "miraclebox"
        elif ret["box"] == "ini-3000":
            ret["remote"] = "ini-3000"
        elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
            ret["remote"] = "ini-7000"
        elif ret["box"] in ("xp1000", "xp1000s"):
            ret["remote"] = "xp1000"
        elif ret["box"] == "odinm9":
            ret["remote"] = "odinm9"
        elif ret["box"] == 'odinm6':
            ret["remote"] = "starsatlx"
        elif ret["box"] == "odinm7":
            ret["remote"] = "odinm7"
        elif ret["box"] == "e3hd":
            ret["remote"] = "e3hd"
        elif ret["box"] in ("ebox5000", "ebox5100", "ebox7358"):
            ret["remote"] = "ebox5000"
        elif getBoxType() == 'ixusssone':
            ret["remote"] = "ixussone"
        elif getBoxType() == 'ixussduo':
            ret["remote"] = "ixussone"
        elif getBoxType() == 'ixusszero':
            ret["remote"] = "ixusszero"
        elif ret["box"] in ("spark", "spark7162"):
            ret["remote"] = "spark"
        else:
            ret["remote"] = "dmm"
        extras = []
        extras.append({'key': 'ajax/settings', 'description': _("Settings")})
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/LCD4linux/WebSite.pyo")):
            extras.append({
                'key': 'lcd4linux/config',
                'description': _("LCD4Linux Setup")
            })

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface

#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:

#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:

#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

        ret['extras'] = extras

        return ret
Ejemplo n.º 26
0
	def prepareMainTemplate(self):
		# here will be generated the dictionary for the main template
		ret = getCollapsedMenus()
		ret['remotegrabscreenshot'] = getRemoteGrabScreenshot()['remotegrabscreenshot']
		ret['configsections'] = getConfigsSections()['sections']
		ret['zapstream'] = getZapStream()['zapstream']
		ret['box'] = "dmm"
		if open("/proc/stb/info/model",'r').read().strip().lower() == "gigablue":
			ret['box'] = "gigablue"
		if fileExists("/proc/stb/info/boxtype"):
			ret['box'] = open("/proc/stb/info/boxtype").read().strip().lower()
		elif fileExists("/proc/stb/info/vumodel"):
			ret['box'] = open("/proc/stb/info/vumodel").read().strip().lower()
		elif fileExists("/proc/stb/info/azmodel"):
			ret['box'] = open("/proc/stb/info/model").read().strip().lower()
			
		if ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
			ret["remote"] = "vu_normal"
		elif ret["box"] == "ultimo":
			ret["remote"] = "vu_ultimo"
		elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
			ret["remote"] = "et9x00"
		elif ret["box"] in ("et5x00", "et5000", "et6000"):
			ret["remote"] = "et5x00"
		elif ret["box"] in ("et4x00", "et4000"):
			ret["remote"] = "et4x00"
		elif ret["box"] == "gigablue":
			ret["remote"] = "gigablue"
		elif ret["box"] in ("me", "minime"):
			ret["remote"] = "me"
		elif ret["box"] in ("premium", "premium+"):
			ret["remote"] = "premium"
		elif ret["box"] in ("elite", "ultra"):
			ret["remote"] = "elite"
		elif ret["box"] in ("ini-1000", "ini-1000ru"):
			ret["remote"] = "ini-1000"
		elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
			ret["remote"] = "miraclebox"
		elif ret["box"] == "ini-3000":
			ret["remote"] = "ini-3000"
		elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
			ret["remote"] = "ini-7000"
		elif ret["box"] == "xp1000":
			ret["remote"] = "xp1000"
		else:
			ret["remote"] = "dmm"
		extras = []
		extras.append({ 'key': 'ajax/settings','description': 'Settings'})

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface
		
#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:
		
#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

		ret['extras'] = extras
		return ret
Ejemplo n.º 27
0
    def prepareMainTemplate(self, request):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret['configsections'] = getConfigsSections()['sections']
        ret['showname'] = getShowName()['showname']
        ret['customname'] = getCustomName()['customname']
        ret['boxname'] = getBoxName()['boxname']
        if not ret['boxname'] or not ret['customname']:
            ret['boxname'] = getInfo()['brand'] + " " + getInfo()['model']
        ret['box'] = getBoxType()
        ret["remote"] = REMOTE
        if hasattr(eEPGCache, 'FULL_DESCRIPTION_SEARCH'):
            ret['epgsearchcaps'] = True
        else:
            ret['epgsearchcaps'] = False
        extras = [{'key': 'ajax/settings', 'description': _("Settings")}]
        ifaces = iNetwork.getConfiguredAdapters()
        if len(ifaces):
            ip_list = iNetwork.getAdapterAttribute(
                ifaces[0], "ip")  # use only the first configured interface
            ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2],
                                  ip_list[3])

            if fileExists(
                    resolveFilename(SCOPE_PLUGINS,
                                    "Extensions/LCD4linux/WebSite.pyo")):
                lcd4linux_key = "lcd4linux/config"
                if fileExists(
                        resolveFilename(SCOPE_PLUGINS,
                                        "Extensions/WebInterface/plugin.pyo")):
                    try:
                        lcd4linux_port = "http://" + ip + ":" + str(
                            config.plugins.Webinterface.http.port.value) + "/"
                        lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
                    except:  # noqa: E722
                        lcd4linux_key = None
                if lcd4linux_key:
                    extras.append({
                        'key': lcd4linux_key,
                        'description': _("LCD4Linux Setup"),
                        'nw': '1'
                    })

        self.oscamconf = self.oscamconfPath()
        if self.oscamconf is not None:
            data = open(self.oscamconf, "r").readlines()
            proto = "http"
            port = None
            for i in data:
                if "httpport" in i.lower():
                    port = i.split("=")[1].strip()
                    if port[0] == '+':
                        proto = "https"
                        port = port[1:]
            if port is not None:
                url = "%s://%s:%s" % (proto, request.getRequestHostname(),
                                      port)
                extras.append({
                    'key': url,
                    'description': _("OSCam Webinterface"),
                    'nw': '1'
                })

        try:
            from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer  # noqa: F401
            extras.append({'key': 'ajax/at', 'description': _('AutoTimer')})
        except ImportError:
            pass

        if fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/bqe.tmpl")
        ) or fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/bqe.pyo")):
            extras.append({
                'key': 'ajax/bqe',
                'description': _('BouquetEditor')
            })

        try:
            from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh  # noqa: F401
            extras.append({'key': 'ajax/epgr', 'description': _('EPGRefresh')})
        except ImportError:
            pass

        try:
            # this will currenly only works if NO Webiterface plugin installed
            # TODO: test if webinterface AND openwebif installed
            from Plugins.Extensions.WebInterface.WebChilds.Toplevel import loaded_plugins
            for plugins in loaded_plugins:
                if plugins[0] in ["fancontrol", "iptvplayer"]:
                    try:
                        extras.append({
                            'key': plugins[0],
                            'description': plugins[2],
                            'nw': '2'
                        })
                    except KeyError:
                        pass
        except ImportError:
            pass

        if os.path.exists('/usr/bin/shellinaboxd') and (fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/terminal.tmpl"
                )
        ) or fileExists(
                resolveFilename(
                    SCOPE_PLUGINS,
                    "Extensions/OpenWebif/controllers/views/ajax/terminal.pyo")
        )):
            extras.append({
                'key': 'ajax/terminal',
                'description': _('Terminal')
            })

        ret['extras'] = extras
        theme = 'original'
        if config.OpenWebif.webcache.theme.value:
            theme = config.OpenWebif.webcache.theme.value
        if not os.path.exists(getPublicPath('themes')):
            if not (theme == 'original' or theme == 'clear'):
                theme = 'original'
                config.OpenWebif.webcache.theme.value = theme
                config.OpenWebif.webcache.theme.save()
        ret['theme'] = theme
        ret['webtv'] = os.path.exists(getPublicPath('webtv'))
        return ret
	def P_settings(self, request):
		ret = {
			"result": True
		}
		ret['configsections'] = getConfigsSections()['sections']
		return ret
Ejemplo n.º 29
0
    def prepareMainTemplate(self):
        # here will be generated the dictionary for the main template
        ret = getCollapsedMenus()
        ret['remotegrabscreenshot'] = getRemoteGrabScreenshot(
        )['remotegrabscreenshot']
        ret['configsections'] = getConfigsSections()['sections']
        ret['zapstream'] = getZapStream()['zapstream']
        ret['box'] = "dmm"

        if fileExists("/proc/stb/info/hwmodel"):
            file = open("/proc/stb/info/hwmodel")
            model = file.read().strip().lower()
            file.close()
        elif fileExists("/proc/stb/info/boxtype"):
            file = open("/proc/stb/info/boxtype")
            model = file.read().strip().lower()
            file.close()
            if model == "gigablue":
                if fileExists("/proc/stb/info/gbmodel"):
                    file = open("/proc/stb/info/gbmodel")
                    model = file.read().strip().lower()
                    file.close()
        elif fileExists("/proc/stb/info/azmodel"):
            file = open("/proc/stb/info/model")
            model = file.read().strip().lower()
            file.close()
        elif fileExists("/proc/stb/info/vumodel"):
            file = open("/proc/stb/info/vumodel")
            model = file.read().strip().lower()
            file.close()
        else:
            file = open("/proc/stb/info/model")
            model = file.read().strip().lower()
            file.close()

        ret['box'] = model

        if ret["box"] == "tmtwinoe":
            ret["remote"] = "tm"
        elif ret["box"] == "tm2toe":
            ret["remote"] = "tm"
        elif ret["box"] == "tmsingle":
            ret["remote"] = "tm"
        elif ret["box"] == "tmnanooe":
            ret["remote"] = "tm"
        elif ret["box"] in ("ios100hd", "ios200hd", "ios300hd"):
            ret["remote"] = "iqon"
        elif ret["box"] in ("optimussos1", "optimussos2"):
            ret["remote"] = "optimuss"
        elif ret["box"] in ("solo", "duo", "uno", "solo2", "duo2"):
            ret["remote"] = "vu_normal"
        elif ret["box"] == "ultimo":
            ret["remote"] = "vu_ultimo"
        elif ret["box"] in ("et9x00", "et9000", "et9200", "et9500"):
            ret["remote"] = "et9x00"
        elif ret["box"] in ("et5x00", "et5000", "et6000"):
            ret["remote"] = "et5x00"
        elif ret["box"] in ("et4x00", "et4000"):
            ret["remote"] = "et4x00"
        elif ret["box"] == "et6500":
            ret["remote"] = "et6500"
        elif ret["box"] in ("gb800solo", "gb800se", "gb800ue", "gbquad",
                            "gb800seplus", "gb800ueplus", "gbquadplus"):
            ret["remote"] = "gigablue"
        elif ret["box"] in ("me", "minime"):
            ret["remote"] = "me"
        elif ret["box"] in ("premium", "premium+"):
            ret["remote"] = "premium"
        elif ret["box"] in ("elite", "ultra"):
            ret["remote"] = "elite"
        elif ret["box"] == "enfinity":
            ret["remote"] = "evo_small"
        elif ret["box"] in ("ini-1000de", "ini-9000de"):
            ret["remote"] = "xpeedlx"
        elif ret["box"] in ("ini-1000", "ini-1000ru", "ini-9000ru"):
            ret["remote"] = "ini-1000"
        elif ret["box"] in ("ini-1000sv", "ini-5000sv"):
            ret["remote"] = "miraclebox"
        elif ret["box"] == "ini-3000":
            ret["remote"] = "ini-3000"
        elif ret["box"] in ("ini-7012", "ini-7000", "ini-5000", "ini-5000ru"):
            ret["remote"] = "ini-7000"
        elif ret["box"] == "sogno-8800hd":
            ret["remote"] = "sogno"
        elif ret["box"] in ("xp1000", "xp1000s"):
            ret["remote"] = "xp1000"
        elif ret["box"] == "odinm9":
            ret["remote"] = "odinm9"
        elif getBoxType() == 'odinm6' or getMachineName() == 'AX-Odin':
            ret["remote"] = "starsatlx"
        elif ret["box"] == "odinm7":
            ret["remote"] = "odinm7"
        elif ret["box"] == "e3hd":
            ret["remote"] = "e3hd"
        elif ret["box"] in ("ebox5000", "ebox5100", "ebox7358"):
            ret["remote"] = "ebox5000"
        elif getBoxType() == 'ixussone':
            ret["remote"] = "ixussone"
        elif getBoxType() == 'ixussduo':
            ret["remote"] = "ixussone"
        elif getBoxType() == 'ixusszero':
            ret["remote"] = "ixusszero"
        elif ret["box"] in ("spark", "spark7162"):
            ret["remote"] = "spark"
        else:
            ret["remote"] = "dmm"
        extras = []
        extras.append({'key': 'ajax/settings', 'description': _("Settings")})
        if fileExists(
                resolveFilename(SCOPE_PLUGINS,
                                "Extensions/LCD4linux/WebSite.pyo")):
            lcd4linux_key = "lcd4linux/config"
            if fileExists(
                    resolveFilename(SCOPE_PLUGINS,
                                    "Extensions/WebInterface/plugin.pyo")):
                from Components.config import config
                from Components.Network import iNetwork
                ifaces = iNetwork.getConfiguredAdapters()
                if len(ifaces):
                    ip_list = iNetwork.getAdapterAttribute(
                        ifaces[0],
                        "ip")  # use only the first configured interface
                    ip = "%d.%d.%d.%d" % (ip_list[0], ip_list[1], ip_list[2],
                                          ip_list[3])
                try:
                    lcd4linux_port = "http://" + ip + ":" + str(
                        config.plugins.Webinterface.http.port.value) + "/"
                    lcd4linux_key = lcd4linux_port + 'lcd4linux/config'
                except KeyError:
                    lcd4linux_key = None
            if lcd4linux_key:
                extras.append({
                    'key': lcd4linux_key,
                    'description': _("LCD4Linux Setup")
                })

# TODO AutoTimer,Epgrefresh,BouquetEditor as Webinterface

#		try:
#			from Plugins.Extensions.AutoTimer.AutoTimer import AutoTimer
#			extras.append({ 'key': 'ajax/xxx','description': 'AutoTimer'})
#		except ImportError:

#		try:
#			from Plugins.Extensions.WebBouquetEditor.WebComponents.Sources.BouquetEditor import BouquetEditor
#			extras.append({ 'key': 'ajax/xxx','description': 'BouquetEditor'})
#		except ImportError:

#		try:
#			from Plugins.Extensions.EPGRefresh.EPGRefresh import epgrefresh
#			extras.append({ 'key': 'ajax/xxx','description': 'EPGRefresh'})
#		except ImportError:

        ret['extras'] = extras

        return ret