diff options
author | nfnty <git@nfnty.se> | 2017-01-15 23:09:58 +0100 |
---|---|---|
committer | nfnty <git@nfnty.se> | 2017-01-17 05:59:04 +0100 |
commit | 84a22ae0c78b087b0cb080f47620291833586e6f (patch) | |
tree | 95b6c55d171d61d9c1c6b552ce17c2e34ba21acc /ranger/api/commands.py | |
parent | 52403c53841a30edf550f5610e33e6c0981caad1 (diff) | |
download | ranger-84a22ae0c78b087b0cb080f47620291833586e6f.tar.gz |
linting: pylint 2.0.0
Diffstat (limited to 'ranger/api/commands.py')
-rw-r--r-- | ranger/api/commands.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 097ead2c..35e073cc 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -70,7 +70,7 @@ class CommandContainer(object): lst = [cls for cmd, cls in self.commands.items() if cls.allow_abbrev and cmd.startswith(name) or cmd == name] - if len(lst) == 0: + if not lst: raise KeyError if len(lst) == 1: return lst[0] @@ -112,8 +112,7 @@ class Command(FileManagerAware): classdict = cls.__mro__[0].__dict__ if 'name' in classdict and classdict['name']: return cls.name - else: - return cls.__name__ + return cls.__name__ def execute(self): """Override this""" @@ -230,7 +229,7 @@ class Command(FileManagerAware): flags = "" args = self.line.split() rest = "" - if len(args) > 0: + if args: rest = self.line[len(args[0]):].lstrip() for arg in args[1:]: if arg == "--": @@ -283,7 +282,7 @@ class Command(FileManagerAware): dirnames.sort() # no results, return None - if len(dirnames) == 0: + if not dirnames: return # one result. since it must be a directory, append a slash. @@ -347,7 +346,7 @@ class Command(FileManagerAware): pass else: # no results, return None - if len(names) == 0: + if not names: return # one result. append a slash if it's a directory @@ -399,7 +398,7 @@ class FunctionCommand(Command): value = (value == 'True') else: try: - value = float(value) # pylint: disable=redefined-variable-type + value = float(value) except Exception: pass |