Minor fixes in pizza tools

This commit is contained in:
Richard Berger
2021-06-01 16:57:19 -04:00
parent 0d0c0ab136
commit 62675e6e2b
6 changed files with 33 additions and 34 deletions

View File

@ -87,12 +87,12 @@ g.curve(N,'r') set color of curve N
# Imports and external programs
import types, os
import os
try: from DEFAULTS import PIZZA_GNUPLOT
except: PIZZA_GNUPLOT = "gnuplot -p"
except ImportError: PIZZA_GNUPLOT = "gnuplot -p"
try: from DEFAULTS import PIZZA_GNUTERM
except: PIZZA_GNUTERM = "x11"
except ImportError: PIZZA_GNUTERM = "x11"
# Class definition
@ -122,7 +122,7 @@ class gnu:
def enter(self):
while 1:
command = raw_input("gnuplot> ")
command = input("gnuplot> ")
if command == "quit" or command == "exit": return
self.__call__(command)
@ -136,7 +136,7 @@ class gnu:
self.export(file,linear,vectors[0])
self.figures[self.current-1].ncurves = 1
else:
if len(vectors) % 2: raise StandardError("vectors must come in pairs")
if len(vectors) % 2: raise Exception("vectors must come in pairs")
for i in range(0,len(vectors),2):
file = self.file + ".%d.%d" % (self.current,i/2+1)
self.export(file,vectors[i],vectors[i+1])
@ -170,7 +170,7 @@ class gnu:
def export(self,filename,*vectors):
n = len(vectors[0])
for vector in vectors:
if len(vector) != n: raise StandardError("vectors must be same length")
if len(vector) != n: raise Exception("vectors must be same length")
f = open(filename,'w')
nvec = len(vectors)
for i in range(n):