83 | | if line.startswith(r"%%Page: ") : |
84 | | pagecount += 1 |
85 | | pages[pagecount] = { "copies" : pages[pagecount-1]["copies"] } |
86 | | elif line.startswith(r"(%%[Page: ") : |
87 | | pagecount += 1 |
88 | | pages[pagecount] = { "copies" : pages[pagecount-1]["copies"] } |
| 84 | if line.startswith(r"%%Page: ") or line.startswith(r"(%%[Page: ") : |
| 85 | proceed = 1 |
| 86 | try : |
| 87 | newpagenum = int(line.split(']')[0].split()[1]) |
| 88 | except : |
| 89 | pass |
| 90 | else : |
| 91 | if newpagenum == oldpagenum : |
| 92 | proceed = 0 |
| 93 | else : |
| 94 | oldpagenum = newpagenum |
| 95 | if proceed : |
| 96 | pagecount += 1 |
| 97 | pages[pagecount] = { "copies" : pages[pagecount-1]["copies"] } |