From 4343c2f00ca9d86be8579d403c4bc12dcd60b96d Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 8 Mar 2011 03:43:13 +0000 Subject: Fix loss of bookmarks when disk is full --- ranger/container/bookmarks.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py index 1e801638..f115c753 100644 --- a/ranger/container/bookmarks.py +++ b/ranger/container/bookmarks.py @@ -15,7 +15,7 @@ import string import re -import os.path +import os ALLOWED_KEYS = string.ascii_letters + string.digits + "`'" class Bookmarks(object): @@ -152,7 +152,7 @@ class Bookmarks(object): if self.path is None: return if os.access(self.path, os.W_OK): - f = open(self.path, 'w') + f = open(self.path+".new", 'w') for key, value in self.dct.items(): if type(key) == str\ and key in ALLOWED_KEYS: @@ -162,6 +162,7 @@ class Bookmarks(object): pass f.close() + os.rename(self.path+".new", self.path) self._update_mtime() def _load_dict(self): -- cgit 1.4.1-2-gfad0 From 9755f3b036e154d7b6f1efff9f83a7043859a398 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 8 Mar 2011 03:44:14 +0000 Subject: extended apps.py Patch taken from: https://bbs.archlinux.org/viewtopic.php?pid=900213#p900213 --- ranger/defaults/apps.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py index 7926bbba..ffa828c0 100644 --- a/ranger/defaults/apps.py +++ b/ranger/defaults/apps.py @@ -65,8 +65,9 @@ class CustomApplications(Applications): if f.extension is not None: if f.extension in ('pdf', ): - c.flags += 'd' return self.either(c, 'evince', 'zathura', 'apvlv') + if f.extension == 'djvu': + return self.either(c, 'evince') if f.extension in ('xml', ): return self.either(c, 'editor') if f.extension in ('html', 'htm', 'xhtml'): -- cgit 1.4.1-2-gfad0 From 2c309379ac09dabb8b1043ae0ad652dc47657649 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 1 Apr 2011 23:04:24 +0200 Subject: Improved manpage --- doc/ranger.1 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/ranger.1 b/doc/ranger.1 index c2a8e243..beb580c6 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -86,14 +86,15 @@ S Open a shell in the current directory .TP yy -Yank the selection. (mark the files as copied) +Yank the selection to the "copy" buffer and mark them as to be copied .TP dd -Cut the selection +Cut the selection to the "copy" buffer and mark them as to be moved .TP pp -Paste the copied/cut files. By default, this will not overwrite existing -files. To overwrite them, use \fBpo\fR. +Paste the files from the "copy" buffer here (by moving or copying, depending +on how they are marked.) By default, this will not overwrite existing files. +To overwrite them, use \fBpo\fR. .TP m\fIX\fR Create a bookmark with the name \fIX\fR -- cgit 1.4.1-2-gfad0 From d1784230c9f05c7032a17ebd46d2362f2c371ad6 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 3 Apr 2011 16:10:55 +0200 Subject: core.fm: fixed mimetype bug --- ranger/core/fm.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ranger/core/fm.py b/ranger/core/fm.py index ec2fbdbb..fa972b50 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -60,6 +60,10 @@ class FM(Actions, SignalDispatcher): .format(__version__, os.getpid())) self.log.append('Running on Python ' + sys.version.replace('\n','')) + mimetypes.knownfiles.append(os.path.expanduser('~/.mime.types')) + mimetypes.knownfiles.append(self.relpath('data/mime.types')) + self.mimetypes = mimetypes.MimeTypes() + # COMPAT @property def executables(self): @@ -96,10 +100,6 @@ class FM(Actions, SignalDispatcher): self.env.signal_bind('cd', self._update_current_tab) - mimetypes.knownfiles.append(os.path.expanduser('~/.mime.types')) - mimetypes.knownfiles.append(self.relpath('data/mime.types')) - self.mimetypes = mimetypes.MimeTypes() - def destroy(self): debug = ranger.arg.debug if self.ui: -- cgit 1.4.1-2-gfad0 From c9023dbd5bee393da3f0913a2977f717270426af Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 2 Apr 2011 23:06:56 +0200 Subject: defaults/options.py: hide __cache__ folder --- ranger/defaults/options.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/defaults/options.py b/ranger/defaults/options.py index 124fa212..a2289729 100644 --- a/ranger/defaults/options.py +++ b/ranger/defaults/options.py @@ -36,7 +36,7 @@ from ranger.api.options import * # Which files should be hidden? Toggle this by typing `zh' or # changing the setting `show_hidden' hidden_filter = regexp( - r'^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$') + r'^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__cache__$') show_hidden = False # Which script is used to generate file previews? -- cgit 1.4.1-2-gfad0 From d8084b41f67b1b8470251633529cacf2ba07fb6a Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 4 Apr 2011 21:52:41 +0200 Subject: improved ranger.py --- ranger.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ranger.py b/ranger.py index 240b3687..16c6b1b5 100755 --- a/ranger.py +++ b/ranger.py @@ -34,9 +34,10 @@ return 1 """ import sys +import os.path -# When using the --clean option, not even bytecode should be written. -# Thus, we need to find out if --clean is used as soon as possible. +# Need to find out whether or not the flag --clean was used ASAP, +# because --clean is supposed to disable bytecode compilation try: argv = sys.argv[0:sys.argv.index('--')] except: @@ -46,6 +47,13 @@ sys.dont_write_bytecode = '-c' in argv or '--clean' in argv # Set the actual docstring __doc__ = """Ranger - file browser for the unix terminal""" +# Don't import ./ranger when running an installed binary at /usr/bin/ranger +if os.path.isdir('ranger'): + try: + sys.path.remove(os.path.abspath('.')) + except ValueError: + pass + # Start ranger import ranger sys.exit(ranger.main()) -- cgit 1.4.1-2-gfad0 From d36c43ff45e5f57f7b2ae507cafc3976b8c752e8 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 5 Apr 2011 17:04:18 +0200 Subject: ranger.py: minor change, more general exception handling --- ranger.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger.py b/ranger.py index 16c6b1b5..ffdf13aa 100755 --- a/ranger.py +++ b/ranger.py @@ -51,7 +51,7 @@ __doc__ = """Ranger - file browser for the unix terminal""" if os.path.isdir('ranger'): try: sys.path.remove(os.path.abspath('.')) - except ValueError: + except: pass # Start ranger -- cgit 1.4.1-2-gfad0 From 2ed2d4f79238ce505724fc5873c6a912e19be305 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 5 Apr 2011 17:07:29 +0200 Subject: This gonna be cool once it's finished --- CHANGELOG | 5 +++++ README | 2 +- doc/ranger.1 | 2 +- ranger/__init__.py | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7661ca1e..f934591d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,11 @@ Stable versions are identifiable (since 1.2) through their even minor version number, like 1.2.x, 1.4.x, etc. Odd minor version numbers are used for rolling-release git snapshots. +2011-04-05: Version 1.4.3 +* Fixed mimetype checking when invoking ranger with a filename +* Fixed loss of bookmarks when disk is full +* Minor improvements + 2011-03-05: Version 1.4.2 * Added --choosefile and --choosedir flag * Added use of bookmarks in tab completion of the :cd command diff --git a/README b/README index 5221574c..0f43f6bd 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Ranger v.1.4.2 +Ranger v.1.4.3 ============== Ranger is a free console file manager that gives you greater flexibility diff --git a/doc/ranger.1 b/doc/ranger.1 index beb580c6..5b9d9df8 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.TH RANGER 1 ranger-1.4.2 +.TH RANGER 1 ranger-1.4.3 .SH NAME ranger - visual file manager .\"----------------------------------------- diff --git a/ranger/__init__.py b/ranger/__init__.py index 88117f6c..03a1d2da 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -29,7 +29,7 @@ from ranger.core.main import main # Information __license__ = 'GPL3' -__version__ = '1.4.2' +__version__ = '1.4.3' __author__ = __maintainer__ = 'Roman Zimbelmann' __email__ = 'romanz@lavabit.com' -- cgit 1.4.1-2-gfad0