summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-30 12:51:13 +0200
committerhut <hut@lavabit.com>2010-07-03 19:08:42 +0200
commitc9f479ab1a2f8df056a27c388ec2a9791b8bca8f (patch)
tree88eeeaf1209c4c7ffd516cdc877bd7f24af94ff5 /ranger
parentfb05609637209fbbef26b09705378d03f335d770 (diff)
downloadranger-c9f479ab1a2f8df056a27c388ec2a9791b8bca8f.tar.gz
core.actions: added "execute_console"
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/actions.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index 008a89fe..911f5ca4 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -74,6 +74,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		if hasattr(self.ui, 'open_console'):
 			self.ui.open_console(mode, string, prompt=prompt)
 
+	def execute_console(self, string='', mode=cmode.COMMAND):
+		"""Execute a command for the console"""
+		self.open_console(mode=mode, string=string)
+		self.ui.console.line = string
+		self.ui.console.execute()
+
 	def execute_file(self, files, **kw):
 		"""Execute a file.
 		app is the name of a method in Applications, without the "app_"