import os import glob import subprocess import shutil import sys BACKGROUNDS=["desktop","aula","infantil","biblioteca","musica","lite","pime","bttl","extra","installer"] FACTOR=1.5 WIDTH=1024 HEIGHT=768 if sys.argv[1]=="build": for d in BACKGROUNDS: for f in glob.glob(d+"/*.svg"): if os.path.exists(f): print "Processing %s" % (f) p1=subprocess.Popen(["rsvg","-w "+str(int(WIDTH*FACTOR)),"-h "+str(int(HEIGHT*FACTOR)),f,d+"/"+os.path.basename(f).replace(".svg",".png")]) output=p1.communicate() else: print "Error finding %s" %f if sys.argv[1]=="clean": for d in BACKGROUNDS: for f in glob.glob(d+"/*.png"): print "Deleting %s" % (f) os.remove(f)