示例#1
0
文件: RcModel.py 项目: wslee2/enigma2
class RcModel:
    RcModels = {}

    def __init__(self):
        self.model = HardwareInfo().get_device_model()
        # cfg files has modelname  rcname entries.
        # modelname is boxname optionally followed by .rctype
        if "technomate" in open("/etc/.brandtype", "r").readline():
            for line in open(
                (resolveFilename(SCOPE_SKIN, 'rc_models/rc_models_te.cfg')),
                    'r'):
                if line.startswith(self.model):
                    m, r = line.strip().split()
                    self.RcModels[m] = r

        elif "edision" in open("/etc/.brandtype", "r").readline():
            for line in open(
                (resolveFilename(SCOPE_SKIN, 'rc_models/rc_models_ed.cfg')),
                    'r'):
                if line.startswith(self.model):
                    m, r = line.strip().split()
                    self.RcModels[m] = r

        else:
            for line in open(
                (resolveFilename(SCOPE_SKIN, 'rc_models/rc_models.cfg')), 'r'):
                if line.startswith(self.model):
                    m, r = line.strip().split()
                    self.RcModels[m] = r

    def rcIsDefault(self):
        # Default RC can only happen with DMM type remote controls...
        return self.model.startswith('dm')

    def getRcFile(self, ext):
        # check for rc/type every time so rctype changes will be noticed
        if os.path.exists('/proc/stb/ir/rc/type'):
            rc = open('/proc/stb/ir/rc/type').read().strip()
            modeltype = '%s.%s' % (self.model, rc)
        else:
            modeltype = None

        if modeltype is not None and modeltype in self.RcModels.keys():
            remote = self.RcModels[modeltype]
        elif self.model in self.RcModels.keys():
            remote = self.RcModels[self.model]
        else:
            remote = 'dmm'  # default. Assume files for dmm exists
        f = resolveFilename(SCOPE_SKIN, 'rc_models/' + remote + '.' + ext)
        if not os.path.exists(f):
            f = resolveFilename(SCOPE_SKIN, 'rc_models/dmm.' + ext)
        return f

    def getRcImg(self):
        return self.getRcFile('png')

    def getRcPositions(self):
        return self.getRcFile('xml')
示例#2
0
文件: RcModel.py 项目: wslee2/enigma2
class RcModel:
        RcModels = {}

	def __init__(self):
		self.model = HardwareInfo().get_device_model()
		# cfg files has modelname  rcname entries.
		# modelname is boxname optionally followed by .rctype
		if "technomate" in open("/etc/.brandtype","r").readline():
			for line in open((resolveFilename(SCOPE_SKIN, 'rc_models/rc_models_te.cfg')), 'r'):
				if line.startswith(self.model):
					m, r = line.strip().split()
					self.RcModels[m] = r

		elif "edision" in open("/etc/.brandtype","r").readline():
			for line in open((resolveFilename(SCOPE_SKIN, 'rc_models/rc_models_ed.cfg')), 'r'):
				if line.startswith(self.model):
					m, r = line.strip().split()
					self.RcModels[m] = r

		else:
			for line in open((resolveFilename(SCOPE_SKIN, 'rc_models/rc_models.cfg')), 'r'):
				if line.startswith(self.model):
					m, r = line.strip().split()
					self.RcModels[m] = r

	def rcIsDefault(self):
		# Default RC can only happen with DMM type remote controls...
		return self.model.startswith('dm')

	def getRcFile(self, ext):
		# check for rc/type every time so rctype changes will be noticed
		if os.path.exists('/proc/stb/ir/rc/type'):
			rc = open('/proc/stb/ir/rc/type').read().strip()
			modeltype = '%s.%s' % (self.model, rc)
		else:
			modeltype = None

		if modeltype is not None and modeltype in self.RcModels.keys():
			remote = self.RcModels[modeltype]
		elif self.model in self.RcModels.keys():
			remote = self.RcModels[self.model]
		else:
			remote = 'dmm'	# default. Assume files for dmm exists
		f = resolveFilename(SCOPE_SKIN, 'rc_models/' + remote + '.' + ext)
		if not os.path.exists(f):
			f = resolveFilename(SCOPE_SKIN, 'rc_models/dmm.' + ext)
		return f

	def getRcImg(self):
		return self.getRcFile('png')

	def getRcPositions(self):
		return self.getRcFile('xml')
