summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech.siewierski@onet.pl>2015-02-18 11:20:00 +0100
committerWojciech Siewierski <wojciech.siewierski@onet.pl>2015-02-18 11:25:24 +0100
commita949de1706994396bfe763f2bce0979b48dfa94d (patch)
tree44116fed09b7057317811123be2af8b622ba6f2f /ranger
parentd6098a81a0e62274b0bf975975d2c3a72bdfcbdc (diff)
downloadranger-a949de1706994396bfe763f2bce0979b48dfa94d.tar.gz
fsobject.drawn_basename renamed to fsobject.relative_path
Diffstat (limited to 'ranger')
-rw-r--r--ranger/config/commands.py4
-rw-r--r--ranger/container/directory.py2
-rw-r--r--ranger/container/fsobject.py8
-rw-r--r--ranger/gui/widgets/browsercolumn.py4
-rw-r--r--ranger/gui/widgets/titlebar.py2
5 files changed, 9 insertions, 11 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 55f6442b..6467f98a 100644
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -793,14 +793,12 @@ class bulkrename(Command):
     def execute(self):
         import sys
         import tempfile
-        from os.path import relpath
         from ranger.container.file import File
         from ranger.ext.shell_escape import shell_escape as esc
         py3 = sys.version_info[0] >= 3
 
         # Create and edit the file list
-        filenames = [relpath(f.path, start=self.fm.thisdir.path)
-                     for f in self.fm.thistab.get_selection()]
+        filenames = [f.relative_path for f in self.fm.thistab.get_selection()]
         listfile = tempfile.NamedTemporaryFile(delete=False)
         listpath = listfile.name
 
diff --git a/ranger/container/directory.py b/ranger/container/directory.py
index 63502ce9..f78b3d97 100644
--- a/ranger/container/directory.py
+++ b/ranger/container/directory.py
@@ -20,7 +20,7 @@ from ranger.container.settings import LocalSettings
 
 def sort_by_basename(path):
     """returns path.basename (for sorting)"""
-    return path.drawn_basename
+    return path.relative_path
 
 def sort_by_basename_icase(path):
     """returns case-insensitive path.basename (for sorting)"""
diff --git a/ranger/container/fsobject.py b/ranger/container/fsobject.py
index 08161c3c..2f2b5197 100644
--- a/ranger/container/fsobject.py
+++ b/ranger/container/fsobject.py
@@ -94,11 +94,11 @@ class FileSystemObject(FileManagerAware, SettingsAware):
         self.basename_is_rel_to = basename_is_rel_to
         if basename_is_rel_to == None:
             self.basename = basename(path)
-            self.drawn_basename = self.basename
+            self.relative_path = self.basename
         else:
             self.basename = basename(path)
-            self.drawn_basename = relpath(path, basename_is_rel_to)
-        self.basename_lower = self.drawn_basename.lower()
+            self.relative_path = relpath(path, basename_is_rel_to)
+        self.basename_lower = self.relative_path.lower()
         self.extension = splitext(self.basename)[1].lstrip(extsep) or None
         self.dirname = dirname(path)
         self.preload = preload
@@ -142,7 +142,7 @@ class FileSystemObject(FileManagerAware, SettingsAware):
     @lazy_property
     def basename_natural(self):
         return [c if i % 3 == 1 else (int(c) if c else 0) for i, c in \
-            enumerate(_extract_number_re.split(self.drawn_basename))]
+            enumerate(_extract_number_re.split(self.relative_path))]
 
     @lazy_property
     def basename_natural_lower(self):
diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py
index 564e9a5f..563716bb 100644
--- a/ranger/gui/widgets/browsercolumn.py
+++ b/ranger/gui/widgets/browsercolumn.py
@@ -277,10 +277,10 @@ class BrowserColumn(Pager):
                 else:
                     text = metadata.title
             if use_linemode == "filename":
-                text = drawn.drawn_basename
+                text = drawn.relative_path
             elif use_linemode == "permissions":
                 text = "%s %s %s %s" % (drawn.get_permission_string(),
-                        drawn.user, drawn.group, drawn.drawn_basename)
+                        drawn.user, drawn.group, drawn.relative_path)
 
 
             if drawn.marked and (self.main_column or \
diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py
index 55cc25e6..52726b1c 100644
--- a/ranger/gui/widgets/titlebar.py
+++ b/ranger/gui/widgets/titlebar.py
@@ -117,7 +117,7 @@ class TitleBar(Widget):
 
         if self.fm.thisfile is not None and \
                 self.settings.show_selection_in_titlebar:
-            bar.add(self.fm.thisfile.drawn_basename, 'file')
+            bar.add(self.fm.thisfile.relative_path, 'file')
 
     def _get_right_part(self, bar):
         # TODO: fix that pressed keys are cut off when chaining CTRL keys