Changeset 258
- Timestamp:
- 09/07/05 20:30:56 (19 years ago)
- Location:
- pkpgcounter/trunk
- Files:
-
- 4 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/NEWS
r256 r258 22 22 pkpgcounter News : 23 23 24 * 1.66 : 25 26 - Improved PCLXL parser. 27 28 - Improved PCL3/4/5 parser. 29 24 30 * 1.65 : 25 31 -
pkpgcounter/trunk/pkpgpdls/pcl345.py
r256 r258 309 309 sys.stderr.write("escstart : %s\n" % escstart) 310 310 311 # if not pagecount :312 # pagecount = (pagecount or ((resets - 3) * (resets > 2)))313 # else :314 # # here we add counters for other ways new pages may have315 # # been printed and ejected by the printer316 # pagecount += ejects + backsides317 #318 # # now handle number of copies for each page (may differ).319 # # in duplex mode, number of copies may be sent only once.320 # for pnum in range(pagecount) :321 # # if no number of copies defined, take the preceding one else the one set before any page else 1.322 # page = pages.get(pnum, pages.get(pnum - 1, pages.get(0, { "copies" : 1 })))323 # pagecount += (page["copies"] - 1)324 #325 # # in PCL3 files, there's one Start Gfx tag per page326 # if ispcl3 :327 # if endgfx == int(startgfx / 2) : # special case for cdj1600328 # pagecount = endgfx329 # elif startgfx :330 # pagecount = startgfx331 # elif endgfx :332 # pagecount = endgfx333 334 335 311 if resets == ejects == mediasourcecount == mediasizecount == escstart == 1 : 336 312 pagecount = orientationcount … … 342 318 pass 343 319 elif (not startgfx) and (not endgfx) : 344 if ejects : 345 pagecount = ejects 320 pass 346 321 elif (resets == 2) and (startgfx == endgfx) and (mediasourcecount == 1) : 347 322 pass -
pkpgcounter/trunk/pkpgpdls/pclxl.py
r253 r258 148 148 # From what I read in PCLXL documentation, the number 149 149 # of copies is an unsigned 16 bits integer 150 self.pages[self.pagecount]["copies"] = unpack(self.endianness + "H", minfile[pos-5:pos3])[0] 150 try : 151 self.pages[self.pagecount]["copies"] = unpack(self.endianness + "H", minfile[pos-5:pos3])[0] 152 except KeyError : 153 self.logdebug("It looks like this PCLXL file is corrupted.") 151 154 return 0 152 155 … … 461 464 462 465 infileno = self.infile.fileno() 463 self.pages = {} 466 self.pages = { 0 : { "copies" : 1, 467 "orientation" : "Default", 468 "mediatype" : "Plain", 469 "mediasize" : "Default", 470 "mediasource" : "Default", 471 } 472 } 464 473 self.minfile = minfile = mmap.mmap(infileno, os.fstat(infileno)[6], prot=mmap.PROT_READ, flags=mmap.MAP_SHARED) 465 474 tags = self.tags -
pkpgcounter/trunk/pkpgpdls/version.py
r256 r258 20 20 # 21 21 22 __version__ = "1.6 5"22 __version__ = "1.66" 23 23 24 24 __doc__ = """pkpgcounter : a generic Page Description Languages parser."""