Changeset 1699
- Timestamp:
- 09/03/04 00:08:37 (20 years ago)
- Location:
- pykota/trunk
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/NEWS
r1697 r1699 22 22 PyKota NEWS : 23 23 24 - 1.20alpha7 : 25 26 - First draft of PCL3GUI (Deskjet 640C for example) analyzer. 27 Needs more work, but no documentation is available. 28 24 29 - 1.20alpha6 : 25 30 -
pykota/trunk/pykota/pdlanalyzer.py
r1698 r1699 22 22 # 23 23 # $Log$ 24 # Revision 1.38 2004/09/02 22:08:37 jalet 25 # First draft of PCL3GUI analyzer. 26 # 24 27 # Revision 1.37 2004/09/02 21:22:49 jalet 25 28 # One more PCL tag … … 411 414 return pagecount 412 415 416 class PCL3GUIAnalyzer : 417 def __init__(self, infile) : 418 """Initialize PCL3GUI Analyzer.""" 419 self.infile = infile 420 421 def getJobSize(self) : 422 """Count pages in a PCL3GUI document. 423 424 Not much documentation available, so we will count occurences 425 of <ESC>*r1A which is start of graphical data. 426 427 This is FAR from being accurate. PCL3 ressembles PCL5 in fact, 428 and PCL parser should be made better, but some documentation 429 definitely lacks. 430 """ 431 data = self.infile.read() 432 pagecount = data.count("\033*r1A") 433 return pagecount 434 413 435 class PCLXLAnalyzer : 414 436 def __init__(self, infile) : … … 740 762 return 0 741 763 764 def isPCL3GUI(self, data) : 765 """Returns 1 if data is PCL3GUI, else 0.""" 766 if data.find("@PJL ENTER LANGUAGE=PCL3GUI") != -1 : 767 return 1 768 else : 769 return 0 770 742 771 def isPCLXL(self, data) : 743 772 """Returns 1 if data is PCLXL aka PCL6, else 0.""" … … 766 795 # Try to detect file type by reading first block of datas 767 796 self.infile.seek(0) 768 firstblock = self.infile.read( KILOBYTE)797 firstblock = self.infile.read(4 * KILOBYTE) 769 798 self.infile.seek(0) 770 799 if self.isPostScript(firstblock) : … … 774 803 elif self.isPDF(firstblock) : 775 804 return PDFAnalyzer 805 elif self.isPCL3GUI(firstblock) : 806 return PCL3GUIAnalyzer 776 807 elif self.isPCL(firstblock) : 777 808 return PCLAnalyzer -
pykota/trunk/pykota/version.py
r1692 r1699 22 22 # 23 23 24 __version__ = "1.20alpha 6_unofficial"24 __version__ = "1.20alpha7_unofficial" 25 25 26 26 __doc__ = """PyKota : a complete Printing Quota Solution for CUPS and LPRng."""