Merge pull request #267 from fredj/coding_style

Minor coding style fixes
This commit is contained in:
tobi-wan-kenobi 2018-06-04 20:24:01 +02:00 committed by GitHub
commit 30b542906c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 12 additions and 12 deletions

View file

@ -288,7 +288,7 @@ class Engine(object):
for module in self._modules:
self._current_module = module
module.update_wrapper(module.widgets())
if module.error == None:
if module.error is None:
if module.minimized():
widget = module.minimizedWidget()
widget.link_module(module)

View file

@ -49,7 +49,7 @@ class Module(bumblebee.engine.Module):
self._tags = defaultdict(lambda: '')
def hidden(self):
return self._status == None
return self._status is None
@scrollable
def description(self, widget):

View file

@ -18,7 +18,7 @@ class Module(bumblebee.engine.Module):
self.status = False
super(Module,self).__init__(engine, config, widgets)
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):
self._update_widgets(widgets)

View file

@ -56,7 +56,7 @@ class Module(bumblebee.engine.Module):
self._tags = defaultdict(lambda: '')
def hidden(self):
return self._status == None
return self._status is None
@scrollable
def description(self, widget):

View file

@ -100,7 +100,7 @@ class Module(bumblebee.engine.Module):
widget.set("visited", True)
for widget in widgets:
if widget.get("visited") == False:
if widget.get("visited") is False:
widgets.remove(widget)
def get_ssid(self, intf):

View file

@ -105,12 +105,12 @@ class Module(bumblebee.engine.Module):
if "<"+device+">" in line:
found = True
continue
if found == False:
if found is False:
continue
for pattern in self._patterns:
if not pattern["expr"] in line:
continue
if pattern["callback"](line) == False and found == True:
if pattern["callback"](line) is False and found == True:
return
except Exception:
self._failed = True

View file

@ -49,7 +49,7 @@ class Module(bumblebee.engine.Module):
num_shortcuts = min(len(cmds), len(labels))
# 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 "\
"the number of provided labels.")
logging.warning("cmds : %s, labels : %s", cmds, labels)

View file

@ -66,7 +66,7 @@ class Module(bumblebee.engine.Module):
except Exception:
self._full_title = no_title
if(self._full_title is None):
if self._full_title is None:
self._full_title = no_title
# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

View file

@ -64,7 +64,7 @@ class Module(bumblebee.engine.Module):
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))
else:
bumblebee.util.execute("{} --output {} --auto --{}-of {}".format(toggle_cmd, widget.name,

View file

@ -150,7 +150,7 @@ class Module(bumblebee.engine.Module):
band=bytefmt(nread)))
for widget in widgets:
if widget.get("visited") == False:
if widget.get("visited") is False:
widgets.remove(widget)
@staticmethod

View file

@ -102,7 +102,7 @@ class Theme(object):
def icon(self, widget):
icon = self._get(widget, "icon", None)
if icon == None:
if icon is None:
return self._get(widget, "prefix", None)
def padding(self, widget):