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


Python HardwareInfo.get_device_name方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import get_device_name [as 别名]
	def __init__(self, session, request):
		WebScreen.__init__(self, session, request)
		from WebComponents.Sources.About import About
		from WebComponents.Sources.Frontend import Frontend
		from WebComponents.Sources.Hdd import Hdd
		from WebComponents.Sources.Network import Network
		from Components.config import config
		from Components.About import about
		from Components.Sources.StaticText import StaticText
		try:
			from Tools.StbHardware import getFPVersion
		except:
			from Tools.DreamboxHardware import getFPVersion
		from Tools.HardwareInfo import HardwareInfo

		hw = HardwareInfo()

		self["About"] = About(session)

		self["Network"] = Network()
		self["Hdd"] = Hdd()
		self["Frontends"] = Frontend()
		try:
			from enigma import getImageVersionString, getBuildVersionString, getEnigmaVersionString
			self["EnigmaVersion"] = StaticText(getEnigmaVersionString())
			self["ImageVersion"] = StaticText(getVersionString() + '.' + getBuildVersionString())
		except:
			self["EnigmaVersion"] = StaticText(about.getEnigmaVersionString())
			self["ImageVersion"] = StaticText(about.getVersionString())
		self["WebIfVersion"] = StaticText(config.plugins.Webinterface.version.value)
		self["FpVersion"] = StaticText(str(getFPVersion()))
		self["DeviceName"] = StaticText(hw.get_device_name())
开发者ID:13K-OMAR,项目名称:enigma2-plugins-sh4,代码行数:34,代码来源:WebScreens.py

示例2: getDeviceName

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import get_device_name [as 别名]
	def getDeviceName(self):
		device_name = "unknown"
		try:
			file = open("/proc/stb/info/vumodel", "r")
			device_name = file.readline().strip()
			file.close()
		except IOError:
			from Tools.HardwareInfo import HardwareInfo
			device_name = HardwareInfo.get_device_name()

		return device_name
开发者ID:kingvuplus,项目名称:e2-v,代码行数:13,代码来源:VideoHardware.py

示例3: __init__

# 需要导入模块: from Tools.HardwareInfo import HardwareInfo [as 别名]
# 或者: from Tools.HardwareInfo.HardwareInfo import get_device_name [as 别名]
class AC3delay:
    def __init__(self):
        self.iService = None
        self.iServiceReference = None
        self.isStreamService = False
        self.iAudioDelay = None
        self.channelAudio = AC3
        self.whichAudio = AC3
        self.bIsRecording = False

        # Current audio- delay
        self.systemDelay = {}

        self.getAudioInformation()

        self.activateTimer = eTimer()
        self.activateTimer.callback.append(self.activateDelay)
        self.activateWait = config.plugins.AC3LipSync.activationDelay.getValue()
        
        # Current value for movie start behaviour
        self.movieStart = config.usage.on_movie_start.getValue()

        # find out box type
        self.oHWInfo = HardwareInfo()
        self.bHasToRestartService = self.oHWInfo.get_device_name() == "dm7025"
        
    def initAudio(self):
        self.iService = NavigationInstance.instance.getCurrentService()
        self.iServiceReference = NavigationInstance.instance.getCurrentlyPlayingServiceReference()
        self.isStreamService = self.iServiceReference and '%3a//' in self.iServiceReference.toString()
        self.iAudioDelay = self.iService and self.iService.audioDelay()
        self.iSeek = self.iService and self.iService.seek()

    def deleteAudio(self):
        self.iService = None
        self.iAudioDelay = None
        self.iSeek = None

    def setChannelAudio(self, sAudio):
        self.channelAudio = sAudio

    def delayedActivateDelay(self):
        if self.activateTimer.isActive:
            self.activateTimer.stop()
        self.activateTimer.start(self.activateWait, True)

    def activateDelay(self):
        # This activation code is only neccessary for DM7025. 
        # DM800, DM8000 and DM500HD directly activate the delay after using "setAC3Delay" and "setPCMDelay", they don't need the service restart
        if self.activateTimer.isActive:
            self.activateTimer.stop()
        if self.bHasToRestartService == True:
            bInitialized = False
            if self.iService is None:
                self.initAudio()
                bInitialized = True
            if self.iServiceReference is not None:
                lCurPosition = self.cueGetCurrentPosition()
                self.deleteAudio()
                if self.whichAudio == self.channelAudio:
                    config.usage.on_movie_start.setValue("beginning")
                    NavigationInstance.instance.stopService()
                    NavigationInstance.instance.playService(self.iServiceReference)
                    config.usage.on_movie_start.setValue(self.movieStart)
                    if lCurPosition is not None:
                        self.lCurPosition = lCurPosition
                        self.timer = eTimer()
                        self.timer.callback.append(self.seekAfterWait)
                        self.timer.start(200, True)
            else:
                self.deleteAudio()
        
    def seekAfterWait(self):
        self.timer.stop()
        self.initAudio()
        if self.iSeek is not None:
            self.iSeek.seekTo(self.lCurPosition)
        self.deleteAudio()

    def cueGetCurrentPosition(self):
        if self.iSeek is None:
            return None
        r = self.iSeek.getPlayPosition()
        if r[0]:
            return None
        return long(r[1])

    def getSystemDelay(self, sAudio):
        bInitialized = False
        if self.iService is None:
            self.initAudio()
            bInitialized = True
        iDelay = 0
        if self.iAudioDelay is not None:
            if sAudio == AC3:
                iDelay = self.iAudioDelay.getAC3Delay()
            elif sAudio == PCM:
                iDelay = self.iAudioDelay.getPCMDelay()
            elif sAudio == AC3GLOB:
                iDelay = config.av.generalAC3delay.getValue()
#.........这里部分代码省略.........
开发者ID:68foxboris,项目名称:enigma2-plugins,代码行数:103,代码来源:AC3delay.py


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