示例#3
0
class RcModel:
    RcModels = {}

    def __init__(self):
        self.model = HardwareInfo().get_device_model()
        # cfg files has modelname  rcname entries.
        # modelname is boxname optionally followed by .rctype
        for line in open((resolveFilename(SCOPE_SKIN, "rc_models/rc_models.cfg")), "r"):
            if line.startswith(self.model):
                m, r = line.strip().split()
                self.RcModels[m] = r

    def rcIsDefault(self):
        # Default RC can only happen with DMM type remote controls...
        return self.model.startswith("dm")

    def getRcFile(self, ext):
        # check for rc/type every time so rctype changes will be noticed
        if os.path.exists("/proc/stb/ir/rc/type"):
            rc = open("/proc/stb/ir/rc/type").read().strip()
            modeltype = "%s.%s" % (self.model, rc)
        else:
            modeltype = None

        if modeltype is not None and modeltype in self.RcModels.keys():
            remote = self.RcModels[modeltype]
        elif self.model in self.RcModels.keys():
            remote = self.RcModels[self.model]
        else:
            remote = "dmm"  # default. Assume files for dmm exists
        f = resolveFilename(SCOPE_SKIN, "rc_models/" + remote + "." + ext)
        if not os.path.exists(f):
            f = resolveFilename(SCOPE_SKIN, "rc_models/dmm." + ext)
        return f

    def getRcImg(self):
        return self.getRcFile("png")

    def getRcPositions(self):
        return self.getRcFile("xml")
示例#4
0
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance(
).canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck(
    "/proc/stb/video/zapping_mode")
SystemInfo["ISDREAMBOX"] = getBoxBrand() in ("dreambox", )
SystemInfo["HaveTouchSensor"] = model in ("dm520", "dm525", "dm900", "dm920")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists(
    "/dev/dbox/lcd0")
SystemInfo["LCDsymbol_circle_recording"] = fileCheck(
    "/proc/stb/lcd/symbol_circle") or model in (
        "hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_recording")
SystemInfo["LCDsymbol_timeshift"] = fileCheck("/proc/stb/lcd/symbol_timeshift")
SystemInfo["LCDshow_symbols"] = (model.startswith("et9") or model in (
    "hd51", "vs1500")) and fileCheck("/proc/stb/lcd/show_symbols")
SystemInfo["LCDsymbol_hdd"] = model in (
    "hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_hdd")
SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["PowerLED"] = fileCheck("/proc/stb/power/powerled") or model in (
    "gbue4k", "gbquad4k") and fileCheck("/proc/stb/fp/led1_pattern")
SystemInfo["StandbyLED"] = fileCheck(
    "/proc/stb/power/standbyled") or model in (
        "gbue4k", "gbquad4k") and fileCheck("/proc/stb/fp/led0_pattern")
SystemInfo["SuspendLED"] = fileCheck(
    "/proc/stb/power/suspendled") or fileCheck("/proc/stb/fp/enable_led")
