diff options
author | hut <hut@lavabit.com> | 2011-09-25 00:46:57 +0200 |
---|---|---|
committer | hut <hut@lavabit.com> | 2011-09-25 00:46:57 +0200 |
commit | 8d21b83ce6f77e3e348930e3ee45935917ee2e34 (patch) | |
tree | 559c7301ca9874a91a628e062d122873129fefb6 /ranger | |
parent | dbb04b860eb2cae2024523dd18b45401cc81e610 (diff) | |
download | ranger-8d21b83ce6f77e3e348930e3ee45935917ee2e34.tar.gz |
extended manpage and fixed {load,save}_copy_buffer commands
Diffstat (limited to 'ranger')
-rw-r--r-- | ranger/defaults/commands.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index cb39ddf9..f25abc19 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -503,9 +503,11 @@ class load_copy_buffer(Command): from ranger.fsobject import File from os.path import exists try: - f = open(self.fm.confpath(self.copy_buffer_filename), 'r') + fname = self.fm.confpath(self.copy_buffer_filename) + f = open(fname, 'r') except: - return self.fm.notify("Cannot open file %s" % fname, bad=True) + return self.fm.notify("Cannot open %s" % \ + (fname or self.copy_buffer_filename), bad=True) self.fm.env.copy = set(File(g) \ for g in f.read().split("\n") if exists(g)) f.close() @@ -520,10 +522,13 @@ class save_copy_buffer(Command): """ copy_buffer_filename = 'copy_buffer' def execute(self): + fname = None try: - f = open(self.fm.confpath(self.copy_buffer_filename), 'w') + fname = self.fm.confpath(self.copy_buffer_filename) + f = open(fname, 'w') except: - return self.fm.notify("Cannot open file %s" % fname, bad=True) + return self.fm.notify("Cannot open %s" % \ + (fname or self.copy_buffer_filename), bad=True) f.write("\n".join(f.path for f in self.fm.env.copy)) f.close() |