From 6cb960642b3cf7b62c94962f6308b207ec54dbc2 Mon Sep 17 00:00:00 2001 From: hut Date: Sun, 5 Aug 2012 05:31:56 +0200 Subject: core.environment: added a layer for backwards compatibility --- ranger/core/environment.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ranger/core/environment.py b/ranger/core/environment.py index ece1c4c8..bd4d3ad9 100644 --- a/ranger/core/environment.py +++ b/ranger/core/environment.py @@ -11,7 +11,26 @@ from ranger.container.history import History from ranger.ext.signals import SignalDispatcher from ranger.core.shared import SettingsAware, FileManagerAware -class Environment(SettingsAware, FileManagerAware, SignalDispatcher): +# COMPAT +class EnvironmentCompatibilityWrapper(object): + def _get_copy(self): return self.fm.copy_buffer + def _set_copy(self, obj): self.fm.copy_buffer = obj + copy = property(_get_copy, _set_copy) + + def _get_cut(self): return self.fm.do_cut + def _set_cut(self, obj): self.fm.do_cut = obj + cut = property(_get_cut, _set_cut) + + def _get_keymaps(self): return self.fm.ui.keymaps + def _set_keymaps(self, obj): self.fm.ui.keymaps = obj + keymaps = property(_get_keymaps, _set_keymaps) + + def _get_keybuffer(self): return self.fm.ui.keybuffer + def _set_keybuffer(self, obj): self.fm.ui.keybuffer = obj + keybuffer = property(_get_keybuffer, _set_keybuffer) + +class Environment(SettingsAware, FileManagerAware, SignalDispatcher, + EnvironmentCompatibilityWrapper): """ A collection of data which is relevant for more than one class. """ -- cgit 1.4.1-2-gfad0