10 def alleps2gif(setupok,keepeps=True,tareps=True,tardir="MooRTT_epsimages"):
13 print "Usage: " + sys.argv[0] +
" [directory]"
21 for epsname
in os.listdir(
"."):
22 if epsname.count(old):
24 gifname = epsname.replace(old,new)
25 commands = [
"pstopnm -ppm -xborder 0 -yborder 0 -portrait -xsize=1000 " + epsname ,
26 "ppmtogif " + epsname +
"001.ppm > " + gifname ,
27 "rm " + epsname +
"001.ppm" ]
29 commands.append(
"rm " + epsname)
30 for command
in commands:
31 print "Running: " + command
34 if keepeps
and tareps:
35 commands = [
"mkdir " + tardir ,
36 "mv *" + old +
" " + tardir ,
37 "tar -czf " + tardir +
".tar.gz " + tardir ,
39 for command
in commands:
40 print "Running: " + command
44 print "No " + old +
" files in directory."