コード例 #1
0
    def timerPoll(self):
        timeout = self.polltime
        FanConf = config.plugins.FanSetup
        mode = FanConf.mode.value
        timeset = FanConf.timeset.value

        # check time settings and if need change fan mode
        if mode != "off" and timeset != "none":
            ts = localtime()
            nowsec = (ts.tm_hour * 3600) + (ts.tm_min * 60)
            offlist = config.plugins.FanSetup.timestartoff.value
            offsec = (offlist[0] * 3600) + (offlist[1] * 60)
            onlist = config.plugins.FanSetup.timeendoff.value
            onsec = (onlist[0] * 3600) + (onlist[1] * 60)
            invert = False
            if offsec > onsec:
                invert = True
                offsec, onsec = onsec, offsec
            if (offsec <= nowsec < onsec):
                if not invert:
                    mode = timeset
                timeout = min(self.polltime, onsec - nowsec)
            elif nowsec < offsec:
                if invert:
                    mode = timeset
                timeout = min(self.polltime, offsec - nowsec)
            else:
                if invert:
                    mode = timeset
                timeout = min(self.polltime, 86400 - nowsec)

        # check hdd settings (sleeping and temperature hdd's)
        if FanConf.hddwatch.value != "none" and mode == "off":
            hddcount = harddiskmanager.HDDCount()
            if hddcount:
                if FanConf.hddwatch.value == "sleep" and FanConf.hddsleep.value is True:
                    sleepcount = 0
                    hddlist = harddiskmanager.HDDList()
                    for x in range(hddcount):
                        if hddlist[x][1].isSleeping():
                            sleepcount += 1
                        else:
                            mode = "on"
                    if sleepcount == hddcount:
                        mode = "off"
                elif FanConf.hddwatch.value == "temp" and FanConf.hddtemp.value != 0:
                    hddlist = harddiskmanager.HDDList()
                    if not hddlist[0][1].isSleeping():
                        hddlist = tempwatcher.getHddTempList()
                        for d in hddlist:
                            hddtemp = hddlist[d]["temp"]
                            if hddtemp >= FanConf.hddtemp.value:
                                mode = "on"
                            else:
                                mode = "off"
                    else:
                        mode = "off"
        self.applySettings(mode)
        self.timer.start(timeout * 1000, True)
コード例 #2
0
 def RecordingLed(self):
     global RecLed
     led_sda1 = "0"
     if config.plugins.VFD_Giga.ledSDA1.getValue() != "0":
         try:
             for hdd in harddiskmanager.HDDList():
                 if hdd[1].getDeviceName().startswith("/dev/sda"):
                     if not hdd[1].isSleeping():
                         led_sda1 = config.plugins.VFD_Giga.ledSDA1.getValue(
                         )
         except:
             pass
     led_sdb1 = "0"
     if config.plugins.VFD_Giga.ledSDB1.getValue() != "0":
         try:
             for hdd in harddiskmanager.HDDList():
                 if hdd[1].getDeviceName().startswith("/dev/sdb"):
                     if not hdd[1].isSleeping():
                         led_sdb1 = config.plugins.VFD_Giga.ledSDB1.getValue(
                         )
         except:
             pass
     try:
         #not all images support recording type indicators
         recordings = self.session.nav.getRecordings(
             False,
             Components.RecordingConfig.recType(
                 config.recording.show_rec_symbol_for_rec_types.getValue()))
     except:
         recordings = self.session.nav.getRecordings()
     led_rec = "0"
     if recordings:
         self.updatetime = 1000
         if not config.plugins.VFD_Giga.recLedBlink.value:
             self.blink = True
         if self.blink:
             led_rec = config.plugins.VFD_Giga.ledREC.getValue()
         else:
             if config.plugins.VFD_Giga.ledREC.value == "3":
                 led_rec = "2"
             else:
                 led_rec = "0"
         self.blink = not self.blink
         RecLed = True
     else:
         if (config.plugins.VFD_Giga.ledSDA1.getValue() != "0") or (
                 config.plugins.VFD_Giga.ledSDB1.getValue() != "0"):
             self.updatetime = 1000
         else:
             self.updatetime = 10000
         if RecLed is not None:
             RecLed = None
         if Screens.Standby.inStandby:
             led_rec = config.plugins.VFD_Giga.ledSBY.getValue()
         else:
             led_rec = config.plugins.VFD_Giga.ledRUN.getValue()
     if config.plugins.VFD_Giga.setLed.value:
         setLed(str(int(led_sda1) | int(led_sdb1) | int(led_rec)))
