Permalink
Browse files

power-now is unsupported in ACPI, so use power-average. removed some …

…debug printing, small cleanup, and stopped specifying a minimum width in the power display
  • Loading branch information...
1 parent 7cb8d19 commit 112c9964a058961bdc6e5c38407d1fa2e3a78141 @teleshoes committed May 30, 2012
Showing with 2 additions and 3 deletions.
  1. +2 −3 src/battstatus.py
View
@@ -42,7 +42,7 @@ def getBattInfo(self, batt_id):
return None
def getPowerDisplay(self):
disp = self.prefs.display_power_usage.lower()
- if disp == 'average':
+ if disp == 'average' or (disp == 'now' and self.prefs.use_acpi):
p0 = int(self.batt0.power_avg)
p1 = int(self.batt1.power_avg)
elif disp == 'now':
@@ -55,7 +55,7 @@ def getPowerDisplay(self):
p = p0
else:
p = p1
- return "%3.1fW" % (p/1000.0)
+ return "%.1fW" % (p/1000.0)
def update(self, prefs):
if self.last_acpi != self.prefs.use_acpi:
if self.prefs.use_acpi:
@@ -237,7 +237,6 @@ def update(self, prefs):
atts = dict()
atts.update(self.parseAcpi(file(self.acpiStatePath()).read()))
atts.update(self.parseAcpi(file(self.acpiInfoPath()).read()))
- print atts['present rate']
try:
voltValUnit = self.getValueAndUnit(atts['present voltage'])

0 comments on commit 112c996

Please sign in to comment.