From 542103498ad5efc91bfee8eb3b742118c9f35db5 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 23 Sep 2010 10:50:42 +0200 Subject: ranger.__main__: typo --- ranger/__main__.py | 1 - 1 file changed, 1 deletion(-) diff --git a/ranger/__main__.py b/ranger/__main__.py index 0ded8c95..7a31f6a3 100644 --- a/ranger/__main__.py +++ b/ranger/__main__.py @@ -19,7 +19,6 @@ # Most import statements in this module are inside the functions. # This enables more convenient exception handling in ranger.py # (ImportError will imply that this module can't be found) -# convenient exception handling in ranger.py (ImportError) import locale import os.path -- cgit 1.4.1-2-gfad0 From 36814777ba720dc4c092becfad7ede98e4e89331 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 27 Sep 2010 02:38:20 +0200 Subject: defaults.apps: open empty files with unknown mimetype in vim --- ranger/defaults/apps.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/defaults/apps.py b/ranger/defaults/apps.py index 47eff0c9..1f9ba763 100644 --- a/ranger/defaults/apps.py +++ b/ranger/defaults/apps.py @@ -87,7 +87,7 @@ class CustomApplications(Applications): if f.image: return self.either(c, 'feh', 'eog', 'mirage') - if f.document or f.filetype.startswith('text'): + if f.document or f.filetype.startswith('text') or f.size == 0: return self.either(c, 'editor') -- cgit 1.4.1-2-gfad0 From ab2265d35945afdee9d4c0d06bf7859157e7b8ce Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 27 Sep 2010 14:38:34 +0200 Subject: core.actions: Minor bug in move_parent() Unwanted horizontal wrapping when all items in the parent directory are directories and you're moving below an index of 0. --- ranger/core/actions.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ranger/core/actions.py b/ranger/core/actions.py index b88849ef..a19927a4 100644 --- a/ranger/core/actions.py +++ b/ranger/core/actions.py @@ -216,6 +216,8 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware): def move_parent(self, n): parent = self.env.at_level(-1) + if parent.pointer + n < 0: + n = 0 - parent.pointer try: self.env.enter_dir(parent.files[parent.pointer+n]) except IndexError: -- cgit 1.4.1-2-gfad0 From 9bf46780c43bd5cf3e9ab503abc5c38b50bce290 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 29 Sep 2010 21:07:42 +0200 Subject: Cosmetic changes --- ranger/core/fm.py | 1 - ranger/gui/widgets/titlebar.py | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ranger/core/fm.py b/ranger/core/fm.py index dfad3425..05b3e52b 100644 --- a/ranger/core/fm.py +++ b/ranger/core/fm.py @@ -35,7 +35,6 @@ from ranger.ext.signal_dispatcher import SignalDispatcher from ranger import __version__ from ranger.core.loader import Loader -CTRL_C = 3 TICKS_BEFORE_COLLECTING_GARBAGE = 100 TIME_BEFORE_FILE_BECOMES_GARBAGE = 1200 diff --git a/ranger/gui/widgets/titlebar.py b/ranger/gui/widgets/titlebar.py index 35e2e3d9..025ad95e 100644 --- a/ranger/gui/widgets/titlebar.py +++ b/ranger/gui/widgets/titlebar.py @@ -14,7 +14,7 @@ # along with this program. If not, see . """ -The titlebar is the widget at the top, giving you broad orientation. +The titlebar is the widget at the top, giving you broad overview. It displays the current path among other things. """ -- cgit 1.4.1-2-gfad0 From b1105006ca6b3e14de1c997f1258a951d267e408 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 29 Sep 2010 21:10:57 +0200 Subject: Prevent garbage-collecting used directories --- ranger/core/environment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/core/environment.py b/ranger/core/environment.py index 61db8694..8d4c60df 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -124,7 +124,7 @@ class Environment(SettingsAware, SignalDispatcher): """Delete unused directory objects""" for key in tuple(self.directories): value = self.directories[key] - if value.is_older_than(age): # and not value in self.pathway: + if value.is_older_than(age) and not value in self.pathway: del self.directories[key] if value.is_directory: value.files = None -- cgit 1.4.1-2-gfad0 From 1013395554732543ad8da72b2f0ed8895df508f8 Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 1 Oct 2010 21:35:48 +0200 Subject: gui.ui: Disable mouse when console is open --- ranger/gui/ui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ranger/gui/ui.py b/ranger/gui/ui.py index b0c1a352..2f27f11e 100644 --- a/ranger/gui/ui.py +++ b/ranger/gui/ui.py @@ -123,8 +123,8 @@ class UI(DisplayableContainer): event = MouseEvent(curses.getmouse()) except _curses.error: return - - DisplayableContainer.click(self, event) + if not self.console.visible: + DisplayableContainer.click(self, event) def handle_key(self, key): """Handles key input""" -- cgit 1.4.1-2-gfad0 From 2173743b50fcc7332271fdeab896fb9c948b3e9c Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 2 Oct 2010 06:23:26 +0200 Subject: colorschemes.snow: updated snow colorscheme --- ranger/colorschemes/snow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ranger/colorschemes/snow.py b/ranger/colorschemes/snow.py index e89359c4..a449db87 100644 --- a/ranger/colorschemes/snow.py +++ b/ranger/colorschemes/snow.py @@ -32,7 +32,10 @@ class Snow(ColorScheme): if context.directory: attr |= bold - if context.highlight: + elif context.highlight: + attr |= reverse + + elif context.in_titlebar and context.tab and context.good: attr |= reverse return fg, bg, attr -- cgit 1.4.1-2-gfad0 From 27a99615d6b7899b0eb54f43cc5fb1b238ee9d64 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 2 Oct 2010 06:24:26 +0200 Subject: colorschemes.jungle: updated jungle colorscheme --- ranger/colorschemes/jungle.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/colorschemes/jungle.py b/ranger/colorschemes/jungle.py index af10a404..f5e03c06 100644 --- a/ranger/colorschemes/jungle.py +++ b/ranger/colorschemes/jungle.py @@ -20,7 +20,7 @@ class Scheme(Default): def use(self, context): fg, bg, attr = Default.use(self, context) - if context.directory and not context.marked: + if context.directory and not context.marked and not context.link: fg = green if context.in_titlebar and context.hostname: -- cgit 1.4.1-2-gfad0 From 3f4deafd9a0dea2078fc4b621d558641cf39382e Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 2 Oct 2010 07:31:26 +0200 Subject: api.commands, api.keys: added dummies that allow pydoc to be generated --- ranger/api/commands.py | 3 +++ ranger/api/keys.py | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/ranger/api/commands.py b/ranger/api/commands.py index f4e2ca76..9dd8ffd9 100644 --- a/ranger/api/commands.py +++ b/ranger/api/commands.py @@ -19,6 +19,9 @@ from ranger.api import * from ranger.shared import FileManagerAware from ranger.ext.command_parser import LazyParser as parse +# A dummy that allows the generation of docstrings in ranger.defaults.commands +def alias(*_): + pass class CommandContainer(object): def __init__(self): diff --git a/ranger/api/keys.py b/ranger/api/keys.py index 5812de39..7ba05c73 100644 --- a/ranger/api/keys.py +++ b/ranger/api/keys.py @@ -23,6 +23,16 @@ from ranger.api import * from ranger.container.bookmarks import ALLOWED_KEYS as ALLOWED_BOOKMARK_KEYS from ranger.container.keymap import KeyMap, Direction, KeyMapWithDirections +# A dummy that allows the generation of docstrings in ranger.defaults.keys +class DummyKeyManager(object): + def get_context(self, _): + class Dummy(object): + def __getattr__(self, *_, **__): + return Dummy() + __call__ = __getattr__ + return Dummy() +keymanager = DummyKeyManager() + class Wrapper(object): def __init__(self, firstattr): self.__firstattr__ = firstattr -- cgit 1.4.1-2-gfad0 From 52cf9f19b3738d42878cb35f4eb88a6f0775ea89 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 4 Oct 2010 21:23:10 +0200 Subject: gui.color: fixed ranger.gui.color.remove_attr --- ranger/gui/color.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/gui/color.py b/ranger/gui/color.py index 69f67eba..58f0b38a 100644 --- a/ranger/gui/color.py +++ b/ranger/gui/color.py @@ -62,7 +62,7 @@ invisible = curses.A_INVIS default_colors = (default, default, normal) -def remove_attr(integer, attr): +def remove_attr(integer, attribute): """Remove an attribute from an integer""" if integer & attribute: return integer ^ attribute -- cgit 1.4.1-2-gfad0 From 358a934500f439fb6fa05d4cadb0a6995fd91b8b Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 5 Oct 2010 00:31:35 +0200 Subject: defaults.commands: Fixed :cd command without argument --- ranger/defaults/commands.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ranger/defaults/commands.py b/ranger/defaults/commands.py index d3c05023..b874c5fa 100644 --- a/ranger/defaults/commands.py +++ b/ranger/defaults/commands.py @@ -73,9 +73,8 @@ class cd(Command): def execute(self): line = parse(self.line) - try: - destination = line.rest(1) - except IndexError: + destination = line.rest(1) + if not destination: destination = '~' if destination == '-': -- cgit 1.4.1-2-gfad0 From 5dbaad4db675802d6021cfdcb176b3ad10451e3b Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 10 Oct 2010 00:22:29 +0200 Subject: defaults.keys: show bookmarks when typing "um" --- ranger/defaults/keys.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ranger/defaults/keys.py b/ranger/defaults/keys.py index 9f0c78cb..e9ac4bde 100644 --- a/ranger/defaults/keys.py +++ b/ranger/defaults/keys.py @@ -285,7 +285,8 @@ for key in ALLOWED_BOOKMARK_KEYS: map("m" + key, fm.set_bookmark(key)) map("um" + key, fm.unset_bookmark(key)) map("`", "'", "m", fm.draw_bookmarks()) -map('um', fm.hint("delete which bookmark?")) +map('um', lambda arg: (arg.fm.draw_bookmarks(), + arg.fm.hint("delete which bookmark?"))) # ---------------------------------------------------- change views map('i', fm.display_file()) -- cgit 1.4.1-2-gfad0 From cbcd332596c53b43c06206a35b7830223a0bf411 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 10 Oct 2010 03:20:45 +0200 Subject: Tea, Earl Grey, Hot. --- CHANGELOG | 24 ++++++++++++++++-------- README | 2 +- doc/ranger.1 | 2 +- ranger/__init__.py | 2 +- 4 files changed, 19 insertions(+), 11 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 8078305d..5ce768b3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,12 +1,17 @@ -This log only documents changes between stable versions. +NOTE: This log only documents changes between stable versions. -From 1.2 on, odd minor version numbers (1.3, 1.5, 1.7,..) are assigned to the -fresh git snapshots while stable versions will have even minor numbers. +2010-10-10: Version 1.2.2 +* Prevent currently used directories from being garbage collected +* Disable mouse buttons when console is open +* Fixed :cd command: Without arguments, cd's into $HOME +* Fixed bug which prevented pydoc to work on some config files +* Fixed some bugs in "snow" and "jungle" colorschemes +* Several other clean-ups and fixes -1.2 -> 1.2.1: +2010-09-16: Version 1.2.1 * Fixed yy/pp bug when yanking multiple directories -1.1.2 -> 1.2: +2010-09-13: Version 1.2.0 * !!! Changed the default configuration directory to ~/.config/ranger !!! * Removed "Console Modes", each old mode is now a simple command * Disabled file previews by default if ranger is used by root @@ -19,18 +24,21 @@ fresh git snapshots while stable versions will have even minor numbers. * Use the file ~/.mime.types for mime type detection * Several clean-ups and fixes -1.1.1 -> 1.1.2: +NOTE: From 1.2 on, odd minor version numbers (1.3, 1.5, 1.7,..) are assigned to +the fresh git snapshots while stable versions will have even minor numbers. + +2010-07-17: Version 1.1.2 * Fix crash when using scrollwheel to scroll down in some cases * The command "ranger dir1 dir2 ..." opens multiple directories in tabs * Removed pydoc html documentation by default, re-create it with "make doc" * Minor fixes -1.1.0 -> 1.1.1: +2010-06-18: Version 1.1.1 * New install script, "setup.py" * New flag for running programs: "w" (waits for enter press) * Minor fixes -1.0.4 -> 1.1.0: +2010-06-09: Version 1.1.0 * Added a man page * Tab support * Improved directory loading performance diff --git a/README b/README index f0ee7a06..6f7357e8 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Ranger v.1.2.1 +Ranger v.1.2.2 ============== Ranger is a free console file manager that gives you greater flexibility diff --git a/doc/ranger.1 b/doc/ranger.1 index 03cc3d56..0eff60d8 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.TH RANGER 1 ranger-1.2.1 +.TH RANGER 1 ranger-1.2.2 .SH NAME ranger - visual file manager .\"----------------------------------------- diff --git a/ranger/__init__.py b/ranger/__init__.py index 4f223b7d..3553441a 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -20,7 +20,7 @@ import sys from ranger.ext.openstruct import OpenStruct __license__ = 'GPL3' -__version__ = '1.2.1' +__version__ = '1.2.2' __credits__ = 'Roman Zimbelmann' __author__ = 'Roman Zimbelmann' __maintainer__ = 'Roman Zimbelmann' -- cgit 1.4.1-2-gfad0 From 8c73056a44b6f7a267c98eb912fba3911ed33e9a Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 14 Oct 2010 16:14:18 +0200 Subject: ext.keybinding_parser: allow mapping alt+special keys --- ranger/ext/keybinding_parser.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py index 015d173f..e044d80d 100644 --- a/ranger/ext/keybinding_parser.py +++ b/ranger/ext/keybinding_parser.py @@ -66,10 +66,13 @@ DIRKEY = 9001 ANYKEY = 9002 PASSIVE_ACTION = 9003 -special_keys = { +very_special_keys = { 'dir': DIRKEY, 'any': ANYKEY, 'bg': PASSIVE_ACTION, +} + +special_keys = { 'bs': curses.KEY_BACKSPACE, 'backspace': curses.KEY_BACKSPACE, 'backspace2': curses.ascii.DEL, @@ -92,11 +95,16 @@ special_keys = { 's-tab': curses.KEY_BTAB, } -for char in ascii_lowercase: - special_keys['c-' + char] = ord(char) - 96 +for key, val in special_keys.items(): + special_keys['a-' + key] = (27, val) -for char in (ascii_lowercase + '0123456789'): +for char in ascii_lowercase + '0123456789': special_keys['a-' + char] = (27, ord(char)) +for char in ascii_lowercase: + special_keys['c-' + char] = ord(char) - 96 + for n in range(64): special_keys['f' + str(n)] = curses.KEY_F0 + n + +special_keys.update(very_special_keys) -- cgit 1.4.1-2-gfad0 From 72c70a2df45b957fee8c755e8bc953e4126dd2fb Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 15 Oct 2010 17:28:20 +0200 Subject: ext.keybinding_parser: fixed python3 incompatibility --- ranger/ext/keybinding_parser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/ext/keybinding_parser.py b/ranger/ext/keybinding_parser.py index e044d80d..0330c8ec 100644 --- a/ranger/ext/keybinding_parser.py +++ b/ranger/ext/keybinding_parser.py @@ -95,7 +95,7 @@ special_keys = { 's-tab': curses.KEY_BTAB, } -for key, val in special_keys.items(): +for key, val in tuple(special_keys.items()): special_keys['a-' + key] = (27, val) for char in ascii_lowercase + '0123456789': -- cgit 1.4.1-2-gfad0 From 6a7c1b84604cb378b6e82ed616776db0a89f5dcb Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 1 Nov 2010 17:17:50 +0100 Subject: fsobject.directory: Fixed sorting by type --- ranger/fsobject/directory.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ranger/fsobject/directory.py b/ranger/fsobject/directory.py index 9bdb4caa..dcb4bf2c 100644 --- a/ranger/fsobject/directory.py +++ b/ranger/fsobject/directory.py @@ -78,7 +78,7 @@ class Directory(FileSystemObject, Accumulator, SettingsAware): 'basename': sort_by_basename, 'size': lambda path: -path.size, 'mtime': lambda path: -(path.stat and path.stat.st_mtime or 1), - 'type': lambda path: path.mimetype, + 'type': lambda path: path.mimetype or '', } def __init__(self, path, **kw): -- cgit 1.4.1-2-gfad0 From f05a2eda194142de77a62acb12fecc2ec6386c48 Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 6 Nov 2010 16:44:51 +0100 Subject: fsobject.fsobject: Use ctime, not mtime, for identifying changes --- ranger/fsobject/fsobject.py | 7 ++++--- ranger/gui/widgets/statusbar.py | 12 ++++++------ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 4ca5a6c8..6e18d0e3 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -169,6 +169,7 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): self.loaded = True # Get the stat object, either from preload or from [l]stat + self.permissions = None new_stat = None path = self.path is_link = False @@ -264,10 +265,10 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): self.load() return True try: - real_mtime = lstat(self.path).st_mtime + real_ctime = lstat(self.path).st_ctime except OSError: - real_mtime = None - if not self.stat or self.stat.st_mtime != real_mtime: + real_ctime = None + if not self.stat or self.stat.st_ctime != real_ctime: self.load() return True return False diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 3019930b..6fff7383 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -39,7 +39,7 @@ class StatusBar(Widget): msg = None old_cf = None - old_mtime = None + old_ctime = None old_du = None old_hint = None result = None @@ -79,9 +79,9 @@ class StatusBar(Widget): self.need_redraw = True try: - mtime = self.env.cf.stat.st_mtime + ctime = self.env.cf.stat.st_ctime except: - mtime = -1 + ctime = -1 if not self.result: self.need_redraw = True @@ -94,8 +94,8 @@ class StatusBar(Widget): self.old_cf = self.env.cf self.need_redraw = True - if self.old_mtime != mtime: - self.old_mtime = mtime + if self.old_ctime != ctime: + self.old_ctime = ctime self.need_redraw = True if self.need_redraw: @@ -176,7 +176,7 @@ class StatusBar(Widget): left.add_space() left.add(strftime(self.timeformat, - localtime(stat.st_mtime)), 'mtime') + localtime(stat.st_ctime)), 'mtime') def _get_owner(self, target): uid = target.stat.st_uid -- cgit 1.4.1-2-gfad0 From f44c4a886d8a984b6297a7847f87ef0e469e785b Mon Sep 17 00:00:00 2001 From: hut Date: Sat, 6 Nov 2010 16:53:16 +0100 Subject: widgets.statusbar: Reload permissions of current file on change --- ranger/gui/widgets/statusbar.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index 6fff7383..c51af0ff 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -78,9 +78,10 @@ class StatusBar(Widget): self.msg = None self.need_redraw = True - try: + if self.env.cf: + self.env.cf.load_if_outdated() ctime = self.env.cf.stat.st_ctime - except: + else: ctime = -1 if not self.result: -- cgit 1.4.1-2-gfad0 From 2ef7d919e75ba172257b5f5cbc1ad0abe371e0b3 Mon Sep 17 00:00:00 2001 From: hut Date: Wed, 17 Nov 2010 19:48:53 +0100 Subject: widgets.statusbar: Fixed crash after deleting current file --- ranger/gui/widgets/statusbar.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ranger/gui/widgets/statusbar.py b/ranger/gui/widgets/statusbar.py index c51af0ff..5eedce05 100644 --- a/ranger/gui/widgets/statusbar.py +++ b/ranger/gui/widgets/statusbar.py @@ -80,7 +80,10 @@ class StatusBar(Widget): if self.env.cf: self.env.cf.load_if_outdated() - ctime = self.env.cf.stat.st_ctime + try: + ctime = self.env.cf.stat.st_ctime + except: + ctime = -1 else: ctime = -1 -- cgit 1.4.1-2-gfad0 From ea1797127be066a38096c8c43a34cba554ff2089 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 22 Nov 2010 02:35:59 +0100 Subject: fsobject: The lazy lookup of .image attribute was *too* lazy Conflicts: ranger/fsobject/fsobject.py --- ranger/fsobject/fsobject.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ranger/fsobject/fsobject.py b/ranger/fsobject/fsobject.py index 6e18d0e3..4db24eba 100644 --- a/ranger/fsobject/fsobject.py +++ b/ranger/fsobject/fsobject.py @@ -98,6 +98,10 @@ class FileSystemObject(MimeTypeAware, FileManagerAware): except OSError: return "" + for attr in ('video', 'audio', 'image', 'media', 'document', 'container'): + exec("%s = lazy_property(" + "lambda self: self.set_mimetype() or self.%s)" % (attr, attr)) + def __str__(self): """returns a string containing the absolute path""" return str(self.path) -- cgit 1.4.1-2-gfad0 From ffa2e9a0a763f8a284925edf52022e966c57fce3 Mon Sep 17 00:00:00 2001 From: hut Date: Thu, 14 Oct 2010 23:47:55 +0200 Subject: ext.signal_dispatcher: optimization of signal_emit --- ranger/ext/signal_dispatcher.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ranger/ext/signal_dispatcher.py b/ranger/ext/signal_dispatcher.py index c1630c0c..3f407bff 100644 --- a/ranger/ext/signal_dispatcher.py +++ b/ranger/ext/signal_dispatcher.py @@ -76,12 +76,11 @@ class SignalDispatcher(object): def signal_emit(self, signal_name, **kw): assert isinstance(signal_name, str) - try: - handlers = self._signals[signal_name] - except: - return + if signal_name not in self._signals: + return True + handlers = self._signals[signal_name] if not handlers: - return + return True signal = Signal(origin=self, name=signal_name, **kw) @@ -98,6 +97,7 @@ class SignalDispatcher(object): else: fnc() if signal.stopped: - return + return False except ReferenceError: handlers.remove(handler) + return True -- cgit 1.4.1-2-gfad0 From 0940c18905ede976d576150f235e378fe8c4c8b5 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 22 Nov 2010 02:06:46 +0100 Subject: ext.signals: fixed memory leak Signal handlers with dead weak references are only cleaned up when using signal_emit. If no signals are emitted, dead signal handlers will accumulate. This is avoided by adding the function signal_garbage_collect() and calling it in env.garbage_collect() --- ranger/core/environment.py | 2 ++ ranger/ext/signal_dispatcher.py | 26 ++++++++++++++++++++------ 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ranger/core/environment.py b/ranger/core/environment.py index 8d4c60df..417e36c0 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -128,6 +128,8 @@ class Environment(SettingsAware, SignalDispatcher): del self.directories[key] if value.is_directory: value.files = None + self.settings.signal_garbage_collect() + self.signal_garbage_collect() def get_selection(self): if self.cwd: diff --git a/ranger/ext/signal_dispatcher.py b/ranger/ext/signal_dispatcher.py index 3f407bff..5d80590a 100644 --- a/ranger/ext/signal_dispatcher.py +++ b/ranger/ext/signal_dispatcher.py @@ -74,6 +74,20 @@ class SignalDispatcher(object): except: pass + def signal_garbage_collect(self): + for handler_list in self._signals.values(): + i = len(handler_list) + while i: + i -= 1 + handler = handler_list[i] + try: + if isinstance(handler.function, tuple): + handler.function[1].__class__ + else: + handler.function.__class__ + except ReferenceError: + del handler_list[i] + def signal_emit(self, signal_name, **kw): assert isinstance(signal_name, str) if signal_name not in self._signals: @@ -87,17 +101,17 @@ class SignalDispatcher(object): # propagate for handler in tuple(handlers): if handler.active: + if isinstance(handler.function, tuple): + fnc = MethodType(*handler.function) + else: + fnc = handler.function try: - if isinstance(handler.function, tuple): - fnc = MethodType(*handler.function) - else: - fnc = handler.function if handler.pass_signal: fnc(signal) else: fnc() - if signal.stopped: - return False except ReferenceError: handlers.remove(handler) + if signal.stopped: + return False return True -- cgit 1.4.1-2-gfad0 From 77611f38dcea220ac431d4e9c3c40515003500de Mon Sep 17 00:00:00 2001 From: hut Date: Fri, 10 Dec 2010 00:17:26 +0100 Subject: updated README --- README | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/README b/README index 6f7357e8..6fb83dad 100644 --- a/README +++ b/README @@ -17,16 +17,19 @@ text-based user interface. About ----- -* Author: Roman Zimbelmann -* Website: http://savannah.nongnu.org/projects/ranger +* Authors: Check the copyright notices in each source file +* Website: http://ranger.nongnu.org/ * License: GNU General Public License Version 3 * Download URL of the newest stable version: -http://git.savannah.gnu.org/cgit/ranger.git/snapshot/ranger-stable.tar.gz +http://ranger.nongnu.org/ranger-stable.tar.gz * Git Clone URL: git clone http://git.sv.gnu.org/r/ranger.git +* Bug report: +https://savannah.nongnu.org/bugs/?group=ranger&func=additem + Design Goals ------------ -- cgit 1.4.1-2-gfad0 From efd7c0c16203cdeafcd58201d509325129397a67 Mon Sep 17 00:00:00 2001 From: hut Date: Mon, 13 Dec 2010 18:39:50 +0100 Subject: HOW DO I TURN OFF CAPS LOCK? --- CHANGELOG | 7 +++++++ README | 2 +- doc/ranger.1 | 2 +- ranger/__init__.py | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5ce768b3..98f79991 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,12 @@ NOTE: This log only documents changes between stable versions. +2010-12-13: Version 1.2.3 +* Enable binding to alt-keys +* Fixed memory leak in garbage collecting of old, unused directory objects +* Fixed python3 incompatibilities +* Fixed problems with identifying changes of files +* Fixed lazy lookup of some FSObject attributes + 2010-10-10: Version 1.2.2 * Prevent currently used directories from being garbage collected * Disable mouse buttons when console is open diff --git a/README b/README index 6fb83dad..79b3a767 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -Ranger v.1.2.2 +Ranger v.1.2.3 ============== Ranger is a free console file manager that gives you greater flexibility diff --git a/doc/ranger.1 b/doc/ranger.1 index 0eff60d8..e098c2b0 100644 --- a/doc/ranger.1 +++ b/doc/ranger.1 @@ -1,4 +1,4 @@ -.TH RANGER 1 ranger-1.2.2 +.TH RANGER 1 ranger-1.2.3 .SH NAME ranger - visual file manager .\"----------------------------------------- diff --git a/ranger/__init__.py b/ranger/__init__.py index 3553441a..e0a4f4e0 100644 --- a/ranger/__init__.py +++ b/ranger/__init__.py @@ -20,7 +20,7 @@ import sys from ranger.ext.openstruct import OpenStruct __license__ = 'GPL3' -__version__ = '1.2.2' +__version__ = '1.2.3' __credits__ = 'Roman Zimbelmann' __author__ = 'Roman Zimbelmann' __maintainer__ = 'Roman Zimbelmann' -- cgit 1.4.1-2-gfad0