12 def alleps2gif(setupok,keepeps=True,tareps=True,tardir="MuonRecRTT_epsimages"):
15 print (
"Usage: " + sys.argv[0] +
" [directory]")
23 for epsname
in os.listdir(
"."):
24 if epsname.count(old):
26 gifname = epsname.replace(old,new)
27 commands = [
"pstopnm -ppm -xborder 0 -yborder 0 -portrait -xsize=1000 " + epsname ,
28 "ppmtogif " + epsname +
"001.ppm > " + gifname ,
29 "rm " + epsname +
"001.ppm" ]
31 commands.append(
"rm " + epsname)
32 for command
in commands:
33 print (
"Running: " + command)
36 if keepeps
and tareps:
37 commands = [
"mkdir " + tardir ,
38 "mv *" + old +
" " + tardir ,
39 "tar -czf " + tardir +
".tar.gz " + tardir ,
41 for command
in commands:
42 print (
"Running: " + command)
46 print (
"No " + old +
" files in directory.")