Permalink
Browse files

small cleanup to prevent typos

  • Loading branch information...
1 parent 5394ef2 commit b39813612594d32aeebe2e4a6ee283971a0512c4 @teleshoes committed May 30, 2012
Showing with 10 additions and 8 deletions.
  1. +10 −8 src/battstatus.py
View
18 src/battstatus.py
@@ -218,20 +218,22 @@ def update(self, prefs):
self.installed = '0'
if self.installed == '1':
- stateD = self.parseAcpi(file(self.acpiStatePath()).read())
- infoD = self.parseAcpi(file(self.acpiInfoPath()).read())
+ 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(stateD['present voltage'])
+ voltValUnit = self.getValueAndUnit(atts['present voltage'])
if voltValUnit == None or voltValUnit[1] != 'mV':
return
voltMv = voltValUnit[0]
- remMah = self.extractCurrent(stateD['remaining capacity'], voltMv)
- lastMah = self.extractCurrent(infoD['last full capacity'], voltMv)
- designMah = self.extractCurrent(infoD['design capacity'], voltMv)
- rateMa = self.extractCurrent(stateD['present rate'], voltMv)
- charge = stateD['charging state']
+ remMah = self.extractCurrent(atts['remaining capacity'], voltMv)
+ lastMah = self.extractCurrent(atts['last full capacity'], voltMv)
+ designMah = self.extractCurrent(atts['design capacity'], voltMv)
+ rateMa = self.extractCurrent(atts['present rate'], voltMv)
+ charge = atts['charging state']
if (False
or remMah < 0

0 comments on commit b398136

Please sign in to comment.