diff options
author | hut <hut@hut.pm> | 2017-07-16 05:55:03 +0200 |
---|---|---|
committer | hut <hut@hut.pm> | 2017-07-16 05:55:03 +0200 |
commit | 447ce459c48dceffe98d5ff7acbfcbe473c08d73 (patch) | |
tree | 29df4d60a70e8473a80fc4246f44e4b9e108eb8d | |
parent | f9f485ed3ec35291a2ea7d6ab8f7d44ffc0c403d (diff) | |
download | ranger-447ce459c48dceffe98d5ff7acbfcbe473c08d73.tar.gz |
container.fsobject: move __init__ definition to the top
-rw-r--r-- | ranger/container/fsobject.py | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py index e3f02b75..121fac22 100644 --- a/ranger/container/fsobject.py +++ b/ranger/container/fsobject.py @@ -94,6 +94,21 @@ class FileSystemObject( # pylint: disable=too-many-instance-attributes,too-many MtimeLinemode, SizeMtimeLinemode] ) + def __init__(self, path, preload=None, path_is_abs=False, basename_is_rel_to=None): + if not path_is_abs: + path = abspath(path) + self.path = path + self.basename = basename(path) + if basename_is_rel_to is None: + self.relative_path = self.basename + else: + self.relative_path = relpath(path, basename_is_rel_to) + self.preload = preload + self.display_data = {} + + def __repr__(self): + return "<{0} {1}>".format(self.__class__.__name__, self.path) + @lazy_property def extension(self): try: @@ -124,21 +139,6 @@ class FileSystemObject( # pylint: disable=too-many-instance-attributes,too-many def dirname(self): return dirname(self.path) - def __init__(self, path, preload=None, path_is_abs=False, basename_is_rel_to=None): - if not path_is_abs: - path = abspath(path) - self.path = path - self.basename = basename(path) - if basename_is_rel_to is None: - self.relative_path = self.basename - else: - self.relative_path = relpath(path, basename_is_rel_to) - self.preload = preload - self.display_data = {} - - def __repr__(self): - return "<{0} {1}>".format(self.__class__.__name__, self.path) - @lazy_property def shell_escaped_basename(self): return shell_escape(self.basename) |