summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--AUTHORS14
-rw-r--r--CHANGELOG.md4
-rw-r--r--doc/colorschemes.txt2
-rw-r--r--examples/rc_emacs.conf2
-rw-r--r--ranger/config/rc.conf2
-rw-r--r--ranger/config/rifle.conf2
-rw-r--r--ranger/container/settings.py15
-rw-r--r--ranger/core/main.py14
-rw-r--r--ranger/core/tab.py4
-rw-r--r--ranger/ext/keybinding_parser.py2
-rw-r--r--ranger/gui/curses_shortcuts.py2
-rw-r--r--ranger/gui/displayable.py2
-rw-r--r--ranger/gui/widgets/view_base.py3
-rw-r--r--ranger/gui/widgets/view_miller.py7
-rw-r--r--tests/ranger/container/test_bookmarks.py2
-rw-r--r--tests/ranger/container/test_fsobject.py2
16 files changed, 52 insertions, 27 deletions
diff --git a/AUTHORS b/AUTHORS
index d3789119..75d988f9 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -2,27 +2,27 @@ Copyright 2009-2016  Roman Zimbelmann <hut@hut.pm>
 Copyright 2010  David Barnett <davidbarnett2@gmail.com>
 Copyright 2010  Lucas de Vries <lucas@glacicle.org>
 Copyright 2010  Sitaram Chamarty <sitaram@atc.tcs.com>
-Copyright 2011-2012  Abdó Roig-Maranges <abdo.roig@gmail.com>
-Copyright 2011-2012  M Rawash <mrawash@gmail.com>
 Copyright 2011  David Pugnasse <david.pugnasse@gmail.com>
 Copyright 2011  ornicar <thibault.duplessis@gmail.com>
-Copyright 2012  joe <joebodo@gmail.com>
+Copyright 2011-2012  Abdó Roig-Maranges <abdo.roig@gmail.com>
+Copyright 2011-2012  M Rawash <mrawash@gmail.com>
 Copyright 2012  Serge Broslavsky <serge.broslavsky@gmail.com>
-Copyright 2013-2014  GermainZ <germanosz@gmail.com>
+Copyright 2012  joe <joebodo@gmail.com>
 Copyright 2013  Emanuel Guevel
 Copyright 2013  Joseph Tannhuber <sepp.tannhuber@yahoo.de>
+Copyright 2013-2014  GermainZ <germanosz@gmail.com>
 Copyright 2014  Célestin Matte <celestin.matte@gmail.com>
 Copyright 2014  Milan Svoboda <milan.svoboda@centrum.cz>
 Copyright 2014  rukai <rubickent@gmail.com>
 Copyright 2015  Alexander Buddenbrock <a.buddenbrock@ish.de>
-Copyright 2015  anekos <anekos@snca.net>
-Copyright 2015  bastorran
 Copyright 2015  Delisa Mason <iskanamagus@gmail.com>
 Copyright 2015  No Suck <admin@nosuck.org>
 Copyright 2015  Randy Nance <randynobx@gmail.com>
-Copyright 2015  Wojciech Siewierski <wojciech.siewierski@onet.pl>
 Copyright 2015  Ryan Burns <rdburns@gmail.com>
+Copyright 2015  anekos <anekos@snca.net>
+Copyright 2015  bastorran
 Copyright 2015  nfnty <git@nfnty.se>
+Copyright 2015-2016  Wojciech Siewierski <wojciech.siewierski@onet.pl>
 
 Ideally, all contributors of non-trivial code are named here to the extent that
 a name and e-mail address is available.  Please write a mail to hut@hut.pm if
diff --git a/CHANGELOG.md b/CHANGELOG.md
index a408d968..68a72746 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -114,7 +114,7 @@ This log documents changes between stable versions.
 * Added `dc` binding for getting the cumulative size of a directory
 * Added `autoupdate_cumulative_size` option
 * Added `pht` binding to Paste Hardlinked subTrees (like cp -l)
