diff options
author | toonn <toonn@toonn.io> | 2020-01-15 22:17:49 +0100 |
---|---|---|
committer | toonn <toonn@toonn.io> | 2020-07-05 15:23:44 +0200 |
commit | 82f68f863315a6325f9ca4aa59232d40d16250ad (patch) | |
tree | 75a3a84a37d24de238c082cc3f6c5941bb5b168c | |
parent | 1cd29c998e735a43ad496e0f26cf9dede1ff22dd (diff) | |
download | ranger-82f68f863315a6325f9ca4aa59232d40d16250ad.tar.gz |
Use in instead of multiple equality clauses
-rw-r--r-- | ranger/container/fsobject.py | 2 | ||||
-rw-r--r-- | ranger/core/fm.py | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py index 7de889bf..664537e8 100644 --- a/ranger/container/fsobject.py +++ b/ranger/container/fsobject.py @@ -313,7 +313,7 @@ class FileSystemObject( # pylint: disable=too-many-instance-attributes,too-many mode = new_stat.st_mode if new_stat else 0 fmt = mode & 0o170000 - if fmt == 0o020000 or fmt == 0o060000: # stat.S_IFCHR/BLK + if fmt in (0o020000, 0o060000): # stat.S_IFCHR/BLK self.is_device = True self.size = 0 self.infostring = 'dev' diff --git a/ranger/core/fm.py b/ranger/core/fm.py index c05e0925..da8b27c3 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -271,15 +271,15 @@ class FM(Actions, # pylint: disable=too-many-instance-attributes shutil.copy(self.relpath(src), self.confpath(dest)) except OSError as ex: sys.stderr.write(" ERROR: %s\n" % str(ex)) - if which == 'rifle' or which == 'all': + if which in ('rifle', 'all'): copy('config/rifle.conf', 'rifle.conf') - if which == 'commands' or which == 'all': + if which in ('commands', 'all'): copy('config/commands_sample.py', 'commands.py') - if which == 'commands_full' or which == 'all': + if which in ('commands_full', 'all'): copy('config/commands.py', 'commands_full.py') - if which == 'rc' or which == 'all': + if which in ('rc', 'all'): copy('config/rc.conf', 'rc.conf') - if which == 'scope' or which == 'all': + if which in ('scope', 'all'): copy('data/scope.sh', 'scope.sh') os.chmod(self.confpath('scope.sh'), os.stat(self.confpath('scope.sh')).st_mode | stat.S_IXUSR) |