コード例 #3
0
def show_temp_simple(session, wakeup=False, **kwargs):
    if not os.path.exists("/usr/sbin/hddtemp"):
        session.open(MessageBox,
                     _("HDDtemp not installed!"),
                     type=MessageBox.TYPE_ERROR,
                     timeout=5)
        return
    internal_hddlist = []
    ret = ""
    arg = ""
    if wakeup:
        arg = "-w"
    for hdd in harddiskmanager.HDDList():
        if "pci" in hdd[1].phys_path or "ahci" in hdd[
                1].phys_path or "sata" in hdd[1].phys_path:
            internal_hddlist.append(hdd[1].getDeviceDir())
            ret += os.popen("hddtemp %s %s" %
                            (arg, hdd[1].getDeviceDir())).read()
            ret += "\n"
    if internal_hddlist:
        message = _("Found internal HDD/SSD!\n") + "\n" + ret
        session.open(MessageBox, message, type=MessageBox.TYPE_INFO)
    else:
        session.open(MessageBox,
                     _("Not found an internal HDD/SSD!\n\n"),
                     type=MessageBox.TYPE_INFO,
                     timeout=5)
コード例 #4
0
	def __init__(self, session):
		Screen.__init__(self, session)
		Screen.setTitle(self, _("Initialization"))
		self.skinName = "HarddiskSelection" # For derived classes
		
		menu = []
		if harddiskmanager.HDDCount() == 0:
			menu.append(SubHarddiskMenuEntryComponent((_("no storage devices found")), 0))
		else:
			for x in harddiskmanager.HDDList():
				menu.append(SubHarddiskMenuEntryComponent(x[0], x))

		self["hddlist"] = HarddiskMenuList(menu)
		
		self["key_red"] = Label(_("Exit"))
		self["key_green"] = Label(_("Select"))
		self["key_yellow"] = Label()
		self["key_blue"] = Label()
		self["actions"] = ActionMap(["SetupActions"],
		{
			"save" : self.okbuttonClick,
			"ok": self.okbuttonClick,
			"cancel": self.close,
			"red": self.close
		})
コード例 #5
0
ファイル: plugin.py プロジェクト: vuteam/dvbapp
def generateInformation():
    from os import popen
    from Tools.DreamboxHardware import getFPVersion
    from Components.Harddisk import harddiskmanager
    from Components.NimManager import nimmanager
    from Components.About import about

    def command(cmd):
        try:
            result = popen(cmd, "r").read().strip()
            return str(result)
        except:
            pass

    information = [
        "kernel         : %s\n" % (command("uname -a")),
        "version        : %s (%s)\n" % (str(about.getImageVersionString()),
                                        str(about.getEnigmaVersionString())),
        "frontprocessor : %s\n" % (str(getFPVersion())),
        "frontend       : %s\n" % (str(nimmanager.nimList())),
        "hdd info       : %s\n" % (str(harddiskmanager.HDDList())),
        "network information : \n%s\n" % (command("ifconfig -a"))
    ]
    f = open("/tmp/machine.info", 'w')
    f.writelines(information)
    f.close()
コード例 #6
0
	def getText(self):
		data = tmpdata = ''
		hddlist = harddiskmanager.HDDList()
		if hddlist:
			try:
				for count in range(len(hddlist)):
					hdd = hddlist[count][1]
					if 'hdd' in self.paramert_str:
						self.device = 'hdd'
					elif 'usb' in self.paramert_str:
						self.device = 'usb'
					if hdd.mountDevice() == '/media/%s' % self.device:
						if self.type is self.capacity:
							data = hdd.capacity()
						elif self.type is self.free:
							if int(hdd.free()) > 1024:
								data = '%d.%03d GB' % (hdd.free()/1024 , hdd.free()%1024)
							else:
								data = '%03d MB' % hdd.free()
						elif self.type is self.model:
							data = hdd.model()
						elif self.type is self.fsystem:
							data = self.filesystem(hdd.mountDevice())
						elif self.type is self.dpoint:
							data = self.devpoint(hdd.mountDevice())
						elif self.type is self.format:
							if int(hdd.free()) > 1024:
								tmpdata = '%d.%03d GB' % (hdd.free()/1024 , hdd.free()%1024)
							else:
								tmpdata = '%03d MB' % hdd.free()
							data = self.paramert_str.replace('Format:', '').replace('hdd', '').replace('usb', '').replace('%C', hdd.capacity()).replace('%M', hdd.model())\
								.replace('%S', self.filesystem(hdd.mountDevice())).replace('%D', self.devpoint(hdd.mountDevice())).replace('%F', tmpdata)
			except:
				pass
		return data
