Changeset 484 for pkpgcounter/trunk/pkpgpdls
- Timestamp:
- 11/17/07 00:55:12 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/lidil.py
r483 r484 21 21 # 22 22 23 """This modules implements a page counter for HP LIDIL format.""" 23 """This modules implements a page counter for HP LIDIL format. 24 25 Documentation used : 26 27 hplip-2.7.10/prnt/ldl.py 28 hplip-2.7.10/prnt/hpijs/ldlencap.h 29 """ 24 30 25 31 import sys … … 34 40 def isValid(self) : 35 41 """Returns True if data is LIDIL, else False.""" 36 37 38 39 40 41 42 42 # Beginning Of File marker is a Sync packet, followed with 43 # a Sync Complete packet followed with a Reset packet. 44 # We just look at the start of the Sync packet for simplicity's sake. 45 BOFMarker = "$\x01\x00\x00\x07" 46 # End Of File marker is a Sync Complete packet followed 47 # with a Reset packet. We ignore the preceding Sync packet 48 # for simplicity's sake. 43 49 EOFMarker = "$\x00\x10\x00\x08\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$$\x00\x10\x00\x06\x00\x00\x00\x00\x00\xff\xff\xff\xff\xff$" 44 50 if self.firstblock.startswith(BOFMarker) \ 45 51 and self.lastblock.endswith(EOFMarker) : 46 52 self.logdebug("DEBUG: Input file is in the Hewlett-Packard LIDIL format.") 47 53 return True … … 51 57 def getJobSize(self) : 52 58 """Computes the number of pages in a HP LIDIL document.""" 59 ejectpagemarker = "$\x00\x01\x00\x00\x02" # ensure it's a complete packet (ends with '$') 53 60 return 0 54 61