Changeset 553 for pkpgcounter
- Timestamp:
- 12/09/07 14:57:41 (17 years ago)
- Location:
- pkpgcounter/trunk/pkpgpdls
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/bj.py
r552 r553 23 23 """This modules implements a page counter for Canon BJ documents.""" 24 24 25 import sys26 25 import os 27 26 import mmap 28 from struct import unpack29 27 30 28 import pdlparser -
pkpgcounter/trunk/pkpgpdls/pnmascii.py
r551 r553 30 30 openmode = "rU" 31 31 def isValid(self) : 32 """Returns True if data is plain text, else False. 33 34 It's hard to detect a plain text file, so we just try to 35 extract lines from the first block (sufficiently large). 36 If it's impossible to find one we consider it's not plain text. 37 """ 38 if (self.firstblock.split()[0] in ("P1", "P2", "P3")) : 32 """Returns True if data is ASCII PNM, else False.""" 33 if self.firstblock.split()[0] in ("P1", "P2", "P3") : 39 34 self.logdebug("DEBUG: Input file seems to be in the PNM (ascii) format.") 40 35 self.marker = self.firstblock[:2] … … 54 49 # Special case of cmyk map 55 50 divby = 4 51 # Unfortunately any whitespace is valid, 52 # so we do it the slow way... 56 53 pagecount += line.split().count(marker) 57 54