diff options
Diffstat (limited to 'ranger/defaults/commands.py')
-rw-r--r-- | ranger/defaults/commands.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index c9b3a878..dc7593a5 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -40,7 +40,7 @@ class Command(FileManagerAware): from os.path import dirname, basename, expanduser, join, isdir line = parse(self.line) - pwd = self.fm.env.pwd.path + cwd = self.fm.env.cwd.path try: rel_dest = line.rest(1) @@ -52,7 +52,7 @@ class Command(FileManagerAware): rel_dest = expanduser(rel_dest) # define some shortcuts - abs_dest = join(pwd, rel_dest) + abs_dest = join(cwd, rel_dest) abs_dirname = dirname(abs_dest) rel_basename = basename(rel_dest) rel_dirname = dirname(rel_dest) @@ -89,7 +89,7 @@ class Command(FileManagerAware): from os.path import dirname, basename, expanduser, join, isdir line = parse(self.line) - pwd = self.fm.env.pwd.path + cwd = self.fm.env.cwd.path try: rel_dest = line.rest(1) @@ -101,7 +101,7 @@ class Command(FileManagerAware): rel_dest = expanduser(rel_dest) # define some shortcuts - abs_dest = join(pwd, rel_dest) + abs_dest = join(cwd, rel_dest) abs_dirname = dirname(abs_dest) rel_basename = basename(rel_dest) rel_dirname = dirname(rel_dest) @@ -167,13 +167,13 @@ class cd(Command): def quick_open(self): from os.path import isdir, join, normpath line = parse(self.line) - pwd = self.fm.env.pwd.path + cwd = self.fm.env.cwd.path rel_dest = line.rest(1) if not rel_dest: return False - abs_dest = normpath(join(pwd, rel_dest)) + abs_dest = normpath(join(cwd, rel_dest)) return rel_dest != '.' and isdir(abs_dest) @@ -212,22 +212,22 @@ class find(Command): def _search(self): self.count = 0 line = parse(self.line) - pwd = self.fm.env.pwd + cwd = self.fm.env.cwd try: arg = line.rest(1) except IndexError: return False - deq = deque(pwd.files) - deq.rotate(-pwd.pointer) + deq = deque(cwd.files) + deq.rotate(-cwd.pointer) i = 0 for fsobj in deq: filename = fsobj.basename_lower if arg in filename: self.count += 1 if self.count == 1: - pwd.move(absolute=(pwd.pointer + i) % len(pwd.files)) - self.fm.env.cf = pwd.pointed_obj + cwd.move(absolute=(cwd.pointer + i) % len(cwd.files)) + self.fm.env.cf = cwd.pointed_obj if self.count > 1: return False i += 1 @@ -277,7 +277,7 @@ class delete(Command): # user did not confirm deletion return - if self.fm.env.pwd.marked_items \ + if self.fm.env.cwd.marked_items \ or (self.fm.env.cf.is_directory and not self.fm.env.cf.empty()): # better ask for a confirmation, when attempting to # delete multiple files or a non-empty directory. @@ -298,7 +298,7 @@ class mkdir(Command): from os import mkdir line = parse(self.line) - dirname = join(self.fm.env.pwd.path, expanduser(line.rest(1))) + dirname = join(self.fm.env.cwd.path, expanduser(line.rest(1))) if not lexists(dirname): mkdir(dirname) else: @@ -317,7 +317,7 @@ class touch(Command): from os import mkdir line = parse(self.line) - fname = join(self.fm.env.pwd.path, expanduser(line.rest(1))) + fname = join(self.fm.env.cwd.path, expanduser(line.rest(1))) if not lexists(fname): open(fname, 'a') else: @@ -382,7 +382,7 @@ class rename(Command): line = parse(self.line) self.fm.rename(self.fm.env.cf, line.rest(1)) f = File(line.rest(1)) - self.fm.env.pwd.pointed_obj = f + self.fm.env.cwd.pointed_obj = f self.fm.env.cf = f def tab(self): @@ -423,7 +423,7 @@ class chmod(Command): try: # reloading directory. maybe its better to reload the selected # files only. - self.fm.env.pwd.load_content() + self.fm.env.cwd.load_content() except: pass |