Changeset 314 for pkpgcounter/trunk/pkpgpdls/pclxl.py
- Timestamp:
- 02/08/06 09:31:42 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/pclxl.py
r313 r314 329 329 """Handles the ESC code.""" 330 330 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" : 332 333 endpos = pos + 9 333 334 endmark = chr(0x0c) + chr(0x00) + chr(0x1b) 334 335 asciilimit = chr(0x80) 335 336 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] == '"' : 339 340 quotes += 1 340 341 endpos += 1 … … 343 344 # NB : First time will be at page 0 (i.e. **before** page 1) ! 344 345 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])) 347 348 return endpos - pos 348 349 349 350 def skipKyoceraPrescribe(self) : 350 351 """Skips Kyocera Prescribe commands.""" 352 pos = self.pos - 1 351 353 minfile = self.minfile 352 pos = self.pos - 1353 354 if minfile[pos:pos+3] == "!R!" : 354 355 while (pos - self.pos) < 1024 : # This is a realistic upper bound, to avoid infinite loops 355 356 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) 357 362 pos += 1 358 363 else : … … 567 572 tags = self.tags 568 573 self.pagecount = 0 569 self.escapedStuff = {} 574 self.escapedStuff = {} # For escaped datas, mostly PJL commands 575 self.prescribeStuff = {} # For Kyocera Prescribe commands 570 576 self.pos = pos = oldpos = 0 571 577 try :