-* Improved sorting speed of signals (noticable when caching many directories)
+* Improved sorting speed of signals (noticeable when caching many directories)
 * Improved drawing speed
 * Fixed unexpected behavior when displaying nonprintable characters
 * Fixed :bulkrename to work with files starting with a minus sign
@@ -122,7 +122,7 @@ This log documents changes between stable versions.
 * Fixed crash when opening images with sxiv/feh by running `ranger <image>`
 
 # 2011-10-23: Version 1.5.2
-* Fixed graphical bug that appears in certian cases when drawing
+* Fixed graphical bug that appears in certain cases when drawing
   characters at the right edge.
 
 # 2011-10-23: Version 1.5.1
diff --git a/doc/colorschemes.txt b/doc/colorschemes.txt
index e1fee2da..145cc94e 100644
--- a/doc/colorschemes.txt
+++ b/doc/colorschemes.txt
@@ -88,5 +88,5 @@ of the default scheme, set the initial colors to the result of the
 default use() method and modified the colors how I wanted.
 
 This has the obvious advantage that you need to write less, which
-results in less maintainance work and a greater chance that your colorscheme
+results in less maintenance work and a greater chance that your colorscheme
 will work with future versions of ranger.
diff --git a/examples/rc_emacs.conf b/examples/rc_emacs.conf
index f0752e62..39a6d654 100644
--- a/examples/rc_emacs.conf
+++ b/examples/rc_emacs.conf
@@ -137,7 +137,7 @@ set max_console_history_size 50
 # Try to keep so much space between the top/bottom border when scrolling:
 set scroll_offset 8
 
-# Flush the input after each key hit?  (Noticable when ranger lags)
+# Flush the input after each key hit?  (Noticeable when ranger lags)
 set flushinput true
 
 # Padding on the right when there's no preview?
diff --git a/ranger/config/rc.conf b/ranger/config/rc.conf
index 533013ff..560fbe4d 100644
--- a/ranger/config/rc.conf
+++ b/ranger/config/rc.conf
@@ -143,7 +143,7 @@ set max_console_history_size 50
 # Try to keep so much space between the top/bottom border when scrolling:
 set scroll_offset 8
 
-# Flush the input after each key hit?  (Noticable when ranger lags)
+# Flush the input after each key hit?  (Noticeable when ranger lags)
 set flushinput true
 
 # Padding on the right when there's no preview?
diff --git a/ranger/config/rifle.conf b/ranger/config/rifle.conf
index f95c94ff..d6165f21 100644
--- a/ranger/config/rifle.conf
+++ b/ranger/config/rifle.conf
@@ -204,5 +204,5 @@ label wallpaper, number 14, mime ^image, has feh, X = feh --bg-fill "$1"
 label editor, !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php  = $EDITOR -- "$@"
 label pager,  !mime ^text, !ext xml|json|csv|tex|py|pl|rb|js|sh|php  = "$PAGER" -- "$@"
 
-# The very last action, so that it's never triggered accidently, is to execute a program:
+# The very last action, so that it's never triggered accidentally, is to execute a program:
 mime application/x-executable = "$1"
diff --git a/ranger/container/settings.py b/ranger/container/settings.py
index a7911251..a5d71874 100644
--- a/ranger/container/settings.py
+++ b/ranger/container/settings.py
@@ -8,6 +8,15 @@ from ranger.gui.colorscheme import _colorscheme_name_to_class
 import re
 import os.path
 
