Mercurial Hosting > traffic-intelligence
diff python/storage.py @ 753:3d48e34db846 dev
switched to subprocess.check_call
author | Nicolas Saunier <nicolas.saunier@polymtl.ca> |
---|---|
date | Thu, 29 Oct 2015 14:29:31 -0400 |
parents | 14963a9c3b09 |
children | 782e8fd3672c |
line wrap: on
line diff
--- a/python/storage.py Wed Oct 28 23:37:25 2015 -0400 +++ b/python/storage.py Thu Oct 29 14:29:31 2015 -0400 @@ -743,9 +743,11 @@ "DELETE FROM curvilinear_positions WHERE trajectory_id IS NULL OR trajectory_id = \"NO\";\n") out.close() # system call - from os import system, remove - system("sqlite3 "+utils.removeExtension(filename)+".sqlite < "+sqlScriptFilename) - remove(sqlScriptFilename) + from subprocess import check_call + out = openCheck("err.log", "w") + check_call("sqlite3 "+utils.removeExtension(filename)+".sqlite < "+sqlScriptFilename, stderr = out, shell = True) + out.close() + shutil.os.remove(sqlScriptFilename) def loadTrajectoriesFromVissimFile(filename, simulationStepsPerTimeUnit, objectNumbers = None, warmUpLastInstant = None, usePandas = False, nDecimals = 2, lowMemory = True): '''Reads data from VISSIM .fzp trajectory file