Guido van Rossum | b9973d9 | 1997-12-24 18:31:53 +0000 | [diff] [blame] | 1 | #! /usr/bin/env python |
| 2 | |
| 3 | """Dumb script to edit a particular line in the PostScript. |
| 4 | |
| 5 | This makes it possible to print on A4 paper. |
| 6 | """ |
| 7 | |
| 8 | f = open("ref.ps", "r") |
| 9 | |
| 10 | lines = f.readlines() |
| 11 | f.close() |
| 12 | didit = 0 |
| 13 | |
| 14 | for i in range(100): |
| 15 | if lines[i] == '/FMAllowPaperSizeMismatch false def\n': |
| 16 | lines[i] = '/FMAllowPaperSizeMismatch true def\n' |
| 17 | didit = 1 |
| 18 | break |
| 19 | |
| 20 | if not didit: |
| 21 | print "ref.ps not changed" |
| 22 | else: |
| 23 | print "rewriting edited ref.ps" |
| 24 | f = open("ref.ps", "w") |
| 25 | f.writelines(lines) |
| 26 | f.close() |