summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2011-10-30 01:21:40 +0200
committerhut <hut@lavabit.com>2011-10-30 01:22:21 +0200
commit353d765c2a14ac23ccea337f4cac2bc73b2b0693 (patch)
treeee9f9a3451fd63ac1fec9229f203c60413614b21
parentfdd390452b1937db7ba3ba7f30d0a6ece44ca02f (diff)
downloadranger-353d765c2a14ac23ccea337f4cac2bc73b2b0693.tar.gz
Added signals runner.execute.{before,after}
-rw-r--r--ranger/core/runner.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/ranger/core/runner.py b/ranger/core/runner.py
index 8adf01d7..5d97489d 100644
--- a/ranger/core/runner.py
+++ b/ranger/core/runner.py
@@ -195,10 +195,14 @@ class Runner(object):
 		if toggle_ui:
 			self._activate_ui(False)
 		try:
+			error = None
 			process = None
+			self.fm.signal_emit('runner.execute.before',
+					popen_kws=popen_kws, context=context)
 			try:
 				process = Popen(**popen_kws)
 			except Exception as e:
+				error = e
 				self._log("Failed to run: %s\n%s" % (str(action), str(e)))
 			else:
 				if context.wait:
@@ -208,6 +212,8 @@ class Runner(object):
 				if wait_for_enter:
 					press_enter()
 		finally:
+			self.fm.signal_emit('runner.execute.after',
+					popen_kws=popen_kws, context=context, error=error)
 			if devnull:
 				devnull.close()
 			if toggle_ui: