summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-03-21 02:58:54 +0100
committerhut <hut@lavabit.com>2012-03-21 02:58:54 +0100
commitc9a5be7f8e9e881ae33b851910a626cca58fd0bf (patch)
treecd120d33bb8acf602b7105222630bb7579cf8769
parent79c760d71f62889e85f55a5bc130a20667feb894 (diff)
downloadranger-c9a5be7f8e9e881ae33b851910a626cca58fd0bf.tar.gz
core.actions: fixed some of the rifle code
-rw-r--r--ranger/core/actions.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/ranger/core/actions.py b/ranger/core/actions.py
index f701c08f..8ce91396 100644
--- a/ranger/core/actions.py
+++ b/ranger/core/actions.py
@@ -300,7 +300,7 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		self.signal_emit('execute.before', keywords=kw)
 		filenames = [f.path for f in files]
 		mimetype = files[0].mimetype if files else None
-		label = kw.get('app', None)
+		label = kw.get('label', kw.get('app', None))
 		try:
 			return self.rifle.execute(filenames, mode, label, flags, mimetype)
 		finally:
@@ -683,8 +683,12 @@ class Actions(FileManagerAware, EnvironmentAware, SettingsAware):
 		self.ui.browser.draw_bookmarks = False
 
 	def draw_possible_programs(self):
-		selection = [f.path for f in self.env.get_selection()]
-		programs = self.rifle.list_commands(selection)
+		try:
+			target = self.env.get_selection()[0]
+		except:
+			self.ui.browser.draw_info = []
+			return
+		programs = self.rifle.list_commands(target.path, target.mimetype)
 		programs = ['%s | %s' % program[0:2] for program in programs]
 		self.ui.browser.draw_info = programs