Merge pull request #267 from fredj/coding_style
Minor coding style fixes
This commit is contained in:
commit
30b542906c
11 changed files with 12 additions and 12 deletions
|
@ -288,7 +288,7 @@ class Engine(object):
|
||||||
for module in self._modules:
|
for module in self._modules:
|
||||||
self._current_module = module
|
self._current_module = module
|
||||||
module.update_wrapper(module.widgets())
|
module.update_wrapper(module.widgets())
|
||||||
if module.error == None:
|
if module.error is None:
|
||||||
if module.minimized():
|
if module.minimized():
|
||||||
widget = module.minimizedWidget()
|
widget = module.minimizedWidget()
|
||||||
widget.link_module(module)
|
widget.link_module(module)
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Module(bumblebee.engine.Module):
|
||||||
self._tags = defaultdict(lambda: '')
|
self._tags = defaultdict(lambda: '')
|
||||||
|
|
||||||
def hidden(self):
|
def hidden(self):
|
||||||
return self._status == None
|
return self._status is None
|
||||||
|
|
||||||
@scrollable
|
@scrollable
|
||||||
def description(self, widget):
|
def description(self, widget):
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Module(bumblebee.engine.Module):
|
||||||
self.status = False
|
self.status = False
|
||||||
super(Module,self).__init__(engine, config, widgets)
|
super(Module,self).__init__(engine, config, widgets)
|
||||||
self._include = tuple(filter(len, self.parameter("include", "NumLock,CapsLock").split(",")))
|
self._include = tuple(filter(len, self.parameter("include", "NumLock,CapsLock").split(",")))
|
||||||
self._signalType = self.parameter("signaltype") if not self.parameter("signaltype") == None else "warning"
|
self._signalType = self.parameter("signaltype") if not self.parameter("signaltype") is None else "warning"
|
||||||
|
|
||||||
def update(self, widgets):
|
def update(self, widgets):
|
||||||
self._update_widgets(widgets)
|
self._update_widgets(widgets)
|
||||||
|
|
|
@ -56,7 +56,7 @@ class Module(bumblebee.engine.Module):
|
||||||
self._tags = defaultdict(lambda: '')
|
self._tags = defaultdict(lambda: '')
|
||||||
|
|
||||||
def hidden(self):
|
def hidden(self):
|
||||||
return self._status == None
|
return self._status is None
|
||||||
|
|
||||||
@scrollable
|
@scrollable
|
||||||
def description(self, widget):
|
def description(self, widget):
|
||||||
|
|
|
@ -100,7 +100,7 @@ class Module(bumblebee.engine.Module):
|
||||||
widget.set("visited", True)
|
widget.set("visited", True)
|
||||||
|
|
||||||
for widget in widgets:
|
for widget in widgets:
|
||||||
if widget.get("visited") == False:
|
if widget.get("visited") is False:
|
||||||
widgets.remove(widget)
|
widgets.remove(widget)
|
||||||
|
|
||||||
def get_ssid(self, intf):
|
def get_ssid(self, intf):
|
||||||
|
|
|
@ -105,12 +105,12 @@ class Module(bumblebee.engine.Module):
|
||||||
if "<"+device+">" in line:
|
if "<"+device+">" in line:
|
||||||
found = True
|
found = True
|
||||||
continue
|
continue
|
||||||
if found == False:
|
if found is False:
|
||||||
continue
|
continue
|
||||||
for pattern in self._patterns:
|
for pattern in self._patterns:
|
||||||
if not pattern["expr"] in line:
|
if not pattern["expr"] in line:
|
||||||
continue
|
continue
|
||||||
if pattern["callback"](line) == False and found == True:
|
if pattern["callback"](line) is False and found == True:
|
||||||
return
|
return
|
||||||
except Exception:
|
except Exception:
|
||||||
self._failed = True
|
self._failed = True
|
||||||
|
|
|
@ -49,7 +49,7 @@ class Module(bumblebee.engine.Module):
|
||||||
num_shortcuts = min(len(cmds), len(labels))
|
num_shortcuts = min(len(cmds), len(labels))
|
||||||
|
|
||||||
# report possible problem as a warning
|
# report possible problem as a warning
|
||||||
if (len(cmds) is not len(labels)):
|
if len(cmds) is not len(labels):
|
||||||
logging.warning("shortcut: the number of commands does not match "\
|
logging.warning("shortcut: the number of commands does not match "\
|
||||||
"the number of provided labels.")
|
"the number of provided labels.")
|
||||||
logging.warning("cmds : %s, labels : %s", cmds, labels)
|
logging.warning("cmds : %s, labels : %s", cmds, labels)
|
||||||
|
|
|
@ -66,7 +66,7 @@ class Module(bumblebee.engine.Module):
|
||||||
except Exception:
|
except Exception:
|
||||||
self._full_title = no_title
|
self._full_title = no_title
|
||||||
|
|
||||||
if(self._full_title is None):
|
if self._full_title is None:
|
||||||
self._full_title = no_title
|
self._full_title = no_title
|
||||||
|
|
||||||
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
|
||||||
|
|
|
@ -64,7 +64,7 @@ class Module(bumblebee.engine.Module):
|
||||||
|
|
||||||
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 is None:
|
||||||
bumblebee.util.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
bumblebee.util.execute("{} --output {} --auto".format(toggle_cmd, widget.name))
|
||||||
else:
|
else:
|
||||||
bumblebee.util.execute("{} --output {} --auto --{}-of {}".format(toggle_cmd, widget.name,
|
bumblebee.util.execute("{} --output {} --auto --{}-of {}".format(toggle_cmd, widget.name,
|
||||||
|
|
|
@ -150,7 +150,7 @@ class Module(bumblebee.engine.Module):
|
||||||
band=bytefmt(nread)))
|
band=bytefmt(nread)))
|
||||||
|
|
||||||
for widget in widgets:
|
for widget in widgets:
|
||||||
if widget.get("visited") == False:
|
if widget.get("visited") is False:
|
||||||
widgets.remove(widget)
|
widgets.remove(widget)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -102,7 +102,7 @@ class Theme(object):
|
||||||
|
|
||||||
def icon(self, widget):
|
def icon(self, widget):
|
||||||
icon = self._get(widget, "icon", None)
|
icon = self._get(widget, "icon", None)
|
||||||
if icon == None:
|
if icon is None:
|
||||||
return self._get(widget, "prefix", None)
|
return self._get(widget, "prefix", None)
|
||||||
|
|
||||||
def padding(self, widget):
|
def padding(self, widget):
|
||||||
|
|
Loading…
Reference in a new issue