about summary refs log tree commit diff stats
path: root/ranger/container/commandlist.py
diff options
context:
space:
mode:
Diffstat (limited to 'ranger/container/commandlist.py')
-rw-r--r--ranger/container/commandlist.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/ranger/container/commandlist.py b/ranger/container/commandlist.py
index d38116eb..e90f298e 100644
--- a/ranger/container/commandlist.py
+++ b/ranger/container/commandlist.py
@@ -1,3 +1,15 @@
+class CommandArgument(object):
+	def __init__(self, fm, displayable, keybuffer):
+		self.fm = fm
+		self.wdg = displayable
+		self.keybuffer = keybuffer
+		self.n = keybuffer.number
+		self.keys = str(keybuffer)
+
+def cmdarg(displayable):
+	return CommandArgument(displayable.fm, \
+			displayable, displayable.env.keybuffer)
+
 class CommandList(object):
 	"""
 	CommandLists are dictionary-like objects which give you a command
@@ -112,6 +124,9 @@ class Command(object):
 	def execute(self, *args):
 		"""Execute the command"""
 	
+	def execute_wrap(self, displayable):
+		self.execute(cmdarg(displayable))
+	
 #	def __str__(self):
 #		return 'Cmd({0})'.format(str(self.keys))