本文整理汇总了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')
示例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")
示例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:
示例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
示例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