Changeset 448
- Timestamp:
- 02/04/07 15:38:39 (18 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
pkpgcounter/trunk/pkpgpdls/postscript.py
r447 r448 171 171 if number > self.pages[pagecount]["copies"] : 172 172 self.pages[pagecount]["copies"] = number 173 elif line.startswith(r"%RBINumCopies: ") : 174 try : 175 number = int(line.strip().split()[1]) 176 except : 177 pass 178 else : 179 if number > self.pages[pagecount]["copies"] : 180 self.pages[pagecount]["copies"] = number 173 181 previousline = line 174 182 … … 178 186 179 187 # now apply the number of copies to each page 188 if not pagecount and pagescomment : 189 pagecount = pagescomment 180 190 for pnum in range(1, pagecount + 1) : 181 page = self.pages.get(pnum, self.pages.get(1, { "copies" : 1 }))191 page = self.pages.get(pnum, self.pages.get(1, self.pages.get(0, { "copies" : 1 }))) 182 192 copies = page["copies"] 183 193 pagecount += (copies - 1) 184 194 self.logdebug("%s * page #%s" % (copies, pnum)) 185 195 186 if not pagecount and pagescomment :187 pagecount = pagescomment188 196 self.logdebug("Internal parser said : %s pages" % pagecount) 189 197 return (pagecount, notrust)