Fix trailing-whitespace errors found by pylint
This commit is contained in:
parent
57204a215e
commit
5f20fa6134
6 changed files with 11 additions and 12 deletions
|
@ -87,7 +87,7 @@ class Config(bumblebee.store.Store):
|
||||||
def theme(self):
|
def theme(self):
|
||||||
"""Return the name of the selected theme"""
|
"""Return the name of the selected theme"""
|
||||||
return self._args.theme
|
return self._args.theme
|
||||||
|
|
||||||
def debug(self):
|
def debug(self):
|
||||||
return self._args.debug
|
return self._args.debug
|
||||||
|
|
||||||
|
|
|
@ -54,7 +54,7 @@ class Module(bumblebee.engine.Module):
|
||||||
if self._count == 0:
|
if self._count == 0:
|
||||||
thread = threading.Thread(target=get_pacman_info, args=(widgets[0], path))
|
thread = threading.Thread(target=get_pacman_info, args=(widgets[0], path))
|
||||||
thread.start()
|
thread.start()
|
||||||
|
|
||||||
# TODO: improve this waiting mechanism a bit
|
# TODO: improve this waiting mechanism a bit
|
||||||
self._count += 1
|
self._count += 1
|
||||||
self._count = 0 if self._count > 300 else self._count
|
self._count = 0 if self._count > 300 else self._count
|
||||||
|
|
|
@ -4,7 +4,7 @@ Requires the following python packages:
|
||||||
* requests
|
* requests
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
* publicip.region: us-central (default), us-east, us-west, uk, de, pl, nl
|
* publicip.region: us-central (default), us-east, us-west, uk, de, pl, nl
|
||||||
* publicip.service: web address that returns plaintext ip address (ex. "http://l2.io/ip")
|
* publicip.service: web address that returns plaintext ip address (ex. "http://l2.io/ip")
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ class Module(bumblebee.engine.Module):
|
||||||
super(Module, self).__init__(engine, config,
|
super(Module, self).__init__(engine, config,
|
||||||
bumblebee.output.Widget(full_text=self.public_ip)
|
bumblebee.output.Widget(full_text=self.public_ip)
|
||||||
)
|
)
|
||||||
self._avail_regions = {"us-east":"http://l2.io/ip",
|
self._avail_regions = {"us-east":"http://l2.io/ip",
|
||||||
"us-central":"http://whatismyip.akamai.com",
|
"us-central":"http://whatismyip.akamai.com",
|
||||||
"us-west":"http://ipv4bot.whatismyipaddress.com",
|
"us-west":"http://ipv4bot.whatismyipaddress.com",
|
||||||
"pl":"http://ip.42.pl/raw",
|
"pl":"http://ip.42.pl/raw",
|
||||||
|
@ -45,4 +45,3 @@ class Module(bumblebee.engine.Module):
|
||||||
self._ip = get(self.address).text.rstrip()
|
self._ip = get(self.address).text.rstrip()
|
||||||
except Exception:
|
except Exception:
|
||||||
self._ip = "No Connection"
|
self._ip = "No Connection"
|
||||||
|
|
||||||
|
|
|
@ -15,24 +15,24 @@ import bumblebee.engine
|
||||||
|
|
||||||
class Module(bumblebee.engine.Module):
|
class Module(bumblebee.engine.Module):
|
||||||
|
|
||||||
|
|
||||||
def __init__(self, engine, config):
|
def __init__(self, engine, config):
|
||||||
super(Module, self).__init__(engine, config,
|
super(Module, self).__init__(engine, config,
|
||||||
bumblebee.output.Widget(full_text=self.output)
|
bumblebee.output.Widget(full_text=self.output)
|
||||||
)
|
)
|
||||||
self._todos = self.count_items()
|
self._todos = self.count_items()
|
||||||
|
|
||||||
|
|
||||||
def output(self, widget):
|
def output(self, widget):
|
||||||
self._todos = self.count_items()
|
self._todos = self.count_items()
|
||||||
return str(self._todos)
|
return str(self._todos)
|
||||||
|
|
||||||
|
|
||||||
def state(self, widgets):
|
def state(self, widgets):
|
||||||
if self._todos == 0:
|
if self._todos == 0:
|
||||||
return "empty"
|
return "empty"
|
||||||
return "items"
|
return "items"
|
||||||
|
|
||||||
|
|
||||||
def count_items(filename):
|
def count_items(filename):
|
||||||
try:
|
try:
|
||||||
|
@ -41,7 +41,7 @@ class Module(bumblebee.engine.Module):
|
||||||
with open(doc) as f:
|
with open(doc) as f:
|
||||||
for i, l in enumerate(f):
|
for i, l in enumerate(f):
|
||||||
pass
|
pass
|
||||||
return i+1
|
return i+1
|
||||||
except Exception:
|
except Exception:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
|
|
@ -87,7 +87,7 @@ class Module(bumblebee.engine.Module):
|
||||||
}
|
}
|
||||||
|
|
||||||
name = "traffic-{}".format(interface)
|
name = "traffic-{}".format(interface)
|
||||||
|
|
||||||
if self._showname:
|
if self._showname:
|
||||||
self.create_widget(widgets, name, interface)
|
self.create_widget(widgets, name, interface)
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ class Module(bumblebee.engine.Module):
|
||||||
last_neighbor = next((widget for widget in reversed(self.widgets()) if widget.get("state") == "on"), None)
|
last_neighbor = next((widget for widget in reversed(self.widgets()) if widget.get("state") == "on"), None)
|
||||||
|
|
||||||
neighbor = first_neighbor if event["button"] == bumblebee.input.LEFT_MOUSE else last_neighbor
|
neighbor = first_neighbor if event["button"] == bumblebee.input.LEFT_MOUSE else last_neighbor
|
||||||
|
|
||||||
if neighbor == None:
|
if neighbor == None:
|
||||||
bumblebee.util.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
bumblebee.util.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in a new issue