mirror of
https://github.com/powerline/powerline.git
synced 2025-07-31 01:35:40 +02:00
Merge pull request #1005 from ZyX-I/fix-1002
Fix incorrect use of partial
This commit is contained in:
commit
21b10ee7e1
@ -9,7 +9,6 @@ import socket
|
||||
|
||||
from datetime import datetime
|
||||
from multiprocessing import cpu_count as _cpu_count
|
||||
from functools import partial
|
||||
|
||||
from powerline.lib import add_divider_highlight_group
|
||||
from powerline.lib.shell import asrun, run_cmd
|
||||
@ -1301,11 +1300,12 @@ def _get_battery(pl):
|
||||
pl.debug('Not using DBUS+UPower with {0}: not a power supply', devpath)
|
||||
continue
|
||||
pl.debug('Using DBUS+UPower with {0}', devpath)
|
||||
return lambda pl: float(partial(
|
||||
dbus.Interface(dev, dbus_interface=devinterface).Get,
|
||||
return lambda pl: float(
|
||||
dbus.Interface(dev, dbus_interface=devinterface).Get(
|
||||
devtype_name,
|
||||
'Percentage'
|
||||
))
|
||||
)
|
||||
)
|
||||
pl.debug('Not using DBUS+UPower as no batteries were found')
|
||||
|
||||
if os.path.isdir('/sys/class/power_supply'):
|
||||
|
Loading…
x
Reference in New Issue
Block a user