[Pythonmac-SIG] revised printing patch

Joseph J. Strout joe@strout.net
Thu, 30 Sep 1999 09:40:23 -0700


I've updated the printing patch.  Changes today:

- Line numbers now start at 1 rather than 0, as Richard suggested.

- We now indent 1/4 inch from the top, and 1/8 inch from the left, to 
keep lines from being cut off by the printer.

- We now find the proper line spacing from the font metrics, rather 
than just guessing based on the nominal font size.

- The patch is now broken into two files, PrintingPatch.py and 
PatchUtils.py.  The latter contains code which may be used on other 
patches.

- The patch is now a little smarter; after using this new version 
once, you can use it again and it will recognize the need to undo 
previous patching.  But please note!  You will have to manually undo 
yesterday's patch the first time.  Here's the procedure:

1. Open up Python 1.5.2c1:Mac:Tools:IDE.

2. Delete PyEdit.py and PythonIDEMain.py.

3a. Rename PyEdit.py.bak to PyEdit.py.
3b. Rename PythonIDEMAin.py.bak to PythonIDEMain.py.

That's it, you're back to the original state (whew!), and can go 
ahead and apply the new patch.  Hereafter, you can skip these steps, 
as they will be done for you.

Things still less-than-ideal about the printing support:

- The page is always assumed to be 10 inches long.  This will 
probably cause grief when printing in landscape mode, or scaled, or 
whatever.  I don't know how to get the page size from the print 
record (any ideas?).

- Hmm... well, actually that's pretty much it.

If you have any trouble, please let me know right away; don't waste 
too much time wrestling with it, because it ought to be a very quick 
& painless operation.  If it's not, something is wrong and I want to 
know about it!

Cheers,
-- Joe
,------------------------------------------------------------------.
|    Joseph J. Strout           Biocomputing -- The Salk Institute |
|    joe@strout.net             http://www.strout.net              |
`------------------------------------------------------------------'