コード例 #7
0
def devDiskInfo(ruta='/', txtini='', sidormido=False):
    if not txtini == '':
        txtini = txtini + ': '
    if sidormido and ruta == '/hdd/':
        try:
            cadret = ''
            if harddiskmanager.HDDCount():
                for hdd in harddiskmanager.HDDList():
                    if ('pci' in hdd[1].phys_path or 'ahci' in hdd[1].phys_path
                        ) and hdd[1].isSleeping() and hdd[1].max_idle_time:
                        cadret = _('Sleep')
                        break

            if not cadret == '':
                return txtini + '(' + cadret + ')'
        except:
            return ''

    try:
        stat = statvfs(ruta)
    except OSError:
        return ''

    try:
        percent = '(' + str(100 * stat.f_bavail // stat.f_blocks) + '%)'
        total = stat.f_bsize * stat.f_blocks
        free = stat.f_bfree * stat.f_bsize
        if total == 0:
            return ''
        return txtini + Humanizer(total) + ', ' + Humanizer(
            free) + ' ' + percent + ' ' + _('free')
    except:
        return ''
コード例 #8
0
 def __onClose(self):
     global inStandby
     inStandby = None
     self.standbyStopServiceTimer.stop()
     if self.timeHandler:
         try:
             self.timeHandler and self.timeHandler.m_timeUpdated.get(
             ).remove(self.stopService)
         except:
             pass
     if self.paused_service:
         self.paused_action and self.paused_service.unPauseService()
     elif self.prev_running_service:
         service = self.prev_running_service.toString()
         if config.servicelist.startupservice_onstandby.value:
             self.session.nav.playService(
                 eServiceReference(config.servicelist.startupservice.value))
             from Screens.InfoBar import InfoBar
             InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber(
             )
         else:
             self.session.nav.playService(self.prev_running_service)
     self.session.screen["Standby"].boolean = False
     globalActionMap.setEnabled(True)
     for hdd in harddiskmanager.HDDList():
         hdd[1].setIdleTime(int(config.usage.hdd_standby.value)
                            )  # HDD standby timer value (box active)
コード例 #9
0
ファイル: plugin.py プロジェクト: jack2015/enigma2-plugins
	def getHDD(self):
		if harddiskmanager.HDDCount() > 0 and config.plugins.FanControl.CheckHDDTemp.value !="never":
			GetHDDtemp(True)
			for hdd in harddiskmanager.HDDList():
				if hdd[1].model().startswith("ATA"):
					if hdd[1].isSleeping():
						(stat,wert)=getstatusoutput("hdparm -y %s" % hdd[1].getDeviceName())
コード例 #10
0
def getHDDTempInfo():
    if not os.path.exists("/usr/sbin/hddtemp"):
        return _("hddtemp not installed!"), MessageBox.TYPE_ERROR
    if tempwatcher is None:
        return _("HddTempWatcher not running!"), MessageBox.TYPE_ERROR

    inernal_hddlist = []
    for hdd in harddiskmanager.HDDList():
        if "pci" in hdd[1].phys_path:
            inernal_hddlist.append(hdd[1].getDeviceDir())

    message = _(" ")
    hddlist = tempwatcher.getHddTempList()
    for d in hddlist:
        if d in inernal_hddlist:
            message += "%s %s\n" % (hddlist[d]["path"], hddlist[d]["name"])
            if hddlist[d]["temp"] == -253:
                message += _("Drive is sleeping\n")
            elif hddlist[d]["temp"] == -254:
                message += _("ERROR\n")
            else:
                message += _("temp : ") + "%s %s\n" % (hddlist[d]["temp"],
                                                       hddlist[d]["unit"])
    if message == "":
        message = _("Not found an internal HDD !")
    else:
        message = _("Found internal HDD !\n") + message
    return message, MessageBox.TYPE_INFO
コード例 #11
0
    def isHDDActive(self):  # remake certainly
        for hdd in harddiskmanager.HDDList():
            if not hdd[1].isSleeping():
                #				print "<ManualFancontrol_> %s is not Sleeping"%hdd[0]
                return True
#		print "<ManualFancontrol_> All HDDs are Sleeping"
        return False
コード例 #12
0
    def __init__(self, session, menu_path=""):
        Screen.__init__(self, session)
        screentitle = _("Initialise Devices")
        self.menu_path = menu_path
        if config.usage.show_menupath.value == 'large':
            self.menu_path += screentitle
            title = self.menu_path
            self["menu_path_compressed"] = StaticText("")
            self.menu_path += ' / '
        elif config.usage.show_menupath.value == 'small':
            title = screentitle
            condtext = ""
            if self.menu_path and not self.menu_path.endswith(' / '):
                condtext = self.menu_path + " >"
            elif self.menu_path:
                condtext = self.menu_path[:-3] + " >"
            self["menu_path_compressed"] = StaticText(condtext)
            self.menu_path += screentitle + ' / '
        else:
            title = screentitle
            self["menu_path_compressed"] = StaticText("")
        Screen.setTitle(self, title)

        self.skinName = "HarddiskSelection"  # For derived classes
        if harddiskmanager.HDDCount() == 0:
            tlist = [(_("no storage devices found"), 0)]
            self["hddlist"] = MenuList(tlist)
        else:
            self["hddlist"] = MenuList(harddiskmanager.HDDList())

        self["actions"] = ActionMap(["OkCancelActions"], {
            "ok": self.okbuttonClick,
            "cancel": self.close
        })
コード例 #13
0
ファイル: Standby.py プロジェクト: ghani-1977/dvbapp
    def __onClose(self):
        global inStandby
        inStandby = None
        self.standbyTimeoutTimer.stop()
        self.standbyStopServiceTimer.stop()
        self.standbyWakeupTimer.stop()
        self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(
            self.stopService)
        if self.paused_service:
            self.paused_action and self.paused_service.unPauseService()
        elif self.prev_running_service:
            service = self.prev_running_service.toString()
            if config.servicelist.startupservice_onstandby.value:
                self.session.nav.playService(
                    eServiceReference(config.servicelist.startupservice.value))
                from Screens.InfoBar import InfoBar
                InfoBar.instance and InfoBar.instance.servicelist.correctChannelNumber(
                )
            else:
                self.session.nav.playService(self.prev_running_service)
        self.session.screen["Standby"].boolean = False
        globalActionMap.setEnabled(True)
        if (getBrandOEM() in ('fulan')):
            open("/proc/stb/hdmi/output", "w").write("on")

        for hdd in harddiskmanager.HDDList():
            hdd[1].setIdleTime(int(config.usage.hdd_standby.value)
                               )  # HDD standby timer value (box active)
        if RecordTimer.RecordTimerEntry.receiveRecordEvents:
            RecordTimer.RecordTimerEntry.stopTryQuitMainloop()
        self.avswitch.setInput("ENCODER")
        self.leaveMute()
コード例 #14
0
def getInternalHDD():
    for hdname, hd in harddiskmanager.HDDList():
        physLoc = harddiskmanager.getPhysicalDeviceLocation(
            hd.getDevicePhysicalName())
        if physLoc == "Internal HDD":
            return hd
    return None
コード例 #15
0
def checkHardDisk():
    if harddiskmanager.HDDCount():
        for hdd in harddiskmanager.HDDList():
            if hdd[1].idle_running and hdd[
                    1].max_idle_time and not hdd[1].isSleeping():
                return True
    return False
コード例 #16
0
ファイル: Standby.py プロジェクト: mat12/mytest
	def __init__(self, session):
		Screen.__init__(self, session)
		self.skinName = "Standby"
		self.avswitch = AVSwitch()

		print "enter standby"

		self["actions"] = ActionMap( [ "StandbyActions" ],
		{
			"power": self.Power,
			"discrete_on": self.Power
		}, -1)

		globalActionMap.setEnabled(False)

		self.standbyTimeUnknownTimer = eTimer()

		#mute adc
		self.setMute()
	
		if SystemInfo["Display"] and SystemInfo["LCDMiniTV"]:
			# set LCDminiTV off
			setLCDModeMinitTV("0")

		self.paused_service = None
		self.prev_running_service = None

		if self.session.current_dialog:
			if self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_STOPS:
				if localtime(time()).tm_year > 1970 and self.session.nav.getCurrentlyPlayingServiceOrGroup():
					if config.servicelist.startupservice_standby.value:
						self.prev_running_service = eServiceReference(config.servicelist.startupservice_standby.value)
					else:
						self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup()
					self.session.nav.stopService()
				else:
					self.standbyTimeUnknownTimer.callback.append(self.stopService)
					self.standbyTimeUnknownTimer.startLongTimer(60)
			elif self.session.current_dialog.ALLOW_SUSPEND == Screen.SUSPEND_PAUSES:
				self.paused_service = self.session.current_dialog
				self.paused_service.pauseService()
		if self.session.pipshown:
			from Screens.InfoBar import InfoBar
			InfoBar.instance and hasattr(InfoBar.instance, "showPiP") and InfoBar.instance.showPiP()

		#set input to vcr scart
		if SystemInfo["ScartSwitch"]:
			self.avswitch.setInput("SCART")
		else:
			self.avswitch.setInput("AUX")
		if (getBrandOEM() in ('fulan')):
			open("/proc/stb/hdmi/output", "w").write("off")

		if int(config.usage.hdd_standby_in_standby.value) != -1: # HDD standby timer value (box in standby) / -1 = same as when box is active
			for hdd in harddiskmanager.HDDList():
				hdd[1].setIdleTime(int(config.usage.hdd_standby_in_standby.value))

		self.onFirstExecBegin.append(self.__onFirstExecBegin)
		self.onClose.append(self.__onClose)
コード例 #17
0
ファイル: UsbTest.py プロジェクト: OpenHyperCube/enigma2-arm
 def getUsbPortDevice(self, port):
     hddlist = harddiskmanager.HDDList()
     for hdd in hddlist:
         dhhpath = hdd[1].sysfsPath("")
         if port == (dhhpath.split('/')[-7])[-1]:
             print port[-1]
             return hdd
     return None
コード例 #18
0
    def __init__(self, session):
        Screen.__init__(self, session)
        self.skinName = 'Standby'
        self.avswitch = AVSwitch()
        print '[Standby] enter standby'
        self['actions'] = ActionMap(['StandbyActions'], {
            'power': self.Power,
            'discrete_on': self.Power
        }, -1)
        globalActionMap.setEnabled(False)
        self.standbyStopServiceTimer = eTimer()
        self.standbyStopServiceTimer.callback.append(self.stopService)
        self.timeHandler = None
        self.setMute()
        if SystemInfo['Display'] and SystemInfo['LCDMiniTV']:
            setLCDModeMinitTV('0')
        self.paused_service = None
        self.prev_running_service = None
        self.prev_running_service = self.session.nav.getCurrentlyPlayingServiceOrGroup(
        )
        service = self.prev_running_service and self.prev_running_service.toString(
        )
        if service:
            if service.startswith('1:') and service.rsplit(
                    ':', 1)[1].startswith('/'):
                self.paused_service = self.session.current_dialog
                self.paused_service.pauseService()
            else:
                self.timeHandler = eDVBLocalTimeHandler.getInstance()
                if self.timeHandler.ready():
                    if self.session.nav.getCurrentlyPlayingServiceOrGroup():
                        self.stopService()
                    else:
                        self.standbyStopServiceTimer.startLongTimer(5)
                    self.timeHandler = None
                else:
                    self.timeHandler.m_timeUpdated.get().append(
                        self.stopService)
        if self.session.pipshown:
            from Screens.InfoBar import InfoBar
            InfoBar.instance and hasattr(
                InfoBar.instance, 'showPiP') and InfoBar.instance.showPiP()
        if SystemInfo['ScartSwitch']:
            self.avswitch.setInput('SCART')
        else:
            self.avswitch.setInput('AUX')
        if getBrandOEM() in 'fulan':
            open('/proc/stb/hdmi/output', 'w').write('off')
        if int(config.usage.hdd_standby_in_standby.value) != -1:
            for hdd in harddiskmanager.HDDList():
                hdd[1].setIdleTime(
                    int(config.usage.hdd_standby_in_standby.value))

        self.onFirstExecBegin.append(self.__onFirstExecBegin)
        self.onClose.append(self.__onClose)
        return
コード例 #19
0
ファイル: plugin.py プロジェクト: zilizila/alliance-plugins
	def getHddList(self):
		hddlist = { }
		for hdd in harddiskmanager.HDDList():
			if "pci" in hdd[1].phys_path or "ahci" in hdd[1].phys_path:
				devdir = hdd[1].getDeviceDir()
				name = hdd[1].model()
				if name in ("", "-?-"):
					name = devdir
				hddlist[devdir] = name
		return hddlist
コード例 #20
0
ファイル: plugin.py プロジェクト: OpenVisionE2/merlininfo
    def getSysInfo(self):
        fd = open("/proc/loadavg")
        fread = fd.readline().split()
        fd.close()
        loadavg = "LoadAVG: " + fread[0] + " " + fread[1] + " " + fread[2]

        fd = open("/proc/meminfo")
        for line in fd.readlines():
            if line.startswith("MemFree:"):
                memfree = "MemFree: " + line.split(':')[1].strip()
                break
        fd.close()

        freeflash = "Free Flash: "
        # fix error "cannot allocate memory" mit popen...
        try:
            fd = popen("df -h")
            for line in fd.readlines():
                items = line.split()
                if len(items) > 5:
                    if items[5] == '/':
                        freeflash += items[3] + "B used: " + items[4]
                        break
            fd.close()
        except os_error as err:
            print("[Merlin Info] popen os.error:", err)
            freeflash += "popen error"
        self["sysInfo"].setText(loadavg + "\n" + memfree + "\n" + freeflash)

        hddStr = _("Detected HDD:\n")
        hddlist = harddiskmanager.HDDList()
        hdd = hddlist and hddlist[0][1] or None
        if hdd is not None and hdd.model() != "":
            hddStr += _("%s\n%s, %d MB free") % (hdd.model(), hdd.capacity(),
                                                 hdd.free())
            hddDeviceName = hdd.getDeviceName()
        else:
            hddStr += _("none")
            hddDeviceName = None
        self["hddInfo"].setText(hddStr)

        hddTemp = _("No Harddisk Temperature avaiable...")
        if hddDeviceName:
            # fix error "cannot allocate memory" mit popen...
            try:
                fd = popen("smartctl -a %s | grep Temperature_Celsius" %
                           hddDeviceName)
                fread = fd.readline().split()
                if len(fread) > 8:
                    hddTemp = "Harddisk Temperature: %d °C" % int(fread[9])
                fd.close()
            except os_error as err:
                print("[Merlin Info] popen os.error:", err)
                hddTemp = "Harddisk Temperature: popen error"
        self["hddTemp"].setText(hddTemp)
コード例 #21
0
    def getHddList(self):
        newHddList = []

        hddList = harddiskmanager.HDDList()
        for h in hddList:
            devpath = "/sys/block/" + h[1].device[:3]
            removable = bool(int(readFile(devpath + "/removable")))
            if removable:
                newHddList.append((h[1].findMount(), h[1]))

        return newHddList
コード例 #22
0
ファイル: HarddiskSetup.py プロジェクト: ahmedmoselhi/dvbapp2
 def __init__(self, session):
     Screen.__init__(self, session)
     Screen.setTitle(self, _('Initialization'))
     self.skinName = 'HarddiskSelection'
     if harddiskmanager.HDDCount() == 0:
         tlist = [(_('no storage devices found'), 0)]
         self['hddlist'] = MenuList(tlist)
     else:
         self['hddlist'] = MenuList(harddiskmanager.HDDList())
     self['actions'] = ActionMap(['OkCancelActions'], {'ok': self.okbuttonClick,
      'cancel': self.close})
コード例 #23
0
	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyTimeUnknownTimer.stop()
		if self.prev_running_service:
			self.session.nav.playService(self.prev_running_service)
		elif self.paused_service:
			self.paused_service.unPauseService()
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(config.usage.hdd_standby.value)) # HDD standby timer value (box active)
コード例 #24
0
    def __init__(self, session):
        Screen.__init__(self, session)
        if harddiskmanager.HDDCount() == 0:
            tlist = []
            tlist.append((_("no storage devices found"), 0))
            self["hddlist"] = MenuList(tlist)
        else:
            self["hddlist"] = MenuList(harddiskmanager.HDDList())

        self["actions"] = ActionMap(["OkCancelActions"], {
            "ok": self.okbuttonClick,
            "cancel": self.close
        })
