summaryrefslogtreecommitdiff
path: root/support/lib
diff options
context:
space:
mode:
authorMichael Schwarz <michi.schwarz@gmail.com>2015-08-06 16:32:35 +0200
committerMichael Schwarz <michi.schwarz@gmail.com>2015-08-07 02:03:33 +0200
commit5a1604ce202077da2823bf63f4400dd9343a17df (patch)
tree874f57c9243f6b70ff5f24cd8dda65d5664714fe /support/lib
parent6bce36b6ede16d28626d40a0b4d60954a35ad48f (diff)
downloadpogojig-5a1604ce202077da2823bf63f4400dd9343a17df.tar.gz
pogojig-5a1604ce202077da2823bf63f4400dd9343a17df.tar.bz2
pogojig-5a1604ce202077da2823bf63f4400dd9343a17df.zip
Use Python script to run Asymptote.
Diffstat (limited to 'support/lib')
-rw-r--r--support/lib/util.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/support/lib/util.py b/support/lib/util.py
index 3c5117d..54b92f0 100644
--- a/support/lib/util.py
+++ b/support/lib/util.py
@@ -27,15 +27,14 @@ def TemporaryDirectory():
shutil.rmtree(dir)
-def command(args, remove_env = None):
- if remove_env is None:
- env = None
- else:
- env = dict(os.environ)
-
- for i in remove_env:
- if i in env:
- del env[i]
+def command(args, remove_env = [], set_env = { }):
+ env = dict(os.environ)
+
+ for i in remove_env:
+ del env[i]
+
+ for k, v in set_env.items():
+ env[k] = v
process = subprocess.Popen(args, env = env)
process.wait()