SystemInfo[
示例#5
0
PNG_PATH = resolveFilename(SCOPE_PLUGINS)+"/Extensions/ZDFMediathek/"

TYPE_NOTHING = 0
TYPE_MOVIE = 1
TYPE_PODCAST = 2
TYPE_MOVIELIST_CATEGORY = 3

LIST_LEFT = 0
LIST_RIGHT = 1
LIST_NONE = 2

deviceName = HardwareInfo().get_device_name()

PLAY_MP4 = False

if not deviceName.startswith("dm7025"):
	try:
		#FIXMEE add better check ! ? !
		for line in popen("opkg info gst-plugin-rtsp").readlines():
			if line.find("Version: ") != -1:
				if line[9:] >= "0.10.23-r7.1":
					PLAY_MP4 = True
	except:
		pass

try:
	from LT.LTStreamPlayer import streamplayer
except ImportError:
	try:
		from Plugins.Extensions.LTMediaCenter.LTStreamPlayer import streamplayer
	except ImportError:
示例#6
0
PNG_PATH = resolveFilename(SCOPE_PLUGINS) + "/Extensions/ZDFMediathek/"

TYPE_NOTHING = 0
TYPE_MOVIE = 1
TYPE_PODCAST = 2
TYPE_MOVIELIST_CATEGORY = 3

LIST_LEFT = 0
LIST_RIGHT = 1
LIST_NONE = 2

deviceName = HardwareInfo().get_device_name()

PLAY_MP4 = False

if not deviceName.startswith("dm7025"):
    try:
        #FIXMEE add better check ! ? !
        for line in popen("opkg info gst-plugin-rtsp").readlines():
            if line.find("Version: ") != -1:
                if line[9:] >= "0.10.23-r7.1":
                    PLAY_MP4 = True
    except:
        pass

try:
    from LT.LTStreamPlayer import streamplayer
except ImportError:
    try:
        from Plugins.Extensions.LTMediaCenter.LTStreamPlayer import streamplayer
    except ImportError:
示例#7
0
SystemInfo["CommonInterface"] = eDVBCIInterfaces.getInstance().getNumOfSlots()
SystemInfo["CommonInterfaceCIDelay"] = fileCheck("/proc/stb/tsmux/rmx_delay")
for cislot in range(0, SystemInfo["CommonInterface"]):
	SystemInfo["CI%dSupportsHighBitrates" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_tsclk" % cislot)
	SystemInfo["CI%dRelevantPidsRoutingSupport" % cislot] = fileCheck("/proc/stb/tsmux/ci%d_relevant_pids_routing" % cislot)
SystemInfo["HasSoftcamInstalled"] = hassoftcaminstalled()
SystemInfo["NumVideoDecoders"] = getNumVideoDecoders()
SystemInfo["PIPAvailable"] = SystemInfo["NumVideoDecoders"] > 1
SystemInfo["CanMeasureFrontendInputPower"] = eDVBResourceManager.getInstance().canMeasureFrontendInputPower()
SystemInfo["12V_Output"] = Misc_Options.getInstance().detected_12V_output()
SystemInfo["ZapMode"] = fileCheck("/proc/stb/video/zapmode") or fileCheck("/proc/stb/video/zapping_mode")
SystemInfo["NumFrontpanelLEDs"] = countFrontpanelLEDs()
SystemInfo["FrontpanelDisplay"] = fileExists("/dev/dbox/oled0") or fileExists("/dev/dbox/lcd0")
SystemInfo["LCDsymbol_circle_recording"] = fileCheck("/proc/stb/lcd/symbol_circle") or model in ("hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_recording")
SystemInfo["LCDsymbol_timeshift"] = fileCheck("/proc/stb/lcd/symbol_timeshift")
SystemInfo["LCDshow_symbols"] = (model.startswith("et9") or model in ("hd51", "vs1500")) and fileCheck("/proc/stb/lcd/show_symbols")
SystemInfo["LCDsymbol_hdd"] = model in ("hd51", "vs1500") and fileCheck("/proc/stb/lcd/symbol_hdd")
SystemInfo["FrontpanelDisplayGrayscale"] = fileExists("/dev/dbox/oled0")
SystemInfo["DeepstandbySupport"] = HardwareInfo().get_device_name() != "dm800"
SystemInfo["Fan"] = fileCheck("/proc/stb/fp/fan")
SystemInfo["FanPWM"] = SystemInfo["Fan"] and fileCheck("/proc/stb/fp/fan_pwm")
SystemInfo["PowerLED"] = fileCheck("/proc/stb/power/powerled")
SystemInfo["StandbyLED"] = fileCheck("/proc/stb/power/standbyled")
SystemInfo["SuspendLED"] = fileCheck("/proc/stb/power/suspendled")
SystemInfo["Display"] = SystemInfo["FrontpanelDisplay"] or SystemInfo["StandbyLED"]
SystemInfo["LedPowerColor"] = fileCheck("/proc/stb/fp/ledpowercolor")
SystemInfo["LedStandbyColor"] = fileCheck("/proc/stb/fp/ledstandbycolor")
SystemInfo["LedSuspendColor"] = fileCheck("/proc/stb/fp/ledsuspendledcolor")
SystemInfo["Power4x7On"] = fileCheck("/proc/stb/fp/power4x7on")
SystemInfo["Power4x7Standby"] = fileCheck("/proc/stb/fp/power4x7standby")
SystemInfo["Power4x7Suspend"] = fileCheck("/proc/stb/fp/power4x7suspend")
        BOX_NAME = str(model.lower().strip())
        l.close()
        BOX_MODEL = "vuplus"
    except:
        pass
elif fileExists("/proc/stb/info/hwmodel"):
    try:
        l = open("/proc/stb/info/hwmodel")
        model = l.read()
        BOX_NAME = str(model.lower().strip())
        l.close()
    except:
        pass
    if BOX_NAME.startswith('fusion') or BOX_NAME.startswith("purehd"):
        BOX_MODEL = "xsarius"
elif device_name and device_name.startswith('dm') and fileExists(
        "/proc/stb/info/model"):
    try:
        l = open("/proc/stb/info/model")
        model = l.read()
        BOX_NAME = str(model.lower().strip())
        l.close()
        BOX_MODEL = "dreambox"
    except:
        pass

WORKAROUND = False
box = ''
try:
    from boxbranding import *
    BRANDING = True
示例#9
0
TYPE_NOTHING = 0
TYPE_MOVIE = 1
TYPE_PODCAST = 2
TYPE_MOVIELIST_CATEGORY = 3

LIST_LEFT = 0
LIST_RIGHT = 1
LIST_NONE = 2

deviceName = HardwareInfo().get_device_name()

PLAY_MP4 = False
PLAY_WMV = False

if not deviceName.startswith("dm7025"):
	PLAY_MP4 = True
if deviceName.startswith("dm7020hd"):
	PLAY_WMV = True
try:
	from LT.LTStreamPlayer import streamplayer
except ImportError:
	try:
		from Plugins.Extensions.LTMediaCenter.LTStreamPlayer import streamplayer
	except ImportError:
		streamplayer = None

try:
	from Plugins.Extensions.VlcPlayer.VlcServerConfig import vlcServerConfig
except ImportError:
	vlcServerConfig = None
示例#10
0
    BOX_NAME = "all"
    try:
        f = open("/proc/stb/info/hwmodel")
        MODEL_NAME = f.read().strip()
        f.close()
    except:
        pass
elif os.path.exists("/proc/stb/info/vumodel"):
    BOX_NAME = "vu"
    try:
        f = open("/proc/stb/info/vumodel")
        MODEL_NAME = f.read().strip()
        f.close()
    except:
        pass
elif device_name and device_name.startswith('dm') and os.path.exists(
        "/proc/stb/info/model"):
    BOX_NAME = "dmm"
    try:
        f = open("/proc/stb/info/model")
        MODEL_NAME = f.read().strip()
        f.close()
    except:
        pass
elif os.path.exists("/proc/stb/info/gbmodel"):
    BOX_NAME = "all"
    try:
        f = open("/proc/stb/info/gbmodel")
        MODEL_NAME = f.read().strip()
        f.close()
    except:
示例#11
0
TYPE_NOTHING = 0
TYPE_MOVIE = 1
TYPE_PODCAST = 2
TYPE_MOVIELIST_CATEGORY = 3

LIST_LEFT = 0
LIST_RIGHT = 1
LIST_NONE = 2

deviceName = HardwareInfo().get_device_name()

PLAY_MP4 = False
PLAY_WMV = False

if not deviceName.startswith("dm7025"):
	PLAY_MP4 = True
if deviceName.startswith("dm7020hd"):
	PLAY_WMV = True
try:
	from LT.LTStreamPlayer import streamplayer
except ImportError:
	try:
		from Plugins.Extensions.LTMediaCenter.LTStreamPlayer import streamplayer
	except ImportError:
		streamplayer = None

try:
	from Plugins.Extensions.VlcPlayer.VlcServerConfig import vlcServerConfig
except ImportError:
	vlcServerConfig = None
示例#12
0
	BOX_NAME = "all"
	try:
		f = open("/proc/stb/info/hwmodel")
		MODEL_NAME = f.read().strip()
		f.close()
	except:
		pass
elif os.path.exists("/proc/stb/info/vumodel"):
	BOX_NAME = "vu"
	try:
		f = open("/proc/stb/info/vumodel")
		MODEL_NAME = f.read().strip()
		f.close()
	except:
		pass
elif device_name and device_name.startswith('dm') and os.path.exists("/proc/stb/info/model"):
	BOX_NAME = "dmm"
	try:
		f = open("/proc/stb/info/model")
		MODEL_NAME = f.read().strip()
		f.close()
	except:
		pass
elif os.path.exists("/proc/stb/info/gbmodel"):
	BOX_NAME = "all"
	try:
		f = open("/proc/stb/info/gbmodel")
		MODEL_NAME = f.read().strip()
		f.close()
	except:
		pass