Changeset 2012
- Timestamp:
- 01/07/05 16:53:58 (20 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pykota/trunk/pykota/pdlanalyzer.py
r2003 r2012 22 22 # 23 23 # $Log$ 24 # Revision 1.50 2005/01/07 15:53:58 jalet 25 # Another fix for PCL3/4/5 26 # 24 27 # Revision 1.49 2005/01/06 17:41:34 jalet 25 28 # Of course if I forget some files during the commits, the software doesn't … … 423 426 "*g" : "W", 424 427 "*r" : "sbABC", 428 "*t" : "R", 425 429 # "*b" : "VW", # treated specially because it occurs very often 426 430 } 427 431 pagecount = resets = ejects = backsides = startgfx = endgfx = 0 428 starb = ampl = ispcl3 = 0 432 starb = ampl = ispcl3 = escstart = 0 433 mediasourcecount = mediasizecount = orientationcount = mediatypecount = 0 429 434 tag = None 430 435 pages = {} … … 460 465 # <ESC>&l###O -> orientation 461 466 # <ESC>&l###M -> mediatype 467 # <ESC>*t###R -> gfx resolution 462 468 # 463 469 tagstart = minfile[pos] ; pos += 1 … … 491 497 elif char == "H" : 492 498 self.setPageDict(pages, pagecount, "mediasource", self.mediasources.get(size, str(size))) 499 mediasourcecount += 1 493 500 ejects += 1 494 501 elif char == "A" : 495 502 self.setPageDict(pages, pagecount, "mediasize", self.mediasizes.get(size, str(size))) 503 mediasizecount += 1 496 504 elif char == "O" : 497 505 self.setPageDict(pages, pagecount, "orientation", self.orientations.get(size, str(size))) 506 orientationcount += 1 498 507 elif char == "M" : 499 508 self.setPageDict(pages, pagecount, "mediatype", self.mediatypes.get(size, str(size))) 509 mediatypecount += 1 500 510 elif tag == "*r" : 501 511 # Special tests for PCL3 … … 509 519 startgfx += (char == "A") and (minfile[pos - 2] in ("0", "1", "2", "3")) # Start Gfx 510 520 endgfx += (not size) and (char in ("C", "B")) # End Gfx 521 elif tag == "*t" : 522 escstart += 1 511 523 elif (tag == "&a") and (size == 2) : 512 524 backsides += 1 # Back side in duplex mode … … 548 560 if char == "h" : 549 561 self.setPageDict(pages, pagecount, "mediasource", self.mediasources.get(size, str(size))) 562 mediasourcecount += 1 550 563 elif char == "a" : 551 564 self.setPageDict(pages, pagecount, "mediasize", self.mediasizes.get(size, str(size))) 565 mediasizecount += 1 552 566 elif char == "o" : 553 567 self.setPageDict(pages, pagecount, "orientation", self.orientations.get(size, str(size))) 568 orientationcount += 1 554 569 elif char == "m" : 555 570 self.setPageDict(pages, pagecount, "mediatype", self.mediatypes.get(size, str(size))) 571 mediatypecount += 1 556 572 except IndexError : # EOF ? 557 573 minfile.close() # reached EOF … … 574 590 sys.stderr.write("startgfx : %s\n" % startgfx) 575 591 sys.stderr.write("endgfx : %s\n" % endgfx) 592 sys.stderr.write("mediasourcecount : %s\n" % mediasourcecount) 593 sys.stderr.write("mediasizecount : %s\n" % mediasizecount) 594 sys.stderr.write("orientationcount : %s\n" % orientationcount) 595 sys.stderr.write("mediatypecount : %s\n" % mediatypecount) 596 sys.stderr.write("escstart : %s\n" % escstart) 576 597 577 598 # if not pagecount : … … 599 620 600 621 601 if (not startgfx) and (not endgfx) : 622 if pagecount == mediasourcecount == escstart : 623 pass # should be OK. 624 elif (not startgfx) and (not endgfx) : 602 625 pagecount = ejects or pagecount 603 626 elif startgfx == endgfx :