Changeset 553 for pkpgcounter/trunk/pkpgpdls/pnmascii.py
- Timestamp:
- 12/09/07 14:57:41 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
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