Show
Ignore:
Timestamp:
02/08/06 09:31:42 (18 years ago)
Author:
jerome
Message:

1.76 is out.

Files:
1 modified

Legend:

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

    r313 r314  
    329329        """Handles the ESC code.""" 
    330330        pos = endpos = self.pos 
    331         if self.minfile[pos : pos+8] == r"%-12345X" : 
     331        minfile = self.minfile 
     332        if minfile[pos : pos+8] == r"%-12345X" : 
    332333            endpos = pos + 9 
    333334            endmark = chr(0x0c) + chr(0x00) + chr(0x1b) 
    334335            asciilimit = chr(0x80) 
    335336            quotes = 0 
    336             while (self.minfile[endpos] not in endmark) and \ 
    337                    ((self.minfile[endpos] < asciilimit) or (quotes % 2)) : 
    338                 if self.minfile[endpos] == '"' : 
     337            while (minfile[endpos] not in endmark) and \ 
     338                   ((minfile[endpos] < asciilimit) or (quotes % 2)) : 
     339                if minfile[endpos] == '"' : 
    339340                    quotes += 1 
    340341                endpos += 1 
     
    343344            # NB : First time will be at page 0 (i.e. **before** page 1) ! 
    344345            stuff = self.escapedStuff.setdefault(self.pagecount, []) 
    345             stuff.append(self.minfile[pos : endpos]) 
    346             self.logdebug("Escaped datas : [%s]" % repr(self.minfile[pos : endpos])) 
     346            stuff.append(minfile[pos : endpos]) 
     347            self.logdebug("Escaped datas : [%s]" % repr(minfile[pos : endpos])) 
    347348        return endpos - pos 
    348349         
    349350    def skipKyoceraPrescribe(self) :     
    350351        """Skips Kyocera Prescribe commands.""" 
     352        pos = self.pos - 1 
    351353        minfile = self.minfile 
    352         pos = self.pos - 1 
    353354        if minfile[pos:pos+3] == "!R!" : 
    354355            while (pos - self.pos) < 1024 :   # This is a realistic upper bound, to avoid infinite loops 
    355356                if (minfile[pos] == ";") and (minfile[pos-4:pos] == "EXIT") : 
    356                     return (pos + 1 - self.pos) 
     357                    pos += 1 
     358                    prescribe = self.prescribeStuff.setdefault(self.pagecount, []) 
     359                    prescribe.append(minfile[self.pos-1:pos]) 
     360                    self.logdebug("Prescribe commands : [%s]" % repr(minfile[self.pos-1:pos])) 
     361                    return (pos - self.pos) 
    357362                pos += 1     
    358363        else : 
     
    567572        tags = self.tags 
    568573        self.pagecount = 0 
    569         self.escapedStuff = {} 
     574        self.escapedStuff = {}   # For escaped datas, mostly PJL commands 
     575        self.prescribeStuff = {} # For Kyocera Prescribe commands 
    570576        self.pos = pos = oldpos = 0 
    571577        try :