Index: contrib/st2subprocess.py ================================================================== --- contrib/st2subprocess.py +++ contrib/st2subprocess.py @@ -1,10 +1,10 @@ # encoding: utf-8 # api: streamtuner2 # title: win32/subprocess # description: Utilizes subprocess spawning or win32 API instead of os.system -# version: 0.3 +# version: 0.3.1 # depends: streamtuner2 > 2.2.0, python >= 2.7 # priority: optional # config: # { name: cmd_spawn, type: select, select: "popen|shell|call|execv|spawnv|pywin32|win32api|system", value: popen, description: Spawn method } # { name: cmd_flags, type: select, select: "none|nowait|detached|nowaito|all|sw_hide||sw_minimize|sw_show", value: nowait, description: Process creation flags (win32) } @@ -99,20 +99,17 @@ # debug log.EXEC("st2subprocess:", args, "creationflags=%s"%flags) #-- Popen → https://docs.python.org/2/library/subprocess.html#popen-constructor v = conf.cmd_spawn - if v in ("popen"): + if v in ("popen", "shell"): + #-- Popen w/ shell=True and string cmd + if (v=="shell"): + args = [cmd] log.POPEN( subprocess.Popen(args, shell=(v=="shell"), creationflags=flags).__dict__ ) - #-- Popen w/ shell=True and string cmd - v = conf.cmd_spawn - if v in ("popen", "shell"): - log.POPEN_SHELL( - subprocess.Popen(cmd, shell=(v=="shell"), creationflags=flags).__dict__ - ) #-- call → https://docs.python.org/2/library/subprocess.html#replacing-os-system elif v == "call": log.CALL( subprocess.call(args, creationflags=flags).__dict__ )