summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-08-05 05:31:56 +0200
committerhut <hut@lavabit.com>2012-08-05 14:36:32 +0200
commit6cb960642b3cf7b62c94962f6308b207ec54dbc2 (patch)
tree1c7577c37c64718186322a4ddb9ac848e6f6f2ea
parent417c594f51afb558f256e9b00ea321aee1c5a4ab (diff)
downloadranger-6cb960642b3cf7b62c94962f6308b207ec54dbc2.tar.gz
core.environment: added a layer for backwards compatibility
-rw-r--r--ranger/core/environment.py21
1 files changed, 20 insertions, 1 deletions
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.
 	"""