diff options
author | hut <hut@lavabit.com> | 2013-02-22 04:46:09 +0100 |
---|---|---|
committer | hut <hut@lavabit.com> | 2013-02-22 04:46:09 +0100 |
commit | bf6a3d6d6c11a85c37322e713b3c7a6eb2a484fc (patch) | |
tree | 776b05d2e7ed9ae03a3fb1115b8ae023e5bebbdd /ranger | |
parent | 4d48d33ca5529464dadbb2fc70888da4cd9d24fa (diff) | |
parent | c1138eb006c6daaa9b88204b0695f18d55e027dc (diff) | |
download | ranger-bf6a3d6d6c11a85c37322e713b3c7a6eb2a484fc.tar.gz |
Merge branch 'master' into vcs
Conflicts: ranger/gui/widgets/browsercolumn.py
Diffstat (limited to 'ranger')
58 files changed, 120 insertions, 96 deletions
diff --git a/ranger/__init__.py b/ranger/__init__.py index 2dbffb7e..8dbd7fc6 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ @@ -16,7 +16,7 @@ import os __license__ = 'GPL3' __version__ = '1.5.5' __author__ = __maintainer__ = 'Roman Zimbelmann' -__email__ = 'romanz@lavabit.com' +__email__ = 'hut@lavabit.com' # Constants RANGERDIR = os.path.dirname(__file__) diff --git a/ranger/api/commands.py b/ranger/api/commands.py index 010ea37b..8a9df1ec 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. # TODO: Add an optional "!" to all commands and set a flag if it's there diff --git a/ranger/api/options.py b/ranger/api/options.py index 38e5f760..1d90f228 100644 --- a/ranger/api/options.py +++ b/ranger/api/options.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. # THIS WHOLE FILE IS OBSOLETE AND EXISTS FOR BACKWARDS COMPATIBILITIY diff --git a/ranger/colorschemes/default.py b/ranger/colorschemes/default.py index a391f03c..767d370d 100644 --- a/ranger/colorschemes/default.py +++ b/ranger/colorschemes/default.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from ranger.gui.colorscheme import ColorScheme diff --git a/ranger/colorschemes/jungle.py b/ranger/colorschemes/jungle.py index 01a5ab1f..42a8465c 100644 --- a/ranger/colorschemes/jungle.py +++ b/ranger/colorschemes/jungle.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from ranger.gui.color import * diff --git a/ranger/colorschemes/snow.py b/ranger/colorschemes/snow.py index e3b433b6..b2da0a39 100644 --- a/ranger/colorschemes/snow.py +++ b/ranger/colorschemes/snow.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from ranger.gui.colorscheme import ColorScheme diff --git a/ranger/config/commands.py b/ranger/config/commands.py index daeb49f7..66869c70 100644 --- a/ranger/config/commands.py +++ b/ranger/config/commands.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This configuration file is licensed under the same terms as ranger. # =================================================================== # This file contains ranger's commands. @@ -344,7 +344,10 @@ class find(Command): def execute(self): if self.quick(): - self.fm.move(right=1) + if self.rest(1) == '..': + self.fm.move(left=1) + else: + self.fm.move(right=1) self.fm.block_input(0.5) else: self.fm.cd(self.rest(1)) diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf index 1138ac27..1343e07e 100644 --- a/ranger/config/rc.conf +++ b/ranger/config/rc.conf @@ -3,8 +3,8 @@ # To change them, it is recommended to create the file # ~/.config/ranger/rc.conf and add your custom commands there. # -# If you copy this whole file there, you may want to install the plugin -# "plugins/plugin_skip_default_rc.py" to avoid loading the rc.conf twice. +# If you copy this whole file there, you may want to set the environment +# variable RANGER_LOAD_DEFAULT_RC to FALSE to avoid loading it twice. # # The purpose of this file is mainly to define keybindings and settings. # For running more complex python code, please create a plugin in "plugins/" or @@ -52,6 +52,8 @@ set vcs_backend_hg disabled set vcs_backend_bzr disabled # Preview images in full color with the external command "w3mimgpreview"? +# This requires the console web browser "w3m" and a supported terminal. +# It has been successfully tested with "xterm" and "urxvt" without tmux. set preview_images false # Use a unicode "..." character to mark cut-off filenames? @@ -61,8 +63,7 @@ set unicode_ellipsis false set show_hidden_bookmarks true # Which colorscheme to use? These colorschemes are available by default: -# default, default88, jungle, snow -# Snow is monochrome and default88 uses 88 colors. +# default, jungle, snow set colorscheme default # Preview files on the rightmost column? @@ -79,7 +80,7 @@ set status_bar_on_top false # Draw a progress bar in the status bar which displays the average state of all # currently running tasks which support progress bars? -set draw_progress_bar_in_status_bar True +set draw_progress_bar_in_status_bar true # Draw borders around columns? set draw_borders false @@ -104,7 +105,7 @@ set update_title false set update_tmux_title false # Shorten the title if it gets long? The number defines how many -# directories are displayed at once, False turns off this feature. +# directories are displayed at once, 0 turns off this feature. set shorten_title 3 # Abbreviate $HOME with ~ in the titlebar (first line) of ranger? @@ -202,7 +203,7 @@ map cd console cd # Tagging / Marking map t tag_toggle -map T tag_remove +map ut tag_remove map "<any> tag_toggle tag=%any map <Space> mark_files toggle=True map v mark_files all=True toggle=True diff --git a/ranger/container/bookmarks.py b/ranger/container/bookmarks.py index f5476dd8..fa4679b6 100644 --- a/ranger/container/bookmarks.py +++ b/ranger/container/bookmarks.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import string diff --git a/ranger/container/history.py b/ranger/container/history.py index 6939c533..1bc15a53 100644 --- a/ranger/container/history.py +++ b/ranger/container/history.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. # TODO: rewrite to use deque instead of list diff --git a/ranger/container/settingobject.py b/ranger/container/settingobject.py index 06572d97..8fa27a43 100644 --- a/ranger/container/settingobject.py +++ b/ranger/container/settingobject.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from inspect import isfunction diff --git a/ranger/container/tags.py b/ranger/container/tags.py index b37ac4dc..45090d9d 100644 --- a/ranger/container/tags.py +++ b/ranger/container/tags.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from os.path import isdir, exists, dirname, abspath, realpath, expanduser diff --git a/ranger/core/actions.py b/ranger/core/actions.py index e0612952..6b75c691 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import codecs @@ -864,7 +864,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): f.close() else: data[(-1, -1)] = None - if self.thisfile.realpath == path: + if self.thisfile and self.thisfile.realpath == path: self.ui.browser.need_redraw = True data['loading'] = False pager = self.ui.browser.pager diff --git a/ranger/core/environment.py b/ranger/core/environment.py index 6ef61941..56bed156 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. # THIS WHOLE FILE IS OBSOLETE AND EXISTS FOR BACKWARDS COMPATIBILITIY diff --git a/ranger/core/fm.py b/ranger/core/fm.py index e9ffb888..a217be95 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/core/loader.py b/ranger/core/loader.py index e968b2eb..efcc0983 100644 --- a/ranger/core/loader.py +++ b/ranger/core/loader.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from collections import deque diff --git a/ranger/core/main.py b/ranger/core/main.py index 16096deb..dc35b47e 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ @@ -8,8 +8,6 @@ The main function responsible to initialize the FM object and stuff. import os.path import sys -load_default_config = True - def main(): """initialize objects and run the filemanager""" import locale @@ -234,7 +232,6 @@ def parse_arguments(): def load_settings(fm, clean): - global load_default_config from ranger.core.actions import Actions import ranger.core.shared import ranger.api.commands @@ -264,7 +261,7 @@ def load_settings(fm, clean): custom_conf = fm.confpath('rc.conf') default_conf = fm.relpath('config', 'rc.conf') - if load_default_config: + if os.environ.get('RANGER_LOAD_DEFAULT_RC', 0) != 'FALSE': fm.source(default_conf) if os.access(custom_conf, os.R_OK): fm.source(custom_conf) diff --git a/ranger/core/runner.py b/ranger/core/runner.py index 223bc1b6..0e4138d7 100644 --- a/ranger/core/runner.py +++ b/ranger/core/runner.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/core/shared.py b/ranger/core/shared.py index 7b679bb0..22203e0f 100644 --- a/ranger/core/shared.py +++ b/ranger/core/shared.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """Shared objects contain singleton variables which can be @@ -54,7 +54,7 @@ class SettingsAware(Awareness): after_setting_preview_script, priority=1) def after_setting_use_preview_script(signal): if signal.fm.settings.preview_script is None and signal.value \ - and not signal.previous: + and signal.fm.ui.is_on: signal.fm.notify("Preview script undefined or not found!", bad=True) settings.signal_bind('setopt.use_preview_script', diff --git a/ranger/core/tab.py b/ranger/core/tab.py index ae9d9073..212d58ef 100644 --- a/ranger/core/tab.py +++ b/ranger/core/tab.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import os diff --git a/ranger/ext/accumulator.py b/ranger/ext/accumulator.py index a027ecc2..75fec352 100644 --- a/ranger/ext/accumulator.py +++ b/ranger/ext/accumulator.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from ranger.ext.direction import Direction diff --git a/ranger/ext/cached_function.py b/ranger/ext/cached_function.py index ad7c5c11..daee6397 100644 --- a/ranger/ext/cached_function.py +++ b/ranger/ext/cached_function.py @@ -1,15 +1,15 @@ -# Copyright (C) 2012 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2012-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. def cached_function(fnc): - cache = {} - def inner_cached_function(*args): - try: - return cache[args] - except: - value = fnc(*args) - cache[args] = value - return value - inner_cached_function._cache = cache - return inner_cached_function + cache = {} + def inner_cached_function(*args): + try: + return cache[args] + except: + value = fnc(*args) + cache[args] = value + return value + inner_cached_function._cache = cache + return inner_cached_function diff --git a/ranger/ext/curses_interrupt_handler.py b/ranger/ext/curses_interrupt_handler.py index 50caebf7..91bbc3e4 100644 --- a/ranger/ext/curses_interrupt_handler.py +++ b/ranger/ext/curses_interrupt_handler.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/ext/direction.py b/ranger/ext/direction.py index eb359afb..371b417c 100644 --- a/ranger/ext/direction.py +++ b/ranger/ext/direction.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/ext/get_executables.py b/ranger/ext/get_executables.py index cf0d2a15..f9e3c021 100644 --- a/ranger/ext/get_executables.py +++ b/ranger/ext/get_executables.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from stat import S_IXOTH, S_IFREG diff --git a/ranger/ext/human_readable.py b/ranger/ext/human_readable.py index 0e3f3d4b..f1c5b1f6 100644 --- a/ranger/ext/human_readable.py +++ b/ranger/ext/human_readable.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. def human_readable(byte, separator=' '): diff --git a/ranger/ext/iter_tools.py b/ranger/ext/iter_tools.py index 9e8fcd74..f962a37d 100644 --- a/ranger/ext/iter_tools.py +++ b/ranger/ext/iter_tools.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from collections import deque diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py index 3439fa80..a8ae0cb8 100644 --- a/ranger/ext/keybinding_parser.py +++ b/ranger/ext/keybinding_parser.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import sys diff --git a/ranger/ext/mount_path.py b/ranger/ext/mount_path.py index 2114957a..9697884f 100644 --- a/ranger/ext/mount_path.py +++ b/ranger/ext/mount_path.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from os.path import realpath, abspath, dirname, ismount diff --git a/ranger/ext/next_available_filename.py b/ranger/ext/next_available_filename.py index 67d56126..38d13e16 100644 --- a/ranger/ext/next_available_filename.py +++ b/ranger/ext/next_available_filename.py @@ -1,4 +1,4 @@ -# Copyright (C) 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2011-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import os.path diff --git a/ranger/ext/openstruct.py b/ranger/ext/openstruct.py index af2e027e..710a8263 100644 --- a/ranger/ext/openstruct.py +++ b/ranger/ext/openstruct.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. # prepend __ to arguments because one might use "args" diff --git a/ranger/ext/popen_forked.py b/ranger/ext/popen_forked.py index 6c40d552..8ecba331 100644 --- a/ranger/ext/popen_forked.py +++ b/ranger/ext/popen_forked.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2012-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import os diff --git a/ranger/ext/relative_symlink.py b/ranger/ext/relative_symlink.py index 347aad8c..a8029880 100644 --- a/ranger/ext/relative_symlink.py +++ b/ranger/ext/relative_symlink.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from os import symlink, sep diff --git a/ranger/ext/rifle.py b/ranger/ext/rifle.py index c94dd74b..e28c8bd6 100755 --- a/ranger/ext/rifle.py +++ b/ranger/ext/rifle.py @@ -1,5 +1,5 @@ -#!/usr/bin/python -S -# Copyright (C) 2012 Roman Zimbelmann <romanz@lavabit.com> +#!/usr/bin/python +# Copyright (C) 2012-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ @@ -373,9 +373,19 @@ def main(): conf_path = os.environ['XDG_CONFIG_HOME'] + '/ranger/rifle.conf' else: conf_path = os.path.expanduser('~/.config/ranger/rifle.conf') + default_conf_path = conf_path if not os.path.isfile(conf_path): conf_path = os.path.normpath(os.path.join(os.path.dirname(__file__), '../config/rifle.conf')) + if not os.path.isfile(conf_path): + try: + # if ranger is installed, get the configuration from ranger + import ranger + except ImportError: + pass + else: + conf_path = os.path.join(ranger.__path__[0], "config", "rifle.conf") + # Evaluate arguments from optparse import OptionParser @@ -396,6 +406,11 @@ def main(): parser.print_help() raise SystemExit(1) + if not os.path.isfile(conf_path): + sys.stderr.write("Could not find a configuration file.\n" + "Please create one at %s.\n" % default_conf_path) + raise SystemExit(1) + if options.p.isdigit(): number = int(options.p) label = None diff --git a/ranger/ext/run_forked.py b/ranger/ext/run_forked.py index f08494b9..39d08e51 100644 --- a/ranger/ext/run_forked.py +++ b/ranger/ext/run_forked.py @@ -1,4 +1,4 @@ -# Copyright (C) 2012 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2012-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import os diff --git a/ranger/ext/shell_escape.py b/ranger/ext/shell_escape.py index d67b9083..a4e5628d 100644 --- a/ranger/ext/shell_escape.py +++ b/ranger/ext/shell_escape.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/ext/signals.py b/ranger/ext/signals.py index e42e740d..5ff467aa 100644 --- a/ranger/ext/signals.py +++ b/ranger/ext/signals.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/ext/spawn.py b/ranger/ext/spawn.py index 13fbd252..240fa94a 100644 --- a/ranger/ext/spawn.py +++ b/ranger/ext/spawn.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from subprocess import Popen, PIPE diff --git a/ranger/ext/widestring.py b/ranger/ext/widestring.py index 31e41210..c5b26a18 100644 --- a/ranger/ext/widestring.py +++ b/ranger/ext/widestring.py @@ -1,5 +1,5 @@ # -*- encoding: utf8 -*- -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import sys diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index 86014f38..6aa58f37 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import os.path diff --git a/ranger/fsobject/file.py b/ranger/fsobject/file.py index 2a287ff5..0b4f9776 100644 --- a/ranger/fsobject/file.py +++ b/ranger/fsobject/file.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import re diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index f8a8d162..b0b70098 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. CONTAINER_EXTENSIONS = ('7z', 'ace', 'ar', 'arc', 'bz', 'bz2', 'cab', 'cpio', diff --git a/ranger/gui/ansi.py b/ranger/gui/ansi.py index 7019c6fb..ba6aa44d 100644 --- a/ranger/gui/ansi.py +++ b/ranger/gui/ansi.py @@ -1,5 +1,5 @@ # Copyright (C) 2010 David Barnett <davidbarnett2@gmail.com> -# Copyright (C) 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2010-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/gui/bar.py b/ranger/gui/bar.py index ebd56166..6bba85c4 100644 --- a/ranger/gui/bar.py +++ b/ranger/gui/bar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from ranger.ext.widestring import WideString, utf_char_width diff --git a/ranger/gui/color.py b/ranger/gui/color.py index ab986b55..06f49147 100644 --- a/ranger/gui/color.py +++ b/ranger/gui/color.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/gui/colorscheme.py b/ranger/gui/colorscheme.py index 0a142d52..b44eacd0 100644 --- a/ranger/gui/colorscheme.py +++ b/ranger/gui/colorscheme.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/gui/context.py b/ranger/gui/context.py index 2ea23571..ecef7d07 100644 --- a/ranger/gui/context.py +++ b/ranger/gui/context.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. CONTEXT_KEYS = ['reset', 'error', 'badinfo', diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py index 82640322..571824ba 100644 --- a/ranger/gui/curses_shortcuts.py +++ b/ranger/gui/curses_shortcuts.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # Copyright (C) 2010 David Barnett <davidbarnett2@gmail.com> # This software is distributed under the terms of the GNU GPL version 3. diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py index e5431039..78bc0448 100644 --- a/ranger/gui/displayable.py +++ b/ranger/gui/displayable.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. from ranger.core.shared import FileManagerAware, EnvironmentAware diff --git a/ranger/gui/mouse_event.py b/ranger/gui/mouse_event.py index 1f157570..2533cc4d 100644 --- a/ranger/gui/mouse_event.py +++ b/ranger/gui/mouse_event.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import curses diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index 5760090c..b2db6975 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. import os diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index 38a7fdcb..d2c5e400 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """The BrowserColumn widget displays the contents of a directory or file.""" diff --git a/ranger/gui/widgets/browserview.py b/ranger/gui/widgets/browserview.py index e0a2275e..c3e264ad 100644 --- a/ranger/gui/widgets/browserview.py +++ b/ranger/gui/widgets/browserview.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """The BrowserView manages a set of BrowserColumns.""" @@ -131,15 +131,17 @@ class BrowserView(Widget, DisplayableContainer): left_start = child.x + child.wid else: break - if not self.pager.visible: - for child in reversed(self.columns): - if not child.has_preview(): - right_end = child.x - 1 - else: - break + + # Shift the rightmost vertical line to the left to create a padding, + # but only when padding_right is on, the preview column is collapsed + # and we did not open the pager to "zoom" in to the file. + if self.settings.padding_right and not self.pager.visible and \ + self.is_collapsed: + right_end = self.columns[-1].x - 1 if right_end < left_start: right_end = self.wid - 1 + # Draw horizontal lines and the leftmost vertical line try: win.hline(0, left_start, curses.ACS_HLINE, right_end - left_start) win.hline(self.hei - 1, left_start, curses.ACS_HLINE, @@ -148,11 +150,13 @@ class BrowserView(Widget, DisplayableContainer): except _curses.error: pass - for child in self.columns: + # Draw the vertical lines in the middle + for child in self.columns[:-1]: if not child.has_preview(): continue if child.main_column and self.pager.visible: - win.vline(1, right_end, curses.ACS_VLINE, self.hei - 2) + # If we "zoom in" with the pager, we have to + # skip the between main_column and pager. break x = child.x + child.wid y = self.hei - 1 @@ -164,6 +168,12 @@ class BrowserView(Widget, DisplayableContainer): # in case it's off the boundaries pass + # Draw the last vertical line + try: + win.vline(1, right_end, curses.ACS_VLINE, self.hei - 2) + except _curses.error: + pass + self.addch(0, left_start, curses.ACS_ULCORNER) self.addch(self.hei - 1, left_start, curses.ACS_LLCORNER) self.addch(0, right_end, curses.ACS_URCORNER) diff --git a/ranger/gui/widgets/console.py b/ranger/gui/widgets/console.py index 10458a54..c9271cac 100644 --- a/ranger/gui/widgets/console.py +++ b/ranger/gui/widgets/console.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/gui/widgets/pager.py b/ranger/gui/widgets/pager.py index de73ddc2..f5988e08 100644 --- a/ranger/gui/widgets/pager.py +++ b/ranger/gui/widgets/pager.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # Copyright (C) 2010 David Barnett <davidbarnett2@gmail.com> # This software is distributed under the terms of the GNU GPL version 3. @@ -40,7 +40,7 @@ class Pager(Widget): self.need_redraw = True def clear_image(self, force=False): - if force or self.need_clear_image: + if (force or self.need_clear_image) and self.image_drawn: img_display.clear(self.x, self.y, self.wid, self.hei) self.need_clear_image = False self.image_drawn = False @@ -53,8 +53,7 @@ class Pager(Widget): self.source.close() def destroy(self): - if self.image_drawn: - img_display.clear(self.x, self.y, self.wid, self.hei) + self.clear_image(force=True) def finalize(self): self.fm.ui.win.move(self.y, self.x) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index da21b098..3d860fbc 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ @@ -177,8 +177,7 @@ class StatusBar(Widget): if self.settings.display_size_in_status_bar and target.infostring: left.add(target.infostring.replace(" ", "")) - - left.add_space() + left.add_space() left.add(strftime(self.timeformat, localtime(stat.st_mtime)), 'mtime') diff --git a/ranger/gui/widgets/taskview.py b/ranger/gui/widgets/taskview.py index 3637d0e3..ae69402a 100644 --- a/ranger/gui/widgets/taskview.py +++ b/ranger/gui/widgets/taskview.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index 5986ec7a..2a17211f 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -1,4 +1,4 @@ -# Copyright (C) 2009, 2010, 2011 Roman Zimbelmann <romanz@lavabit.com> +# Copyright (C) 2009-2013 Roman Zimbelmann <hut@lavabit.com> # This software is distributed under the terms of the GNU GPL version 3. """ |