From 27e5907532c6b44192015f08490f11bb75395e5d Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 6 Mar 2012 10:35:51 +0100 Subject: scope.sh: added exiftool --- ranger/data/scope.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/ranger/data/scope.sh b/ranger/data/scope.sh index ed4f01e1..3a6504dd 100755 --- a/ranger/data/scope.sh +++ b/ranger/data/scope.sh @@ -1,7 +1,7 @@ #!/bin/bash # ranger supports enhanced previews. If the option "use_preview_script" -# is set to True (by default it's False), this script will be called -# and its output is displayed in ranger. ANSI color codes are supported. +# is set to True and this file exists, this script will be called and its +# output is displayed in ranger. ANSI color codes are supported. # NOTES: This script is considered a configuration file. If you upgrade # ranger, it will be left untouched. (You must update it yourself.) @@ -67,9 +67,13 @@ case "$mimetype" in img2txt --gamma=0.6 --width="$width" "$path" && exit 4 || exit 1;; # Display information about media files: video/* | audio/*) + have exiftool && exiftool "$path" && exit 5 # Use sed to remove spaces so the output fits into the narrow window - mediainfo "$path" | sed 's/ \+:/: /;' - success && exit 5 || exit 1;; + if have mediainfo; then + mediainfo "$path" | sed 's/ \+:/: /;' + success && exit 5 + fi + exit 1;; esac exit 1 -- cgit 1.4.1-2-gfad0 From 9fcef7132f7503498398ba13f2cda86be443be2f Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 14 Mar 2012 15:58:27 +0100 Subject: gui.ui: catch an exception with surrogates in "update title" code --- ranger/gui/ui.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index e6c7d065..69b8463b 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -293,10 +293,13 @@ class UI(DisplayableContainer): split = cwd.rsplit(os.sep, self.settings.shorten_title) if os.sep in split[0]: cwd = os.sep.join(split[1:]) - fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \ - decode('utf-8', 'replace') - sys.stdout.write("\033]2;ranger:" + fixed_cwd + "\007") - sys.stdout.flush() + try: + fixed_cwd = cwd.encode('utf-8', 'surrogateescape'). \ + decode('utf-8', 'replace') + sys.stdout.write("\033]2;ranger:" + fixed_cwd + "\007") + sys.stdout.flush() + except: + pass self.win.refresh() def finalize(self): -- cgit 1.4.1-2-gfad0 From 78a98cfdfb498382e953b8955d3753b413b2efd9 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 14 Mar 2012 17:17:32 +0100 Subject: ext.human_readable: added comment --- ranger/ext/human_readable.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ranger/ext/human_readable.py b/ranger/ext/human_readable.py index c5bd2aac..1a667519 100644 --- a/ranger/ext/human_readable.py +++ b/ranger/ext/human_readable.py @@ -24,6 +24,10 @@ def human_readable(byte, separator=' '): >>> human_readable(2 ** 20 * 1023) '1023 M' """ + + # I know this can be written much shorter, but this long version + # performs much better than what I had before. If you attempt to + # shorten this code, take performance into consideration. if byte <= 0: return '0' if byte < 2**10: -- cgit 1.4.1-2-gfad0 From e1eb43f03921ba67574f44f483042c36f2adfc01 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 14 Mar 2012 17:22:27 +0100 Subject: defaults/options: add __pycache__ to hidden files --- 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 d076a96d..5e30f042 100644 --- a/ranger/defaults/options.py +++ b/ranger/defaults/options.py @@ -26,7 +26,7 @@ column_ratios = (1, 3, 4) # 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$|^__cache__$') + r'^\.|\.(?:pyc|pyo|bak|swp)$|^lost\+found$|^__(py)?cache__$') show_hidden = False # Which script is used to generate file previews? -- cgit 1.4.1-2-gfad0 From b2132b442921e1b77355b428965055dbbf96ebf5 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 14 Mar 2012 17:27:28 +0100 Subject: data/mime.types: use spaces instead of tabs, line them up --- ranger/data/mime.types | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ranger/data/mime.types b/ranger/data/mime.types index 14c35a9a..0eec7f4e 100644 --- a/ranger/data/mime.types +++ b/ranger/data/mime.types @@ -10,15 +10,15 @@ # ############################################################################### -audio/flac flac -audio/musepack mpc mpp mp+ -audio/ogg oga ogg spx -audio/wavpack wv wvc +audio/flac flac +audio/musepack mpc mpp mp+ +audio/ogg oga ogg spx +audio/wavpack wv wvc -video/mkv mkv -video/webm webm -video/flash flv -video/ogg ogv ogm -video/divx div divx +video/mkv mkv +video/webm webm +video/flash flv +video/ogg ogv ogm +video/divx div divx -text/x-ruby rb +text/x-ruby rb -- cgit 1.4.1-2-gfad0 From 9e63f83abf81c8853e5ed3382358330007aced9c Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 16 Mar 2012 00:21:12 +0100 Subject: ext.get_executables: speed optimization --- ranger/ext/get_executables.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ranger/ext/get_executables.py b/ranger/ext/get_executables.py index c19798a6..03f438dd 100644 --- a/ranger/ext/get_executables.py +++ b/ranger/ext/get_executables.py @@ -16,7 +16,6 @@ from stat import S_IXOTH, S_IFREG from ranger.ext.iter_tools import unique from os import listdir, environ, stat -from os.path import join _cached_executables = None @@ -54,7 +53,7 @@ def get_executables_uncached(*paths): except: continue for item in content: - abspath = join(path, item) + abspath = path + '/' + item try: filestat = stat(abspath) except: -- cgit 1.4.1-2-gfad0 From 4f5a4bed219324168a2f2e828cbf2e07b37b4aa8 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 16 Mar 2012 22:55:20 +0100 Subject: container.tags: typo --- ranger/container/tags.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/container/tags.py b/ranger/container/tags.py index 9c1c68a0..c08abdaa 100644 --- a/ranger/container/tags.py +++ b/ranger/container/tags.py @@ -37,7 +37,7 @@ class Tags(object): if 'tag' in others: tag = others['tag'] else: - tag = self.defautag + tag = self.default_tag self.sync() for item in items: self.tags[item] = tag -- cgit 1.4.1-2-gfad0 From f77192913a0e17f57f80135b8104ab9a4771763e Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 2 Apr 2012 04:00:44 +0200 Subject: core.shared: ImportErrors in options.py are mistakenly ignored... --- ranger/core/shared.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/core/shared.py b/ranger/core/shared.py index e1aa5e65..9da79578 100644 --- a/ranger/core/shared.py +++ b/ranger/core/shared.py @@ -76,6 +76,8 @@ class SettingsAware(Awareness): try: import options as my_options except ImportError: + # XXX: This mistakenly ignores ImportErrors inside options.py + # It should only ignore missing options.py instead. pass else: settings._setting_sources.append(my_options) -- cgit 1.4.1-2-gfad0 From 55d8566c11dfa23fd3c12d7d4f32878ac7ecc376 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 3 May 2012 18:47:39 +0200 Subject: What kind of idiot invented bugs anyway? --- CHANGELOG | 5 +++++ README | 2 +- doc/ranger.1 | 4 ++-- ranger/__init__.py | 2 +- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 1e5039e1..79949eb2 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,10 @@ This log documents changes between stable versions. +2012-05-03: Version 1.5.4 +* Added exiftool to scope.sh by default +* Fixed a crash when entering a directory with a unicode name +* Speedup in ranger.ext.get_executables + 2012-03-05: Version 1.5.3 * Added --selectfile option that selects a certain file on startup * Added --list-tagged-files option diff --git a/README b/README index e752c37a..0688030d 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -ranger v.1.5.3 +ranger v.1.5.4 ============== ranger is a console file manager with VI key bindings. It provides a minimalistic and nice curses interface with a view on the directory hierarchy. diff --git a/doc/ranger.1 b/doc/ranger.1 index 2b7df773..e3e48c2d 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== @@ -124,7 +124,7 @@ .\" ======================================================================== .\" .IX Title "RANGER 1" -.TH RANGER 1 "ranger-1.5.3" "03/05/2012" "ranger manual" +.TH RANGER 1 "ranger-1.5.4" "05/03/2012" "ranger manual" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l diff --git a/ranger/__init__.py b/ranger/__init__.py index 1589a745..ae9229b3 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -25,7 +25,7 @@ import os # Information __license__ = 'GPL3' -__version__ = '1.5.3' +__version__ = '1.5.4' __author__ = __maintainer__ = 'Roman Zimbelmann' __email__ = 'romanz@lavabit.com' -- cgit 1.4.1-2-gfad0