Env var GNUPLOT overrides gnuplot path.

By default 'gnuplot' will be searched from the system path.
This commit is contained in:
Heikki Hokkanen 2008-06-28 10:38:45 +03:00
parent a7f0f5ea50
commit 80ca8cb2ef

View File

@ -1,5 +1,5 @@
#!/usr/bin/env python #!/usr/bin/env python
# Copyright (c) 2007 Heikki Hokkanen <hoxu@users.sf.net> # Copyright (c) 2007-2008 Heikki Hokkanen <hoxu@users.sf.net>
# GPLv2 # GPLv2
import subprocess import subprocess
import datetime import datetime
@ -10,13 +10,18 @@ import shutil
import sys import sys
import time import time
GNUPLOT = 'c:/tools/gnuplot/bin/wgnuplot_pipes.exe'
GNUPLOT_COMMON = 'set terminal png transparent\nset size 0.5,0.5\n' GNUPLOT_COMMON = 'set terminal png transparent\nset size 0.5,0.5\n'
exectime_internal = 0.0 exectime_internal = 0.0
exectime_external = 0.0 exectime_external = 0.0
time_start = time.time() time_start = time.time()
# By default, gnuplot is searched from path, but can be overridden with the
# environment variable "GNUPLOT"
gnuplot_cmd = 'gnuplot'
if 'GNUPLOT' in os.environ:
gnuplot_cmd = os.environ['GNUPLOT']
def getpipeoutput(cmds, quiet = False): def getpipeoutput(cmds, quiet = False):
def beautify_name(cmds): def beautify_name(cmds):
ret = cmds[0] ret = cmds[0]
@ -807,7 +812,7 @@ plot 'lines_of_code.dat' using 1:2 w lines
os.chdir(path) os.chdir(path)
files = glob.glob(path + '/*.plot') files = glob.glob(path + '/*.plot')
for f in files: for f in files:
out = getpipeoutput((GNUPLOT + ' "%s"' % f,)) out = getpipeoutput((gnuplot_cmd + ' "%s"' % f,))
if len(out) > 0: if len(out) > 0:
print out print out