+# Use these priority constants to trigger events at specific points in time
+# during processing of the signals "setopt" and "setopt.<some_setting_name>"
+SIGNAL_PRIORITY_RAW        = 2.0  # signal.value will be raw
+SIGNAL_PRIORITY_SANITIZE   = 1.0  # (Internal) post-processing signal.value
+SIGNAL_PRIORITY_BETWEEN    = 0.6  # sanitized signal.value, old fm.settings.XYZ
+SIGNAL_PRIORITY_SYNC       = 0.2  # (Internal) updating fm.settings.XYZ
+SIGNAL_PRIORITY_AFTER_SYNC = 0.1  # after fm.settings.XYZ was updated
+
+
 ALLOWED_SETTINGS = {
     'automatically_count_files': bool,
     'autosave_bookmarks': bool,
@@ -97,9 +106,11 @@ class Settings(SignalDispatcher, FileManagerAware):
         self.__dict__['_settings'] = dict()
         for name in ALLOWED_SETTINGS:
             self.signal_bind('setopt.' + name,
-                    self._sanitize, priority=1.0)
+                    self._sanitize,
+                    priority=SIGNAL_PRIORITY_SANITIZE)
             self.signal_bind('setopt.' + name,
-                    self._raw_set_with_signal, priority=0.2)
+                    self._raw_set_with_signal,
+                    priority=SIGNAL_PRIORITY_SYNC)
 
     def _sanitize(self, signal):
         name, value = signal.setting, signal.value
diff --git a/ranger/core/main.py b/ranger/core/main.py
index 528d849c..118a7480 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -242,7 +242,7 @@ def parse_arguments():
 
     if arg.fail_unless_cd:  # COMPAT
         sys.stderr.write("Warning: The option --fail-unless-cd is deprecated.\n"
-            "It was used to faciliate using ranger as a file launcher.\n"
+            "It was used to facilitate using ranger as a file launcher.\n"
             "Now, please use the standalone file launcher 'rifle' instead.\n")
 
     return arg
@@ -303,8 +303,16 @@ def load_settings(fm, clean):
             ranger.fm = fm
             for plugin in sorted(plugins):
                 try:
-                    module = __import__('plugins', fromlist=[plugin])
-                    fm.commands.load_commands_from_module(module)
+                    try:
+                        # importlib does not exist before python2.7.  It's
+                        # required for loading commands from plugins, so you
+                        # can't use that feature in python2.6.
+                        import importlib
+                    except ImportError:
+                        module = __import__('plugins', fromlist=[plugin])
+                    else:
+                        module = importlib.import_module('plugins.' + plugin)
+                        fm.commands.load_commands_from_module(module)
                     fm.log.append("Loaded plugin '%s'." % plugin)
                 except Exception as e:
                     fm.log.append("Error in plugin '%s'" % plugin)
diff --git a/ranger/core/tab.py b/ranger/core/tab.py
index 7b60a5b1..fa40a12b 100644
--- a/ranger/core/tab.py
+++ b/ranger/core/tab.py
@@ -5,6 +5,7 @@ import os
 import sys
 from os.path import abspath, normpath, join, expanduser, isdir
 
+from ranger.container import settings
 from ranger.container.history import History
 from ranger.core.shared import FileManagerAware, SettingsAware
 from ranger.ext.signals import SignalDispatcher
@@ -22,7 +23,8 @@ class Tab(FileManagerAware, SettingsAware):
         # NOTE: in the line below, weak=True works only in python3.  In python2,
         # weak references are not equal to the original object when tested with
         # "==", and this breaks _set_thisfile_from_signal and _on_tab_change.
