Changeset 3502
- Timestamp:
- 07/18/09 09:35:07 (15 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/plain.py
r3474 r3502 57 57 linecount = 0 58 58 for line in self.infile : 59 if line.endswith("\n") : 60 linecount += 1 61 if (linecount > pagesize) : 62 pagecount += 1 59 linecount += 1 60 if (linecount > pagesize) : 61 pagecount += 1 62 linecount = 0 63 else : 64 cnt = line.count("\f") 65 if cnt : 66 pagecount += cnt 63 67 linecount = 0 64 else : 65 cnt = line.count("\f") 66 if cnt : 67 pagecount += cnt 68 linecount = 0 69 else : 70 raise pdlparser.PDLParserError, "Unsupported file format. Please send the file to %s" % version.__authoremail__ 68 71 69 return pagecount + 1 # NB : empty files are catched in isValid()