Changeset 2891
- Timestamp:
- 05/22/06 23:32:15 (19 years ago)
- Location:
- pykota/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/bin/cupspykota
r2889 r2891 47 47 from pykota.tool import PyKotaTool, PyKotaToolError, crashed 48 48 from pykota.accounter import openAccounter 49 from pykota.ipp import IPPRequest, IPPError 50 49 # TODO : remove the three lines below and the code which handles 50 # TODO : them in a future release. 51 from pykota.ipp import IPPRequest as oldIPPRequest 52 from pykota.ipp import IPPError as oldIPPError 53 54 try : 55 from pkipplib import pkipplib 56 except ImportError : 57 haspkipplib = False 58 else : 59 haspkipplib = True 60 51 61 class FakeObject : 52 62 """Fake object.""" … … 272 282 (self.myname, self.PrinterName, self.UserName, self.JobId)) 273 283 274 (ippfilename, ippmessage) = self.parseIPPRequestFile() 275 self.ControlFile = ippfilename 276 john = ippmessage.operation_attributes.get("job-originating-host-name", \ 277 ippmessage.job_attributes.get("job-originating-host-name", \ 278 (None, None))) 284 if not haspkipplib : 285 (ippfilename, ippmessage) = self.parseIPPRequestFile() 286 self.ControlFile = ippfilename 287 john = ippmessage.operation_attributes.get("job-originating-host-name", \ 288 ippmessage.job_attributes.get("job-originating-host-name", \ 289 (None, None))) 290 jbing = ippmessage.job_attributes.get("job-billing", (None, None)) 291 else : 292 cupsserver = pkipplib.CUPS(url="http://%s:%s" % \ 293 (os.environ.get("CUPS_SERVER", "localhost"), \ 294 os.environ.get("IPP_PORT", "631"))) 295 answer = cupsserver.getJobAttributes(self.JobId) 296 self.ControlFile = "NotUsedAnymore" 297 try : 298 john = answer.job["job-originating-host-name"] 299 except KeyError : 300 try : 301 john = answer.operation["job-originating-host-name"] 302 except KeyError : 303 john = (None, None) 304 try : 305 jbing = answer.job["job-billing"] 306 except KeyError : 307 jbing = (None, None) 279 308 if type(john) == type([]) : 280 309 john = john[-1] 281 310 (chtype, self.ClientHost) = john 282 jbing = ippmessage.job_attributes.get("job-billing", (None, None))283 311 if type(jbing) == type([]) : 284 312 jbing = jbing[-1] … … 520 548 self.logdebug("Parsing of IPP request file %s begins." % ippmessagefile) 521 549 try : 522 ippmessage = IPPRequest(ippdatafile.read())550 ippmessage = oldIPPRequest(ippdatafile.read()) 523 551 ippmessage.parse() 524 except IPPError, msg :552 except oldIPPError, msg : 525 553 self.printInfo("Error while parsing %s : %s" \ 526 554 % (ippmessagefile, msg), "warn") -
pykota/trunk/NEWS
r2883 r2891 22 22 PyKota NEWS : 23 23 24 - 1.25alpha4 (2006-05-22) : 25 26 - Now uses pkipplib if present to directly retrieve the job 27 information from the CUPS server over IPP. 28 24 29 - 1.25alpha3 (2006-05-11) : 25 30 -
pykota/trunk/pykota/version.py
r2882 r2891 22 22 # 23 23 24 __version__ = "1.25alpha 3_unofficial"24 __version__ = "1.25alpha4_unofficial" 25 25 26 26 __doc__ = "PyKota : a complete Printing Quota Solution for CUPS." -
pykota/trunk/README
r2877 r2891 369 369 tool is now mandatory for PyKota to work. 370 370 (http://www.librelogiciel.com/software/) 371 - The pkipplib Python library (http://www.pykota.com/software/pkipplib) 371 372 - The JAXML Python module to be able to dump datas in the XML format. 372 373 (http://www.librelogiciel.com/software/)