[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Ranger-users] bulkrename does not work in osx
From: |
Ingo Lindholm |
Subject: |
[Ranger-users] bulkrename does not work in osx |
Date: |
Sun, 8 Sep 2013 17:37:48 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
Hello,
the powerful bulkrename command does not work under OSX 10.8 Mountain
Lion. Reason: if you reread the open tempfile, you will get the unchanged
content. Solution: close and reopen the tempfile.
In the file commands.py I have change in Class bulkrename:
# Create and edit the file list
filenames = [f.basename for f in self.fm.env.get_selection()]
listfile = tempfile.NamedTemporaryFile(delete=False)
listpath = listfile.name
if py3:
listfile.write("\n".join(filenames).encode("utf-8"))
else:
listfile.write("\n".join(filenames))
listfile.close()
self.fm.execute_file([File(listpath)], app='editor')
listfile = open(listpath, 'r')
if py3:
new_filenames = listfile.read().decode("utf-8").split("\n")
else:
new_filenames = listfile.read().split("\n")
listfile.close()
os.unlink(listpath)
if all(a == b for a, b in zip(filenames, new_filenames)):
self.fm.notify("No renaming to be done!")
return
# Generate and ...
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Ranger-users] bulkrename does not work in osx,
Ingo Lindholm <=