From 57f830585733a01420f0ff0e4764725524fab6dd Mon Sep 17 00:00:00 2001 From: Samo Penic <samo.penic@fe.uni-lj.si> Date: Fri, 08 Apr 2016 10:42:42 +0000 Subject: [PATCH] Fix in comment in main.c --- python/trisurf/trisurf.py | 13 +++++++------ 1 files changed, 7 insertions(+), 6 deletions(-) diff --git a/python/trisurf/trisurf.py b/python/trisurf/trisurf.py index dc1cb78..b1f99b6 100644 --- a/python/trisurf/trisurf.py +++ b/python/trisurf/trisurf.py @@ -12,7 +12,7 @@ import psutil import time import datetime -from subprocess import call, Popen +import subprocess # Process status TS_NOLOCK=0 # lock file does not exist @@ -246,8 +246,9 @@ ''' Class Runner consists of a single running or terminated instance of the trisurf. It manages starting, stopping, verifying the running process and printing the reports of the configured instances. ''' - def __init__(self, subdir='run0', tape='', snapshot=''): + def __init__(self, subdir='run0', tape='', snapshot='', runArgs=[]): self.subdir=subdir + self.runArgs=runArgs self.fromSnapshot=False if(tape!=''): self.initFromTape(tape) @@ -309,10 +310,10 @@ self.Dir.goto() print("Starting trisurf-ng executable at "+self.Dir.fullpath()+"\n") if(self.fromSnapshot==True): - params=["trisurf", "--restore-from-vtk",self.snapshotFile] + params=["trisurf", "--restore-from-vtk",self.snapshotFile]+self.runArgs else: - params="trisurf" - Popen (params, stdout=False) + params=["trisurf"]+self.runArgs + subprocess.Popen (params, stdout=subprocess.DEVNULL) cwd.goto() else: print("Process already running. Not starting\n") @@ -351,7 +352,7 @@ statustxt="Running" if(self.statistics.fileOK): - report=[time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(self.statistics.startDate))),str(datetime.timedelta(microseconds=(int(self.tape.config['iterations'])-int(self.statistics.last))*self.statistics.dT)*1000), statustxt, pid, str(self.Dir.fullpath()), self.Comment.getText()] + report=[time.strftime('%Y-%m-%d %H:%M:%S', time.localtime(int(self.statistics.startDate))),str(datetime.timedelta(microseconds=(int(self.tape.config['iterations'])-int(self.statistics.last))*self.statistics.dT)*1000000), statustxt, pid, str(self.Dir.fullpath()), self.Comment.getText()] else: report=["N/A","N/A\t",statustxt, pid, str(self.Dir.fullpath()), self.Comment.getText()] return report -- Gitblit v1.9.3