diff options
-rw-r--r-- | ranger/container/directory.py | 2 | ||||
-rw-r--r-- | ranger/container/fsobject.py | 4 | ||||
-rw-r--r-- | ranger/ext/vcs/vcs.py | 5 |
3 files changed, 6 insertions, 5 deletions
diff --git a/ranger/container/directory.py b/ranger/container/directory.py index 877584a9..cabd4d65 100644 --- a/ranger/container/directory.py +++ b/ranger/container/directory.py @@ -74,7 +74,7 @@ def accept_file(fobj, filters): def walklevel(some_dir, level): some_dir = some_dir.rstrip(os.path.sep) - followlinks = True if level > 0 else False + followlinks = level > 0 assert os.path.isdir(some_dir) num_sep = some_dir.count(os.path.sep) for root, dirs, files in os.walk(some_dir, followlinks=followlinks): diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py index 664537e8..51eb5376 100644 --- a/ranger/container/fsobject.py +++ b/ranger/container/fsobject.py @@ -296,7 +296,7 @@ class FileSystemObject( # pylint: disable=too-many-instance-attributes,too-many if self.is_link: new_stat = self.preload[0] self.preload = None - self.exists = True if new_stat else False + self.exists = bool(new_stat) else: try: new_stat = lstat(path) @@ -309,7 +309,7 @@ class FileSystemObject( # pylint: disable=too-many-instance-attributes,too-many # Set some attributes - self.accessible = True if new_stat else False + self.accessible = bool(new_stat) mode = new_stat.st_mode if new_stat else 0 fmt = mode & 0o170000 diff --git a/ranger/ext/vcs/vcs.py b/ranger/ext/vcs/vcs.py index 2c727b93..e0f83da9 100644 --- a/ranger/ext/vcs/vcs.py +++ b/ranger/ext/vcs/vcs.py @@ -76,8 +76,9 @@ class Vcs(object): # pylint: disable=too-many-instance-attributes ) self.root, self.repodir, self.repotype, self.links = self._find_root(self.path) - self.is_root = True if self.obj.path == self.root else False - self.is_root_link = True if self.obj.is_link and self.obj.realpath == self.root else False + self.is_root = self.obj.path == self.root + self.is_root_link = (self.obj.is_link + and self.obj.realpath == self.root) self.is_root_pointer = self.is_root or self.is_root_link self.in_repodir = False self.rootvcs = None |