Show
Ignore:
Timestamp:
11/21/07 16:41:06 (16 years ago)
Author:
jerome
Message:

Re-optimize disk access by not reopening and re-reading first and last block
more than once.

Files:
1 modified

Legend:

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

    r491 r493  
    100100        self.escapedStuff = {}   # For escaped datas, mostly PJL commands 
    101101        self.bigEndian() 
    102          
     102        codesop = chr(0x06) + chr(0x00) + chr(0x00) + chr(0x80) + chr(0x13) + chr(0x40) 
    103103        self.isbitmap = False 
    104104        pos = 0 
     
    114114                        offset = unpack(self.unpackLong, minfile[pos:pos+4])[0] 
    115115                        sequencenum = unpack(self.unpackShort, minfile[pos+4:pos+6])[0] 
    116                         codesop = " ".join([ "%02x" % ord(v) for v in minfile[pos+6:pos+12]]) 
    117                         if codesop != "06 00 00 80 13 40" : 
     116                        if minfile[pos+6:pos+12] != codesop : 
    118117                            raise pdlparser.PDLParserError, "Unfortunately SPL1 is incompletely recognized. Parsing aborted. Please report the problem to %s" % version.__authoremail__ 
    119118                        if not sequencenum :