Changeset 314 for pkpgcounter/trunk
- Timestamp:
- 02/08/06 09:31:42 (19 years ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 5 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/man/pkpgcounter.1
r303 r314 1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.3 5.2 .TH PKPGCOUNTER "1" " January 2006" "C@LL - Conseil Internet & Logiciels Libres" "User Commands"1 .\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.36. 2 .TH PKPGCOUNTER "1" "February 2006" "C@LL - Conseil Internet & Logiciels Libres" "User Commands" 3 3 .SH NAME 4 pkpgcounter \- manual page for pkpgcounter 1.7 44 pkpgcounter \- manual page for pkpgcounter 1.76 5 5 .SH DESCRIPTION 6 pkpgcounter v1.7 4(c) 2003, 2004, 2005, 2006 Jerome Alet6 pkpgcounter v1.76 (c) 2003, 2004, 2005, 2006 Jerome Alet 7 7 .PP 8 8 pkpgcounter is a generic Page Description Language parser. -
pkpgcounter/trunk/NEWS
r305 r314 22 22 pkpgcounter News : 23 23 24 * 1.76 : 25 26 - Improved the PCLXL parser wrt undocumented tags. 27 28 - Preliminary support for Kyocera Prescribe commands. 29 24 30 * 1.75 : 25 31 -
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 : -
pkpgcounter/trunk/pkpgpdls/postscript.py
r308 r314 85 85 previousline = "" 86 86 notrust = 0 87 kpdl = 0 # Kyocera Mita87 prescribe = 0 # Kyocera's Prescribe commands 88 88 for line in self.infile.xreadlines() : 89 if (not kpdl) and line.startswith(r"%%BeginResource: procset pdf") :89 if (not prescribe) and line.startswith(r"%%BeginResource: procset pdf") : 90 90 notrust = 1 # Let this stuff be managed by GhostScript, but we still extract number of copies 91 elif line.startswith(" /KPDLBASE") :92 kpdl= 191 elif line.startswith("!R!") : 92 prescribe = 1 93 93 elif line.startswith(r"%%Page: ") or line.startswith(r"(%%[Page: ") : 94 94 proceed = 1 -
pkpgcounter/trunk/pkpgpdls/version.py
r307 r314 20 20 # 21 21 22 __version__ = "1.76 beta"22 __version__ = "1.76" 23 23 24 24 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""