Skip to content

Commit

Permalink
small cleanup to prevent typos
Browse files Browse the repository at this point in the history
  • Loading branch information
teleshoes committed May 30, 2012
1 parent 5394ef2 commit b398136
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/battstatus.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -218,20 +218,22 @@ def update(self, prefs):
self.installed = '0' self.installed = '0'


if self.installed == '1': if self.installed == '1':
stateD = self.parseAcpi(file(self.acpiStatePath()).read()) atts = dict()
infoD = self.parseAcpi(file(self.acpiInfoPath()).read()) atts.update(self.parseAcpi(file(self.acpiStatePath()).read()))
atts.update(self.parseAcpi(file(self.acpiInfoPath()).read()))
print atts['present rate']


try: try:
voltValUnit = self.getValueAndUnit(stateD['present voltage']) voltValUnit = self.getValueAndUnit(atts['present voltage'])
if voltValUnit == None or voltValUnit[1] != 'mV': if voltValUnit == None or voltValUnit[1] != 'mV':
return return
voltMv = voltValUnit[0] voltMv = voltValUnit[0]


remMah = self.extractCurrent(stateD['remaining capacity'], voltMv) remMah = self.extractCurrent(atts['remaining capacity'], voltMv)
lastMah = self.extractCurrent(infoD['last full capacity'], voltMv) lastMah = self.extractCurrent(atts['last full capacity'], voltMv)
designMah = self.extractCurrent(infoD['design capacity'], voltMv) designMah = self.extractCurrent(atts['design capacity'], voltMv)
rateMa = self.extractCurrent(stateD['present rate'], voltMv) rateMa = self.extractCurrent(atts['present rate'], voltMv)
charge = stateD['charging state'] charge = atts['charging state']


if (False if (False
or remMah < 0 or remMah < 0
Expand Down

0 comments on commit b398136

Please sign in to comment.