Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
marc
measurements
Commits
c07b75d8
Commit
c07b75d8
authored
Nov 04, 2017
by
marc
Browse files
Repaired popen syntax
parent
d32b8644
Changes
1
Hide whitespace changes
Inline
Side-by-side
__init__.py
View file @
c07b75d8
...
...
@@ -62,10 +62,14 @@ class Measurements():
'''
Note: in the stub dumpwide I added /bin/bash, otherwise you get an Exec format error.
'''
#self.measurement = subprocess.Popen(self.tool, self.centralFrequency, self.integrationTime, stdout=subprocess.PIPE)
self
.
measurement
=
subprocess
.
Popen
(
self
.
tool
+
" "
+
str
(
self
.
centralFrequency
)
+
" "
+
str
(
self
.
integrationTime
),
shell
=
True
,
stdout
=
subprocess
.
PIPE
)
measResults
=
self
.
measurement
.
stdout
try
:
self
.
measurement
=
subprocess
.
Popen
(
self
.
tool
,
self
.
integrationTime
,
stdout
=
subprocess
.
PIPE
)
#self.measurement = subprocess.Popen(self.tool +" "+ str(self.centralFrequency) +" "+ str(self.integrationTime), shell=True, stdout=subprocess.PIPE)
measResults
=
self
.
measurement
.
stdout
except
OSError
as
e
:
raise
OSError
(
'Can not open command file: {},
\
please check measurement.ini file'
.
format
(
self
.
tool
))
""" Write results into file"""
for
line
in
measResults
:
self
.
outputFile
.
write
(
line
.
decode
(
'utf-8'
))
...
...
@@ -79,6 +83,6 @@ if __name__ == '__main__':
for
tool
in
myMeas
.
getTools
():
logging
.
info
(
'Defined tools in ini file are: {}'
.
format
(
tool
))
myMeas
.
startMeasurement
(
'dumpwide'
,
1420
,
120
,
measFile
)
myMeas
.
startMeasurement
(
tool
,
1420
,
120
,
measFile
)
measFile
.
close
()
Write
Preview
Supports
Markdown
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