Changeset 2193 for pykota/trunk
- Timestamp:
- 04/04/05 21:04:21 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/pkbanner
r2147 r2193 55 55 command line usage : 56 56 57 pkbanner [options] 57 pkbanner [options] [more info] 58 58 59 59 options : … … 144 144 return (size + 4) 145 145 146 def genPDF(self, pagesize, logo, url, savetoner) :146 def genPDF(self, pagesize, logo, url, text, savetoner) : 147 147 """Generates the banner in PDF format, return the PDF document as a string.""" 148 149 148 document = cStringIO.StringIO() 150 149 c = canvas.Canvas(document, pagesize=pagesize, pageCompression=1) … … 183 182 # Outputs the username 184 183 ypos -= self.printVar(c, xcenter, ypos, _("Username"), username, 20, savetoner) 184 185 # Text 186 if text : 187 ypos -= self.printVar(c, xcenter, ypos, _("More Info"), text, 20, savetoner) 185 188 186 189 # Printer and Job Id … … 239 242 return document.getvalue() 240 243 241 def main(self, files, options) :244 def main(self, arguments, options) : 242 245 """Generates a banner.""" 243 246 if not hasRL : … … 261 264 262 265 self.logdebug("Generating the banner in PDF format...") 263 doc = self.genPDF(pagesize, options["logo"].strip(), options["url"].strip(), savetoner) 266 doc = self.genPDF(pagesize, 267 options["logo"].strip(), 268 options["url"].strip(), 269 " ".join(arguments).strip(), 270 savetoner) 264 271 265 272 self.logdebug("Converting the banner to PostScript...") 266 273 os.environ["PATH"] = "%s:/bin:/usr/bin:/usr/local/bin:/opt/bin:/sbin:/usr/sbin" % os.environ.get("PATH", "") 267 child = popen2.Popen3("gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sDEVICE=pswrite -sOutputFile=- - 2>/tmp/errgs") 268 child.tochild.write(doc) 269 child.tochild.close() 270 sys.stdout.write(child.fromchild.read()) 271 sys.stdout.flush() 272 child.fromchild.close() 274 child = popen2.Popen3("gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sDEVICE=pswrite -sOutputFile=- -") 275 try : 276 child.tochild.write(doc) 277 child.tochild.close() 278 sys.stdout.write(child.fromchild.read()) 279 sys.stdout.flush() 280 child.fromchild.close() 281 except IOError, msg : 282 self.printInfo("I/O Error %s" % msg, "error") 273 283 status = child.wait() 274 284 if os.WIFEXITED(status) : -
pykota/trunk/conf/pykota.conf.sample
r2146 r2193 721 721 # NB : pkbanner's default page size is A4 722 722 # 723 # A static banner page 723 724 # endingbanner: /home/joe/mystaticbanner.ps 725 # 726 # A banner with personnalized logo and url 724 727 # endingbanner: /usr/bin/pkbanner --pagesize=A4 --logo="/home/joe/mylogo.jpeg" --url="http://tech.example.com" 728 # 729 # A banner in the format accepted by the printer 725 730 # endingbanner: /usr/bin/pkbanner | gs -q -dNOPAUSE -dBATCH -dPARANOIDSAFER -sOutputFile=- -sDEVICE=lj5mono - 726 # endingbanner: /usr/bin/pkbanner 731 # 732 # A banner with more info on it, extracted from the yellow pages. 733 # the string "Phone 111222333444" will be added to the banner page 734 # if extractphone.sh returns 111222333444 for the current user. 735 # endingbanner: /usr/bin/pkbanner Phone `extractphone.sh $PYKOTAUSERNAME` 736 # 737 # Default PyKota banner 738 # endingbanner: /usr/bin/pkbanner 727 739 728 740 # How should enforcement be done for this printer ? -
pykota/trunk/NEWS
r2188 r2193 22 22 PyKota NEWS : 23 23 24 - 1.22alpha4 : 25 26 - Allows pkbanner to accept more info to display on its 27 command line. 28 24 29 - 1.22alpha3 : 25 30 -
pykota/trunk/pykota/version.py
r2179 r2193 22 22 # 23 23 24 __version__ = "1.22alpha 3_unofficial"24 __version__ = "1.22alpha4_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""