Changeset 475 for pkpgcounter

Show
Ignore:
Timestamp:
09/21/07 00:14:48 (17 years ago)
Author:
jerome
Message:

Removed debugging messages.

Files:
1 modified

Legend:

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

    r474 r475  
    3232 
    3333class Parser(pdlparser.PDLParser) : 
    34     """A parser for ESC/PAGES03 documents.""" 
     34    """A parser for ESC/PageS03 documents.""" 
    3535    def isValid(self) :         
    3636        """Returns True if data is TIFF, else False.""" 
    3737        if self.firstblock.startswith("\033\1@EJL") and \ 
    3838            (self.firstblock.find("=ESC/PAGES03\n") != -1) : 
    39             self.logdebug("DEBUG: Input file is in the ESC/PAGES03 format.") 
     39            self.logdebug("DEBUG: Input file is in the ESC/PageS03 format.") 
    4040            return True 
    4141        else :     
     
    4343     
    4444    def getJobSize(self) : 
    45         """Counts pages in an ESC/PAGES03 document. 
     45        """Counts pages in an ESC/PageS03 document. 
    4646         
    4747           Algorithm by Jerome Alet. 
     
    5555        startsequence = chr(0x1d) 
    5656        if startpos == -1 : 
    57             raise pdlparser.PDLParserError, "Invalid ESC/PAGES03 file." 
     57            raise pdlparser.PDLParserError, "Invalid ESC/PageS03 file." 
    5858        startpos += len(marker) 
    5959        if minfile[startpos] != startsequence : 
    60             raise pdlparser.PDLParserError, "Invalid ESC/PAGES03 file." 
     60            raise pdlparser.PDLParserError, "Invalid ESC/PageS03 file." 
    6161        endsequence = "eps{I" 
    6262        lgendsequence = len(endsequence) 
     
    6565                while True : 
    6666                    if minfile[startpos] == startsequence : 
    67                         #self.logdebug("Start sequence at %08x" % startpos) 
    6867                        skiplen = 0 
    6968                        while True : 
     
    7170                            c = minfile[startpos] 
    7271                            if not c.isdigit() : 
    73                                 #self.logdebug("stop on %02x at %08x" % (ord(c), startpos)) 
    7472                                break 
    7573                            else : 
    7674                                skiplen = (skiplen * 10) + int(c) 
    7775                        if minfile[startpos:startpos+lgendsequence] == endsequence : 
    78                             #self.logdebug("skipped %i bytes at %08x until %08x" % (skiplen, startpos, startpos+skiplen+lgendsequence)) 
    79                             startpos += skiplen + lgendsequence 
    80                         else :     
    81                             #self.logdebug("Problem at %08x" % startpos) 
    82                             pass 
     76                            startpos += (skiplen + lgendsequence) 
    8377                    else : 
    8478                        if minfile[startpos:startpos+6] == "\033\1@EJL" : 
    85                             # self.logdebug("EJL found at %08x" % startpos) 
     79                            # Probably near the end of the file. 
     80                            # Test suite was too small to be sure. 
    8681                            ejlparser = pjl.EJLParser(minfile[startpos:]) 
    8782                            pagecount = ejlparser.environment_variables.get("PAGES", "1") 
     
    9085                            pagecount = int(pagecount)     
    9186                            if pagecount <= 0 : 
    92                                 pagecount = 1 # TODO : 1000000 ;-) 
     87                                pagecount = 1 # TODO : 0 or 1000000 ??? ;-) 
    9388                            break 
    94                         else :     
    95                             #self.logdebug("Skipped byte at %08x" % startpos) 
    96                             pass 
    9789                        startpos += 1     
    9890            except IndexError :