コード例 #25
0
ファイル: About.py プロジェクト: popazerty/bh1
    def __init__(self, session):
        Screen.__init__(self, session)

        bhVer = "Black Hole"
        f = open("/etc/bhversion", 'r')
        bhVer = f.readline().strip()
        f.close()

        bhRev = ""
        f = open("/etc/bhrev", 'r')
        bhRev = f.readline().strip()
        f.close()

        self["EnigmaVersion"] = StaticText("Firmware: " + bhVer + " " + bhRev)
        #		self["ImageVersion"] = StaticText("Image: " + about.getImageVersionString())

        self["ImageVersion"] = StaticText("Build: " +
                                          about.getEnigmaVersionString())
        driverdate = self.getDriverInstalledDate()
        if driverdate == "unknown":
            driverdate = self.getDriverInstalledDate_proxy()
        self["DriverVersion"] = StaticText(_("DVB drivers: ") + driverdate)
        self["KernelVersion"] = StaticText(
            _("Kernel version: ") + self.getKernelVersionString())

        self["FPVersion"] = StaticText("Team Homesite: vuplus-community.net")

        self["CpuInfo"] = StaticText(_("CPU: ") + self.getCPUInfoString())
        self["TunerHeader"] = StaticText(_("Detected NIMs:"))

        nims = nimmanager.nimList()
        for count in (0, 1, 2, 3):
            if count < len(nims):
                self["Tuner" + str(count)] = StaticText(nims[count])
            else:
                self["Tuner" + str(count)] = StaticText("")

        self["HDDHeader"] = StaticText(_("Detected HDD:"))
        hddlist = harddiskmanager.HDDList()
        hdd = hddlist and hddlist[0][1] or None
        if hdd is not None and hdd.model() != "":
            self["hddA"] = StaticText(
                _("%s\n(%s, %d MB free)") %
                (hdd.model(), hdd.capacity(), hdd.free()))
        else:
            self["hddA"] = StaticText(_("none"))

        self["actions"] = ActionMap(["SetupActions", "ColorActions"], {
            "cancel": self.close,
            "ok": self.close,
        })
