Show
Ignore:
Timestamp:
11/17/07 00:55:12 (17 years ago)
Author:
jerome
Message:

Added the eject page marker.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pkpgcounter/trunk/pkpgpdls/lidil.py

    r483 r484  
    2121# 
    2222 
    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""" 
    2430 
    2531import sys 
     
    3440    def isValid(self) :     
    3541        """Returns True if data is LIDIL, else False.""" 
    36         # Beginning Of File marker is a Sync packet, followed with 
    37         # a Sync Complete packet followed with a Reset packet. 
    38         # We just look at the start of the Sync packet for simplicity's sake. 
    39         BOFMarker = "$\x01\x00\x00\x07" 
    40         # End Of File marker is a Sync Complete packet followed 
    41         # with a Reset packet. We ignore the preceding Sync packet 
    42         # for simplicity's sake. 
     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. 
    4349        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$"  
    4450        if self.firstblock.startswith(BOFMarker) \ 
    45            and self.lastblock.endswith(EOFMarker) : 
     51           and self.lastblock.endswith(EOFMarker) : 
    4652            self.logdebug("DEBUG: Input file is in the Hewlett-Packard LIDIL format.") 
    4753            return True 
     
    5157    def getJobSize(self) : 
    5258        """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 '$') 
    5360        return 0 
    5461