[kupfer] commands: Fix new actions to not use shlex



commit cf95c6a2ec9dc6f5e502148fb917a97676795655
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Feb 28 21:36:49 2011 +0100

    commands: Fix new actions to not use shlex

 kupfer/plugin/commands.py |   16 ++--------------
 1 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/kupfer/plugin/commands.py b/kupfer/plugin/commands.py
index daf33ab..c756a90 100644
--- a/kupfer/plugin/commands.py
+++ b/kupfer/plugin/commands.py
@@ -58,13 +58,7 @@ class WriteToCommand (Action):
 		Action.__init__(self, _("Send to Command..."))
 
 	def activate(self, leaf, iobj):
-		# use shlex to allow simple quoting
-		commandline = iobj.object
-		try:
-			argv = unicode_shlex_split(commandline)
-		except ValueError:
-			# Exception raised on unpaired quotation marks
-			argv = commandline.split(None, 1)
+		argv = [iobj.object]
 		ctx = commandexec.DefaultActionExecutionContext()
 		token = ctx.get_async_token()
 		pretty.print_debug(__name__, "Spawning without timeout")
@@ -96,13 +90,7 @@ class FilterThroughCommand (Action):
 		Action.__init__(self, _("Filter through Command..."))
 
 	def activate(self, leaf, iobj):
-		# use shlex to allow simple quoting
-		commandline = iobj.object
-		try:
-			argv = unicode_shlex_split(commandline)
-		except ValueError:
-			# Exception raised on unpaired quotation marks
-			argv = commandline.split(None, 1)
+		argv = [iobj.object]
 		ctx = commandexec.DefaultActionExecutionContext()
 		token = ctx.get_async_token()
 		pretty.print_debug(__name__, "Spawning without timeout")



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]