コード例 #26
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self.skinName = "HarddiskSelection"  # For derived classes
     if harddiskmanager.HDDCount() == 0:
         tlist = []
         tlist.append((_("no storage devices found"), 0))
         self["hddlist"] = MenuList(tlist)
     else:
         self["hddlist"] = MenuList(harddiskmanager.HDDList())
     self["key_red"] = Label(_("Cancel"))
     self["actions"] = ActionMap(["OkCancelActions"], {
         "ok": self.okbuttonClick,
         "cancel": self.close
     })
コード例 #27
0
	def __onClose(self):
		global inStandby
		inStandby = None
		self.standbyStopServiceTimer.stop()
		self.timeHandler and self.timeHandler.m_timeUpdated.get().remove(self.stopService)
		if self.paused_service:
			self.paused_service.unPauseService()
		elif self.prev_running_service:
			service = self.prev_running_service.toString()
			self.session.nav.playService(self.prev_running_service)
		self.session.screen["Standby"].boolean = False
		globalActionMap.setEnabled(True)
		for hdd in harddiskmanager.HDDList():
			hdd[1].setIdleTime(int(config.usage.hdd_standby.value)) # HDD standby timer value (box active)
コード例 #28
0
def getHDDTempInfo(all=False):
    if not os.path.exists("/usr/sbin/hddtemp"):
        return _("HDDtemp not installed!"), MessageBox.TYPE_ERROR
    if tempwatcher is None:
        return _("HddTempWatcher not running!"), MessageBox.TYPE_ERROR
    internal_hddlist = []
    internal = False
    for hdd in harddiskmanager.HDDList():
        if "pci" in hdd[1].phys_path or "ahci" in hdd[
                1].phys_path or "sata" in hdd[1].phys_path:
            internal_hddlist.append(hdd[1].getDeviceDir())
            internal = True
    message = ""
    hddlist = tempwatcher.getHddTempList()
    add_message = _(
        "Try adding your internal HDD/SSD in '/usr/share/misc/hddtemp.db' manually (for SSD use 190 value)."
    )
    for d in hddlist:
        if d in internal_hddlist:
            message += "%s %s\n" % (hddlist[d]["path"], hddlist[d]["name"])
            if hddlist[d]["temp"] == -253:
                message += _("Drive is sleeping\n")
            elif hddlist[d]["temp"] == -254:
                message += _("ERROR\n")
            elif hddlist[d]["temp"] == -255:
                message += _("unknown\n")
            else:
                answer = "%s%s" % (hddlist[d]["temp"], hddlist[d]["unit"])
                if answer == "":
                    message += add_message
                else:
                    message += _("temp: ") + "%s %s\n" % (hddlist[d]["temp"],
                                                          hddlist[d]["unit"])
    if message == "" and not internal:
        message = _("Not found an internal HDD/SSD!\n\n")
    elif message == "" and internal:
        message = _("ERROR\n") + add_message
    elif message != "":
        message = _("Found internal HDD/SSD!\n") + "\n" + message
    if all and system_temp:
        temp = getSystemTemp()
        if temp is not None:
            message += _("\nSystem temperature: ") + str(temp) + str(
                '\xc2\xb0') + ' C'
    if all and cpu_temp:
        cputemp = getCPUtemp()
        if cputemp is not None:
            message += _("\nCPU temperature: ") + str(cputemp) + str(
                '\xc2\xb0') + ' C'
    return message, MessageBox.TYPE_INFO
コード例 #29
0
ファイル: HarddiskSetup.py プロジェクト: technic/enigma2-atv
    def __init__(self, session):
        Screen.__init__(self, session)
        Screen.setTitle(self, _("Initialization"))
        self.skinName = "HarddiskSelection"  # For derived classes
        if harddiskmanager.HDDCount() == 0:
            tlist = [(_("no storage devices found"), 0)]
            self["hddlist"] = MenuList(tlist)
        else:
            self["hddlist"] = MenuList(harddiskmanager.HDDList())

        self["actions"] = ActionMap(["OkCancelActions"], {
            "ok": self.okbuttonClick,
            "cancel": self.close
        })
コード例 #30
0
 def isExtHDDSleeping(self, path, MovieCenterInst):
     isExtHDDSleeping = False
     device = self.getMountPointDeviceCached(path)
     if not (self.postWakeHDDtimerActive
             and self.postWakeHDDtimerDevice == device):
         try:
             from Components.Harddisk import harddiskmanager
             for hdd in harddiskmanager.HDDList():
                 if device.startswith(hdd[1].getDeviceName()):
                     isExtHDDSleeping = hdd[1].isSleeping()
                     break
         except:
             pass
     return isExtHDDSleeping