comparison rgToolFactory.py @ 64:d4fc5eb21a2e draft

Uploaded
author fubar
date Mon, 10 Feb 2014 20:32:57 -0500
parents c0fa3dde02d9
children
comparison
equal deleted inserted replaced
63:baa72cf05e58 64:d4fc5eb21a2e
372 print >> sys.stdout,'## WARNING - no $TMP or $TEMP!!! Please fix - using /tmp temporarily' 372 print >> sys.stdout,'## WARNING - no $TMP or $TEMP!!! Please fix - using /tmp temporarily'
373 self.temp_warned = True 373 self.temp_warned = True
374 hlog = os.path.join(self.opts.output_dir,"compress_%s.txt" % os.path.basename(inpdf)) 374 hlog = os.path.join(self.opts.output_dir,"compress_%s.txt" % os.path.basename(inpdf))
375 sto = open(hlog,'w') 375 sto = open(hlog,'w')
376 outpdf = '%s_compressed' % inpdf 376 outpdf = '%s_compressed' % inpdf
377 cl = ["gs", "-sDEVICE=pdfwrite", "-dNOPAUSE", "-dBATCH","-dPDFSETTINGS=/printer", "-sOutputFile=%s" % outpdf,inpdf] 377 cl = ["gs", "-sDEVICE=pdfwrite", "-dNOPAUSE", "-dUseCIEColor", "-dBATCH","-dPDFSETTINGS=/printer", "-sOutputFile=%s" % outpdf,inpdf]
378 x = subprocess.Popen(cl,stdout=sto,stderr=sto,cwd=self.opts.output_dir,env=our_env) 378 x = subprocess.Popen(cl,stdout=sto,stderr=sto,cwd=self.opts.output_dir,env=our_env)
379 retval1 = x.wait() 379 retval1 = x.wait()
380 sto.close() 380 sto.close()
381 if retval1 == 0: 381 if retval1 == 0:
382 os.unlink(inpdf) 382 os.unlink(inpdf)