Changeset 1918 for pykota/trunk/bin/pkbanner
- Timestamp:
- 11/15/04 20:59:34 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkbanner
r1911 r1918 24 24 # 25 25 # $Log$ 26 # Revision 1.4 2004/11/15 19:59:34 jalet 27 # PyKota banners now basically work ! 28 # 26 29 # Revision 1.3 2004/11/12 23:46:44 jalet 27 30 # Heavy work on pkbanner. Not finished yet though, but mostly works. … … 39 42 import os 40 43 import cStringIO 44 import popen2 41 45 42 46 try : … … 198 202 self.printInfo("Unknown page size %s, defaulting to A4." % options["pagesize"], "warn") 199 203 204 self.logdebug("Generating the banner in PDF format...") 200 205 doc = self.genPDF(pagesize, options["logo"], options["url"].strip()) 201 print doc 206 207 self.logdebug("Converting the banner to PostScript...") 208 os.environ["PATH"] = "%s:/bin:/usr/bin:/usr/local/bin:/opt/bin:/sbin:/usr/sbin" % os.environ.get("PATH", "") 209 child = popen2.Popen3("gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sDEVICE=pswrite -sOutputFile=- - 2>/tmp/errgs") 210 child.tochild.write(doc) 211 child.tochild.close() 212 sys.stdout.write(child.fromchild.read()) 213 sys.stdout.flush() 214 child.fromchild.close() 215 status = child.wait() 216 if os.WIFEXITED(status) : 217 status = os.WEXITSTATUS(status) 218 self.logdebug("PDF to PostScript converter exit code is %s" % str(status)) 219 self.logdebug("Banner completed.") 220 return status 202 221 203 222 def getInfo(name) :