[Pythonmac-SIG] RE: IDE class/method popup?

Oliver Steele steele@cs.brandeis.edu
Fri, 8 Oct 1999 16:06:03 -0400


Pieter Claerhout:
>I just had the same problem this week, and check
>if you use spaces instead of tabs for indentation.

Jim Harrison:
>That did it, thanks (version 1.5.2c1). This will make editing Linux
>python scripts interesting.

Joe Strout:
> You know, this issue has come up before.  It occurs to me that the
> IDE has a "scripts" menu in which you can place any Python script you
> want to be easily accessible.  Couldn't you write "Tabify" and
> "Detabify" scripts, and place them in this menu?  They'd be designed
> to act on the frontmost window (if you need help getting a reference
> this window or its data, I can probably help).  So when you suck your
> space-indented file down, you'd just "Tabify" it, and when you're
> ready to upload to Linux, you'd "Detabify" it (if you really feel the
> need -- personally, I just leave the tabs in).

<http://www.cs.brandeis.edu/~steele/sources/python.html> has a IDE patch
called PyIDESpacesToTabsPatch.py:  "make the IDE change spaces to tabs when
it opens a file, and back to spaces when it writes it out".  There are
installation instructions at the top of the file.

I've been using this with earlier versions of MacPython 1.5.2bx, to view and
edit files from linux and the rest of the world.  I haven't yet tested it
with 1.5.2c1, or updated it to use Joe Strout's patch excellent mechanism.
It assumes 4 spaces per tab stop.