-        self.fm.signal_bind('move', self._set_thisfile_from_signal, priority=0.1,
+        self.fm.signal_bind('move', self._set_thisfile_from_signal,
+                priority=settings.SIGNAL_PRIORITY_AFTER_SYNC,
                 weak=(sys.version_info[0] >= 3))
         self.fm.signal_bind('tab.change', self._on_tab_change,
                 weak=(sys.version_info[0] >= 3))
diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py
index b285237e..6a4cbde9 100644
--- a/ranger/ext/keybinding_parser.py
+++ b/ranger/ext/keybinding_parser.py
@@ -71,7 +71,7 @@ def parse_keybinding(obj):
     (108, 111, 108, 10)
 
     >>> out = tuple(parse_keybinding("x<A-Left>"))
-    >>> out  # it's kind of dumb that you cant test for constants...
+    >>> out  # it's kind of dumb that you can't test for constants...
     (120, 9003, 260)
     >>> out[0] == ord('x')
     True
diff --git a/ranger/gui/curses_shortcuts.py b/ranger/gui/curses_shortcuts.py
index 8937fcb7..ed762c9e 100644
--- a/ranger/gui/curses_shortcuts.py
+++ b/ranger/gui/curses_shortcuts.py
@@ -17,7 +17,7 @@ def _fix_surrogates(args):
 
 
 class CursesShortcuts(SettingsAware):
-    """This class defines shortcuts to faciliate operations with curses.
+    """This class defines shortcuts to facilitate operations with curses.
 
     color(*keys) -- sets the color associated with the keys from
         the current colorscheme.
diff --git a/ranger/gui/displayable.py b/ranger/gui/displayable.py
index 9f2dbf0d..7b5aa954 100644
--- a/ranger/gui/displayable.py
+++ b/ranger/gui/displayable.py
@@ -33,7 +33,7 @@ class Displayable(FileManagerAware, CursesShortcuts):
             be set at various places in the script and should eventually be
             handled (and unset) in the draw() method.
 
-    Read-Only: (i.e. reccomended not to change manually)
+    Read-Only: (i.e. recommended not to change manually)
         win -- the own curses window object
         parent -- the parent (DisplayableContainer) object or None
         x, y, wid, hei -- absolute coordinates and boundaries
diff --git a/ranger/gui/widgets/view_base.py b/ranger/gui/widgets/view_base.py
index 0f3809e5..a50fb5ce 100644
--- a/ranger/gui/widgets/view_base.py
+++ b/ranger/gui/widgets/view_base.py
@@ -3,7 +3,8 @@
 
 """The base GUI element for views on the directory"""
 
-import curses, _curses
+import curses
+import _curses
 from ranger.ext.keybinding_parser import key_to_string
 from . import Widget
 from ..displayable import DisplayableContainer
diff --git a/ranger/gui/widgets/view_miller.py b/ranger/gui/widgets/view_miller.py
index 7d0d26e1..90046456 100644
--- a/ranger/gui/widgets/view_miller.py
+++ b/ranger/gui/widgets/view_miller.py
@@ -3,7 +3,9 @@
 
 """ViewMiller arranges the view in miller columns"""
 
-import curses, _curses
+import curses
+import _curses
+from ranger.container import settings
 from ranger.ext.signals import Signal
 from .browsercolumn import BrowserColumn
 from .pager import Pager
@@ -34,7 +36,8 @@ class ViewMiller(ViewBase):
                     self._request_clear_if_has_borders, weak=True)
 
         self.settings.signal_bind('setopt.column_ratios', self.request_clear)
-        self.settings.signal_bind('setopt.column_ratios', self.rebuild)
+        self.settings.signal_bind('setopt.column_ratios', self.rebuild,
+                priority=settings.SIGNAL_PRIORITY_AFTER_SYNC)
 
         self.old_draw_borders = self.settings.draw_borders
 
diff --git a/tests/ranger/container/test_bookmarks.py b/tests/ranger/container/test_bookmarks.py
index 2c0f78bd..a2cd446f 100644
--- a/tests/ranger/container/test_bookmarks.py
+++ b/tests/ranger/container/test_bookmarks.py
@@ -35,7 +35,7 @@ def testbookmarks(tmpdir):
     assert "'" in secondstore
     assert secondstore["'"] == "the milk"
 
-    # We don't uneccesary update when the file on disk does not change
+    # We don't unnecessary update when the file on disk does not change
     origupdate = secondstore.update
 
     class OutOfDateException(Exception):
diff --git a/tests/ranger/container/test_fsobject.py b/tests/ranger/container/test_fsobject.py
index 3ea52d6f..73d2024a 100644
--- a/tests/ranger/container/test_fsobject.py
+++ b/tests/ranger/container/test_fsobject.py
@@ -5,7 +5,7 @@ from ranger.container.fsobject import FileSystemObject
 
 
 class MockFM(object):
-    """Used to fullfill the dependency by FileSystemObject."""
+    """Used to fulfill the dependency by FileSystemObject."""
 
     default_linemodes = []