Commit c07b75d8 authored by marc's avatar marc
Browse files

Repaired popen syntax

parent d32b8644
......@@ -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()
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment