Ejemplo n.º 1
0
    def getHddtemp(self):
        temperature = 'N/A'
        temperc = 0
        hdd_dev = BhU_find_hdd()
        hddloc = '/dev/' + hdd_dev
        if hdd_dev:
            cmd = 'hddtemp -w ' + hddloc + ' > /tmp/ninfo.tmp'
            rc = system(cmd)
            if fileExists('/tmp/ninfo.tmp'):
                f = open('/tmp/ninfo.tmp', 'r')
                for line in f.readlines():
                    if line.find('WARNING') != -1:
                        continue
                    parts = line.strip().split(':')
                    temperature = parts[2].strip()
                    pos = temperature.find(' ')
                    temperature = temperature[0:pos]
                    if temperature.isdigit():
                        temperc = int(temperature)
                    else:
                        temperature = 'N/A'

                f.close()
                os_remove('/tmp/ninfo.tmp')
        self['hddtempg'].setValue(temperc + 64)
        self.smallmontxt += 'HDD temp: ' + temperature + ' C'
Ejemplo n.º 2
0
    def getHddtemp(self):
        temperature = "N/A"
        temperc = 0
        hdd_dev = BhU_find_hdd()
        hddloc = "/dev/" + hdd_dev

        if hdd_dev:
            cmd = "hddtemp -w " + hddloc + " > /tmp/ninfo.tmp"
            rc = system(cmd)
            if fileExists("/tmp/ninfo.tmp"):
                f = open("/tmp/ninfo.tmp", 'r')
                for line in f.readlines():
                    if line.find('WARNING') != -1:
                        continue

                    parts = line.strip().split(':')
                    temperature = parts[2].strip()
                    pos = temperature.find(' ')
                    temperature = temperature[0:pos]
                    if temperature.isdigit():
                        temperc = int(temperature)
                    else:
                        temperature = "N/A"
                f.close()
                os_remove("/tmp/ninfo.tmp")

        self["hddtempg"].setValue(temperc + 64)
        self.smallmontxt += "HDD temp: " + temperature + " C"
Ejemplo n.º 3
0
 def delTimer(self):
     hdd_dev = BhU_find_hdd()
     hddloc = '/dev/' + hdd_dev
     if hdd_dev != '':
         cmd = 'hdparm -y ' + hddloc
         system(cmd)
     del self.activityTimer
     del self.moniTimer
Ejemplo n.º 4
0
    def delTimer(self):
        hdd_dev = BhU_find_hdd()
        hddloc = "/dev/" + hdd_dev
        if hdd_dev != "":
            cmd = "hdparm -y " + hddloc
            system(cmd)

        del self.activityTimer
        del self.moniTimer
Ejemplo n.º 5
0
	def __init__(self, session):
		Screen.__init__(self, session)
		
		self["infotext"] = ScrollLabel()
		self["lab1"] = Label(_("Status:"))
		self["labstop"] = Label(_("Standby"))
		self["labrun"] = Label(_("Running"))
		self["key_red"] = Label(_("Standby Now"))
		self["key_green"] = Label(_("Set Acoustic"))
		self["key_yellow"] = Label(_("Set Standby"))
		
		self.cur_state = False
		
		self["actions"] = ActionMap(["WizardActions", "ColorActions", "DirectionActions"],
		{
			"back": self.close,
			"up": self["infotext"].pageUp,
			"left": self["infotext"].pageUp,
			"down": self["infotext"].pageDown,
			"right": self["infotext"].pageDown,
			"red": self.setStand,
			"green": self.setAcu,
			"yellow": self.setSsec
		})
		
#		self.hddloc = ""
#		if fileExists("/proc/mounts"):
#			f = open("/proc/mounts",'r')
#			for line in f.readlines():
#				if line.find('/hdd') != -1:
#					self.hddloc = line
#					pos = self.hddloc.find(' ')
#					self.hddloc = self.hddloc[0:pos]
#					self.hddloc = self.hddloc.strip()
#					self.hddloc = self.hddloc.replace('part1', 'disc')
#			f.close()

		self.hdd_dev = BhU_find_hdd()
		self.hddloc = "/dev/" + self.hdd_dev
		
		self.onLayoutFinish.append(self.updateHdd)
Ejemplo n.º 6
0
 def __init__(self, session):
     Screen.__init__(self, session)
     self['infotext'] = ScrollLabel()
     self['lab1'] = Label(_('Status:'))
     self['labstop'] = Label(_('Standby'))
     self['labrun'] = Label(_('Running'))
     self['key_red'] = Label(_('Standby Now'))
     self['key_green'] = Label(_('Set Acoustic'))
     self['key_yellow'] = Label(_('Set Standby'))
     self.cur_state = False
     self['actions'] = ActionMap(
         ['WizardActions', 'ColorActions', 'DirectionActions'], {
             'back': self.close,
             'up': self['infotext'].pageUp,
             'left': self['infotext'].pageUp,
             'down': self['infotext'].pageDown,
             'right': self['infotext'].pageDown,
             'red': self.setStand,
             'green': self.setAcu,
             'yellow': self.setSsec
         })
     self.hdd_dev = BhU_find_hdd()
     self.hddloc = '/dev/' + self.hdd_dev
     self.onLayoutFinish.append(self.updateHdd)