Changeset 299
- Timestamp:
- 12/07/05 15:43:44 (19 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/pclxl.py
r298 r299 97 97 mediasizelabel = "Default" 98 98 orientationlabel = "Portrait" 99 duplexmode = None 99 100 100 101 # Now go upstream to decode media type, size, source, and orientation … … 140 141 break 141 142 mediatypelabel = minfile[startpos:startpos+size] 143 elif val == 0x34 : 144 duplexmode = "Simplex" 145 pos = pos - 2 146 elif val in (0x35, 0x36) : 147 duplexmode = "Duplex" 148 pos = pos - 2 142 149 # else : TODO : CUSTOM MEDIA SIZE AND UNIT ! 143 150 else : … … 148 155 "mediasize" : mediasizelabel, 149 156 "mediasource" : mediasourcelabel, 157 "duplex" : duplexmode, 150 158 } 151 159 return 0 … … 495 503 "mediasize" : "Default", 496 504 "mediasource" : "Default", 505 "duplex" : None, 497 506 } 498 507 } … … 535 544 # but the formula below is still correct : we want 536 545 # to decrease the total number of pages in this case. 537 page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1, "mediasize" : "Default" }))546 page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1, "mediasize" : "Default", "duplex" : None })) 538 547 pjlstuff = self.escapedStuff.get(pnum, self.escapedStuff.get(0, [])) 539 548 if pjlstuff : … … 556 565 else : 557 566 pjlcopies = oldpjlcopies 558 defaultdm = pjlparser.default_variables.get("DUPLEX", "") 559 if defaultdm : 560 if defaultdm.upper() == "ON" : 561 defaultduplexmode = "Duplex" 562 else : 563 defaultduplexmode = "Simplex" 564 envdm = pjlparser.environment_variables.get("DUPLEX", "") 565 if envdm : 566 if envdm.upper() == "ON" : 567 duplexmode = "Duplex" 568 else : 569 duplexmode = "Simplex" 570 else : 571 if not oldduplexmode : 572 duplexmode = defaultduplexmode 573 else : 574 duplexmode = oldduplexmode 567 if page["duplex"] : 568 duplexmode = page["duplex"] 569 else : 570 defaultdm = pjlparser.default_variables.get("DUPLEX", "") 571 if defaultdm : 572 if defaultdm.upper() == "ON" : 573 defaultduplexmode = "Duplex" 574 else : 575 defaultduplexmode = "Simplex" 576 envdm = pjlparser.environment_variables.get("DUPLEX", "") 577 if envdm : 578 if envdm.upper() == "ON" : 579 duplexmode = "Duplex" 580 else : 581 duplexmode = "Simplex" 582 else : 583 if not oldduplexmode : 584 duplexmode = defaultduplexmode 585 else : 586 duplexmode = oldduplexmode 575 587 defaultps = pjlparser.default_variables.get("PAPER", "") 576 588 if defaultps :