Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Scientific Software
MDANSE
Commits
c535896b
Commit
c535896b
authored
Feb 07, 2019
by
Remi Perenon
Browse files
Asynchronous call to subprocess
parent
9b92672d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Src/GUI/Plugins/JobPlugin.py
View file @
c535896b
...
...
@@ -93,14 +93,22 @@ class JobPlugin(ComponentPlugin):
os
.
close
(
handle
)
self
.
_job
.
save
(
filename
,
parameters
)
try
:
from
subprocess
import
DEVNULL
except
ImportError
:
DEVNULL
=
os
.
open
(
os
.
devnull
,
os
.
O_RDWR
)
if
PLATFORM
.
name
==
"windows"
:
startupinfo
=
subprocess
.
STARTUPINFO
()
startupinfo
.
dwFlags
|=
subprocess
.
STARTF_USESHOWWINDOW
startupinfo
.
wShowWindow
=
subprocess
.
SW_HIDE
else
:
startupinfo
=
None
#try:
# from subprocess import DEVNULL
#except ImportError:
# DEVNULL = os.open(os.devnull, os.O_RDWR)
try
:
subprocess
.
check_output
([
sys
.
executable
,
filename
],
st
din
=
DEVNULL
,
stderr
=
DEVNULL
)
subprocess
.
Popen
([
sys
.
executable
,
filename
],
st
artupinfo
=
startupinfo
,
stdin
=
subprocess
.
PIPE
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
except
subprocess
.
CalledProcessError
as
e
:
message
=
e
.
output
else
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment