当前位置: 首页>>代码示例>>Python>>正文


Python HardwareInfo.startswith方法代码示例

本文整理汇总了Python中Tools.HardwareInfo.HardwareInfo.startswith方法的典型用法代码示例。如果您正苦于以下问题:Python HardwareInfo.startswith方法的具体用法?Python HardwareInfo.startswith怎么用?Python HardwareInfo.startswith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Tools.HardwareInfo.HardwareInfo的用法示例。


在下文中一共展示了HardwareInfo.startswith方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import startswith [as 别名]
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')
开发者ID:wslee2,项目名称:enigma2,代码行数:55,代码来源:RcModel.py

示例2: __init__

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import startswith [as 别名]
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")
开发者ID:0sc0d3r,项目名称:enigma2-1,代码行数:42,代码来源:RcModel.py

示例3: resolveFilename

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import startswith [as 别名]
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:
开发者ID:13K-OMAR,项目名称:enigma2-plugins-sh4,代码行数:33,代码来源:plugin.py

示例4: HardwareInfo

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import startswith [as 别名]
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
开发者ID:Haehnchen,项目名称:enigma2-plugins,代码行数:32,代码来源:plugin.py

示例5: open

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import startswith [as 别名]
	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
开发者ID:fairbird,项目名称:OpenPLI-BlackHole,代码行数:33,代码来源:Disks.py


注:本文中的Tools.HardwareInfo.HardwareInfo.startswith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。