classification
Title: IDLE to support reindent.py
Type: enhancement Stage: commit review
Components: IDLE Versions: Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: ned.deily Nosy List: asvetlov, eric.araujo, gpolo, kbk, ned.deily, rhettinger, roger.serwy, terry.reedy
Priority: normal Keywords:

Created on 2009-02-04 08:37 by rhettinger, last changed 2012-03-25 21:32 by asvetlov.

Files
File name Uploaded Description Edit
RstripExtension.py roger.serwy, 2009-05-29 00:05 rstrip extension
ReindentExtension.py roger.serwy, 2010-10-15 23:28 reindent.py extension
Messages (10)
msg81131 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-02-04 08:37
Add rstrip() to the Format menu.

Python's svn repository no longer accepts files with trailing whitespace
and it is often necessary to run reindent.py before submitting.  It
would be nice to have this as a built-in formatting tool.
msg81301 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-02-06 21:50
If the interactive interpreter did not require blank lines within blocks
to have at least one 'trailing' space to avoid prematurely ending the
block (as when copy from editor window and paste), IDLE could
automatically rstrip lines.  Given that that should not be done, a menu
item would be nice.
msg88490 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2009-05-29 00:05
Here's an extension that adds rstrip() to the Format menu.
msg88492 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-05-29 01:23
Applied in r72999.  Will backport to 2.7.
msg88495 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2009-05-29 01:52
Backported in r73001
msg91528 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-13 18:07
This has been closed but why not promote reindent.py to a module and add
an option on IDLE to allow a complete reindent.py run ?
msg118808 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-10-15 17:30
reindent.py is very much a script: It lacks a nice, full programmatic API, I mean standalone functions to check a file object or a filename and functions implementing the command-line interface.  As it is now, you see for example print calls in the middle of functions, so it’s not usable as a module.

Maybe bring this to python-dev or -ideas?
msg118809 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-10-15 17:39
There's no need to go to python-dev or python-ideas with this one.  If someone wants to figure-out a way to add reindent functionality to IDLE, patches are welcome.
msg118847 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2010-10-15 23:28
I grabbed the core of reindent.py and put it into an extension, unmodified. 

The original reindent.py will emit Indentation Errors if they exist. 
ScriptBinding already has nice code to handle these problems by highlighting the error, placing the cursor at the error, and presenting a message box. Rather than duplicate this code, this extension makes calls into ScriptBinding to check for syntax errors when the core reindent code throws exceptions.
msg122083 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2010-11-22 03:27
Opened back up for the new patch (posted after the previous close).
History
Date User Action Args
2012-03-25 21:32:41asvetlovsetnosy: + asvetlov
2010-11-29 01:52:07rhettingersetassignee: rhettinger -> ned.deily

nosy: + ned.deily
2010-11-26 22:48:30terry.reedysetstage: committed/rejected -> commit review
resolution: fixed ->
versions: + Python 3.2, - Python 3.1, Python 2.7
2010-11-22 03:27:56rhettingersetstatus: closed -> open

messages: + msg122083
2010-10-15 23:28:11roger.serwysetfiles: + ReindentExtension.py

messages: + msg118847
2010-10-15 17:39:55rhettingersetmessages: + msg118809
2010-10-15 17:30:56eric.araujosetmessages: + msg118808
2010-07-10 19:38:36eric.araujosetnosy: + eric.araujo

resolution: accepted -> fixed
stage: needs patch -> committed/rejected
2009-08-13 18:07:28gpolosetmessages: + msg91528
2009-05-29 01:52:33rhettingersetstatus: open -> closed

messages: + msg88495
2009-05-29 01:23:16rhettingersetassignee: kbk -> rhettinger
resolution: accepted
messages: + msg88492
2009-05-29 00:05:15roger.serwysetfiles: + RstripExtension.py
nosy: + roger.serwy
messages: + msg88490

2009-04-26 22:18:25ajaksu2setnosy: + gpolo

stage: needs patch
2009-02-06 21:50:38terry.reedysetnosy: + terry.reedy
messages: + msg81301
2009-02-04 08:37:42rhettingercreate