mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-26 05:42:15 +01:00
Refactor how arguments are passed to subprocess.Popen
This commit is contained in:
parent
2474d2fe78
commit
d7ff9156fb
1 changed files with 2 additions and 6 deletions
|
|
@ -42,16 +42,13 @@ class PublishImageSequence(pyblish.api.Extractor):
|
|||
assert os.path.isfile(path), ("Stored path is not a file for %s"
|
||||
% instance.data["name"])
|
||||
|
||||
# Get the script to execute
|
||||
script = _get_script()
|
||||
cmd = 'python {0} --paths "{1}"'.format(script, path)
|
||||
|
||||
# Suppress any subprocess console
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW
|
||||
startupinfo.wShowWindow = subprocess.SW_HIDE
|
||||
|
||||
process = subprocess.Popen(cmd,
|
||||
process = subprocess.Popen(["python", _get_script(),
|
||||
"--paths", path],
|
||||
bufsize=1,
|
||||
stdout=subprocess.PIPE,
|
||||
stderr=subprocess.STDOUT,
|
||||
|
|
@ -78,4 +75,3 @@ class PublishImageSequence(pyblish.api.Extractor):
|
|||
valid = bool(context)
|
||||
if not valid:
|
||||
raise RuntimeError("Unable to publish image sequences")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue