summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-01-18 04:17:44 +0100
committernfnty <git@nfnty.se>2017-01-18 04:17:44 +0100
commit03ee065e35c6a8f0e0dc1e66d8f4c3e83c51f315 (patch)
tree69b56f67dee1d6dfcea869de897846baaded3fa6
parent51ec08da2f3c3c5466a60304dd94db9da45d99d5 (diff)
downloadranger-03ee065e35c6a8f0e0dc1e66d8f4c3e83c51f315.tar.gz
linting: Fix flake8 `W503`
-rw-r--r--ranger/api/commands.py3
-rwxr-xr-xranger/config/commands.py3
-rw-r--r--ranger/gui/widgets/statusbar.py7
3 files changed, 5 insertions, 8 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index 9985b996..0a3ea470 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -68,8 +68,7 @@ class CommandContainer(object):
     def get_command(self, name, abbrev=True):
         if abbrev:
             lst = [cls for cmd, cls in self.commands.items()
-                   if cls.allow_abbrev and cmd.startswith(name)
-                   or cmd == name]
+                   if cls.allow_abbrev and cmd.startswith(name) or cmd == name]
             if not lst:
                 raise KeyError
             if len(lst) == 1:
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 2e84766a..962a6a98 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -528,8 +528,7 @@ class delete(Command):
         from functools import partial
 
         def is_directory_with_files(path):
-            return (os.path.isdir(path) and not os.path.islink(path)
-                    and len(os.listdir(path)) > 0)
+            return os.path.isdir(path) and not os.path.islink(path) and len(os.listdir(path)) > 0
 
         if self.rest(1):
             files = shlex.split(self.rest(1))
diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py
index e17f131c..bb0b2d4c 100644
--- a/ranger/gui/widgets/statusbar.py
+++ b/ranger/gui/widgets/statusbar.py
@@ -266,8 +266,8 @@ class StatusBar(Widget):  # pylint: disable=too-many-instance-attributes
             else:
                 sumsize = sum(
                     f.size for f in target.marked_items
-                    if not f.is_directory
-                    or f._cumulative_size_calculated  # pylint: disable=protected-access
+                    if not f.is_directory or
+                    f._cumulative_size_calculated  # pylint: disable=protected-access
                 )
                 right.add(human_readable(sumsize, separator=''))
             right.add("/" + str(len(target.marked_items)))
@@ -287,8 +287,7 @@ class StatusBar(Widget):  # pylint: disable=too-many-instance-attributes
             # away and don't see them anymore.
             right.add('Mrk', base, 'marked')
         elif target.files:
-            right.add(str(target.pointer + 1) + '/'
-                      + str(len(target.files)) + '  ', base)
+            right.add(str(target.pointer + 1) + '/' + str(len(target.files)) + '  ', base)
             if max_pos <= 0:
                 right.add('All', base, 'all')
             elif pos == 0: