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
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"] = rc_model.getRcFolder()+remotesuffix 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
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
def P_boxinfo(self, request): info = getInfo() model = info["model"] if model == "et9000" or model == "et9200": model = "et9x00" elif model == "et5000" or model == "et6000": model = "et5x00" elif model == "mediabox": model = "Mediabox HD LX-1" elif model == "optimussos1": model = "Optimuss OS1" elif model == "optimussos2": model = "Optimuss OS2" elif model == "et4000" : model = "et4x00" elif model == "xp1000" : model = "xp1000" elif model == "tmnano3tcombo": model = "force1plus" elif model == "tmnanosem2": model = "tmnanosem2" elif model == "tmnanoseplus": model = "tmnanoseplus" if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" return info
def P_boxinfo(self, request): info = getInfo() model = info["model"] if model == "et9000" or model == "et9200": model = "et9x00" elif model == "et5000" or model == "et6000": model = "et5x00" elif model == "mediabox": model = "Mediabox HD LX-1" elif model == "optimussos1": model = "Optimuss OS1" elif model == "optimussos2": model = "Optimuss OS2" elif model == "et4000": model = "et4x00" elif model == "xp1000": model = "xp1000" elif model == "tmnano3tcombo": model = "force1plus" elif model == "tmnanosem2": model = "tmnanosem2" elif model == "tmnanoseplus": model = "tmnanoseplus" if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" return info
def P_boxinfo(self, request): info = getInfo() if fileExists(getPublicPath("/images/boxes/" + info["model"] + ".jpg")): info["boximage"] = info["model"] + ".jpg" else: info["boximage"] = "unknown.jpg" return info
def P_boxinfo(self, request): info = getInfo() model = info["boxtype"] if model in ("et9000", "et9200", "et9500"): model = "et9x00" elif model in ("et5000", "et6000", "et6x00"): model = "et5x00" elif model == "et4000": model = "et4x00" elif model == "xp1000": model = "xp1000" elif model.startswith("vu"): model = model.replace("vu", "") elif model in ("bska", "bxzb"): model = "nbox_white" elif model in ("bsla", "bzzb"): model = "nbox" elif model == "sagemcom88": model = "esi88" if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" if model in ("tf7700hdpvr", "topf", "TF 7700 HDPVR"): info["model"] = "TF 7700 HDPVR" if fileExists(getPublicPath("/images/boxes/topf.jpg")): info["boximage"] = "topf.jpg" return info
def P_movies(self, request): if "dirname" in request.args.keys(): movies = getMovieList(request.args["dirname"][0]) else: movies = getMovieList() info = getInfo() model = info["model"] movies['transcoding'] = getTranscodingSupport() return movies
def P_boxinfo(self, request): info = getInfo() type = getBoxType() if fileExists(getPublicPath("/images/boxes/"+type+".jpg")): info["boximage"] = type+".jpg" else: info["boximage"] = "unknown.jpg?notfound"+type return info
def P_movies(self, request): if "dirname" in request.args.keys(): movies = getMovieList(request.args["dirname"][0]) else: movies = getMovieList() info = getInfo() model = info["model"] movies['transcoding'] = False if model in ("solo2", "duo2", "Sezam Marvel", "Xpeed LX3", "gbquad", "gbquadplus") and path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo')): movies['transcoding'] = True return movies
def P_movies(self, request): if "dirname" in request.args.keys(): movies = getMovieList(request.args["dirname"][0]) else: movies = getMovieList() info = getInfo() model = info["model"] movies['transcoding'] = False if model in ("solo2", "duo2"): movies['transcoding'] = True return movies
def P_getipv6(self, request): request.setHeader("content-type", "text/html") firstpublic = '' info = getInfo()['ifaces'] for iface in info: public = iface['firstpublic'] if public is not None: firstpublic = public break return {"firstpublic": firstpublic}
def P_boxinfo(self, request): info = getInfo(self.session, need_fullinfo = True) type = getBoxType() if fileExists(getPublicPath("/images/boxes/"+type+".png")): info["boximage"] = type+".png" elif fileExists(getPublicPath("/images/boxes/"+type+".jpg")): info["boximage"] = type+".jpg" else: info["boximage"] = "unknown.png" return info
def P_movies(self, request): if "dirname" in request.args.keys(): movies = getMovieList(request.args["dirname"][0]) else: movies = getMovieList() info = getInfo() model = info["model"] chipset = info["chipset"] movies['transcoding'] = False if model in ("solo2", "duo2", "solose", "vusolo2", "vuduo2", "vusolose", "xpeedlx3", "gbquad", "gbquadplus") or chipset in ("7356"): # 7356 model default transcoding movies['transcoding'] = True return movies
def P_boxinfo(self, request): info = getInfo() model = info["model"] if model == "et9000" or model == "et9200": model = "et9x00" elif model == "et5000" or model == "et6000": model = "et5x00" if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" return info
def P_movies(self, request): if "dirname" in request.args.keys(): movies = getMovieList(request.args["dirname"][0]) else: movies = getMovieList() info = getInfo() model = info["model"] movies['transcoding'] = False if model in ("solo2", "duo2", "solose", "vusolo2", "vuduo2", "vusolose", "xpeedlx3", "gbquad", "gbquadplus"): movies['transcoding'] = True return movies
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) info = getInfo() model = info["model"] channels['transcoding'] = getTranscodingSupport() channels['type'] = stype return channels
def P_getipv6(self, request): request.setHeader("content-type", "text/html") firstpublic = '' info = getInfo()['ifaces'] for iface in info: public = iface['firstpublic'] if public is not None: firstpublic = public break return { "firstpublic": firstpublic }
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) info = getInfo() model = info["model"] channels['transcoding'] = False if model in ("solo2", "duo2", "Sezam Marvel", "Xpeed LX3", "gbquad", "gbquadplus") and path.exists(eEnv.resolve('${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo')): channels['transcoding'] = True return channels
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) info = getInfo() model = info["model"] channels['transcoding'] = False if model in ("solo2", "duo2"): channels['transcoding'] = True return channels
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) info = getInfo() model = info["model"] channels['transcoding'] = False channels['type'] = stype if model in ("solo2", "duo2", "solose", "vusolo2", "vuduo2", "vusolose", "xpeedlx3", "gbquad", "gbquadplus"): channels['transcoding'] = True return channels
def P_boxinfo(self, request): """ Gather information about current device. .. deprecated:: 0.26 Box image files mainly increase disk space used by package. Dubious benefit and unclear licensing/distribution permissions. In best case scenario all but one image file is never used. Args: request (twisted.web.server.Request): HTTP request object Returns: dict: key/value pairs """ return getInfo(self.session, need_fullinfo=True)
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) info = getInfo() model = info["model"] chipset = info["chipset"] # for chipset 7356 transcoding channels['transcoding'] = False if model in ("solo2", "duo2", "solose", "vusolo2", "vuduo2", "vusolose", "xpeedlx3", "gbquad", "gbquadplus") or chipset in ("7356"): channels['transcoding'] = True # print "@@@@@@@@@@@@ chipset @@@@@@@@@@@@@@@", chipset return channels
def P_movies(self, request): if "dirname" in request.args.keys(): movies = getMovieList(request.args["dirname"][0]) else: movies = getMovieList() info = getInfo() model = info["model"] movies['transcoding'] = False if model in ( "solo2", "duo2", "Sezam Marvel", "Xpeed LX3", "gbquad", "gbquadplus" ) and path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo' )): movies['transcoding'] = True return movies
def P_channels(self, request): stype = "tv" idbouquet = "ALL" if "stype" in request.args.keys(): stype = request.args["stype"][0] if "id" in request.args.keys(): idbouquet = request.args["id"][0] channels = getChannels(idbouquet, stype) info = getInfo() model = info["model"] channels['transcoding'] = False if model in ( "solo2", "duo2", "Sezam Marvel", "Xpeed LX3", "gbquad", "gbquadplus" ) and path.exists( eEnv.resolve( '${libdir}/enigma2/python/Plugins/SystemPlugins/TransCodingSetup/plugin.pyo' )): channels['transcoding'] = True return channels
def p_index_for_ajax(request): """ The "pages functions" must be called `P_<pagename>`. Example: Contents for endpoint `/index` will be generated using a method named `P_index`. Args: request (twisted.web.server.Request): HTTP request object Returns: dict: Parameter values """ ret = getCollapsedMenus() ginfo = getInfo() 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'] = ginfo['brand'] + " " + ginfo['model'] ret['box'] = getBoxType() if hasattr(eEPGCache, 'FULL_DESCRIPTION_SEARCH'): ret['epgsearchcaps'] = True else: ret['epgsearchcaps'] = False ret['extras'] = [ {'key': 'ajax/settings', 'description': _("Settings")} ] ret['theme'] = 'original-small-screen' ret['content'] = '' 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['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", "vuzero", "solo", "duo", "uno", "solo2", "duo2", "solose", "zero"): 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", "ini-9000de"): 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", "sagemcom88", "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
def P_boxinfo(self, request): info = getInfo() model = info["model"] if model in ("et9000", "et9200", "et9500"): model = "et9x00" elif model in ("et5000", "et6000", "et6x00"): model = "et5x00" elif model == "et4000": model = "et4x00" elif model == "xp1000": model = "xp1000" elif model.startswith("vu"): model = model.replace("vu", "") if fileExists("/etc/.brandtype"): ret_brand = open("/etc/.brandtype").read().strip().lower() # print "@@@@@ [model] @@@@@", model if ret_brand == "technomate": if model == "TM-NANO-3T COMBO": model = "tmnano3tcombo" elif model == "tmnano2super": model = "te_tmnano2super" elif model == "TM-NANO-SE": model = "tmnanose" elif model == "TM-NANO-SE Combo": model = "tmnanosecombo" elif model == "TM-NANO-SE M2": model = "tmnanosem2" elif model == "TM-NANO-SE Plus": model = "tmnanoseplus" elif model == "TM-NANO M3": model = "tmnanom3" else: model = info["model"] elif ret_brand == "edision": if model.endswith("OS1"): model = "optimussos1" elif model.endswith("OS2"): model = "optimussos2" elif model.endswith("OS1PLUS"): model = "ed_op1plus" elif model.endswith("OS2PLUS"): model = "ed_op2plus" elif model.endswith("OS3+"): model = "ed_force1plus" elif model.endswith("OS"): model = "optimussos" else: model = info["model"] elif ret_brand == "worldvision": if model == "Force1+": model = "wo_force1plus" elif model == "force1": model = "wo_force1" elif model == "force2solid": model = "wo_force2solid" elif model == "force2": model = "wo_force2solid" else: model = info["model"] elif ret_brand == "swiss": if model == "Force1+": model = "sw_force1plus" elif model == "force1": model = "sw_force1" else: model = info["model"] elif ret_brand == "xsarius": if model == "FUSION HD": model = "fusionhd" elif model == "FUSION HD SE": model = "fusionhdse" elif model == "PURE HD": model = "purehd" elif model == "SELF SAT": model = "selfsat" else: model = info["model"] elif ret_brand == "iqon": if model == "Force1+": model = "iq_force1plus" elif model == "force1": model = "iq_force1" elif model == "force2": model = "iq_force2" elif model == "force2solid": model = "iq_force2" elif model == "force2plus": model = "iq_force2plus" elif model == "force2se": model = "iq_force2se" elif model == "force2nano": model = "iq_force2nano" elif model == "PURE HD": model = "purehd" elif model == "SELF SAT": model = "selfsat" elif model == "ios100hd": model = "iq_ios100" elif model == "ios200hd": model = "iq_ios200" elif model == "ios300hd": model = "iq_ios300" elif model == "ios300newhd": mdoel = "iq_ios300new" else: model = info["model"] else: model = info["model"] if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" if model in ("tf7700hdpvr", "topf", "TF 7700 HDPVR"): info["model"] = "TF 7700 HDPVR" if fileExists(getPublicPath("/images/boxes/topf.jpg")): info["boximage"] = "topf.jpg" return info
def P_deviceinfo(self, request): return getInfo(need_fullinfo=True)
def P_about(self, request): return { "info": getInfo(self.session, need_fullinfo=True), "service": getCurrentService(self.session) }
def prepareMainTemplate(self, request): # here will be generated the dictionary for the main template ret = getCollapsedMenus() ret['remotegrabscreenshot'] = getRemoteGrabScreenshot( )['remotegrabscreenshot'] 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 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")}) 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
def P_deviceinfo(self, request): return getInfo(session=self.session, need_fullinfo=True)
def P_edittimer(self, request): imagedistro = getInfo()['imagedistro'] vti = imagedistro in ("VTi-Team Image") and 1 or 0 pipzap = imagedistro in ("openpli", "satdreamgr", "openvision", "openrsi") and 1 or 0 return {"vti": vti, "pipzap": pipzap}
def P_about(self, request): return { "info": getInfo(), "service": getCurrentService(self.session) }
def P_deviceinfo(self, request): return getInfo()
def P_boxinfo(self, request): info = getInfo() type = getBoxType() print "##### getBoxType", getBoxType() if fileExists("/etc/.brandtype"): ret_brand = open("/etc/.brandtype").read().strip().lower() if ret_brand == "technomate": if type == "TM-NANO-3T COMBO": type = "tmnano3tcombo" elif type == "tmnano2super": type = "te_tmnano2super" elif type == "TM-NANO-SE": type = "tmnanose" elif type == "TM-NANO-SE Combo": type = "tmnanosecombo" elif type == "TM-NANO-SE M2": type = "tmnanosem2" elif type == "TM-NANO-SE Plus": type = "tmnanoseplus" elif type == "TM-MINI-SE": type = "tmminise" else: type = getBoxType() elif ret_brand == "edision": if type.endswith("OS1"): type = "optimussos1" elif type.endswith("OS2"): type = "optimussos2" elif type.endswith("OS1PLUS"): type = "ed_op1plus" elif type.endswith("OS2PLUS"): type = "ed_op2plus" elif type.endswith("OS3+"): type = "ed_force1plus" elif type.endswith("OS"): type = "optimussos" else: type = getBoxType() elif ret_brand == "worldvision": if type == "Force1+": type = "wo_force1plus" elif type == "force1": type = "wo_force1" elif type == "force2solid": type = "wo_force2solid" elif type == "force2": type = "wo_force2solid" else: type = getBoxType() elif ret_brand == "swiss": if type == "Force1+": type = "sw_force1plus" elif type == "force1": type = "sw_force1" else: type = getBoxType() elif ret_brand == "xsarius": if type == "FUSION HD": type = "fusionhd" elif type == "FUSION HD SE": model = "fusionhdse" elif type == "PURE HD": model = "purehd" elif type == "SELF SAT": type = "selfsat" else: type = getBoxType() elif ret_brand == "iqon": if type == "Force1+": type = "iq_force1plus" elif type == "force1": type = "iq_force1" elif type == "force2": type = "iq_force2" elif type == "force2solid": type = "iq_force2" elif type == "force2plus": type = "iq_force2plus" elif type == "force2se": type = "iq_force2se" elif type == "force2nano": type = "iq_force2nano" elif type == "force2plushv": type = "iq_force2plushv" elif type == "PURE HD": type = "purehd" elif type == "force3": type ="iq_force3" elif type == "force3se": type ="iq_force3se" elif type == "force3uhd": type ="iq_force3uhd" elif type == "force3uhdplus": type ="iq_force3uhdplus" elif type == "SELF SAT": type = "selfsat" elif type == "ios100hd": type = "iq_ios100" elif type == "ios200hd": type = "iq_ios200" elif type == "ios300hd": type = "iq_ios300" elif type == "ios300newhd": type = "iq_ios300new" else: type = getBoxType() else: model = getBoxType() if fileExists(getPublicPath("/images/boxes/"+type+".jpg")): info["boximage"] = type+".jpg" print "##### boximage", info["boximage"] else: info["boximage"] = "unknown.jpg" return info
def P_boxinfo(self, request): info = getInfo() model = info["model"] if model == "et9000" or model == "et9200": model = "et9x00" elif model == "et5000" or model == "et6000": model = "et5x00" elif model == "et4000": model = "et4x00" elif model == "xp1000": model = "xp1000" elif model == "xp1000s": model = "sf8" elif model == "odinm9": model = "odinm9" elif model == "odinm7": model = "odinm7" elif model == "e3hd": model = "e3hd" elif getBoxType() == 'odinm6': model = "starsatlx" elif getMachineName() == 'AX-Odin': model = "axodin" elif model == "MixOs F5": model = "ebox5000" elif model == "MixOs F5mini": model = "ebox5100" elif model == "MixOs F7": model = "ebox7358" elif model == "IOS-100HD": model = "ios100hd" elif model == "IOS-200HD": model = "ios200hd" elif model == "IOS-300HD": model = "ios300hd" elif model == "Optimuss-OS1": model = "optimussos1" elif model == "Optimuss-OS2": model = "optimussos2" elif model == "TM-TWIN-OE": model = "tmtwin" elif model == "TM-2T-OE": model = "tm2t" elif model == "TM-SINGLE": model = "tmsingle" elif model == "TM-NANO-OE": model = "tmnano" elif getBoxType() == 'ixussone': model = "ixussone" elif getBoxType() == 'ixussduo': model = "ixussduo" elif getBoxType() == 'ixusszero': model = "ixusszero" elif model == 'Premium Twin': model = "ini-5000sv" elif model == 'Premium Mini': model = "ini-1000sv" elif model == 'Xpeed LX': if fileExists("/proc/stb/fp/version"): file = open("/proc/stb/fp/version") version = file.read().strip().lower() file.close() if version.startswith('2'): model = "xpeedlx2" else: model = "xpeedlx1" elif model == 'Xpeed LX3': model = "xpeedlx3" elif model == 'Sezam 1000-HD': model = "sezam-1000" elif model == 'Sezam 5000-HD': model = "sezam-5000" elif model == 'Sezam 1000-HD': model = "sezam-9000" elif model == 'Sogno 8800HD': model = "sogno8800hd" elif model == 'ENfinity': model = "enfinity" elif getBoxType() == 'gb800solo': model = "gb800solo" elif getBoxType() == 'gb800se': model = "gb800se" elif getBoxType() == 'gb800ue': model = "gb800ue" elif getBoxType() == 'gb800seplus': model = "gb800seplus" elif getBoxType() == 'gb800ueplus': model = "gb800ueplus" elif getBoxType() == 'gbquad': model = "gbquad" elif getBoxType() == 'gbquadplus': model = "gbquadplus" if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" return info
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
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 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 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
def P_about(self, request): return { "info": getInfo(need_fullinfo=True), "service": getCurrentService(self.session) }
def P_boxinfo(self, request): info = getInfo() model = info["model"] if model in ("et9000", "et9200", "et9500"): model = "et9x00" elif model in ("et5000", "et6000", "et6x00"): model = "et5x00" elif model == "et4000": model = "et4x00" elif model == "xp1000": model = "xp1000" elif model.startswith("vu"): model = model.replace("vu", "") if fileExists("/etc/.brandtype"): ret_brand = open("/etc/.brandtype").read().strip().lower() print "@@@@@ [model] @@@@@", model if ret_brand == "technomate": if model == "TM-NANO-3T COMBO": model = "te_force1plus" elif model == "tmnano2super": model = "te_tmnano2super" else: model = info["model"] elif ret_brand == "edision": if model.endswith("OS1"): model = "optimussos1" elif model.endswith("OS2"): model = "optimussos2" elif model.endswith("OS1PLUS"): model = "ed_op1plus" elif model.endswith("OS2PLUS"): model = "ed_op2plus" elif model.endswith("OS3+"): model = "ed_force1plus" else: model = info["model"] elif ret_brand == "worldvision": if model == "Force1+": model = "wo_force1plus" elif model == "force1": model = "wo_force1" else: model = info["model"] elif ret_brand == "swiss": if model == "Force1+": model = "sw_force1plus" elif model == "force1": model = "sw_force1" else: model = info["model"] elif ret_brand == "iqon": if model == "Force1+": model = "iq_force1plus" elif model == "force1": model = "iq_force1" else: model = info["model"] else: model = info["model"] if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" if model in ("tf7700hdpvr", "topf", "TF 7700 HDPVR"): info["model"] = "TF 7700 HDPVR" if fileExists(getPublicPath("/images/boxes/topf.jpg")): info["boximage"] = "topf.jpg" return info
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_boxinfo(self, request): info = getInfo() model = info["model"] if model == "et9000" or model == "et9200": model = "et9x00" elif model == "et5000" or model == "et6000": model = "et5x00" elif model == "et4000": model = "et4x00" elif model == "xp1000": model = "xp1000" elif model == "xp1000s": model = "sf8" elif model == "odinm9": model = "odinm9" elif model == "odinm7": model = "odinm7" elif model == "e3hd": model = "e3hd" elif getBoxType() == "odinm6": model = "starsatlx" elif getMachineName() == "AX-Odin": model = "axodin" elif model == "MixOs F5": model = "ebox5000" elif model == "MixOs F5mini": model = "ebox5100" elif model == "MixOs F7": model = "ebox7358" elif model == "IOS-100HD": model = "ios100hd" elif model == "IOS-200HD": model = "ios200hd" elif model == "IOS-300HD": model = "ios300hd" elif model == "Optimuss-OS1": model = "optimussos1" elif model == "Optimuss-OS2": model = "optimussos2" elif model == "TM-TWIN-OE": model = "tmtwin" elif model == "TM-2T-OE": model = "tm2t" elif model == "TM-SINGLE": model = "tmsingle" elif model == "TM-NANO-OE": model = "tmnano" elif getBoxType() == "ixusssone": model = "ixussone" elif getBoxType() == "ixussduo": model = "ixussduo" elif getBoxType() == "ixusszero": model = "ixusszero" elif model == "Premium Twin": model = "ini-5000sv" elif model == "Premium Mini": model = "ini-1000sv" elif model == "Xpeed LX": if fileExists("/proc/stb/fp/version"): file = open("/proc/stb/fp/version") version = file.read().strip().lower() file.close() if version.startswith("2"): model = "xpeedlx2" else: model = "xpeedlx1" elif model == "Xpeed LX3": model = "xpeedlx3" elif model == "Sezam 1000-HD": model = "sezam-1000" elif model == "Sezam 5000-HD": model = "sezam-5000" elif model == "Sezam 1000-HD": model = "sezam-9000" if fileExists(getPublicPath("/images/boxes/" + model + ".jpg")): info["boximage"] = model + ".jpg" else: info["boximage"] = "unknown.jpg" return info