From kbk@users.sourceforge.net Mon Dec 2 04:41:32 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 01 Dec 2002 20:41:32 -0800 Subject: [Idle-dev] CVS: idle Debugger.py,1.15,1.16 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv23940 Modified Files: Debugger.py Log Message: Fix beep. Then remove annoying beep, not needed with breakpoint highlighting. Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** Debugger.py 4 Nov 2002 23:39:45 -0000 1.15 --- Debugger.py 2 Dec 2002 04:41:29 -0000 1.16 *************** *** 125,129 **** if not self.vsource: self.__class__.vsource = BooleanVar(top) - ##self.vsource.set(1) self.bsource = Checkbutton(cframe, text="Source", command=self.show_source, variable=self.vsource) --- 125,128 ---- *************** *** 137,141 **** if not self.vglobals: self.__class__.vglobals = BooleanVar(top) - ##self.vglobals.set(1) self.bglobals = Checkbutton(cframe, text="Globals", command=self.show_globals, variable=self.vglobals) --- 136,139 ---- *************** *** 308,327 **** def set_breakpoint_here(self, filename, lineno): ! msg = self.idb.set_break(filename, lineno) ! if msg: ! text.bell() ! return def clear_breakpoint_here(self, filename, lineno): ! msg = self.idb.clear_break(filename, lineno) ! if msg: ! text.bell() ! return def clear_file_breaks(self, filename): ! msg = self.idb.clear_all_file_breaks(filename) ! if msg: ! text.bell() ! return def load_breakpoints(self): --- 306,316 ---- def set_breakpoint_here(self, filename, lineno): ! self.idb.set_break(filename, lineno) def clear_breakpoint_here(self, filename, lineno): ! self.idb.clear_break(filename, lineno) def clear_file_breaks(self, filename): ! self.idb.clear_all_file_breaks(filename) def load_breakpoints(self): *************** *** 469,476 **** l = Label(subframe, text=name) l.grid(row=row, column=0, sticky="nw") - ## l = Label(subframe, text=svalue, justify="l", wraplength=300) l = Entry(subframe, width=0, borderwidth=0) l.insert(0, svalue) - ## l["state"] = "disabled" l.grid(row=row, column=1, sticky="nw") row = row+1 --- 458,463 ---- From kbk@users.sourceforge.net Mon Dec 2 05:08:56 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 01 Dec 2002 21:08:56 -0800 Subject: [Idle-dev] CVS: idle StackViewer.py,1.6,1.7 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv641 Modified Files: StackViewer.py Log Message: Remove dead code in get_stack(). Modify get_stack() and get_exception to be StackTreeItem methods. SF Bug 610756. Neal Norwitz. Index: StackViewer.py =================================================================== RCS file: /cvsroot/idlefork/idle/StackViewer.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** StackViewer.py 18 Sep 2002 03:15:56 -0000 1.6 --- StackViewer.py 2 Dec 2002 05:08:54 -0000 1.7 *************** *** 20,25 **** def __init__(self, flist=None, tb=None): self.flist = flist ! self.stack = get_stack(tb) ! self.text = get_exception() def GetText(self): --- 20,46 ---- def __init__(self, flist=None, tb=None): self.flist = flist ! self.stack = self.get_stack(tb) ! self.text = self.get_exception() ! ! def get_stack(self, tb): ! if tb is None: ! tb = sys.last_traceback ! stack = [] ! if tb and tb.tb_frame is None: ! tb = tb.tb_next ! while tb is not None: ! stack.append((tb.tb_frame, tb.tb_lineno)) ! tb = tb.tb_next ! return stack ! ! def get_exception(self): ! type = sys.last_type ! value = sys.last_value ! if hasattr(type, "__name__"): ! type = type.__name__ ! s = str(type) ! if value is not None: ! s = s + ": " + str(value) ! return s def GetText(self): *************** *** 55,60 **** item = "%s.%s(...), line %d: %s" % (modname, funcname, lineno, sourceline) - ## if i == index: - ## item = "> " + item return item --- 76,79 ---- *************** *** 103,133 **** return sublist - def get_stack(t=None, f=None): - if t is None: - t = sys.last_traceback - stack = [] - if t and t.tb_frame is f: - t = t.tb_next - while f is not None: - stack.append((f, f.f_lineno)) - if f is self.botframe: - break - f = f.f_back - stack.reverse() - while t is not None: - stack.append((t.tb_frame, t.tb_lineno)) - t = t.tb_next - return stack - - def get_exception(type=None, value=None): - if type is None: - type = sys.last_type - value = sys.last_value - if hasattr(type, "__name__"): - type = type.__name__ - s = str(type) - if value is not None: - s = s + ": " + str(value) - return s def _test(): --- 122,125 ---- From noreply@sourceforge.net Mon Dec 2 05:10:03 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 01 Dec 2002 21:10:03 -0800 Subject: [Idle-dev] [ idlefork-Bugs-610756 ] Problem in StackViewer.get_stack() Message-ID: Bugs item #610756, was opened at 2002-09-17 15:08 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=610756&group_id=9579 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Neal Norwitz (nnorwitz) Assigned to: Kurt B. Kaiser (kbk) Summary: Problem in StackViewer.get_stack() Initial Comment: See http://python.org/sf/608595 in StackViewer.py get_stack() (line 114) there is a reference to an invalid variable (self). This entire while loop is not executed. Should the while loop be removed? ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2002-12-02 00:10 Message: Logged In: YES user_id=149084 StackViewer.py Rev 1.7 ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2002-09-17 16:24 Message: Logged In: YES user_id=149084 Defer until merge is completed. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=610756&group_id=9579 From kbk@shore.net Mon Dec 2 05:33:18 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 02 Dec 2002 00:33:18 -0500 Subject: [Idle-dev] cleanups References: <20021130193255.GE28552@epoch.metaslash.com> Message-ID: Neal Norwitz writes: > I've tried to make sure everything checked into python was also in > idlefork. I've also run pychecker which resulted in some additional > checkins. Thanks for the review and the updates! > There are still problems, though. The most serious ones are listed > below. > > There's lots of style issues that should be cleaned up. > Is there a preference who is to do this and when? Some examples would be helpful in answering this question. Since time is pressing and correcting issues of style can introduce bugs I'd rather defer this if possible. > I've noticed comments and commented out code which should probably > be removed. Clearly one doesn't want to remove comments which are part of the code documentation. Other comments by GvR and me pertain to design issues which need addressing and IMO should not be removed until that is done. As the issues are resolved, the comments are removed. There is some dead code which is commented out and could be removed. I can take a look at that. If I do something which I think might be controversial, I comment out the code and leave it there for a couple of weeks pending objections. If none are forthcoming, I delete it. Finally, there are some debugging prints in the RPC and debugger code which I would like to leave in for now. > Generally, what is the status of idlefork? Is it fairly stable? > Are there known major problems in particular areas? It is stable but still under development. The startup code could use work before Alpha, and once that is done the help message will need updating. My focus continues to be the debugger and rpc. Although most of the necessary functionality is implemented, here are some performance issues. I will take another look at the startup code if no one else has the time to do so. > Here are some problems: > > * ClassBrowser.py, PathBrowser.py, StackViewer.py cannot work > - ClassBrowser.main() & PathBrowser.main() both reference > PyShell.flist which does not exist PyShell.flist is a global which is set up when IDLE starts. ClassBrowser and PathBrowser .main() can be called from IDLE, but not from the Python command line. Both of these could probably be modified to start the same way as StackViewer.main(), which will run in IDLE or from the commmand line. When used in IDLE, all three appear to work correctly. This is not a priority for me, feel free to jump in there. These issues, and others you raise, predate IDLEfork and are also seen in Python IDLE, pretty much since the beginning. > - StackViewer.get_stack(), self does not exist, see bug 610756 Fixed this evening. > * Debugger.py, the local variable text does not exist in several > places. I believe the patch below fixes this, but I'm not sure. self.pyshell.text.bell(), actually. But once I fixed it I decided to remove it entirely, just an unnecessary annoyance. The breakpoint highlighting is all that is needed. KBK From kbk@shore.net Mon Dec 2 05:38:45 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 02 Dec 2002 00:38:45 -0500 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: <000c01c2987b$3f7d70a0$6801a8c0@hyperon> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> Message-ID: "Bruce Sherwood" writes: > Kurt, now that you're getting close to a release, I should raise a question > about a key binding on Windows that I've recently noticed. The standard > binding for "select all text" in most Windows applications is ctrl-A, but it > is alt-A at least in the old original idlefork. Seems like it ought to be > changed to ctrl-A. I will look at that. There is also a problem in Unix (i.e. emacs) bindings where alt-f2 is Zoom Window. But alt-function key in Gnu/Linux/X is used to change desktops. Anybody got any other keybinding issues? KBK From njriley@uiuc.edu Mon Dec 2 06:08:28 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 00:08:28 -0600 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> Message-ID: <20021202060828.GA2896196@uiuc.edu> On Mon, Dec 02, 2002 at 12:38:45AM -0500, Kurt B. Kaiser wrote: > "Bruce Sherwood" writes: > > > Kurt, now that you're getting close to a release, I should raise a question > > about a key binding on Windows that I've recently noticed. The standard > > binding for "select all text" in most Windows applications is ctrl-A, but it > > is alt-A at least in the old original idlefork. Seems like it ought to be > > changed to ctrl-A. > > I will look at that. There is also a problem in Unix (i.e. emacs) > bindings where alt-f2 is Zoom Window. But alt-function key in Gnu/Linux/X > is used to change desktops. > > Anybody got any other keybinding issues? Option (alt-) keystrokes are not normal on the Mac. Alt-F2 should be changed to command-/ (slash) which seems to be the de facto standard for window zooming. The other one I see is "Expand word"... not exactly a common command, and the only other example I can find is CodeWarrior, which uses control-. (period). -- =Nicholas Riley | Pablo Research Group, Department of Computer Science and Medical Scholars Program, University of Illinois at Urbana-Champaign From tony@lownds.com Mon Dec 2 07:00:32 2002 From: tony@lownds.com (Tony Lownds) Date: Sun, 1 Dec 2002 23:00:32 -0800 Subject: [Idle-dev] keybindings In-Reply-To: <20021202060828.GA2896196@uiuc.edu> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> Message-ID: > > I will look at that. There is also a problem in Unix (i.e. emacs) >> bindings where alt-f2 is Zoom Window. But alt-function key in Gnu/Linux/X >> is used to change desktops. >> >> Anybody got any other keybinding issues? > >Option (alt-) keystrokes are not normal on the Mac. Alt-F2 should be >changed to command-/ (slash) which seems to be the de facto standard >for window zooming. Hmm, I didn't find any apps that use command-/. Maybe the keystroke for zoom-window will change to work better with Linux/X. The Mac keystroke for zoom-window can be adjusted then, as needed. In any case, you can make your own personal changes quite easily, if Option-F2 just isn't memorable or convenient enough! > The other one I see is "Expand word"... not >exactly a common command, and the only other example I can find is >CodeWarrior, which uses control-. (period). Expand word is Option-/. We can eliminate the use of option here; Command-/ is more appropriate than Option-/. I'll change that. One other option keystroke is Option-q, bound to format-paragraph. Using option seems necessary, because Command-Q must be quit. I think the unusual use of option here is better than the alternative of an unusually platform-specific binding (Command-.). -Tony From njriley@uiuc.edu Mon Dec 2 14:34:31 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 08:34:31 -0600 Subject: [Idle-dev] Re: keybindings In-Reply-To: References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> Message-ID: <20021202143431.GB2954631@uiuc.edu> On Sun, Dec 01, 2002 at 11:00:32PM -0800, Tony Lownds wrote: > >Option (alt-) keystrokes are not normal on the Mac. Alt-F2 should be > >changed to command-/ (slash) which seems to be the de facto standard > >for window zooming. > > Hmm, I didn't find any apps that use command-/. Maybe the keystroke > for zoom-window will change to work better with Linux/X. The Mac > keystroke for zoom-window can be adjusted then, as needed. In any > case, you can make your own personal changes quite easily, if > Option-F2 just isn't memorable or convenient enough! Using function keys is especially bad on PowerBooks that don't have separate brightness/contrast/etc controls (everything but Wall Street/PDQ). A few monthe ago when I was looking at implementing this in my own software I did a survey of a bunch of Mac apps and command-/ came out as the consensus for "zoom window". Most apps have no shortcut at all - that's also a possibility for IDLE. > > The other one I see is "Expand word"... not > >exactly a common command, and the only other example I can find is > >CodeWarrior, which uses control-. (period). > > Expand word is Option-/. We can eliminate the use of option here; > Command-/ is more appropriate than Option-/. I'll change that. > > One other option keystroke is Option-q, bound to format-paragraph. > Using option seems necessary, because Command-Q must be quit. I think > the unusual use of option here is better than the alternative of an > unusually platform-specific binding (Command-.). People may want to enter non-ASCII characters, and usurping their ability to do so is not good. I didn't write Command-. (that's cancel) above, I said _control_-. above, which should be reasonably safe. Option-q is seemingly designed to be a facsimile of Emacs' M-q for the same operation. --Nicholas From guido@python.org Mon Dec 2 14:59:55 2002 From: guido@python.org (Guido van Rossum) Date: Mon, 02 Dec 2002 09:59:55 -0500 Subject: [Idle-dev] Re: keybindings In-Reply-To: Your message of "Mon, 02 Dec 2002 08:34:31 CST." <20021202143431.GB2954631@uiuc.edu> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> Message-ID: <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> > Using function keys is especially bad on PowerBooks that don't have > separate brightness/contrast/etc controls (everything but Wall > Street/PDQ). A few monthe ago when I was looking at implementing this > in my own software I did a survey of a bunch of Mac apps and command-/ > came out as the consensus for "zoom window". Most apps have no > shortcut at all - that's also a possibility for IDLE. Note though that Alt-F2 is not the normal zoom (which does whatever the window manager does by default). It is a special operation that keeps the width of the window default (normally 80 columns) but makes it maximal vertically. This is useful to get an overview of a larger piece of code. (I have no use for code wider than 80 columns. :-) --Guido van Rossum (home page: http://www.python.org/~guido/) From tony@lownds.com Mon Dec 2 16:57:17 2002 From: tony@lownds.com (Tony Lownds) Date: Mon, 2 Dec 2002 08:57:17 -0800 Subject: [Idle-dev] Re: [Pythonmac-SIG] readline In-Reply-To: <20021201025316.GB2879058@uiuc.edu> References: <20021201025316.GB2879058@uiuc.edu> Message-ID: --============_-1173274252==_============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Hi Nicholas, At 8:53 PM -0600 11/30/02, Nicholas Riley wrote to Pythonmac-SIG: >The idlefork (www.sourceforge.net/projects/idlefork) version of IDLE >works fine under a framework build of Python 2.2.2, barring a couple >of cosmetic issues. Apply the attached patch to the latest CVS >version of idlefork (fixes it to use pythonw and move the line/column >numbers over to make room for the size box) and you should be all set. >The changes aren't at all cleanly done but they work for me. I'm taking a look now to update idlefork - thanks for posting this! The only change where I noticed a cosmetic glitch showing up was the addition of padx=14 on the status bar. A fix *is* needed on Mac OS X. I'm wondering if I can just change it without a special case. The only side effect for non-OSX platforms should be a slightly wider "Col:" area in the status bar. I'm reluctant to hardcode the Geneva font into IDLE, or even have logic specific to Mac OS X to change the font, as it just adds more special code. There is plenty of Mac OS X special code already! Are there cosmetic glitches in the tree window on your computer, or do you just prefer Geneva? -Tony --============_-1173274252==_============ Content-Id: Content-Type: text/plain; name="idle-python-2.2.2-patch.txt"; charset="us-ascii" ; format="flowed" Content-Disposition: attachment; filename="idle-python-2.2.2-patch.txt" ; modification-date="Sat, 30 Nov 2002 21:04:31 -0800" Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.35 diff -c -r1.35 EditorWindow.py *** EditorWindow.py 23 Oct 2002 04:48:08 -0000 1.35 --- EditorWindow.py 1 Dec 2002 02:44:50 -0000 *************** *** 193,199 **** self.status_bar = self.MultiStatusBar(self.top) self.status_bar.set_label('column', 'Col: ?', side=RIGHT) self.status_bar.set_label('line', 'Ln: ?', side=RIGHT) ! self.status_bar.pack(side=BOTTOM, fill=X) self.text.bind('', self.set_line_and_column) self.text.bind('', self.set_line_and_column) self.text.after_idle(self.set_line_and_column) --- 193,199 ---- self.status_bar = self.MultiStatusBar(self.top) self.status_bar.set_label('column', 'Col: ?', side=RIGHT) self.status_bar.set_label('line', 'Ln: ?', side=RIGHT) ! self.status_bar.pack(side=BOTTOM, fill=X, padx=14) self.text.bind('', self.set_line_and_column) self.text.bind('', self.set_line_and_column) self.text.after_idle(self.set_line_and_column) Index: MultiStatusBar.py =================================================================== RCS file: /cvsroot/idlefork/idle/MultiStatusBar.py,v retrieving revision 1.3 diff -c -r1.3 MultiStatusBar.py *** MultiStatusBar.py 13 Jul 2001 17:52:08 -0000 1.3 --- MultiStatusBar.py 1 Dec 2002 02:44:50 -0000 *************** *** 10,16 **** def set_label(self, name, text='', side=LEFT): if not self.labels.has_key(name): ! label = Label(self, bd=1, relief=SUNKEN, anchor=W) label.pack(side=side) self.labels[name] = label else: --- 10,16 ---- def set_label(self, name, text='', side=LEFT): if not self.labels.has_key(name): ! label = Label(self, bd=1, relief=SUNKEN, anchor=W, font=('Geneva', 9, '')) label.pack(side=side) self.labels[name] = label else: Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.35 diff -c -r1.35 PyShell.py *** PyShell.py 30 Nov 2002 18:49:10 -0000 1.35 --- PyShell.py 1 Dec 2002 02:44:53 -0000 *************** *** 285,293 **** # # Instead, find the executable by looking relative to # sys.prefix. ! executable = os.path.join(sys.prefix, 'Resources', ! 'Python.app', 'Contents', ! 'MacOS', 'python') return executable else: return sys.executable --- 285,294 ---- # # Instead, find the executable by looking relative to # sys.prefix. ! #executable = os.path.join(sys.prefix, 'Resources', ! # 'Python.app', 'Contents', ! # 'MacOS', 'python') ! executable = os.path.join(sys.prefix, 'bin', 'python') return executable else: return sys.executable Index: TreeWidget.py =================================================================== RCS file: /cvsroot/idlefork/idle/TreeWidget.py,v retrieving revision 1.5 diff -c -r1.5 TreeWidget.py *** TreeWidget.py 30 Nov 2002 19:04:06 -0000 1.5 --- TreeWidget.py 1 Dec 2002 02:44:53 -0000 *************** *** 248,254 **** label = self.label except AttributeError: # padding carefully selected (on Windows) to match Entry widget: ! self.label = Label(self.canvas, text=text, bd=0, padx=2, pady=2) if self.selected: self.label.configure(fg="white", bg="darkblue") else: --- 248,254 ---- label = self.label except AttributeError: # padding carefully selected (on Windows) to match Entry widget: ! self.label = Label(self.canvas, text=text, bd=0, padx=2, pady=2, font=('', 11, '')) if self.selected: self.label.configure(fg="white", bg="darkblue") else: Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.3 diff -c -r1.3 idle *** idle 17 Jul 2001 04:59:01 -0000 1.3 --- idle 1 Dec 2002 02:44:53 -0000 *************** *** 1,4 **** ! #! /usr/bin/env python import PyShell PyShell.main() --- 1,4 ---- ! #! /usr/bin/env pythonw import PyShell PyShell.main() --============_-1173274252==_============-- From tony@lownds.com Mon Dec 2 17:08:10 2002 From: tony@lownds.com (Tony Lownds) Date: Mon, 2 Dec 2002 09:08:10 -0800 Subject: [Idle-dev] Re: keybindings In-Reply-To: <20021202143431.GB2954631@uiuc.edu> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> Message-ID: At 8:34 AM -0600 12/2/02, Nicholas Riley wrote: >Using function keys is especially bad on PowerBooks that don't have >separate brightness/contrast/etc controls (everything but Wall >Street/PDQ). A few monthe ago when I was looking at implementing this >in my own software I did a survey of a bunch of Mac apps and command-/ >came out as the consensus for "zoom window". Most apps have no >shortcut at all - that's also a possibility for IDLE. I think command-/ would be better used when bound to expand-word. >People may want to enter non-ASCII characters, and usurping their >ability to do so is not good. I didn't write Command-. (that's >cancel) above, I said _control_-. above, which should be reasonably >safe. Option-q is seemingly designed to be a facsimile of Emacs' M-q >for the same operation. How about Control-Q for format-paragraph then? -Tony From njriley@uiuc.edu Mon Dec 2 17:14:11 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 11:14:11 -0600 Subject: [Idle-dev] Re: [Pythonmac-SIG] readline In-Reply-To: References: <20021201025316.GB2879058@uiuc.edu> Message-ID: <20021202171411.GA2944208@uiuc.edu> On Mon, Dec 02, 2002 at 08:57:17AM -0800, Tony Lownds wrote: > Hi Nicholas, > > At 8:53 PM -0600 11/30/02, Nicholas Riley wrote to Pythonmac-SIG: > >The idlefork (www.sourceforge.net/projects/idlefork) version of IDLE > >works fine under a framework build of Python 2.2.2, barring a couple > >of cosmetic issues. Apply the attached patch to the latest CVS > >version of idlefork (fixes it to use pythonw and move the line/column > >numbers over to make room for the size box) and you should be all set. > >The changes aren't at all cleanly done but they work for me. > > The only change where I noticed a cosmetic glitch showing up was the > addition of padx=14 on the status bar. A fix *is* needed on Mac OS X. > I'm wondering if I can just change it without a special case. The > only side effect for non-OSX platforms should be a slightly wider > "Col:" area in the status bar. > > I'm reluctant to hardcode the Geneva font into IDLE, or even have > logic specific to Mac OS X to change the font, as it just adds more > special code. There is plenty of Mac OS X special code already! Fonts, like keyboard equivalents, are the kinds of things that are extremely platform-specific. I don't see this as a problem. If it's possible to do cleanly, then great, otherwise the cosmetic problems just need fixing whatever way possible. > Are there cosmetic glitches in the tree window on your computer, or > do you just prefer Geneva? Geneva 9 is not for the tree window, it's for the Ln/Col markers. Any bigger font, and there is too much space between the bottom of the vertical scroll bar and the size box. Any status-area information is constrained in height to the height of the size box. Lucida Grande 10/11 is the appropriate font to use here, but Tk puts too much spacing around the text to permit it. There is a cosmetic glitch in the tree window - try selecting something and you'll notice the highlight is messed up. With an 11 point font this doesn't happen. Last time I worked in Python was a few years ago, on Linux since it was before OS X was released. I did a significant overhaul of the TreeWidget code for my own use, including fixing the bug that causes it not to handle different font sizes properly. I need to pick up the code at some point and try to get it into IDLE, but I won't have time in the next few months to do that. -- =Nicholas Riley | Pablo Research Group, Department of Computer Science and Medical Scholars Program, University of Illinois at Urbana-Champaign From njriley@uiuc.edu Mon Dec 2 17:44:25 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 11:44:25 -0600 Subject: [Idle-dev] Re: keybindings In-Reply-To: <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <20021202174425.GC2944208@uiuc.edu> On Mon, Dec 02, 2002 at 09:59:55AM -0500, Guido van Rossum wrote: > > Using function keys is especially bad on PowerBooks that don't have > > separate brightness/contrast/etc controls (everything but Wall > > Street/PDQ). A few monthe ago when I was looking at implementing this > > in my own software I did a survey of a bunch of Mac apps and command-/ > > came out as the consensus for "zoom window". Most apps have no > > shortcut at all - that's also a possibility for IDLE. > > Note though that Alt-F2 is not the normal zoom (which does whatever > the window manager does by default). It is a special operation that > keeps the width of the window default (normally 80 columns) but makes > it maximal vertically. This is useful to get an overview of a larger > piece of code. (I have no use for code wider than 80 columns. :-) There's no 'normal zoom' on the Mac; window zooming is entirely under the application's control. In many applications, the standard window zoom behaves pretty much like IDLE's "zoom height". To get a true full-screen zoom, you hold down the Option key while clicking the Zoom box. However, there's no way to intercept normal Mac window zooming with Tk at the moment - clicking the zoom box does nothing. This is even true in Alphatk (which, btw, uses command-/ to zoom :) so I figure if Vince hasn't been able to find a way around it, nobody can, until Tk is fixed. One more Mac-specific problem I noticed in IDLE was the new Preferences window - it opens centered over the parent window, which can mean that the dismiss buttons are below the bottom of the screen, and it's not movable. If this could be made into a movable modal dialog, or to use more sensible positioning rules, that would be a good thing. Movable modal dialogs do seem possible, as Alphatk uses them. -- =Nicholas Riley | Pablo Research Group, Department of Computer Science and Medical Scholars Program, University of Illinois at Urbana-Champaign From fedor@mailandnews.com Mon Dec 2 17:50:41 2002 From: fedor@mailandnews.com (Fedor Baart) Date: Mon, 2 Dec 2002 18:50:41 +0100 Subject: [Idle-dev] Re: Anybody got any other keybinding issues? In-Reply-To: <20021202165801.11163.74614.Mailman@mail.python.org> References: <20021202165801.11163.74614.Mailman@mail.python.org> Message-ID: <200212021850.41465.fedor@mailandnews.com> Op maandag 2 december 2002 17:58, schreef idle-dev-request@python.org: > I will look at that. There is also a problem in Unix (i.e. emacs) > bindings where alt-f2 is Zoom Window. But alt-function key in Gnu/Linu= x/X > is used to change desktops. > > Anybody got any other keybinding issues? > > KBK KDE (3.0.4 in Suse 8.1) uses CTL Fn to switch to desktop n. For example C= TL F5=20 switches to desktop 5 instead of running a python script.=20 Fedor From tony@lownds.com Mon Dec 2 18:26:24 2002 From: tony@lownds.com (Tony Lownds) Date: Mon, 2 Dec 2002 10:26:24 -0800 Subject: [Idle-dev] Re: keybindings In-Reply-To: References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> Message-ID: At 9:08 AM -0800 12/2/02, Tony Lownds wrote: > >I think command-/ would be better used when bound to expand-word. >[...] >How about Control-Q for format-paragraph then? > It turns out that settings in config-keys.def do not override the key settings in extensions, which is how expand-word and format-paragraph (and zoom-window) are implemented. So, I can't change these keys for Mac OS X at this time. -Tony From kbk@shore.net Mon Dec 2 19:09:45 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 02 Dec 2002 14:09:45 -0500 Subject: [Idle-dev] Re: keybindings References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> Message-ID: Guido van Rossum writes: > Note though that Alt-F2 is not the normal zoom (which does whatever > the window manager does by default). It is a special operation that > keeps the width of the window default (normally 80 columns) but makes > it maximal vertically. This is useful to get an overview of a larger > piece of code. (I have no use for code wider than 80 columns. :-) Right. I have not been able to take the time to figure out how to get Tk to return the coordinates of the area inside the docked panels. top.winfo_screenheight() doesn't seem to be the right thing to use as it is the full height of the screen. Stephen appears to have his button panel at the top, and set the height to accomodate that, while I have mine at the bottom and so have locally modified my ZoomHeight.py as follows: else: ! #newy = 24 ! newy = 0 ! #newheight = newheight - 96 ! newheight = newheight - 88 Anybody know how to do this correctly? The current implementation allows keybinding sets to be configured in config-keys.def, and there are separate bindings for Windows, Mac, and Unix. However, the IDLE "Extensions", such as ZoomHeight (!), are defined in config-extensions.def and there is only one binding available for all platforms, as far as I can see. How does Alt-H sound for Zoom across the three platforms? KBK From kbk@shore.net Mon Dec 2 19:14:52 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 02 Dec 2002 14:14:52 -0500 Subject: [Idle-dev] Re: Anybody got any other keybinding issues? In-Reply-To: <200212021850.41465.fedor@mailandnews.com> References: <20021202165801.11163.74614.Mailman@mail.python.org> <200212021850.41465.fedor@mailandnews.com> Message-ID: Fedor Baart writes: > Op maandag 2 december 2002 17:58, schreef idle-dev-request@python.org: > > I will look at that. There is also a problem in Unix (i.e. emacs) > > bindings where alt-f2 is Zoom Window. But alt-function key in > > Gnu/Linux/X is used to change desktops. > > > > Anybody got any other keybinding issues? > > > > KBK > > KDE (3.0.4 in Suse 8.1) uses CTL Fn to switch to desktop n. For > example CTL F5 switches to desktop 5 instead of running a python > script. Bah. I was just going to suggest Ctrl-F5 for Check-module. How about Alt-X for Check-Module on all platforms? It's done via the ScriptBinding extension, so only one choice can be made! Run-Script is F5 in IDLEfork. KBK From michael.williams@st-annes.oxford.ac.uk Mon Dec 2 19:31:40 2002 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Mon, 2 Dec 2002 19:31:40 +0000 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: <200211301644.gAUGi5d13178@pcp02138704pcs.reston01.va.comcast.net> Message-ID: On Saturday, November 30, 2002, at 04:44 pm, Guido van Rossum wrote: >> I've never really used idle, so don't expect great testing from me. > > Maybe you can give it a try. It would be cool if it could optionally > apply PyChecker to a module. There's a "Check" menu entry already; > currently it just does a syntax check and a tabnanny check. Seconded. It would be very cool, and certainly something we'd want to use in the Oxford course[0]. [0] We're really looking forward to the next IDLE release here, as we've felt unable to use the (very active) CVS over the past few months on our students. I pulled it down this afternoon to see what had changed and have a couple of queries: + Where have the Run and Edit menus gone? Is this a temporary thing while CVS is in flux? + I checked whether the server-client overhaul which has (presumably!?) taken place solved our show-stopper (see ) regarding multi-user machines. It does seem to although I'm a bit confused as to the origin and seriousness of the error message one gets the second time it launches: first time: % ./idle Idle accepted connection from ('127.0.0.1', 41902) [should it even say this? is it debugging stuff that will be removed?] ------ second time, different user, different terminal: % ./idle . . . Idle socket error: Address already in use, retrying... Idle socket error: Address already in use, retrying... Idle socket error: Address already in use, retrying... IDLE cannot run. IDLE needs to use a specific TCP/IP port (8833) in order to execute and debug programs. IDLE is unable to bind to this port, and so cannot start. Here are some possible causes of this problem: 1. TCP/IP networking is not installed or not working on this computer 2. Another program is running that uses this port 3. Personal firewall software is preventing IDLE from using this port IDLE makes and accepts connections only with this computer, and does not communicate over the internet in any way. Its use of port 8833 should not be a security risk on a single-user machine. ----- This takes several seconds on our machine (presumably probing ports). Despite the protestations that something is broken it then launches a new instance of idle in the expected way: on the second users terminal. What's the significance of this error message? By the way, if anyone hasn't seen it yet, I produced a detailed report on the successes and failures of our trial of Python as a teaching language, using IDLEfork 0.8.1 as the IDE. It's here: . Perhaps of particular interest to members of this list are: + , which describes the temporary workaround we implemented to fix the static port problem. + , which discusses idleforks strenghs for our purposes. I would still like to see some sort of warning (that could be turned off in Settings, but that was on by default) when a file is saved without a Python extension: "You are saving this file without a .py extension. This extension indicates that IDLE should treat it as a Python program. Are you sure what you are saving is not a Python program?" -- Michael From njriley@uiuc.edu Mon Dec 2 19:52:47 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 13:52:47 -0600 Subject: [Idle-dev] Re: keybindings In-Reply-To: References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <20021202195247.GA2965127@uiuc.edu> On Mon, Dec 02, 2002 at 02:09:45PM -0500, Kurt B. Kaiser wrote: > How does Alt-H sound for Zoom across the three platforms? Command-H and command-option-H are taken by "hide application" and "hide others" on OS X, and Alt-/Option- equivalents are taken by character entry. How about Alt/Command/Control (depending on platform)-T? Or else, there could just be no shortcut for zoom on the Mac. -- =Nicholas Riley | Pablo Research Group, Department of Computer Science and Medical Scholars Program, University of Illinois at Urbana-Champaign From tony@lownds.com Mon Dec 2 20:19:02 2002 From: tony@lownds.com (Tony Lownds) Date: Mon, 2 Dec 2002 12:19:02 -0800 Subject: [Idle-dev] Re: keybindings In-Reply-To: <20021202195247.GA2965127@uiuc.edu> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> <20021202195247.GA2965127@uiuc.edu> Message-ID: At 1:52 PM -0600 12/2/02, Nicholas Riley wrote: >On Mon, Dec 02, 2002 at 02:09:45PM -0500, Kurt B. Kaiser wrote: >> How does Alt-H sound for Zoom across the three platforms? > >Command-H and command-option-H are taken by "hide application" and >"hide others" on OS X, and Alt-/Option- equivalents are taken by >character entry. How about Alt/Command/Control (depending on >platform)-T? > >Or else, there could just be no shortcut for zoom on the Mac. Alt-H will turn into Option-H on the Mac. We can't change the default just for the Mac with the current code, nor can we have no shortcut just for the Mac - extensions' default key binding can't be overriden by platform. As you note, Option-H isn't perfect since it shadows the degree sign character keystroke. But users can get around this easily, so IMO Alt-H is ok. Alt-X for check module is ok too IMO. -Tony From martin@tactilis.co.uk Mon Dec 2 20:24:51 2002 From: martin@tactilis.co.uk (Martin Armstrong) Date: Mon, 2 Dec 2002 20:24:51 +0000 Subject: [Idle-dev] Re: keybindings In-Reply-To: References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> Message-ID: On Mon, 2 Dec 2002, at 14:09:45, Kurt B. Kaiser wrote: >Guido van Rossum writes: > >> Note though that Alt-F2 is not the normal zoom (which does whatever >> the window manager does by default). It is a special operation that >> keeps the width of the window default (normally 80 columns) but makes >> it maximal vertically. This is useful to get an overview of a larger >> piece of code. (I have no use for code wider than 80 columns. :-) >Right. > >I have not been able to take the time to figure out how to get Tk to >return the coordinates of the area inside the docked panels. > >top.winfo_screenheight() doesn't seem to be the right thing to use as it >is the full height of the screen. > >Stephen appears to have his button panel at the top, and set the height to >accomodate that, while I have mine at the bottom and so have locally >modified my ZoomHeight.py as follows: > > else: >! #newy = 24 >! newy = 0 >! #newheight = newheight - 96 >! newheight = newheight - 88 > >Anybody know how to do this correctly? No, not here :( The same problem afflicts Windows users if you have the Taskbar set to be always displayed (i.e. autohide switched off). When I zoom Idle's window the bottom sits underneath the Taskbar so I can't see the status line. Even worse, if I rotate the mouse wheel when part of Idle's window is underneath the Taskbar, instead of scrolling the window contents it causes a switch (like Alt TAB does) to another window! I get around this by editing ZoomHeight.py, but it's not ideal. >How does Alt-H sound for Zoom across the three platforms? +1 here -- Martin Armstrong From njriley@uiuc.edu Mon Dec 2 20:34:00 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 14:34:00 -0600 Subject: [Idle-dev] Re: keybindings In-Reply-To: References: <000c01c2987b$3f7d70a0$6801a8c0@hyperon> <20021202060828.GA2896196@uiuc.edu> <20021202143431.GB2954631@uiuc.edu> <200212021459.gB2ExtI28318@pcp02138704pcs.reston01.va.comcast.net> <20021202195247.GA2965127@uiuc.edu> Message-ID: <20021202203400.GB2965127@uiuc.edu> On Mon, Dec 02, 2002 at 12:19:02PM -0800, Tony Lownds wrote: > At 1:52 PM -0600 12/2/02, Nicholas Riley wrote: > >On Mon, Dec 02, 2002 at 02:09:45PM -0500, Kurt B. Kaiser wrote: > >> How does Alt-H sound for Zoom across the three platforms? > > > >Command-H and command-option-H are taken by "hide application" and > >"hide others" on OS X, and Alt-/Option- equivalents are taken by > >character entry. How about Alt/Command/Control (depending on > >platform)-T? > > > >Or else, there could just be no shortcut for zoom on the Mac. > > Alt-H will turn into Option-H on the Mac. We can't change the default > just for the Mac with the current code, nor can we have no shortcut > just for the Mac - extensions' default key binding can't be overriden > by platform. As you note, Option-H isn't perfect since it shadows the > degree sign character keystroke. But users can get around this > easily, so IMO Alt-H is ok. > > Alt-X for check module is ok too IMO. Sounds like this really needs changing. How hard would it be to do? -- =Nicholas Riley | Pablo Research Group, Department of Computer Science and Medical Scholars Program, University of Illinois at Urbana-Champaign From kbk@shore.net Mon Dec 2 21:28:20 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 02 Dec 2002 16:28:20 -0500 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: References: Message-ID: Michael Williams writes: > We're really looking forward to the next IDLE release here, as we've > felt unable to use the (very active) CVS over the past few months on > our students. I pulled it down this afternoon to see what had changed > and have a couple of queries: > > + Where have the Run and Edit menus gone? Is this a temporary thing > while CVS is in flux? The Run and Edit menus are found in the Editor windows but not in the Shell window. "Run" is not appropriate for the latter because it is intended to run a script loaded into an Editor window. "Run" has also been removed from Python IDLE for the same reason. I removed the Edit menu from the Shell, also, as an attempt to encourage people to do their editing in an Editor window and not write/save code in the shell. Doing that can only cause confusion. > + I checked whether the server-client overhaul which has > (presumably!?) taken place solved our show-stopper (see > ) > regarding multi-user machines. It does seem to although I'm a bit > confused as to the origin and seriousness of the error message one > gets the second time it launches: > > first time: > % ./idle > Idle accepted connection from ('127.0.0.1', 41902) > > [should it even say this? is it debugging stuff that will be removed?] It is debugging cruft and will be removed shortly. > ------ second time, different user, different terminal: % ./idle . > . . Idle socket error: Address already in use, retrying... > > Idle socket error: Address already in use, retrying... [...] > This takes several seconds on our machine (presumably probing > ports). Despite the protestations that something is broken it then > launches a new instance of idle in the expected way: on the second > users terminal. What's the significance of this error message? It was intended to inform the user that 8833 was in use and that since Python could not rebind it, IDLE would exit. I'm curious how your system managed to bind a new socket or spawn a new handler since the handler was configured to only service one request. Could you post a lsof -i | grep python or netstat | grep python to give me some idea of what happened? > By the way, if anyone hasn't seen it yet, I produced a detailed > report on the successes and failures of our trial of Python as a > teaching language, using IDLEfork 0.8.1 as the IDE. It's here: > . Perhaps of > particular interest to members of this list are: > > + , which > describes the temporary workaround we implemented to fix the static > port problem. I don't see any reason why IDLEfork can't be enhanced to create additional instances running in parallel. I will look into that. > + , which > discusses idleforks strenghs for our purposes. This is very interesting, thanks for the reference. I've added a personal objective to enhance IDLE's usefulness and reliability in your environment as IMO it is exactly aligned with IDLE's mission. Any further feedback will be greatly appreciated. > I would still like to see some sort of warning (that could be turned > off in Settings, but that was on by default) when a file is saved > without a Python extension: "You are saving this file without a .py > extension. This extension indicates that IDLE should treat it as a > Python program. Are you sure what you are saving is not a Python > program?" What does the IDLE-dev List think about making .py the default extension for saving and loading? KBK From njriley@uiuc.edu Mon Dec 2 21:36:51 2002 From: njriley@uiuc.edu (Nicholas Riley) Date: Mon, 2 Dec 2002 15:36:51 -0600 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: References: Message-ID: <20021202213651.GA2962114@uiuc.edu> On Mon, Dec 02, 2002 at 04:28:20PM -0500, Kurt B. Kaiser wrote: > I removed the Edit menu from the Shell, also, as an attempt to encourage > people to do their editing in an Editor window and not write/save code > in the shell. Doing that can only cause confusion. Was this a very recent change? I'm still using CVS from last week and have an Edit menu. Please put it back - there are plenty of things in the Edit menu that are useful in the shell - cut/copy/paste/undo (not all platforms support mouse copy/pasting!) and finding text among them. I often use Find in the shell window to search through output. > What does the IDLE-dev List think about making .py the default > extension for saving and loading? Sounds fine to me. -- =Nicholas Riley | Pablo Research Group, Department of Computer Science and Medical Scholars Program, University of Illinois at Urbana-Champaign From Martin Armstrong Mon Dec 2 23:20:52 2002 From: Martin Armstrong (Martin Armstrong) Date: Mon, 2 Dec 2002 23:20:52 +0000 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: References: Message-ID: In article , Kurt B. Kaiser writes >What does the IDLE-dev List think about making .py the default >extension for saving and loading? Yes please. I've forgotten to type .py so many times. Saving should be .py by default. Loading should be *.py, *.pyw and maybe *.txt as in Idle 0.8 -- Martin Armstrong martin @ tactilis.co.uk From basherwo@unity.ncsu.edu Tue Dec 3 02:19:32 2002 From: basherwo@unity.ncsu.edu (Bruce Sherwood) Date: Mon, 2 Dec 2002 21:19:32 -0500 Subject: [Idle-dev] Anticipated changes for Mac OS X References: Message-ID: <003601c29a72$6acfaea0$6801a8c0@hyperon> Another vote in favor. This has been a problem for my students, albeit fairly minor. The disappearance of colorizing is pretty counterintuitive, too, when the .py is omitted. Bruce ----- Original Message ----- From: "Martin Armstrong" <{$news2$}@tactilis.co.uk> To: Sent: Monday, December 02, 2002 6:20 PM Subject: Re: [Idle-dev] Anticipated changes for Mac OS X > In article , Kurt B. Kaiser > writes > > >What does the IDLE-dev List think about making .py the default > >extension for saving and loading? > > Yes please. I've forgotten to type .py so many times. > > > Saving should be .py by default. > > Loading should be *.py, *.pyw and maybe *.txt as in Idle 0.8 > > -- > Martin Armstrong martin @ tactilis.co.uk > > _______________________________________________ > IDLE-dev mailing list > IDLE-dev@python.org > http://mail.python.org/mailman/listinfo/idle-dev > From kbk@shore.net Tue Dec 3 04:14:48 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 02 Dec 2002 23:14:48 -0500 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: <20021202060828.GA2896196@uiuc.edu> Message-ID: Sorry for responding out of thread, I managed to blackhole three hours worth of email with a Procmail typo :( All those missed opportunities! * KBK: > The Run and Edit menus are found in the Editor windows but not in > the Shell window. "Run" is not appropriate for the latter because > it is intended to run a script loaded into an Editor window. "Run" has > also been removed from Python IDLE for the same reason. > > I removed the Edit menu from the Shell, also, as an attempt to encourage > people to do their editing in an Editor window and not write/save code > in the shell. Doing that can only cause confusion. I meant to say, I removed the *Format* menu. The Edit menu remains. The way things are currently implemented, you really want to discourage students from coding in the shell and saving or cut/pasting the result into the Editor and then continuing work. The eight character tabs mix with the four character default Python indents and Module-Check fails. I'd like to figure out a way to fix that. Maybe have the "prompts" show in a strip on the left side of the text window so four character indents could be used? Cutting/pasting code within the Shell is minimized because of the following IDLE Shell feature: If you place the cursor on a previous entry and hit , the entire entry will be copied to a new prompt (the I/O point), where it can be edited and re-run. This can be useful for expressions used to examine the environment but which may only be used once or twice. The best way to use IDLE is to write code in an Editor window and hit the "save" keystroke followed by F5. I'm planning on adding a temporary file save feature so only the F5 will be required. Is the .idlerc directory a reasonable place to put the temp file on all platforms? The temporary file(s) would be deleted if the module was closed without saving. There would still be a "save" prompt if the user tried to do that. KBK From guido@python.org Tue Dec 3 08:39:36 2002 From: guido@python.org (Guido van Rossum) Date: Tue, 03 Dec 2002 03:39:36 -0500 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: Your message of "Mon, 02 Dec 2002 21:19:32 EST." <003601c29a72$6acfaea0$6801a8c0@hyperon> References: <003601c29a72$6acfaea0$6801a8c0@hyperon> Message-ID: <200212030839.gB38dad01450@pcp02138704pcs.reston01.va.comcast.net> > Another vote in favor. This has been a problem for my students, albeit > fairly minor. The disappearance of colorizing is pretty counterintuitive, > too, when the .py is omitted. Actually, the latter is a clue. :-) I agree that it's best to have a default .py extension. But note that then the check for an existing file by the dialog is defeated, so you'll have to check for this yourself after adding the extension and pop up a dialog if the file exists. --Guido van Rossum (home page: http://www.python.org/~guido/) From gvanrossum@users.sourceforge.net Tue Dec 3 09:28:14 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Tue, 03 Dec 2002 01:28:14 -0800 Subject: [Idle-dev] CVS: idle ClassBrowser.py,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv27381 Modified Files: ClassBrowser.py Log Message: Get rid of 1.5.2 compatibility hack. :-) Index: ClassBrowser.py =================================================================== RCS file: /cvsroot/idlefork/idle/ClassBrowser.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ClassBrowser.py 15 Sep 2002 22:06:47 -0000 1.4 --- ClassBrowser.py 3 Dec 2002 09:28:11 -0000 1.5 *************** *** 15,26 **** import pyclbr - # XXX Patch pyclbr with dummies if it's vintage Python 1.5.2: - if not hasattr(pyclbr, "readmodule_ex"): - pyclbr.readmodule_ex = pyclbr.readmodule - if not hasattr(pyclbr, "Function"): - class Function(pyclbr.Class): - pass - pyclbr.Function = Function - import PyShell from WindowList import ListedToplevel --- 15,18 ---- From josh_robb@fastmail.fm Tue Dec 3 12:02:28 2002 From: josh_robb@fastmail.fm (Josh Robb) Date: Tue, 3 Dec 2002 12:02:28 -0000 Subject: [Idle-dev] Anticipated changes for Mac OS X References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <200211301522.gAUFMbs12279@pcp02138704pcs.reston01.va.comcast.net> <20021130161840.GC28552@epoch.metaslash.com> <200211301644.gAUGi5d13178@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <00ce01c29ac3$dab1c9a0$0600000a@privateu6b70b4> I have a patch pending which add's a prettyer interface to PyChecker as an IDLE extension. It just needs me to find a evening at home to look at this (and also context sensitive help). j. ----- Original Message ----- From: "Guido van Rossum" To: Cc: "Kurt B. Kaiser" ; Sent: Saturday, November 30, 2002 4:44 PM Subject: Re: [Idle-dev] Anticipated changes for Mac OS X > > Guido, if you want I can merge from idlefork back into python. > > If you want me to do this, what would you like me to do? > > Here's my likely approach: > > > > * test idlefork > > * review diffs between idlefork and python > > (just to make sure nothing gets clobbered) > > * merge into python > > * test merge > > * commit to python > > I think that it's simpler than that. We've tried to hold off on > changes to Python's IDLE and AFAIK all the recent changes there have > been applied to IDLEFORK already. You might want to review the recent > Python IDLE CVS logs (last half year or so) to make sure that they've > been applied to IDLEFORK. Comparing diffs is probably not worth it, > since so much has changed in IDLEFORK. > > I think we should wait until Kurt is ready for his beta release before > we do this, though. > > > I've never really used idle, so don't expect great testing from me. > > Maybe you can give it a try. It would be cool if it could optionally > apply PyChecker to a module. There's a "Check" menu entry already; > currently it just does a syntax check and a tabnanny check. > > --Guido van Rossum (home page: http://www.python.org/~guido/) > > _______________________________________________ > IDLE-dev mailing list > IDLE-dev@python.org > http://mail.python.org/mailman/listinfo/idle-dev > > From kbk@shore.net Tue Dec 3 20:30:05 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 03 Dec 2002 15:30:05 -0500 Subject: [Idle-dev] Anticipated changes for Mac OS X In-Reply-To: <000c01c2987b$3f7d70a0$6801a8c0@hyperon> References: <200211300139.gAU1ddn10012@pcp02138704pcs.reston01.va.comcast.net> <000c01c2987b$3f7d70a0$6801a8c0@hyperon> Message-ID: "Bruce Sherwood" writes: > The standard binding for "select all text" in most Windows > applications is ctrl-A, but it is alt-A at least in the old original > idlefork. Seems like it ought to be changed to ctrl-A. Looks like Stephen did this at config-keys.def Rev 1.10 last June. I'm entering a change to CVS: Zoom: Alt-H Check Module: Alt-X All platforms, because defined in config-extensions.def, which is shared. KBK From kbk@users.sourceforge.net Tue Dec 3 20:34:46 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 03 Dec 2002 12:34:46 -0800 Subject: [Idle-dev] CVS: idle config-extensions.def,1.7,1.8 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv9502 Modified Files: config-extensions.def Log Message: Don't use Alt-Fn or Ctrl-Fn keys, reserved for desktop changes in Unix. Zoom becomes Alt-H "height" Check Module becomes Alt-X "syntax" Index: config-extensions.def =================================================================== RCS file: /cvsroot/idlefork/idle/config-extensions.def,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** config-extensions.def 14 Sep 2002 03:15:06 -0000 1.7 --- config-extensions.def 3 Dec 2002 20:34:43 -0000 1.8 *************** *** 3,14 **** # # Each extension must have at least one section, named after the extension ! # module. This section must contain an 'enable' item (=1 to enable the ! # extension, =0 to disable it) and also contains any other general configuration ! # items for the extension. Each extension may also define up to two optional ! # sections named ExtensionName_bindings and ExtensionName_cfgBindings. If ! # present, ExtensionName_bindings defines virtual event bindings for the ! # extension that are not sensibly re-configurable. If present, ! # ExtensionName_cfgBindings defines virtual event bindings for the extension ! # that may be sensibly re-configured. # See config-keys.def for notes on specifying keys. --- 3,15 ---- # # Each extension must have at least one section, named after the extension ! # module. This section must contain an 'enable' item (=1 to enable the ! # extension, =0 to disable it) and also contains any other general ! # configuration items for the extension. Each extension may also define up to ! # two optional sections named ExtensionName_bindings and ! # ExtensionName_cfgBindings. If present, ExtensionName_bindings defines virtual ! # event bindings for the extension that are not sensibly re-configurable. If ! # present, ExtensionName_cfgBindings defines virtual event bindings for the ! # extension that may be sensibly re-configured. ! # See config-keys.def for notes on specifying keys. *************** *** 26,36 **** enable=1 [ZoomHeight_cfgBindings] ! zoom-height= ! ! #[ExecBinding] # Revert to ScriptBinding ! #enable=1 ! #[ExecBinding_cfgBindings] ! #run-complete-script= ! #stop-execution= [ScriptBinding] --- 27,31 ---- enable=1 [ZoomHeight_cfgBindings] ! zoom-height= [ScriptBinding] *************** *** 38,43 **** [ScriptBinding_cfgBindings] run-script= ! #check-module= ! #import-module= [CallTips] --- 33,37 ---- [ScriptBinding_cfgBindings] run-script= ! check-module= [CallTips] From kbk@users.sourceforge.net Tue Dec 3 23:09:26 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 03 Dec 2002 15:09:26 -0800 Subject: [Idle-dev] CVS: idle ScriptBinding.py,1.11,1.12 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv26593 Modified Files: ScriptBinding.py Log Message: Enable Check Module Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/ScriptBinding.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** ScriptBinding.py 30 Nov 2002 19:18:46 -0000 1.11 --- ScriptBinding.py 3 Dec 2002 23:09:23 -0000 1.12 *************** *** 38,46 **** menudefs = [ ('run', [None, ! # ('Check module', '<>'), ! ('Run script', '<>'), ! ] ! ), ! ] def __init__(self, editwin): --- 38,43 ---- menudefs = [ ('run', [None, ! ('Check module', '<>'), ! ('Run script', '<>'), ]), ] def __init__(self, editwin): From michael.williams@st-annes.oxford.ac.uk Wed Dec 4 14:43:23 2002 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Wed, 4 Dec 2002 14:43:23 +0000 (GMT) Subject: [Idle-dev] Anticipated changes for Mac OS X Message-ID: In message kbk@shore.net (Kurt B. Kaiser) writes: > Michael Williams writes: [running multiple instances on same multi-user machine] > > ------ second time, different user, different terminal: % ./idle . > > . . Idle socket error: Address already in use, retrying... > > > > Idle socket error: Address already in use, retrying... > > [...] > > > This takes several seconds on our machine (presumably probing > > ports). Despite the protestations that something is broken it then > > launches a new instance of idle in the expected way: on the second > > users terminal. What's the significance of this error message? > > It was intended to inform the user that 8833 was in use and that since > Python could not rebind it, IDLE would exit. I'm curious how your > system managed to bind a new socket or spawn a new handler since the > handler was configured to only service one request. > > Could you post a > > lsof -i | grep python or > netstat | grep python > > to give me some idea of what happened? Here's the output after the first user (willmsmj) runs it: [willmsmj@rayleigh:~]$ lsof -i | grep python python2.2 9242 willmsmj 4u inet 0x30008ab6a70 0t0 TCP localhost:8833 (LISTEN) python2.2 9242 willmsmj 5u inet 0x30001ce9a78 0t0 TCP localhost:8833->localhost:54317 (ESTABLISHED) python2.2 9243 willmsmj 3u inet 0x30002d8c0d0 0t0 TCP localhost:54317->localhost:8833 (ESTABLISHED) And here's after the second user (guest1) [willmsmj@rayleigh:~]$ lsof -i | grep python python2.2 9242 willmsmj 4u inet 0x30008ab6a70 0t0 TCP localhost:8833 (LISTEN) python2.2 9242 willmsmj 5u inet 0x30001ce9a78 0t0 TCP localhost:8833->localhost:54317 (ESTABLISHED) python2.2 9243 willmsmj 3u inet 0x30002d8c0d0 0t0 TCP localhost:54317->localhost:8833 (ESTABLISHED) python2.2 9533 guest1 3u inet 0x30002d8d570 0t0 TCP localhost:54352->localhost:8833 (ESTABLISHED) netstat | grep python (or grep idle) give's nothing both times. But... [willmsmj@rayleigh:~]$ netstat | grep 8833 localhost.54317 localhost.8833 32768 0 32768 0 ESTABLISHED localhost.8833 localhost.54317 32768 0 32768 0 ESTABLISHED localhost.54352 localhost.8833 32768 0 32768 0 ESTABLISHED localhost.8833 localhost.54352 32768 0 32768 0 ESTABLISHED It looks to me like guest1's idle is not guest1's. It's binding to the first launched (willmsmj's), using a different socket for the other end. This is probably a bad thing. Recall guest1 sees idle on his own display (after a long wait), and can use it normally (or as far as I've tested normal use). This is in contrast to IDLEfork 0.8.1, which would launch a new (shell I think) window on the first user's display when a second user ran it. So we're half way there! But to emphasise, from our point of view, as long as separate users can run multiple *instances* on the same machine, we're happy. Our workaround: (http://users.ox.ac.uk/~sann1276/python/report/node47.html), which simply generates a number other than 8833 for IDLE to talk on and hopes it works seems far from optimal, stable or secure in a multi-user environment. But it is working for us at the moment. We'll probably stick with IDLEfork 0.8.1 until this is fixed. That wait the second user sees is too long, and too scary for our students. -- Michael From michael.williams@st-annes.oxford.ac.uk Wed Dec 4 15:15:13 2002 From: michael.williams@st-annes.oxford.ac.uk (Michael Williams) Date: Wed, 4 Dec 2002 15:15:13 +0000 (GMT) Subject: [Idle-dev] Re: Anticipated changes for Mac OS X Message-ID: Further testing has yielded some more information and some more queries about the changes since 0.8.1... > Here's the output after the first user (willmsmj) runs it: [snip] > Recall guest1 sees idle on his own display (after a long wait), and can use it > normally (or as far as I've tested normal use). This is in contrast to IDLEfork > 0.8.1, which would launch a new (shell I think) window on the first user's > display when a second user ran it. So we're half way there! Less than half way, actually! I tried using the second users IDLE window (which I should have tried anyway). stdout for this IDLE shell appears to be the terminal from which it was launched on the second users desktop. It should be to the IDLE shell, a la: >>> print "hello" hello Note the first user's IDLE shell appears to function as normal. The second user is unable to run stuff from the editor window at all. They get the following error in the terminal from which they launched IDLE: Exception in Tkinter callback Traceback (most recent call last): File "/usr/local/lib/python2.2/lib-tk/Tkinter.py", line 1292, in __call__ return apply(self.func, args) File "/tmp/idle/ScriptBinding.py", line 114, in run_script_event interp.restart_subprocess() File "./PyShell.py", line 327, in restart_subprocess self.rpcclt.close() AttributeError: 'NoneType' object has no attribute 'close' Perhaps this sheds more light on the situation. ----- On the subject of insisting on saving files edited in the editor window before their first run, I note CVS now says: "you've not saved the contents of the buffer". From a teaching point of view this is good; it gets our students into a good habit from the get-go. (and it gets rid of the relative path file writing problem I mentioned). ----- However, I'm curious to know why the output of a module is directed to the Shell rather than an Output window as it was in IDLEfork 0.8.1. I worry that directing it to the Shell will confuse students already struggling to deal with the distinction between interactive and scripted programs. I'd like to see the Output window return! -- Michael From kbk@users.sourceforge.net Fri Dec 6 21:45:27 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Fri, 06 Dec 2002 13:45:27 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.35,1.36 rpc.py,1.9,1.10 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv23461 Modified Files: PyShell.py rpc.py Log Message: M PyShell.py 1. Format and print exceptions raised in user code. M rpc.py 1. Additional debug messages in rpc.py 2. Move debug message enable switch from SocketIO to Client and Server to allow separate activation. 3. Add indication of origin (client or server) to debug message 4. Add sequence number to appropriate debug messages 5. Pass string exception arg as a string rather than a tuple. Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** PyShell.py 30 Nov 2002 18:49:10 -0000 1.35 --- PyShell.py 6 Dec 2002 21:45:23 -0000 1.36 *************** *** 12,15 **** --- 12,16 ---- import types import warnings + import exceptions import linecache *************** *** 341,344 **** --- 342,346 ---- return response = clt.pollresponse(self.active_seq) + # Reschedule myself in 50 ms self.tkconsole.text.after(50, self.poll_subprocess) if response: *************** *** 363,374 **** tb[i] = fn, ln, nm, line traceback.print_list(tb, file=file) ! if mod and mod != "exceptions": ! name = mod + "." + name ! print >>file, name + ":", " ".join(map(str, args)) if self.tkconsole.getvar("<>"): self.remote_stack_viewer() elif how == "ERROR": ! print >>sys.__stderr__, "Oops:", how, what ! print >>file, "Oops:", how, what self.tkconsole.endexecuting() --- 365,386 ---- tb[i] = fn, ln, nm, line traceback.print_list(tb, file=file) ! # try to reinstantiate the exception, stuff in the args: ! try: ! etype = eval(mod + '.' + name) ! val = etype() ! val.args = args ! except TypeError: # string exception! ! etype = name ! val = args ! lines = traceback.format_exception_only(etype, val) ! for line in lines[:-1]: ! traceback._print(file, line, '') ! traceback._print(file, lines[-1], '') if self.tkconsole.getvar("<>"): self.remote_stack_viewer() elif how == "ERROR": ! errmsg = "PyShell.ModifiedInterpreter: Subprocess ERROR:\n" ! print >>sys.__stderr__, errmsg, what ! print >>file, errmsg, what self.tkconsole.endexecuting() *************** *** 417,420 **** --- 429,434 ---- except (OverflowError, SyntaxError): self.tkconsole.resetoutput() + console = self.tkconsole.console + print >>console, 'Traceback (most recent call last):' InteractiveInterpreter.showsyntaxerror(self, filename) self.tkconsole.showprompt() Index: rpc.py =================================================================== RCS file: /cvsroot/idlefork/idle/rpc.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** rpc.py 30 Nov 2002 06:18:00 -0000 1.9 --- rpc.py 6 Dec 2002 21:45:24 -0000 1.10 *************** *** 91,96 **** class SocketIO: - debugging = False - def __init__(self, sock, objtable=None, debugging=None): self.mainthread = threading.currentThread() --- 91,94 ---- *************** *** 114,122 **** if not self.debugging: return ! s = str(threading.currentThread().getName()) for a in args: s = s + " " + str(a) ! s = s + "\n" ! sys.__stderr__.write(s) def register(self, oid, object): --- 112,119 ---- if not self.debugging: return ! s = self.location + " " + str(threading.currentThread().getName()) for a in args: s = s + " " + str(a) ! print>>sys.__stderr__, s def register(self, oid, object): *************** *** 160,164 **** sys.last_type, sys.last_value, sys.last_traceback = info if isinstance(typ, type(Exception)): ! # Class exceptions mod = typ.__module__ name = typ.__name__ --- 157,161 ---- sys.last_type, sys.last_value, sys.last_traceback = info if isinstance(typ, type(Exception)): ! # Class exception mod = typ.__module__ name = typ.__name__ *************** *** 168,194 **** args = (str(val),) else: ! # String exceptions mod = None name = typ ! args = (str(val),) tb = traceback.extract_tb(tb) return ("EXCEPTION", (mod, name, args, tb)) def remotecall(self, oid, methodname, args, kwargs): ! self.debug("remotecall:", oid, methodname, args, kwargs) seq = self.asynccall(oid, methodname, args, kwargs) ! ret = self.asyncreturn(seq) ! self.debug("return:", ret) ! return ret def asynccall(self, oid, methodname, args, kwargs): - self.debug("asyncall:", oid, methodname, args, kwargs) request = ("call", (oid, methodname, args, kwargs)) seq = self.putrequest(request) return seq def asyncreturn(self, seq): response = self.getresponse(seq) ! self.debug("asyncreturn:", response) return self.decoderesponse(response) --- 165,191 ---- args = (str(val),) else: ! # User string exception mod = None name = typ ! if val is None: val = '' ! args = str(val) tb = traceback.extract_tb(tb) + self.debug("localcall:EXCEPTION: ", mod, name, args, tb) return ("EXCEPTION", (mod, name, args, tb)) def remotecall(self, oid, methodname, args, kwargs): ! self.debug("remotecall:") seq = self.asynccall(oid, methodname, args, kwargs) ! return self.asyncreturn(seq) def asynccall(self, oid, methodname, args, kwargs): request = ("call", (oid, methodname, args, kwargs)) seq = self.putrequest(request) + self.debug(("asyncall:%d:" % seq), oid, methodname, args, kwargs) return seq def asyncreturn(self, seq): response = self.getresponse(seq) ! self.debug(("asyncreturn:%d:" % seq), response) return self.decoderesponse(response) *************** *** 198,201 **** --- 195,199 ---- return what if how == "EXCEPTION": + self.debug("decoderesponse: Internal EXCEPTION:", what) mod, name, args, tb = what self.traceback = tb *************** *** 218,221 **** --- 216,220 ---- raise name, args if how == "ERROR": + self.debug("decoderesponse: Internal ERROR:", what) raise RuntimeError, what raise SystemError, (how, what) *************** *** 275,278 **** --- 274,278 ---- def putmessage(self, message): + ##self.debug("putmessage: ", message) try: s = pickle.dumps(message) *************** *** 346,349 **** --- 346,350 ---- seq, resq = message if resq[0] == "call": + self.debug("call_localcall:%d:" % seq) response = self.localcall(resq) self.putmessage((seq, response)) *************** *** 378,382 **** class RPCHandler(SocketServer.BaseRequestHandler, SocketIO): ! debugging = 0 def __init__(self, sock, addr, svr): --- 379,384 ---- class RPCHandler(SocketServer.BaseRequestHandler, SocketIO): ! debugging = False ! location = "#S" # Server def __init__(self, sock, addr, svr): *************** *** 393,396 **** --- 395,401 ---- class RPCClient(SocketIO): + + debugging = False + location = "#C" # Client nextseq = 1 # Requests coming from the client are odd numbered From noreply@sourceforge.net Fri Dec 6 22:13:46 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 06 Dec 2002 14:13:46 -0800 Subject: [Idle-dev] [ idlefork-Bugs-629983 ] SyntaxError in module reported poorly Message-ID: Bugs item #629983, was opened at 2002-10-28 12:24 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629983&group_id=9579 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Kurt B. Kaiser (kbk) Summary: SyntaxError in module reported poorly Initial Comment: When an imported module contains a syntax error, the traceback doesn't properly show the line with the error. Example: >>> import foo Traceback (most recent call last): File "", line 1, in ? import foo SyntaxError: invalid syntax ('foo.py', 1, 3, '1/\n') >>> The regular Python interpreter reports this: Traceback (most recent call last): File "", line 1, in ? File "foo.py", line 1 1/ ^ SyntaxError: invalid syntax >>> And IDLE 0.8 similarly: >>> import foo Traceback (most recent call last): File "", line 1, in ? import foo File "/home/guido/trunk/Tools/idle/foo.py", line 1 1/ ^ SyntaxError: invalid syntax >>> ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2002-12-06 17:13 Message: Logged In: YES user_id=149084 PyShell.py Rev 1.36 rpc.py Rev 1.10 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629983&group_id=9579 From kbk@users.sourceforge.net Wed Dec 11 04:42:07 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 10 Dec 2002 20:42:07 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.36,1.37 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv30655 Modified Files: PyShell.py Log Message: Rework the command line interface, incorporating the shell/edit configuration selection. Rework the usage message to match. Also some minor code polishing. Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** PyShell.py 6 Dec 2002 21:45:23 -0000 1.36 --- PyShell.py 11 Dec 2002 04:42:04 -0000 1.37 *************** *** 11,15 **** import traceback import types - import warnings import exceptions --- 11,14 ---- *************** *** 33,39 **** IDENTCHARS = string.ascii_letters + string.digits + "_" - # XX hardwire this for now, remove later KBK 09Jun02 - use_subprocess = 1 # Set to 1 to spawn subprocess for command execution - # Change warnings module to write to sys.__stderr__ try: --- 32,35 ---- *************** *** 72,79 **** "Regular text edit window when a shell is present" ! # XXX KBK 19Oct02 Breakpoints are currently removed if module is ! # changed or closed. Future plans include saving breakpoints in a ! # project file and possibly preserving breakpoints by changing their ! # line numbers as a module is modified. def __init__(self, *args): --- 68,74 ---- "Regular text edit window when a shell is present" ! # XXX KBK 10Dec02 Breakpoints are currently removed if module is modified. ! # In the future, it may be possible to preserve breakpoints by changing ! # their line numbers as a module is modified. def __init__(self, *args): *************** *** 318,321 **** --- 313,317 ---- self.rpcclt.register("stderr", self.tkconsole.stderr) self.rpcclt.register("flist", self.tkconsole.flist) + self.transfer_path() self.poll_subprocess() *************** *** 329,332 **** --- 325,329 ---- self.spawn_subprocess() self.rpcclt.accept() + self.transfer_path() # restart remote debugger if debug: *************** *** 335,338 **** --- 332,342 ---- debug.load_breakpoints() + def transfer_path(self): + self.runcommand("""if 1: + import sys as _sys + _sys.path = %s + del _sys + \n""" % `sys.path`) + active_seq = None *************** *** 587,591 **** UndoDelegator = ModifiedUndoDelegator ! # Override menus: Run and Format not desired in shell; add Debug menu_specs = [ ("file", "_File"), --- 591,595 ---- UndoDelegator = ModifiedUndoDelegator ! # Override menus menu_specs = [ ("file", "_File"), *************** *** 1009,1113 **** usage_msg = """\ - usage: idle.py [-c command] [-d] [-i] [-r script] [-s] [-t title] [arg] ... ! idle file(s) (without options) edit the file(s) ! -c cmd run the command in a shell ! -d enable the debugger ! -e edit mode; arguments are files to be edited ! -i open an interactive shell ! -i file(s) open a shell and also an editor window for each file ! -r ! -s run $IDLESTARTUP or $PYTHONSTARTUP before anything else ! -t title set title of shell window ! Remaining arguments are applied to the command (-c) or script (-r). """ def main(): cmd = None - edit = 0 - debug = 0 script = None ! startup = 0 ! try: ! opts, args = getopt.getopt(sys.argv[1:], "c:deir:st:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) - for o, a in opts: if o == '-c': cmd = a if o == '-d': ! debug = 1 if o == '-e': ! edit = 1 if o == '-r': script = a if o == '-s': ! startup = 1 if o == '-t': PyShell.shell_title = a ! if args and args[0] != "-": edit = 1 ! for i in range(len(sys.path)): sys.path[i] = os.path.abspath(sys.path[i]) ! ! pathx = [] ! if edit: for filename in args: pathx.append(os.path.dirname(filename)) ! elif args and args[0] != "-": ! pathx.append(os.path.dirname(args[0])) ! else: ! pathx.append(os.curdir) ! for dir in pathx: ! dir = os.path.abspath(dir) ! if not dir in sys.path: ! sys.path.insert(0, dir) ! ! global flist, root root = Tk(className="Idle") fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) ! ! if edit: ! for filename in args: ! flist.open(filename) ! if not args: ! flist.new() ! else: ! if cmd: ! sys.argv = ["-c"] + args ! else: ! sys.argv = args or [""] ! ! shell = PyShell(flist) ! interp = shell.interp ! flist.pyshell = shell ! if startup: filename = os.environ.get("IDLESTARTUP") or \ os.environ.get("PYTHONSTARTUP") if filename and os.path.isfile(filename): ! interp.execfile(filename) ! ! if debug: ! shell.open_debugger() ! if cmd: ! interp.execsource(cmd) ! elif script: ! if os.path.isfile(script): ! interp.execfile(script) ! else: ! print "No script file: ", script ! shell.begin() root.mainloop() root.destroy() def display_port_binding_error(): --- 1013,1177 ---- usage_msg = """\ ! USAGE: idle [-deis] [-t title] [file]* ! idle [-ds] [-t title] (-c cmd | -r file) [arg]* ! idle [-ds] [-t title] - [arg]* ! ! -h print this help message and exit ! ! The following options will override the IDLE 'settings' configuration: ! ! -e open an edit window ! -i open a shell window ! ! The following options imply -i and will open a shell: ! ! -c cmd run the command in a shell, or ! -r file run script from file ! ! -d enable the debugger ! -s run $IDLESTARTUP or $PYTHONSTARTUP before anything else ! -t title set title of shell window ! ! A default edit window will be bypassed when -c, -r, or - are used. ! ! [arg]* are passed to the command (-c) or script (-r) in sys.argv[1:]. ! ! Examples: ! idle ! Open an edit window or shell depending on IDLE's configuration. ! idle foo.py foobar.py ! Edit the files, also open a shell if configured to start with shell. ! ! idle -est "Baz" foo.py ! Run $IDLESTARTUP or $PYTHONSTARTUP, edit foo.py, and open a shell ! window with the title "Baz". ! ! idle -c "import sys; print sys.argv" "foo" ! Open a shell window and run the command, passing "-c" in sys.argv[0] ! and "foo" in sys.argv[1]. ! ! idle -d -s -r foo.py "Hello World" ! Open a shell window, run a startup script, enable the debugger, and ! run foo.py, passing "foo.py" in sys.argv[0] and "Hello World" in ! sys.argv[1]. ! ! echo "import sys; print sys.argv" | idle - "foobar" ! Open a shell window, run the script piped in, passing '' in sys.argv[0] ! and "foobar" in sys.argv[1]. """ def main(): + global flist, root, use_subprocess + + enable_shell = False + enable_edit = False + debug = False cmd = None script = None ! startup = False try: ! opts, args = getopt.getopt(sys.argv[1:], "c:deihr:st:") except getopt.error, msg: sys.stderr.write("Error: %s\n" % str(msg)) sys.stderr.write(usage_msg) sys.exit(2) for o, a in opts: if o == '-c': cmd = a + enable_shell = True if o == '-d': ! debug = True ! enable_shell = True if o == '-e': ! enable_edit = True ! if o == '-h': ! sys.stdout.write(usage_msg) ! sys.exit() ! if o == '-i': ! enable_shell = True if o == '-r': script = a + if os.path.isfile(script): + pass + else: + print "No script file: ", script + sys.exit() + enable_shell = True if o == '-s': ! startup = True ! enable_shell = True if o == '-t': PyShell.shell_title = a + enable_shell = True + if args and args[0] == '-': + cmd = sys.stdin.read() + enable_shell = True + + use_subprocess = True ! # process sys.argv and sys.path: for i in range(len(sys.path)): sys.path[i] = os.path.abspath(sys.path[i]) ! if args and args[0] == '-': ! sys.argv = [''] + args[1:] ! elif cmd: ! sys.argv = ['-c'] + args ! elif script: ! sys.argv = [script] + args ! elif args: ! enable_edit = True ! pathx = [] for filename in args: pathx.append(os.path.dirname(filename)) ! for dir in pathx: ! dir = os.path.abspath(dir) ! if not dir in sys.path: ! sys.path.insert(0, dir) ! # check the IDLE settings configuration (but command line overrides) ! edit_start = idleConf.GetOption('main', 'General', ! 'editor-on-startup', type='bool') ! enable_edit = enable_edit or edit_start ! enable_shell = enable_shell or not edit_start ! # start editor and/or shell windows: root = Tk(className="Idle") fixwordbreaks(root) root.withdraw() flist = PyShellFileList(root) ! if enable_edit: ! if not (cmd or script): ! for filename in args: ! flist.open(filename) ! if not args: ! flist.new() ! if enable_shell: ! flist.open_shell() ! elif enable_shell: ! flist.pyshell = PyShell(flist) ! flist.pyshell.begin() ! shell = flist.pyshell ! # handle remaining options: ! if debug: ! shell.open_debugger() if startup: filename = os.environ.get("IDLESTARTUP") or \ os.environ.get("PYTHONSTARTUP") if filename and os.path.isfile(filename): ! shell.interp.execfile(filename) ! if cmd or script: ! shell.interp.runcommand("""if 1: ! import sys as _sys ! _sys.argv = %s ! del _sys ! \n""" % `sys.argv`) ! if cmd: ! shell.interp.execsource(cmd) ! elif script: ! shell.interp.execfile(script) root.mainloop() root.destroy() + def display_port_binding_error(): From kbk@users.sourceforge.net Wed Dec 11 04:42:41 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 10 Dec 2002 20:42:41 -0800 Subject: [Idle-dev] CVS: idle help.txt,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv31903 Modified Files: help.txt Log Message: Update to reflect current implementation. Index: help.txt =================================================================== RCS file: /cvsroot/idlefork/idle/help.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** help.txt 31 Oct 2001 10:40:28 -0000 1.4 --- help.txt 11 Dec 2002 04:42:39 -0000 1.5 *************** *** 1,15 **** ! [See end for tips.] Click on the dotted line at the top of a menu to "tear it off": a separate window containing the menu is created. ! File menu: ! New window -- create a new editing window Open... -- open an existing file ! Open module... -- open an existing module (searches sys.path) ! Class browser -- show classes and methods in current file ! Path browser -- show sys.path directories, modules, classes ! and methods --- Save -- save current window to the associated file (unsaved --- 1,16 ---- ! [See end for ** TIPS ] Click on the dotted line at the top of a menu to "tear it off": a separate window containing the menu is created. ! File Menu: ! New Window -- create a new editing window Open... -- open an existing file ! Recent Files... -- open a list of recent files ! Open Module... -- open an existing module (searches sys.path) ! Class Browser -- show classes and methods in current file ! Path Browser -- show sys.path directories, modules, classes ! and methods --- Save -- save current window to the associated file (unsaved *************** *** 17,28 **** Save As... -- save current window to new file, which becomes ! the associated file Save Copy As... -- save current window to different file ! without changing the associated file --- Close -- close current window (asks to save if unsaved) Exit -- close all windows and quit IDLE (asks to save if unsaved) ! Edit menu: Undo -- Undo last change to current window (max 1000 changes) --- 18,31 ---- Save As... -- save current window to new file, which becomes ! the associated file Save Copy As... -- save current window to different file ! without changing the associated file ! --- ! Print Window -- print the current window --- Close -- close current window (asks to save if unsaved) Exit -- close all windows and quit IDLE (asks to save if unsaved) ! Edit Menu: Undo -- Undo last change to current window (max 1000 changes) *************** *** 35,60 **** --- Find... -- Open a search dialog box with many options ! Find again -- Repeat last search ! Find selection -- Search for the string in the selection Find in Files... -- Open a search dialog box for searching files Replace... -- Open a search-and-replace dialog box ! Go to line -- Ask for a line number and show that line ! --- ! Indent region -- Shift selected lines right 4 spaces ! Dedent region -- Shift selected lines left 4 spaces ! Comment out region -- Insert ## in front of selected lines ! Uncomment region -- Remove leading # or ## from selected lines ! Tabify region -- Turns *leading* stretches of spaces into tabs ! Untabify region -- Turn *all* tabs into the right number of spaces ! Expand word -- Expand the word you have typed to match another ! word in the same buffer; repeat to get a different expansion Format Paragraph -- Reformat the current blank-line-separated paragraph --- ! Import module -- Import or reload the current module ! Run script -- Execute the current file in the __main__ namespace ! Windows menu: ! Zoom Height -- toggles the window between normal size (24x80) and maximum height. --- --- 38,79 ---- --- Find... -- Open a search dialog box with many options ! Find Again -- Repeat last search ! Find Selection -- Search for the string in the selection Find in Files... -- Open a search dialog box for searching files Replace... -- Open a search-and-replace dialog box ! Go to Line -- Ask for a line number and show that line ! Expand Word -- Expand the word you have typed to match another ! word in the same buffer; repeat to get a different ! expansion ! ! Format Menu (only in Edit window): ! ! Indent Region -- Shift selected lines right 4 spaces ! Dedent Region -- Shift selected lines left 4 spaces ! Comment Out Region -- Insert ## in front of selected lines ! Uncomment Region -- Remove leading # or ## from selected lines ! Tabify Region -- Turns *leading* stretches of spaces into tabs ! Untabify Region -- Turn *all* tabs into the right number of spaces ! New Indent Width... -- Open dialog to change indent width Format Paragraph -- Reformat the current blank-line-separated paragraph + + Run Menu (only in Edit window): + + Python Shell -- Open or wake up the Python shell window --- ! Check Module -- Run a syntax check on the module ! Run Script -- Execute the current file in the __main__ namespace ! Settings Menu: ! Configure IDLE -- Open a configuration dialog. Fonts, indentation, ! keybindings, and color themes may be altered. ! Startup preferences may be set. ! --- ! Revert to Default Settings -- Restore original settings ! ! Windows Menu: ! ! Zoom Height -- toggles the window between configured size and maximum height. --- *************** *** 63,73 **** necessary). ! Debug menu (in the Python Shell window only): ! Go to file/line -- look around the insert point for a filename ! and linenumber, open the file, and show the line ! Open stack viewer -- show the stack traceback of the last exception ! Debugger toggle -- Run commands in the shell under the debugger ! JIT Stack viewer toggle -- Open stack viewer on traceback Basic editing and navigation: --- 82,105 ---- necessary). ! Debug Menu (in the Python Shell window only): ! Go to File/Line -- look around the insert point for a filename ! and linenumber, open the file, and show the line ! Stack Viewer -- show the stack traceback of the last exception ! Debugger (toggle) -- Run commands in the shell under the debugger ! Auto-open Stack Viewer (toggle) -- Open stack viewer on traceback ! ! Help Menu: ! ! IDLE Help -- Display this file ! Python Documentation -- Access local Python documentation, if ! installed. Otherwise access python.org. ! Advice -- Emergency Only! ! IDLE Readme -- Background discussion and change details ! --- ! About IDLE --- Version, copyright, license, credits ! ! ** TIPS ! ======== Basic editing and navigation: *************** *** 77,81 **** Home/End go to begin/end of line Control-Home/End go to begin/end of file ! Some Emacs bindings may also work, e.g. ^B/^P/^A/^E/^D/^L Automatic indentation: --- 109,114 ---- Home/End go to begin/end of line Control-Home/End go to begin/end of file ! Some Emacs or standard Windows bindings may work. ! Keybindings are selected in the Settings Dialog, look there. Automatic indentation: *************** *** 85,91 **** certain keywords (break, return etc.) the next line is dedented. In leading indentation, Backspace deletes up to 4 ! spaces if they are there. Tab inserts 1-4 spaces (in the ! Python Shell window one tab). See also the indent/dedent ! region commands in the edit menu. Python Shell window: --- 118,124 ---- certain keywords (break, return etc.) the next line is dedented. In leading indentation, Backspace deletes up to 4 ! spaces if they are there. Tab inserts spaces (in the ! Python Shell window one tab), number depends on Indent Width ! See also the indent/dedent region commands in the edit menu. Python Shell window: *************** *** 105,112 **** The coloring is applied in a background "thread", so you may occasionally see uncolorized text. To change the color ! scheme, edit the [Colors] section in config.txt (or add a ! [Colors] section to ~/.idle). ! Python syntax colors: Keywords orange --- 138,144 ---- The coloring is applied in a background "thread", so you may occasionally see uncolorized text. To change the color ! scheme, use the Settings/Highlighting dialog. ! Python default syntax colors: Keywords orange *************** *** 115,119 **** Definitions blue ! Shell colors: Console output brown --- 147,151 ---- Definitions blue ! Shell default colors: Console output brown *************** *** 124,165 **** Other preferences: ! To change the font open config-[win/unix/mac].txt and ! change ! ! font-name: courier new ! font-size: 10 ! ! to, for example: ! ! font-name: courier new bold ! font-size: 14 ! ! Note: a GUI based configuration screen will be provided ! in the future. ! ! To change keyboard bindings, edit Bindings.py Command line usage: ! ! idle.py [-c command] [-d] [-e] [-s] [-t title] [arg] ... ! ! -c command run this command ! -d enable debugger ! -e edit mode; arguments are files to be edited ! -s run $IDLESTARTUP or $PYTHONSTARTUP first ! -t title set title of shell window ! ! If there are arguments: ! ! If -e is used, arguments are files opened for editing and ! sys.argv reflects the arguments passed to IDLE itself. ! ! Otherwise, if -c is used, all arguments are placed in ! sys.argv[1:...], with sys.argv[0] set to '-c'. ! ! Otherwise, if neither -e nor -c is used, the first ! argument is a script which is executed with the remaining ! arguments in sys.argv[1:...] and sys.argv[0] set to the ! script name. If the script name is '-', no script is ! executed but an interactive Python session is started; the ! arguments are still available in sys.argv. --- 156,163 ---- Other preferences: ! The font preferences, keybinding, and startup preferences can ! be changed using the Settings dialog. Command line usage: ! ! Enter idle -h at the command prompt to get a usage message. From kbk@users.sourceforge.net Thu Dec 12 19:15:41 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Thu, 12 Dec 2002 11:15:41 -0800 Subject: [Idle-dev] CVS: idle CallTips.py,1.7,1.8 CallTipWindow.py,1.5,1.6 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv28086 Modified Files: CallTips.py CallTipWindow.py Log Message: M CallTipWindow.py M CallTips.py Calltip fetch was erroring when an Edit window was used without a Shell. Also, fix CallTipWindow.py so test code will run and add a comment about a bug which causes the calltip window to override all others. Index: CallTips.py =================================================================== RCS file: /cvsroot/idlefork/idle/CallTips.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** CallTips.py 10 Oct 2002 08:25:24 -0000 1.7 --- CallTips.py 12 Dec 2002 19:15:39 -0000 1.8 *************** *** 1,8 **** """CallTips.py - An IDLE Extension to Jog Your Memory ! Call Tips are floating windows which display function/method parameter ! information as you open the parameter parenthesis, and which disappear when you ! type the closing parenthesis. Future plans include extending the functionality ! to include class attributes. """ --- 1,9 ---- """CallTips.py - An IDLE Extension to Jog Your Memory ! Call Tips are floating windows which display function, class, and method ! parameter and docstring information when you type an opening parenthesis, and ! which disappear when you type a closing parenthesis. ! ! Future plans include extending the functionality to include class attributes. """ *************** *** 83,88 **** def fetch_tip(self, name): ! interp = self.editwin and self.editwin.flist.pyshell.interp ! rpcclt = interp and interp.rpcclt if rpcclt: return rpcclt.remotecall("exec", "get_the_calltip", --- 84,102 ---- def fetch_tip(self, name): ! """Return the argument list and docstring of a function or class ! ! If there is a Python subprocess, get the calltip there. Otherwise, ! either fetch_tip() is running in the subprocess itself or it was called ! in an IDLE EditorWindow before any script had been run. ! ! The subprocess environment is that of the most recently run script. If ! two unrelated modules are being edited some calltips in the current ! module may be inoperative if the module was not the last to run. ! ! """ ! try: ! rpcclt = self.editwin.flist.pyshell.interp.rpcclt ! except: ! rpcclt = None if rpcclt: return rpcclt.remotecall("exec", "get_the_calltip", *************** *** 93,96 **** --- 107,111 ---- def get_entity(self, name): + "Lookup name in a namespace spanning sys.modules and __main.dict__" if name: namespace = sys.modules.copy() *************** *** 113,117 **** def get_arg_text(ob): ! # Get a string describing the arguments for the given object. argText = "" if ob is not None: --- 128,132 ---- def get_arg_text(ob): ! "Get a string describing the arguments for the given object" argText = "" if ob is not None: Index: CallTipWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/CallTipWindow.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** CallTipWindow.py 23 Sep 2002 01:04:05 -0000 1.5 --- CallTipWindow.py 12 Dec 2002 19:15:39 -0000 1.6 *************** *** 1,6 **** ! # A CallTip window class for Tkinter/IDLE. ! # After ToolTip.py, which uses ideas gleaned from PySol ! # Used by the CallTips IDLE extension. from Tkinter import * --- 1,8 ---- ! """A CallTip window class for Tkinter/IDLE. ! After ToolTip.py, which uses ideas gleaned from PySol ! Used by the CallTips IDLE extension. ! ! """ from Tkinter import * *************** *** 14,24 **** def showtip(self, text): ! # SF bug 546078: IDLE calltips cause application error. ! # There were crashes on various Windows flavors, and even a ! # crashing X server on Linux, with very long calltips. if len(text) >= 79: text = text[:75] + ' ...' self.text = text - if self.tipwindow or not self.text: return --- 16,24 ---- def showtip(self, text): ! " Display text in calltip window" ! # truncate overly long calltip if len(text) >= 79: text = text[:75] + ' ...' self.text = text if self.tipwindow or not self.text: return *************** *** 28,31 **** --- 28,35 ---- y = y + cy + self.widget.winfo_rooty() self.tipwindow = tw = Toplevel(self.widget) + # XXX 12 Dec 2002 KBK The following command has two effects: It removes + # the calltip window border (good) but also causes (at least on + # Linux) the calltip to show as a top level window, burning through + # any other window dragged over it. Also, shows on all viewports! tw.wm_overrideredirect(1) tw.wm_geometry("+%d+%d" % (x, y)) *************** *** 69,73 **** text.focus_set() ! # root.mainloop() # not in idle def calltip_show(self, event): --- 73,77 ---- text.focus_set() ! root.mainloop() def calltip_show(self, event): From teyc@users.sourceforge.net Thu Dec 12 20:53:22 2002 From: teyc@users.sourceforge.net (Chui Tey) Date: Thu, 12 Dec 2002 12:53:22 -0800 Subject: [Idle-dev] CVS: idle Debugger.py,1.16,1.17 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv971 Modified Files: Debugger.py Log Message: Prevent debugger from stepping into Idle rpc code Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** Debugger.py 2 Dec 2002 04:41:29 -0000 1.16 --- Debugger.py 12 Dec 2002 20:53:19 -0000 1.17 *************** *** 14,24 **** def user_line(self, frame): ! # get the currently executing function ! ##print>>sys.__stderr__, "*function: ", frame.f_code.co_name ! ##print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ! ##print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno co_filename = frame.f_code.co_filename co_name = frame.f_code.co_name try: func = frame.f_locals[co_name] if getattr(func, "DebuggerStepThrough", 0): --- 14,34 ---- def user_line(self, frame): ! co_filename = frame.f_code.co_filename co_name = frame.f_code.co_name + + ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name + ## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename + ## print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno + ## print>>sys.__stderr__, "*name: ", co_name + ## print>>sys.__stderr__, "*function: ", frame.f_locals.get(co_name,None) + try: + # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the + # XXX currently running function. If the function has an + # attribute called "DebuggerStepThrough", prevent the debugger + # from stepping through Idle code. The following doesn't work + # in instance methods. Hard coded some workarounds. + func = frame.f_locals[co_name] if getattr(func, "DebuggerStepThrough", 0): *************** *** 28,32 **** except: pass ! if co_filename in ('rpc.py', ''): self.set_step() return --- 38,44 ---- except: pass ! ! # workaround for the problem above ! if co_filename in (r'.\rpc.py', 'rpc.py',''): self.set_step() return From noreply@sourceforge.net Thu Dec 12 21:28:37 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 12 Dec 2002 13:28:37 -0800 Subject: [Idle-dev] [ idlefork-Bugs-652933 ] Open Module "math" Fails Message-ID: Bugs item #652933, was opened at 2002-12-12 16:28 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=652933&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Kurt B. Kaiser (kbk) Assigned to: Raymond Hettinger (rhettinger) Summary: Open Module "math" Fails Initial Comment: Ref SF 600152 AttributeError: 'module' object has no attribute '__path__' ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=652933&group_id=9579 From noreply@sourceforge.net Thu Dec 12 22:48:31 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 12 Dec 2002 14:48:31 -0800 Subject: [Idle-dev] [ idlefork-Bugs-652933 ] Open Module "math" Fails Message-ID: Bugs item #652933, was opened at 2002-12-12 16:28 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=652933&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Kurt B. Kaiser (kbk) Assigned to: Raymond Hettinger (rhettinger) >Summary: Open Module "math" Fails Initial Comment: Ref SF 600152 AttributeError: 'module' object has no attribute '__path__' ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2002-12-12 17:48 Message: Logged In: YES user_id=80475 Open module only has meaning for pure python code. The math module is written in C, so there is nothing to open- up in IDLE. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=652933&group_id=9579 From noreply@sourceforge.net Fri Dec 13 15:25:58 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Fri, 13 Dec 2002 07:25:58 -0800 Subject: [Idle-dev] [ idlefork-Bugs-652933 ] Open Module "math" Fails Message-ID: Bugs item #652933, was opened at 2002-12-12 16:28 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=652933&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Kurt B. Kaiser (kbk) Assigned to: Raymond Hettinger (rhettinger) >Summary: Open Module "math" Fails Initial Comment: Ref SF 600152 AttributeError: 'module' object has no attribute '__path__' ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2002-12-13 10:25 Message: Logged In: YES user_id=149084 Hi Raymond I realize that, but IDLE is raising an error to the console and we're trying to avoid those. If I Open Module "RazzleDazzle" I get a Tk Import Error dialog, "No module named RazzleDazzle." What I'd suggest is to rework that dialog to say "No source for module RazzleDazzle" and then direct the __path__ error to that dialog also, so it can do double duty. ---------------------------------------------------------------------- Comment By: Raymond Hettinger (rhettinger) Date: 2002-12-12 17:48 Message: Logged In: YES user_id=80475 Open module only has meaning for pure python code. The math module is written in C, so there is nothing to open- up in IDLE. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=652933&group_id=9579 From kbk@users.sourceforge.net Sat Dec 14 04:38:53 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Fri, 13 Dec 2002 20:38:53 -0800 Subject: [Idle-dev] CVS: idle Debugger.py,1.17,1.18 IOBinding.py,1.10,1.11 PyShell.py,1.37,1.38 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv6783 Modified Files: Debugger.py IOBinding.py PyShell.py Log Message: M Debugger.py M IOBinding.py M PyShell.py * Could not remove last set of saved breakpoints from a file * Starting with empty edit window, could not load a file * Multiple adjacent breakpoints were saved as one breakpoint * Storing breakpoints whenever a file is closed can get them out of synch with the saved version of a file. Only store them when the file is saved. * Add comment on current limitations on file editing in the presence of breakpoints. * Replace get_current_breaks() with update_breakpoints(), add an update to PyShellEditorWindow.breakpoints, which is the master breakpoint data structure, and which is used to reload the subprocess debugger. * Revert Debugger.Debugger.load_breakpoints() to use editwin.breakpoints. It is easier to debug the debugger if the breakpoint list in IDLE is identical to the list in the subprocess debugger and is transferred when the subprocess debugger is restarted, because this list can be easily queried. * Cleanup some linespacing and comments in IOBinding.py Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** Debugger.py 12 Dec 2002 20:53:19 -0000 1.17 --- Debugger.py 14 Dec 2002 04:38:51 -0000 1.18 *************** *** 332,336 **** filename = editwin.io.filename try: ! for lineno in editwin.get_current_breaks(): self.set_breakpoint_here(filename, lineno) except AttributeError: --- 332,336 ---- filename = editwin.io.filename try: ! for lineno in editwin.breakpoints: self.set_breakpoint_here(filename, lineno) except AttributeError: Index: IOBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/IOBinding.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** IOBinding.py 4 Nov 2002 03:11:10 -0000 1.10 --- IOBinding.py 14 Dec 2002 04:38:51 -0000 1.11 *************** *** 14,38 **** import tkMessageBox import re - from configHandler import idleConf ! #$ event <> ! #$ win ! #$ unix ! ! #$ event <> ! #$ win ! #$ unix ! ! #$ event <> ! #$ win ! #$ unix ! ! #$ event <> ! #$ win ! #$ unix ! ! #$ event <> ! #$ win ! #$ unix try: --- 14,19 ---- import tkMessageBox import re ! from configHandler import idleConf try: *************** *** 86,94 **** coding_re = re.compile("coding[:=]\s*([-\w_.]+)") - def coding_spec(str): """Return the encoding declaration according to PEP 263. - Raise LookupError if the encoding is declared but unknown.""" # Only consider the first two lines str = str.split("\n")[:2] --- 67,76 ---- coding_re = re.compile("coding[:=]\s*([-\w_.]+)") + def coding_spec(str): """Return the encoding declaration according to PEP 263. + Raise LookupError if the encoding is declared but unknown. + """ # Only consider the first two lines str = str.split("\n")[:2] *************** *** 108,111 **** --- 90,94 ---- return name + class IOBinding: *************** *** 219,230 **** self.text.mark_set("insert", "1.0") self.text.see("insert") - self.updaterecentfileslist(filename) return True def decode(self, chars): ! # Try to create a Unicode string. If that fails, let Tcl try ! # its best # Check presence of a UTF-8 signature first if chars.startswith(BOM_UTF8): --- 202,213 ---- self.text.mark_set("insert", "1.0") self.text.see("insert") self.updaterecentfileslist(filename) return True def decode(self, chars): ! """Create a Unicode string + If that fails, let Tcl try its best + """ # Check presence of a UTF-8 signature first if chars.startswith(BOM_UTF8): *************** *** 238,242 **** self.fileencoding = BOM_UTF8 return chars - # Next look for coding specification try: --- 221,224 ---- *************** *** 249,253 **** master = self.text) enc = None - if enc: try: --- 231,234 ---- *************** *** 255,259 **** except UnicodeError: pass - # If it is ASCII, we need not to record anything try: --- 236,239 ---- *************** *** 261,265 **** except UnicodeError: pass - # Finally, try the locale's encoding. This is deprecated; # the user should declare a non-ASCII encoding --- 241,244 ---- *************** *** 296,301 **** if self.writefile(self.filename): self.set_saved(1) self.text.focus_set() - return "break" --- 275,280 ---- if self.writefile(self.filename): self.set_saved(1) + self.editwin.store_file_breaks() self.text.focus_set() return "break" *************** *** 306,311 **** self.set_filename(filename) self.set_saved(1) self.text.focus_set() - self.updaterecentfileslist(filename) return "break" --- 285,290 ---- self.set_filename(filename) self.set_saved(1) + self.editwin.store_file_breaks() self.text.focus_set() self.updaterecentfileslist(filename) return "break" *************** *** 316,320 **** self.writefile(filename) self.text.focus_set() - self.updaterecentfileslist(filename) return "break" --- 295,298 ---- *************** *** 327,331 **** f.write(chars) f.close() - ## print "saved to", `filename` return True except IOError, msg: --- 305,308 ---- *************** *** 339,343 **** # text to us. Don't try to guess further. return chars - # See whether there is anything non-ASCII in it. # If not, no need to figure out the encoding. --- 316,319 ---- *************** *** 346,350 **** except UnicodeError: pass - # If there is an encoding declared, try this first. try: --- 322,325 ---- *************** *** 359,363 **** except UnicodeError: failed = "Invalid encoding '%s'" % enc - if failed: tkMessageBox.showerror( --- 334,337 ---- *************** *** 365,373 **** "%s. Saving as UTF-8" % failed, master = self.text) - # If there was a UTF-8 signature, use that. This should not fail if self.fileencoding == BOM_UTF8 or failed: return BOM_UTF8 + chars.encode("utf-8") - # Try the original file encoding next, if any if self.fileencoding: --- 339,345 ---- *************** *** 381,385 **** master = self.text) return BOM_UTF8 + chars.encode("utf-8") - # Nothing was declared, and we had not determined an encoding # on loading. Recommend an encoding line. --- 353,356 ---- *************** *** 470,478 **** return self.savedialog.show(initialdir=dir, initialfile=base) - def updaterecentfileslist(self,filename): ! # ! # Updates recent file list on all editor windows ! # self.editwin.UpdateRecentFilesList(filename) --- 441,446 ---- return self.savedialog.show(initialdir=dir, initialfile=base) def updaterecentfileslist(self,filename): ! "Update recent file list on all editor windows" self.editwin.UpdateRecentFilesList(filename) Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** PyShell.py 11 Dec 2002 04:42:04 -0000 1.37 --- PyShell.py 14 Dec 2002 04:38:51 -0000 1.38 *************** *** 68,75 **** "Regular text edit window when a shell is present" - # XXX KBK 10Dec02 Breakpoints are currently removed if module is modified. - # In the future, it may be possible to preserve breakpoints by changing - # their line numbers as a module is modified. - def __init__(self, *args): self.breakpoints = [] --- 68,71 ---- *************** *** 79,87 **** self.text.bind("<>", self.flist.open_shell) ! self.breakpointPath=os.path.join(idleConf.GetUserCfgDir(), 'breakpoints.lst') ! # whenever a file is changed, restore breakpoints if self.io.filename: self.restore_file_breaks() ! def filename_changed_hook(old_hook=self.io.filename_change_hook,self=self): self.restore_file_breaks() old_hook() --- 75,84 ---- self.text.bind("<>", self.flist.open_shell) ! self.breakpointPath = os.path.join(idleConf.GetUserCfgDir(), ! 'breakpoints.lst') # whenever a file is changed, restore breakpoints if self.io.filename: self.restore_file_breaks() ! def filename_changed_hook(old_hook=self.io.filename_change_hook, ! self=self): self.restore_file_breaks() old_hook() *************** *** 149,195 **** def store_file_breaks(self): ! if not self.breakpoints: ! return ! filename=self.io.filename try: ! lines=open(self.breakpointPath,"r").readlines() except IOError: ! lines=[] ! new_file=open(self.breakpointPath,"w") for line in lines: ! if not line.startswith(filename+"="): new_file.write(line) ! new_file.write(filename+"="+`self.get_current_breaks()`+"\n") new_file.close() def restore_file_breaks(self): self.text.update() # this enables setting "BREAK" tags to be visible ! filename=self.io.filename if os.path.isfile(self.breakpointPath): ! lines=open(self.breakpointPath,"r").readlines() for line in lines: ! if line.startswith(filename+"="): ! breakpoint_linenumbers=eval(line[len(filename)+1:]) for breakpoint_linenumber in breakpoint_linenumbers: self.set_breakpoint(breakpoint_linenumber) ! def get_current_breaks(self): ! # ! # retrieves all the breakpoints in the current window ! # text = self.text ! lines = text.tag_ranges("BREAK") ! result = [int(float((lines[i]))) for i in range(0,len(lines),2)] ! return result ! ! def saved_change_hook(self): ! "Extend base method - clear breaks if module is modified" ! if not self.get_saved(): ! self.clear_file_breaks() ! EditorWindow.saved_change_hook(self) def _close(self): "Extend base method - clear breaks when module is closed" - self.store_file_breaks() self.clear_file_breaks() EditorWindow._close(self) --- 146,225 ---- def store_file_breaks(self): ! "Save breakpoints when file is saved" ! # XXX 13 Dec 2002 KBK Currently the file must be saved before it can ! # be run. The breaks are saved at that time. If we introduce ! # a temporary file save feature the save breaks functionality ! # needs to be re-verified, since the breaks at the time the ! # temp file is created may differ from the breaks at the last ! # permanent save of the file. A break introduced after a save ! # will be effective, but not persistent. This is necessary to ! # keep the saved breaks synched with the saved file. ! # ! # Breakpoints are set as tagged ranges in the text. Certain ! # kinds of edits cause these ranges to be deleted: Inserting ! # or deleting a line just before a breakpoint, and certain ! # deletions prior to a breakpoint. These issues need to be ! # investigated and understood. It's not clear if they are ! # Tk issues or IDLE issues, or whether they can actually ! # be fixed. Since a modified file has to be saved before it is ! # run, and since self.breakpoints (from which the subprocess ! # debugger is loaded) is updated during the save, the visible ! # breaks stay synched with the subprocess even if one of these ! # unexpected breakpoint deletions occurs. ! breaks = self.breakpoints ! filename = self.io.filename try: ! lines = open(self.breakpointPath,"r").readlines() except IOError: ! lines = [] ! new_file = open(self.breakpointPath,"w") for line in lines: ! if not line.startswith(filename + '='): new_file.write(line) ! self.update_breakpoints() ! breaks = self.breakpoints ! if breaks: ! new_file.write(filename + '=' + str(breaks) + '\n') new_file.close() def restore_file_breaks(self): self.text.update() # this enables setting "BREAK" tags to be visible ! filename = self.io.filename ! if filename is None: ! return if os.path.isfile(self.breakpointPath): ! lines = open(self.breakpointPath,"r").readlines() for line in lines: ! if line.startswith(filename + '='): ! breakpoint_linenumbers = eval(line[len(filename)+1:]) for breakpoint_linenumber in breakpoint_linenumbers: self.set_breakpoint(breakpoint_linenumber) ! def update_breakpoints(self): ! "Retrieves all the breakpoints in the current window" text = self.text ! ranges = text.tag_ranges("BREAK") ! linenumber_list = self.ranges_to_linenumbers(ranges) ! self.breakpoints = linenumber_list ! ! def ranges_to_linenumbers(self, ranges): ! lines = [] ! for index in range(0, len(ranges), 2): ! lineno = int(float(ranges[index])) ! end = int(float(ranges[index+1])) ! while lineno < end: ! lines.append(lineno) ! lineno += 1 ! return lines ! ! # XXX 13 Dec 2020 KBK Not used currently ! # def saved_change_hook(self): ! # "Extend base method - clear breaks if module is modified" ! # if not self.get_saved(): ! # self.clear_file_breaks() ! # EditorWindow.saved_change_hook(self) def _close(self): "Extend base method - clear breaks when module is closed" self.clear_file_breaks() EditorWindow._close(self) From kbk@users.sourceforge.net Mon Dec 16 02:07:13 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 15 Dec 2002 18:07:13 -0800 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.35,1.36 PyShell.py,1.38,1.39 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv30594 Modified Files: EditorWindow.py PyShell.py Log Message: M EditorWindow.py M PyShell.py Idlefork SF Bug 440383 - IDLE goes into beep loop Fix loop in EditorWindow.newline_and_indent_event() and in addition fix submission of >>> prompt to PyParse.Parser Eliminate extra attribute EditorWindow.auto_indent Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -r1.35 -r1.36 *** EditorWindow.py 23 Oct 2002 04:48:08 -0000 1.35 --- EditorWindow.py 16 Dec 2002 02:07:11 -0000 1.36 *************** *** 1086,1091 **** text.undo_block_stop() - auto_indent = newline_and_indent_event - # Our editwin provides a is_char_in_string function that works # with a Tk text index, but PyParse only knows about offsets into --- 1086,1089 ---- Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** PyShell.py 14 Dec 2002 04:38:51 -0000 1.38 --- PyShell.py 16 Dec 2002 02:07:11 -0000 1.39 *************** *** 887,891 **** self.text.see("insert") else: ! self.auto_indent(event) return "break" --- 887,891 ---- self.text.see("insert") else: ! self.newline_and_indent_event(event) return "break" *************** *** 919,922 **** --- 919,927 ---- self.recall(self.text.get("insert linestart", "insert lineend")) return "break" + # If we're between the beginning of the line and the iomark, i.e. + # in the prompt area, complain. + if self.text.compare("insert", "<", "iomark"): + self.text.bell() + return "break" # If we're in the current input and there's only whitespace # beyond the cursor, erase that whitespace first *************** *** 927,931 **** # insert a newline right at the insert point if self.text.compare("insert", "<", "end-1c linestart"): ! self.auto_indent(event) return "break" # We're in the last line; append a newline and submit it --- 932,936 ---- # insert a newline right at the insert point if self.text.compare("insert", "<", "end-1c linestart"): ! self.newline_and_indent_event(event) return "break" # We're in the last line; append a newline and submit it *************** *** 935,939 **** self.text.see("insert") else: ! self.auto_indent(event) self.text.tag_add("stdin", "iomark", "end-1c") self.text.update_idletasks() --- 940,944 ---- self.text.see("insert") else: ! self.newline_and_indent_event(event) self.text.tag_add("stdin", "iomark", "end-1c") self.text.update_idletasks() From noreply@sourceforge.net Mon Dec 16 02:14:59 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Sun, 15 Dec 2002 18:14:59 -0800 Subject: [Idle-dev] [ idlefork-Bugs-440383 ] beep on no-op enter in shell Message-ID: Bugs item #440383, was opened at 2001-07-11 07:24 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=440383&group_id=9579 Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 3 Submitted By: Kurt B. Kaiser (kbk) >Assigned to: Kurt B. Kaiser (kbk) Summary: beep on no-op enter in shell Initial Comment: A bug report. --Guido van Rossum (home page: http://www.python.org/~guido/) ------- Forwarded Message Date: Mon, 02 Jul 2001 09:07:58 -0500 From: vze2f978@verizon.net To: guido@python.org Subject: IDLE issue--beeping and IDLE hangs If the window looks something like this: >>>(cursor is here) for x in range[w]: and you hit return, IDLE will stop responding, but beep continually until the computer is restarted. This is in Windows 2000. I'm not sure whether the cursor is before or after the invisible space after the ">>>"; the for statement is on the line AFTER the >>>. Don't know why the student used square braces either. ------- End of Forwarded Message ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2002-12-15 21:14 Message: Logged In: YES user_id=149084 PyShell.py Rev 1.39 To duplicate: enter def foo():, hit return, then place cursor at column 3 on the first line (just after the prompt) and hit return. IDLE will go into a beep loop. If cursor is at col 1 or 2, IDLE will raise an assertion error because the prompt '>>" submitted to PyParse.Parser doesn't end with \n. Both fixed with this checkin. However, IDLE will still beep when hitting enter at the >>> prompt, which is a different issue. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-05-20 05:51 Message: Logged In: YES user_id=6380 I know it's very minor, but I believe it might point to some unsound code somewhere deep in the bowels of undo. Definitely low priority. ---------------------------------------------------------------------- Comment By: Stephen M. Gava (elguavas) Date: 2002-05-19 21:45 Message: Logged In: YES user_id=75867 I can reproduce the beep on just enter on linux. Why not consider it a feature, reminding you that pressing enter for nothing in the shell is useless? It seems to happen because of something in undo-delegator, if it actually a serious problem for anyone I'll look into it further... ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-10-29 08:16 Message: Logged In: YES user_id=6380 My apologies. I can't reproduced the described behavior either. What's still broken is that if you press Return at the >>> prompt in the Shell window without entering a command, you get a beep and a new >>> prompt. I could do without the beep (the new >>> prompt is expected. :-) Do you want a separate bug report for that? ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2001-10-29 08:10 Message: Logged In: YES user_id=6380 It still beeps for me on Linux, with the latest idlefork checkout, using Python 2.1.1. ---------------------------------------------------------------------- Comment By: Chui Tey (teyc) Date: 2001-10-28 04:57 Message: Logged In: YES user_id=29167 I could not reproduce the error on the latest CVS checkout on Win98, using Python 2.1. If any one else still experiences the problem, please let me know, or I'll categorise it as being "not reproducible". ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2001-07-11 07:26 Message: Logged In: YES user_id=149084 Confirmed on Windows 98 ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2001-07-11 07:25 Message: Logged In: YES user_id=149084 Confirmed on Windows 98 ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=440383&group_id=9579 From kbk@users.sourceforge.net Mon Dec 16 22:25:18 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 16 Dec 2002 14:25:18 -0800 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.36,1.37 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv12732 Modified Files: EditorWindow.py Log Message: In Shell: 1. If a tab is entered at the prompt, allow it to be backspaced away. 2. Eliminate the beep when hitting at the prompt. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -r1.36 -r1.37 *** EditorWindow.py 16 Dec 2002 02:07:11 -0000 1.36 --- EditorWindow.py 16 Dec 2002 22:25:10 -0000 1.37 *************** *** 955,958 **** --- 955,960 ---- ncharsdeleted = 0 while 1: + if chars == sys.ps1: + break chars = chars[:-1] ncharsdeleted = ncharsdeleted + 1 *************** *** 1010,1013 **** --- 1012,1017 ---- line = text.get("insert linestart", "insert") i, n = 0, len(line) + if line == sys.ps1: + return "break" while i < n and line[i] in " \t": i = i+1 From neal@metaslash.com Tue Dec 17 03:47:15 2002 From: neal@metaslash.com (Neal Norwitz) Date: Mon, 16 Dec 2002 22:47:15 -0500 Subject: [Idle-dev] is this feature implemented? Message-ID: <20021217034714.GB7978@epoch.metaslash.com> This are 2 feature requests on SF for Python: http://sourceforge.net/tracker/index.php?func=detail&aid=473584&group_id=5470&atid=355470 Summary: Ctrl-C works always in IDLE It would be nice to have a background thread look for user keys, so that it is possible to edit or press ctrl-C if a program is running for a long time without output. http://sourceforge.net/tracker/index.php?func=detail&aid=404444&group_id=5470&atid=355470 Summary: [IDLE] auto indent/parentheses It'd be really nice to have an automatic indent of a line when using the "TAB" key anywhere on the line, this feature exist in the python emacs mode and is REALLY nice and a total time-saver. Also, having the possibility to see which parentheses/brackets you're closing while typing (as in a lot of editors) would be really nice --- Are either of these implemented in idlefork? Can they be closed when we merge back into python? There's also another feature mentioned in PEP 42: - IDLE should reload & recompile modules changed externally. To be done properly, scripts will have to be run in a separate process. http://www.python.org/sf/210841 Is that done? Neal From kbk@shore.net Tue Dec 17 16:06:10 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 17 Dec 2002 11:06:10 -0500 Subject: [Idle-dev] is this feature implemented? In-Reply-To: <20021217034714.GB7978@epoch.metaslash.com> References: <20021217034714.GB7978@epoch.metaslash.com> Message-ID: Neal Norwitz writes: > This are 2 feature requests on SF for Python: > > http://sourceforge.net/tracker/index.php?func=detail&aid=473584&group_id=5470&atid=355470 > > Summary: Ctrl-C works always in IDLE > > It would be nice to have a background thread look for user keys, so > that it is possible to edit or press ctrl-C if a program is running > for a long time without output. Tk is inherently multitasking, and in Idlefork it is possible to run a script (which actually executes in a subprocess) outputting to the shell while editing several files in different Edit windows. A ctrl-c typed in the shell window will break into the process, even if it is in a tight "pass" loop. I'd consider this feature request to be implemented. > http://sourceforge.net/tracker/index.php?func=detail&aid=404444&group_id=5470&atid=355470 > > Summary: [IDLE] auto indent/parentheses > > It'd be really nice to have an automatic indent of a line when using > the "TAB" key anywhere on the line, this feature exist in the python > emacs mode and is REALLY nice and a total time-saver. Also, having > the possibility to see which parentheses/brackets you're closing while > typing (as in a lot of editors) would be really nice I agree, smart tabs and smart parens are great emacs/Pythonmode features that I'd like to see in IDLE. I miss them too. Once we merge back into Python, would you have time to implement them? [...] > There's also another feature mentioned in PEP 42: > > - IDLE should reload & recompile modules changed externally. To > be done properly, scripts will have to be run in a separate > process. > > http://www.python.org/sf/210841 > > Is that done? This feature works correctly in Idlefork, and in an intuitive way. Running the script with F5 from the edit window causes it to execute in a newly initialized Python subprocess, and the latest versions of the modules will be imported. This is especially helpful if you are editing a module which is several steps down an import chain. If you try to import/reload from the shell, you had better know exactly what you are doing, and even then it is easy to get confused. -- KBK From kbk@users.sourceforge.net Tue Dec 17 21:16:15 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 17 Dec 2002 13:16:15 -0800 Subject: [Idle-dev] CVS: idle ColorDelegator.py,1.8,1.9 PyShell.py,1.39,1.40 ScriptBinding.py,1.12,1.13 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv9440 Modified Files: ColorDelegator.py PyShell.py ScriptBinding.py Log Message: M ColorDelegator.py M PyShell.py M ScriptBinding.py 1. Update ScriptBinding.py to highlight a syntax error in the Edit window, and place the cursor on the error. Add a syntax check to the Run Script event instead of waiting until the script tries to run and raises a syntax error in the shell, forcing the user to navigate back to the Edit window to fix it. 2. Modify tag_config's appropriately in PyShell.py and ColorDelegator.py 3. Some minor clean-up in ScriptBinding.py Index: ColorDelegator.py =================================================================== RCS file: /cvsroot/idlefork/idle/ColorDelegator.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** ColorDelegator.py 15 Sep 2002 22:09:16 -0000 1.8 --- ColorDelegator.py 17 Dec 2002 21:16:12 -0000 1.9 *************** *** 64,67 **** --- 64,68 ---- "TODO": {'background':None,'foreground':None}, "BREAK": idleConf.GetHighlight(theme, "break"), + "ERROR": idleConf.GetHighlight(theme, "error"), # The following is used by ReplaceDialog: "hit": idleConf.GetHighlight(theme, "hit"), Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** PyShell.py 16 Dec 2002 02:07:11 -0000 1.39 --- PyShell.py 17 Dec 2002 21:16:12 -0000 1.40 *************** *** 262,266 **** "stderr": idleConf.GetHighlight(theme, "stderr"), "console": idleConf.GetHighlight(theme, "console"), - "ERROR": idleConf.GetHighlight(theme, "error"), None: idleConf.GetHighlight(theme, "normal"), }) --- 262,265 ---- Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/ScriptBinding.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** ScriptBinding.py 3 Dec 2002 23:09:23 -0000 1.12 --- ScriptBinding.py 17 Dec 2002 21:16:12 -0000 1.13 *************** *** 4,14 **** - Check module does a full syntax check of the current module. ! It also runs the tabnanny to catch any inconsistent tabs. - Run module executes the module's code in the __main__ namespace. The window ! must have been saved previously. The module is added to sys.modules, and is ! also added to the __main__ namespace. ! XXX Redesign this interface (yet again) as follows: - Present a dialog box for ``Run script'' --- 4,14 ---- - Check module does a full syntax check of the current module. ! It also runs the tabnanny to catch any inconsistent tabs. - Run module executes the module's code in the __main__ namespace. The window ! must have been saved previously. The module is added to sys.modules, and is ! also added to the __main__ namespace. ! XXX GvR Redesign this interface (yet again) as follows: - Present a dialog box for ``Run script'' *************** *** 18,23 **** --- 18,29 ---- """ + import re + import string + import tabnanny + import tokenize import tkMessageBox + IDENTCHARS = string.ascii_letters + string.digits + "_" + indent_message = """Error: Inconsistent indentation detected! *************** *** 33,43 **** ! # XXX TBD Implement stop-execution KBK 11Jun02 class ScriptBinding: menudefs = [ ('run', [None, ! ('Check module', '<>'), ! ('Run script', '<>'), ]), ] def __init__(self, editwin): --- 39,50 ---- ! # XXX 11Jun02 KBK TBD Implement stop-execution ! class ScriptBinding: menudefs = [ ('run', [None, ! ('Check Module', '<>'), ! ('Run Script', '<>'), ]), ] def __init__(self, editwin): *************** *** 54,63 **** if not self.tabnanny(filename): return ! if not self.checksyntax(filename): ! return def tabnanny(self, filename): - import tabnanny - import tokenize f = open(filename, 'r') try: --- 61,67 ---- if not self.tabnanny(filename): return ! self.checksyntax(filename) def tabnanny(self, filename): f = open(filename, 'r') try: *************** *** 78,87 **** f.close() if '\r' in source: - import re source = re.sub(r"\r\n", "\n", source) if source and source[-1] != '\n': source = source + '\n' try: ! compile(source, filename, "exec") except (SyntaxError, OverflowError), err: try: --- 82,91 ---- f.close() if '\r' in source: source = re.sub(r"\r\n", "\n", source) if source and source[-1] != '\n': source = source + '\n' try: ! # If successful, return the compiled code ! return compile(source, filename, "exec") except (SyntaxError, OverflowError), err: try: *************** *** 90,106 **** err.args = msg, (filename, lineno, offset, line) err.filename = filename except: - lineno = None msg = "*** " + str(err) - if lineno: - self.editwin.gotoline(lineno) self.errorbox("Syntax error", "There's an error in your program:\n" + msg) ! return True ! def run_script_event(self, event): filename = self.getfilename() if not filename: return flist = self.editwin.flist shell = flist.open_shell() --- 94,125 ---- err.args = msg, (filename, lineno, offset, line) err.filename = filename + self.colorize_syntax_error(msg, lineno, offset) except: msg = "*** " + str(err) self.errorbox("Syntax error", "There's an error in your program:\n" + msg) ! return False ! ! def colorize_syntax_error(self, msg, lineno, offset): ! text = self.editwin.text ! pos = "0.0 + %d lines + %d chars" % (lineno-1, offset-1) ! text.tag_add("ERROR", pos) ! char = text.get(pos) ! if char and char in IDENTCHARS: ! text.tag_add("ERROR", pos + " wordstart", pos) ! if '\n' == text.get(pos): # error at line end ! text.mark_set("insert", pos) ! else: ! text.mark_set("insert", pos + "+1c") ! text.see(pos) ! def run_script_event(self, event): + "Check syntax, if ok run the script in the shell top level" filename = self.getfilename() if not filename: return + code = self.checksyntax(filename) + if not code: + return flist = self.editwin.flist shell = flist.open_shell() *************** *** 117,125 **** if (not _sys.argv or _basename(_sys.argv[0]) != _basename(_filename)): - # XXX 25 July 2002 KBK should this be sys.argv not _sys.argv? _sys.argv = [_filename] ! del _filename, _sys, _basename \n""" % `filename`) ! interp.execfile(filename) def getfilename(self): --- 136,143 ---- if (not _sys.argv or _basename(_sys.argv[0]) != _basename(_filename)): _sys.argv = [_filename] ! del _filename, _sys, _basename \n""" % `filename`) ! interp.runcode(code) def getfilename(self): From neal@metaslash.com Wed Dec 18 01:38:10 2002 From: neal@metaslash.com (Neal Norwitz) Date: Tue, 17 Dec 2002 20:38:10 -0500 Subject: [Idle-dev] is this feature implemented? In-Reply-To: References: <20021217034714.GB7978@epoch.metaslash.com> Message-ID: <20021218013809.GA12063@epoch.metaslash.com> On Tue, Dec 17, 2002 at 11:06:10AM -0500, Kurt B. Kaiser wrote: > > > It'd be really nice to have an automatic indent of a line when using > > the "TAB" key anywhere on the line, this feature exist in the python > > emacs mode and is REALLY nice and a total time-saver. Also, having > > the possibility to see which parentheses/brackets you're closing while > > typing (as in a lot of editors) would be really nice > > I agree, smart tabs and smart parens are great emacs/Pythonmode > features that I'd like to see in IDLE. I miss them too. Once we > merge back into Python, would you have time to implement them? Perhaps I'll take a look once everything stabilizes. Feel free to remind me. I have a short memory/attention span. :-) I closed the feature request and updated PEP 42. Thanks. I found two more feature requests. I believe one is done: Printing. http://sourceforge.net/tracker/index.php?func=detail&aid=229840&group_id=5470&atid=355470 Summary: IDLE needs to print ! It'd be really nice if idle had a print function, all these nice colors got to be printed ! or at least a postscript output would be nice. -- I'm not sure what the old IDLE had, but I see the print menu. Did the original have printing, but not color printing? The other one is: http://sourceforge.net/tracker/index.php?func=detail&aid=230359&group_id=5470&atid=355470 Summary: Run script should not appear in shell window When selecting "Run module" in the shell window, an error message "The buffer Python Shell is not saved..." is produced. Since running the shell window will fail in any case, these menu items should be removed from the shell window. -- Let me know if I should update these. Thanks, Neal From kbk@shore.net Wed Dec 18 03:04:17 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 17 Dec 2002 22:04:17 -0500 Subject: [Idle-dev] is this feature implemented? In-Reply-To: <20021218013809.GA12063@epoch.metaslash.com> References: <20021217034714.GB7978@epoch.metaslash.com> <20021218013809.GA12063@epoch.metaslash.com> Message-ID: Neal Norwitz writes: > I found two more feature requests. I believe one is done: Printing. > > http://sourceforge.net/tracker/index.php?func=detail&aid=229840&group_id=5470&atid=355470 > > Summary: IDLE needs to print ! > > It'd be really nice if idle had a print function, all these nice > colors got to be printed ! or at least a postscript output would be > nice. > > -- > > I'm not sure what the old IDLE had, but I see the print menu. Did the > original have printing, but not color printing? > > The other one is: > > http://sourceforge.net/tracker/index.php?func=detail&aid=230359&group_id=5470&atid=355470 > > Summary: Run script should not appear in shell window > > When selecting "Run module" in the shell window, an error message > "The buffer Python Shell is not saved..." is produced. > > Since running the shell window will fail in any case, these menu items > should be removed from the shell window. Neal, thanks for doing this review. We have a preliminary print capability provided by Guido. Stephen integrated it, and I'm afraid I haven't done much with it. When I try to print on my GNU/Linux system it flubs with some kind of a postscript interpreter error ("Error: /undefined in import ... %interp exit .rune). It may work fine in the Windows environment, and the problem is probably on my side. I'm going to do some Windows testing on the Alpha release, so I'll check it then. Have you tried printing from IDLE? As far as I know, Python IDLE can't print. The second item is fixed, the Run menu was removed from the shell. I'm considering a "hidden" capability where F5 in the shell will re-run the most recent script. Right now you have to focus on the Edit window you want to run. This should probably not be a real high priority. -- KBK From guido@python.org Wed Dec 18 13:14:22 2002 From: guido@python.org (Guido van Rossum) Date: Wed, 18 Dec 2002 08:14:22 -0500 Subject: [Idle-dev] is this feature implemented? In-Reply-To: Your message of "17 Dec 2002 22:04:17 EST." References: <20021217034714.GB7978@epoch.metaslash.com> <20021218013809.GA12063@epoch.metaslash.com> Message-ID: <200212181314.gBIDEM918034@pcp02138704pcs.reston01.va.comcast.net> > We have a preliminary print capability provided by Guido. Stephen > integrated it, and I'm afraid I haven't done much with it. When I try > to print on my GNU/Linux system it flubs with some kind of a > postscript interpreter error ("Error: /undefined in import ... %interp > exit .rune). It may work fine in the Windows environment, and the > problem is probably on my side. I'm going to do some Windows testing > on the Alpha release, so I'll check it then. Have you tried printing > from IDLE? I suggest making the command line to be run a config variable. > As far as I know, Python IDLE can't print. It can, using the same implementation. --Guido van Rossum (home page: http://www.python.org/~guido/) From kbk@users.sourceforge.net Thu Dec 19 03:25:36 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Wed, 18 Dec 2002 19:25:36 -0800 Subject: [Idle-dev] CVS: idle ScriptBinding.py,1.13,1.14 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv26259 Modified Files: ScriptBinding.py Log Message: If Edit window has not been saved, offer to save if user tries to Run or Check the module. Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/ScriptBinding.py,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** ScriptBinding.py 17 Dec 2002 21:16:12 -0000 1.13 --- ScriptBinding.py 19 Dec 2002 03:25:34 -0000 1.14 *************** *** 142,161 **** def getfilename(self): ! # Logic to make sure we have a saved filename ! # XXX Better logic would offer to save! if not self.editwin.get_saved(): ! name = (self.editwin.short_title() or ! self.editwin.long_title() or ! "Untitled") ! self.errorbox("Not saved", ! "The buffer for %s is not saved.\n" % name + ! "Please save it first!") ! self.editwin.text.focus_set() ! return filename = self.editwin.io.filename ! if not filename: ! self.errorbox("No file name", ! "This window has no file name") ! return return filename --- 142,168 ---- def getfilename(self): ! """Get source filename. If not saved, offer to save (or create) file ! ! The debugger requires a source file. Make sure there is one, and that ! the current version of the source buffer has been saved. If the user ! declines to save or cancels the Save As dialog, return None. ! """ if not self.editwin.get_saved(): ! msg = """Source Must Be Saved ! OK to Save?""" ! mb = tkMessageBox.Message( ! title="Save Before Run or Check", ! message=msg, ! icon=tkMessageBox.QUESTION, ! type=tkMessageBox.OKCANCEL, ! master=self.editwin.text) ! reply = mb.show() ! if reply == "ok": ! self.editwin.io.save(None) ! else: ! return None ! # filename is None if file doesn't exist filename = self.editwin.io.filename ! self.editwin.text.focus_set() return filename From kbk@users.sourceforge.net Fri Dec 20 01:19:49 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Thu, 19 Dec 2002 17:19:49 -0800 Subject: [Idle-dev] CVS: idle CREDITS.txt,1.1,1.2 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv14751 Modified Files: CREDITS.txt Log Message: Updated. Index: CREDITS.txt =================================================================== RCS file: /cvsroot/idlefork/idle/CREDITS.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** CREDITS.txt 31 Jul 2001 06:58:34 -0000 1.1 --- CREDITS.txt 20 Dec 2002 01:19:47 -0000 1.2 *************** *** 2,17 **** ================== ! Guido van Rossum, as well as being the creator of the Python language, was ! the original creator of IDLE. His great work continues as both a contributor ! to, and 'benevolent dictator for life' of Python and IDLE/IDLEfork. ! ! The main developers who have been so far active on IDLEfork version 0.8.1 ! and greater are, Guido van Rossum, Stephen M. Gava and Kurt B. Kaiser. ! ! The IDLE fork project was initiated and brought up to version 0.7.1 by ! David Scherer, Peter Schneider-Kamp and Nicholas Riley. ! ! There are doubtless others who should be included here, especially those ! who may have contributed to IDLE versions prior ot 0.8. Please contact ! the IDLEfork coordinator to have yourself included here if you are one of ! those I have missed! (contact details at http://idlefork.sourceforge.net) --- 2,30 ---- ================== ! Guido van Rossum, as well as being the creator of the Python language, is ! the original creator of IDLE. He also developed the RPC code and Remote ! Debugger extension used in IDLEfork. ! ! The IDLEfork project was initiated and brought up to version 0.7.1 primarily ! by David Scherer, with help from Peter Schneider-Kamp and Nicholas Riley. ! Bruce Sherwood has contributed considerable time testing and suggesting ! improvements. ! ! Besides Guido, the main developers who have been active on IDLEfork version ! 0.8.1 and later are Stephen M. Gava, who implemented the configuration GUI, and ! Kurt B. Kaiser, who continued the integration of the RPC and remote debugger, ! and made a number of usability enhancements. ! ! Other contributors include Tony Lownds (Mac integration), and Chui Tey (RPC, ! Debugger) ! ! Neal Norwitz and Josh Robb have submitted useful patches. ! ! There are others who should be included here, especially those who contributed ! to IDLE versions prior to 0.8, principally Mark Hammond, Tim Peters, and Moshe ! Zadka. For additional details refer to NEWS.txt and Changelog. ! ! Please contact the IDLEfork maintainer to have yourself included here if you ! are one of those we missed! ! ! Contact details at http://idlefork.sourceforge.net From kbk@users.sourceforge.net Fri Dec 20 01:22:03 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Thu, 19 Dec 2002 17:22:03 -0800 Subject: [Idle-dev] CVS: idle ZoomHeight.py,1.3,1.4 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv15432 Modified Files: ZoomHeight.py Log Message: Panel Bar on the Bottom is Probably More Common Index: ZoomHeight.py =================================================================== RCS file: /cvsroot/idlefork/idle/ZoomHeight.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** ZoomHeight.py 19 Jan 2002 10:41:51 -0000 1.3 --- ZoomHeight.py 20 Dec 2002 01:22:01 -0000 1.4 *************** *** 31,36 **** newheight = newheight - 72 else: ! newy = 24 ! newheight = newheight - 96 if height >= newheight: newgeom = "" --- 31,38 ---- newheight = newheight - 72 else: ! #newy = 24 ! newy = 0 ! #newheight = newheight - 96 ! newheight = newheight - 88 if height >= newheight: newgeom = "" From tonylownds@users.sourceforge.net Fri Dec 20 04:24:45 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Thu, 19 Dec 2002 20:24:45 -0800 Subject: [Idle-dev] CVS: idle boolcheck.py,NONE,1.1 macosx_main.py,NONE,1.1 PyShell.py,1.40,1.41 idle,1.3,1.4 run.py,1.8,1.9 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv30088 Modified Files: PyShell.py idle run.py Added Files: boolcheck.py macosx_main.py Log Message: Update way a subprocess is launched for Mac OS X. Another applet mechanism has been developed for Python on Mac OS X and trying to use the -c "__import__('run').main()" trick is just not working. macosx_main.py is a new file which should be used as the startup file for Mac OS X applet bundles. This startup file understands a -p option, which when seen will start run.main(). When running as an applet, this seems like the best approach. --- NEW FILE: boolcheck.py --- "boolcheck - import this module to ensure True, False, bool() builtins exist." try: True except NameError: import __builtin__ __builtin__.True = 1 __builtin__.False = 0 from operator import truth __builtin__.bool = truth --- NEW FILE: macosx_main.py --- """IDLE.app Installation: see the install_IDLE target in python/dist/src/Mac/OSX/Makefile Usage: 1. Double clicking IDLE icon will open IDLE. 2. Dropping file on IDLE icon will open that file in IDLE. 3. Launch from command line with files with this command-line: /Applications/Python/IDLE.app/Contents/MacOS/python file1 file2 file3 """ # Add IDLE.app/Contents/Resources/idlelib to path. # __file__ refers to this file when it is used as a module, sys.argv[0] # refers to this file when it is used as a script (pythonw macosx_main.py) import sys from os.path import split, join, isdir try: __file__ except NameError: __file__ = sys.argv[0] idlelib = join(split(__file__)[0], 'idlelib') if isdir(idlelib): sys.path.append(idlelib) # Make sure True, False, bool() builtins exist. # - preserves 2.2 compatibility - 2.2.1 includes bool, 2.2 does not. # - important for Mac OS X because it ships python 2.2 import boolcheck # see if we are being asked to execute the subprocess code if '-p' in sys.argv: # run expects only the port number in sys.argv sys.argv.remove('-p') # this module will become the namepsace used by the interactive # interpreter; remove all variables we have defined. del sys, __file__, boolcheck, split, join __import__('run').main() else: # Load idlelib/idle.py which starts the application. import idle Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** PyShell.py 17 Dec 2002 21:16:12 -0000 1.40 --- PyShell.py 20 Dec 2002 04:24:42 -0000 1.41 *************** *** 299,320 **** def spawn_subprocess(self): ! w = ['-W' + s for s in sys.warnoptions] ! args = [self.find_executable()] + w \ ! + ["-c", "__import__('run').main()", str(self.port)] self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) ! def find_executable(self): ! if sys.platform == 'darwin' and sys.executable.count('.app'): ! # On Mac OS X, avoid calling sys.executable because it ignores ! # command-line options (sys.executable is an applet) # ! # Instead, find the executable by looking relative to ! # sys.prefix. ! executable = os.path.join(sys.prefix, 'Resources', ! 'Python.app', 'Contents', ! 'MacOS', 'python') ! return executable else: ! return sys.executable def start_subprocess(self): --- 299,323 ---- def spawn_subprocess(self): ! args = self.build_subprocess_arglist() self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) ! def build_subprocess_arglist(self): ! if sys.platform == 'darwin' and sys.argv[0].count('.app'): ! # We need to avoid using sys.executable because it fails on some ! # of the applet architectures On Mac OS X. # ! # here are the applet architectures tried: ! # ! # framework applet: sys.executable + -p is correct ! # python 2.2 + pure python main applet: ! # sys.executable + -p is correct ! # pythonw idle.py: sys.executable + -c is correct ! # ! # XXX what about warnoptions? ! return [sys.executable, '-p', str(self.port)] else: ! w = ['-W' + s for s in sys.warnoptions] ! return [sys.executable] + w \ ! + ["-c", "__import__('run').main()", str(self.port)] def start_subprocess(self): *************** *** 1175,1178 **** --- 1178,1182 ---- root.withdraw() flist = PyShellFileList(root) + if enable_edit: if not (cmd or script): Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** idle 17 Jul 2001 04:59:01 -0000 1.3 --- idle 20 Dec 2002 04:24:43 -0000 1.4 *************** *** 1,4 **** #! /usr/bin/env python ! import PyShell ! PyShell.main() --- 1,33 ---- #! /usr/bin/env python ! # Add IDLE.app/Contents/Resources/idlelib to path. ! # __file__ refers to this file when it is used as a module, sys.argv[0] ! # refers to this file when it is used as a script (pythonw macosx_main.py) ! import sys ! from os.path import split, join ! try: ! __file__ ! except NameError: ! __file__ = sys.argv[0] ! idlelib = join(split(__file__)[0], 'idlelib') ! if os.path.isdir(idlelib): ! sys.path.append(idlelib) ! ! # Make sure True, False, bool() builtins exist. ! # - preserves 2.2 compatibility - 2.2.1 includes bool, 2.2 does not. ! # - important for Mac OS X because it ships python 2.2 ! import boolcheck ! ! # see if we are being asked to execute the subprocess code ! if '-p' in sys.argv: ! # run expects only the port number in sys.argv ! sys.argv.remove('-p') ! ! # this module will become the namepsace used by the interactive ! # interpreter; remove all variables we have defined. ! del sys, __file__, boolcheck, split, join ! __import__('run').main() ! else: ! # start the application. ! import PyShell ! PyShell.main() Index: run.py =================================================================== RCS file: /cvsroot/idlefork/idle/run.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** run.py 10 Oct 2002 08:25:24 -0000 1.8 --- run.py 20 Dec 2002 04:24:43 -0000 1.9 *************** *** 3,6 **** --- 3,8 ---- import socket + import boolcheck + import CallTips import RemoteDebugger From tonylownds@users.sourceforge.net Fri Dec 20 04:26:02 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Thu, 19 Dec 2002 20:26:02 -0800 Subject: [Idle-dev] CVS: idle macosx_main.py,1.1,1.2 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv32618 Modified Files: macosx_main.py Log Message: Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** macosx_main.py 20 Dec 2002 04:24:43 -0000 1.1 --- macosx_main.py 20 Dec 2002 04:26:00 -0000 1.2 *************** *** 40,44 **** # this module will become the namepsace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, boolcheck, split, join __import__('run').main() else: --- 40,44 ---- # this module will become the namepsace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, boolcheck, split, join, isdir __import__('run').main() else: From tony@lownds.com Fri Dec 20 04:38:10 2002 From: tony@lownds.com (Tony Lownds) Date: Thu, 19 Dec 2002 20:38:10 -0800 Subject: [Idle-dev] mac osx checkin Message-ID: --============_-1171763366==_============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Hi, I've checked in the code to support Mac OS X applet bundles. The attached patch is needed for python/dist/src/Mac/OSX/Makefile, when idlefork gets integrated back into python for 2.3a1. Once sourceforge.net comes back up I'll close the associated patch. Thanks, -Tony --============_-1171763366==_============ Content-Id: Content-Type: application/mac-binhex40; name="python_integration_patch" Content-Disposition: attachment; filename="python_integration_patch" ; modification-date="Thu, 19 Dec 2002 20:29:58 -0800" (This file must be converted with BinHex 4.0) :'("jG'K[EPpTER4PCh*KG'P[EPp`BA4MD!!!!!!!!!!!!!!!!!!#d3!!!!!AP8P ZC'9i1L"0B@-[6e0B,deKDf9QD@aP#Mdp26dp26dp26dp26dp26dp26dp26dp26d p26dp26dp26dp26dp26dp26dp26dp26dp26dp26dp26dp26dp26dp26d+8N06)'C TE'8k)#pMGR0bEfpd,h"jG'K[ELp`HA4SEfi[C'PcG#pcFQ-[6@&M,dp6@#p0B@Y PCQPXC5af#R*PG(*TCACTEQFJFQ9fDA0TEfiJ-5ic-!TND@CQ)#ee)#eb-5ic-#" 0B@YPCQPXC3SY,5dJ6@&M,dp6@#p0B@YPCQPXC3Nb-#"1EhBJ-M!`-L!a0$S`0MS a0L!Y-$!`-!Na,M-`#LXV+b"0B@-[6e0B,deKDf9QD@aP#6)`)%4PBb!b-$!b)$! d1M)j1M3i)#d`-$!`#N"!)#da-M)X0b!V-6)b,$FJ3%!+)!N**#K*6P0838a-484 I8&P85%p19bNJ*#KcFQ0NDA)T,deKBbpcBh*TF(4c,d*eD@aN3A"`E'9d,R"j)&` +)!N*#5dYEh9dF(9d)#3S8&P85%p139"38d4*8LN[584-45jKF(!JA!SJ#3N*,5e PH(4bB5!N+(0bBf4TFLN[9'p[E(-[D@4XC5"F#Ld*#3NN+(0bBf4TFLN[9'p[E(- [D@4XC5pTC'aP)$XJA!SV#3N**#KcFQ0NDA)T,e4[Efac,fPNE'8[E@&MEh0iAfe KD@iZF(NJ1b"F#L!*#@9MD'mJEABJ*#K3@94)6dj"8&"64%P5+5p*4%a&,Q&`F#p $EfjdC@jdFbp5CA0[GA*MCA-[D@4XC5"F#L!*#3NN+&"C9%K26N&38&0%59)T,dP %6%8ZBA"`,d0[ER4PER4c,e*PFfpeFQ0PFbpTC'aPE'PL1b"F#L!*#@ef)#3S8&P 85%p139"38d4*8LN[584-45jKF(![3fpZG'9ZG(-[8Q9cEh9bBf9c,fPNE'8JA!T N*3!!: --============_-1171763366==_============-- From noreply@sourceforge.net Fri Dec 20 04:41:49 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 19 Dec 2002 20:41:49 -0800 Subject: [Idle-dev] [ idlefork-Patches-645797 ] subprocess code changes for Mac OS X Message-ID: Patches item #645797, was opened at 2002-11-29 18:47 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=309579&aid=645797&group_id=9579 Category: None Group: None >Status: Closed Resolution: None Priority: 5 Submitted By: Tony Lownds (tonylownds) Assigned to: Tony Lownds (tonylownds) Summary: subprocess code changes for Mac OS X Initial Comment: Another applet mechanism has been developed for Python on Mac OS X and trying to use the -c "__import__('run').main()" trick is just not working. This patch adds a new file which should be used as the startup file for Mac OS X. That startup file understands a -p option, which when seen will start run.main() When running as an applet, this seems like the best approach. I want to try a few more cases before commiting this code, and also give any objections a chance to surface. ---------------------------------------------------------------------- >Comment By: Tony Lownds (tonylownds) Date: 2002-12-20 04:41 Message: Logged In: YES user_id=24100 Code checked in. ---------------------------------------------------------------------- Comment By: Tony Lownds (tonylownds) Date: 2002-11-30 18:30 Message: Logged In: YES user_id=24100 Font filtering code removed from the patch, you are right, it should be considered seperately. ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2002-11-30 01:45 Message: Logged In: YES user_id=149084 Since the processing of the Mac subprocess arg list is getting lengthy, it makes sense to factor it. I'd suggest a verb, for example, build_subprocess_arglist(). The patch contains two ideas and the font filter should be a separate check-in. It's a reasonable start but it would be nice if there was a button on the config dialog which would set this option. Default could be Enabled. That way in the 'rare' case the user might find his 'problem' faster. Even better, default it off except for Mac :) The Python project likes context diffs! I'm making changes to PyShell.py but they shouldn't interfere with yours. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=309579&aid=645797&group_id=9579 From kbk@users.sourceforge.net Fri Dec 20 17:18:08 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Fri, 20 Dec 2002 09:18:08 -0800 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.37,1.38 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv4639 Modified Files: EditorWindow.py Log Message: "'foo' in str" not implemented in Python 2.2, only single character lookup Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -r1.37 -r1.38 *** EditorWindow.py 16 Dec 2002 22:25:10 -0000 1.37 --- EditorWindow.py 20 Dec 2002 17:18:03 -0000 1.38 *************** *** 284,287 **** --- 284,288 ---- def view_readme(self, event=None): + print>>sys.__stderr__, "** __file__: ", __file__ fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'README.txt') textView.TextViewer(self.top,'IDLEfork - README',fn) *************** *** 439,443 **** except IOError: return False ! return line.startswith('#!') and 'python' in line def close_hook(self): --- 440,444 ---- except IOError: return False ! return line.startswith('#!') and line.find('python') >= 0 def close_hook(self): From kbk@users.sourceforge.net Fri Dec 20 19:37:12 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Fri, 20 Dec 2002 11:37:12 -0800 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.38,1.39 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv24600 Modified Files: EditorWindow.py Log Message: Remove debugging statement checked in by accident, ah, carelessness. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -r1.38 -r1.39 *** EditorWindow.py 20 Dec 2002 17:18:03 -0000 1.38 --- EditorWindow.py 20 Dec 2002 19:37:09 -0000 1.39 *************** *** 284,288 **** def view_readme(self, event=None): - print>>sys.__stderr__, "** __file__: ", __file__ fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'README.txt') textView.TextViewer(self.top,'IDLEfork - README',fn) --- 284,287 ---- From sholden@holdenweb.com Wed Dec 18 03:53:14 2002 From: sholden@holdenweb.com (Steve Holden) Date: Tue, 17 Dec 2002 22:53:14 -0500 Subject: [Idle-dev] Seeking Expressions of Support Message-ID: <02c101c2a649$048120b0$6ff26c42@holdenweb.com> This is my last word on this subject until after Christmas. It's also about as close as I'll ever get to spamming -- apologies to those of you who receive multiple copies of this mail. Please send it on to any individual or list with an interest in Python and related topics. For PyCon DC 2003 to be a success it needs people to get involved. Then Python will finally have low-cost conferences. So take a look at the following link, then don't mail me -- visit the Python Wiki PyCon page and express your support (or not, as the case may be): http://pydish.holdenweb.com/pycon/threat.html Happy holidays ----------------------------------------------------------------------- Steve Holden http://www.holdenweb.com/ Python Web Programming http://pydish.holdenweb.com/pwp/ Bring your musical instrument to PyCon! http://www.python.org/pycon/ ----------------------------------------------------------------------- From kbk@users.sourceforge.net Fri Dec 20 22:40:32 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Fri, 20 Dec 2002 14:40:32 -0800 Subject: [Idle-dev] CVS: idle setup.py,1.6,1.7 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv365 Modified Files: setup.py Log Message: Update the setup file: 1. Make it easier to change the package and script installation names. 2. Update the text files transferred to include the .def and new .txt files. 3. Update the description and long description, change email to python-dev, update the url to point at sourceforge. 4. Rename the build and install classes for clarity. Index: setup.py =================================================================== RCS file: /cvsroot/idlefork/idle/setup.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** setup.py 30 Nov 2002 17:54:17 -0000 1.6 --- setup.py 20 Dec 2002 22:40:30 -0000 1.7 *************** *** 5,8 **** --- 5,10 ---- import idlever + idle_name = "idle" + try: pos = sys.argv.index("--check-tkinter") *************** *** 18,32 **** try: ! package_dir = os.path.join(os.environ["SRCDIR"], "Tools", "idle") except KeyError: package_dir = "." ! # name of idle package ! idlelib = "idlelib" ! # the normal build_py would not incorporate the .txt files ! txt_files = ['config-unix.txt','config-win.txt','config.txt', 'help.txt'] Icons = glob.glob1("Icons","*.gif") ! class idle_build_py(build_py): def get_plain_outfile(self, build_dir, package, file): # like get_module_outfile, but does not append .py --- 20,36 ---- try: ! package_dir = os.path.join(os.environ["SRCDIR"], "Tools", idle_name) except KeyError: package_dir = "." ! # name of package to be installed in site-packages ! pkgname = idle_name + "lib" ! # the normal build_py would not incorporate the .txt or config files ! txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt'] ! txt_files += ['config-extensions.def', 'config-highlight.def', ! 'config-keys.def', 'config-main.def'] Icons = glob.glob1("Icons","*.gif") ! class IDLE_Builder(build_py): def get_plain_outfile(self, build_dir, package, file): # like get_module_outfile, but does not append .py *************** *** 37,43 **** # Copies all .py files, then also copies the txt and gif files build_py.run(self) ! assert self.packages == [idlelib] for name in txt_files: ! outfile = self.get_plain_outfile(self.build_lib, [idlelib], name) dir = os.path.dirname(outfile) self.mkpath(dir) --- 41,47 ---- # Copies all .py files, then also copies the txt and gif files build_py.run(self) ! assert self.packages == [pkgname] for name in txt_files: ! outfile = self.get_plain_outfile(self.build_lib, [pkgname], name) dir = os.path.dirname(outfile) self.mkpath(dir) *************** *** 46,60 **** for name in Icons: outfile = self.get_plain_outfile(self.build_lib, ! [idlelib,"Icons"], name) dir = os.path.dirname(outfile) self.mkpath(dir) ! self.copy_file(os.path.join("Icons",name), outfile, preserve_mode = 0) def get_source_files(self): ! # returns the .py files, the .txt files, and the icons icons = [os.path.join(package_dir, "Icons",name) for name in Icons] txts = [os.path.join(package_dir, name) for name in txt_files] ! return build_py.get_source_files(self)+txt_files+icons def get_outputs(self, include_bytecode=1): --- 50,64 ---- for name in Icons: outfile = self.get_plain_outfile(self.build_lib, ! [pkgname, "Icons"], name) dir = os.path.dirname(outfile) self.mkpath(dir) ! self.copy_file(os.path.join("Icons", name), outfile, preserve_mode = 0) def get_source_files(self): ! # returns the .py files, the .txt and .def files, and the icons icons = [os.path.join(package_dir, "Icons",name) for name in Icons] txts = [os.path.join(package_dir, name) for name in txt_files] ! return build_py.get_source_files(self) + txt_files + icons def get_outputs(self, include_bytecode=1): *************** *** 65,73 **** for name in txt_files: filename = self.get_plain_outfile(self.build_lib, ! [idlelib], name) outputs.append(filename) for name in Icons: filename = self.get_plain_outfile(self.build_lib, ! [idlelib,"Icons"], name) outputs.append(filename) return outputs --- 69,77 ---- for name in txt_files: filename = self.get_plain_outfile(self.build_lib, ! [pkgname], name) outputs.append(filename) for name in Icons: filename = self.get_plain_outfile(self.build_lib, ! [pkgname, "Icons"], name) outputs.append(filename) return outputs *************** *** 76,105 **** # get_outputs are bytecode files ! class idle_install_lib(install_lib): def _bytecode_filenames(self, files): files = [n for n in files if n.endswith('.py')] ! return install_lib._bytecode_filenames(self,files) ! setup(name="IDLE", version = idlever.IDLE_VERSION, ! description = "IDLE Fork, the Forked Python IDE", ! author = "Guido van Rossum", ! author_email = "guido@python.org", ! #url = long_description = ! """IDLE is a Tkinter based IDE for Python. It is written in 100% pure ! Python and works both on Windows and Unix. It features a multi-window ! text editor with multiple undo, Python colorizing, and many other things, ! as well as a Python shell window and a debugger. ! ! IDLE Fork is a separate line of development which was initiated by D. Scherer ! at CMU as part of Visual Python. It features execution in a separate ! process, with a fresh environment for each run. For further details, ! refer to idlefork.sourceforge.net.""", ! ! cmdclass = {'build_py':idle_build_py, ! 'install_lib':idle_install_lib}, ! package_dir = {idlelib: package_dir}, ! packages = [idlelib], ! scripts = [os.path.join(package_dir, 'idle')] ) --- 80,113 ---- # get_outputs are bytecode files ! class IDLE_Installer(install_lib): def _bytecode_filenames(self, files): files = [n for n in files if n.endswith('.py')] ! return install_lib._bytecode_filenames(self, files) ! setup(name="IDLEfork", version = idlever.IDLE_VERSION, ! description = "IDLEfork, the Developmental Python IDE", ! author = "Guido van Rossum et. al.", ! author_email = "idle-dev@python.org", ! url = "https://sourceforge.net/projects/idlefork/", long_description = ! """IDLE is a Tkinter based IDE for Python. It is written in 100% pure Python ! and works both on Windows and Unix. It features a multi-window text editor with ! multiple undo, Python colorizing, and many other things, as well as a Python ! shell window and a debugger. ! ! IDLEfork is a separate line of development which was initiated by D. Scherer ! at CMU as part of Visual Python. It features execution in a separate process ! which is newly initiated for each run. At version 0.9 the RPC was changed to ! incorporate code by GvR, which supports the debugger. IDLEfork also ! incorporates a GUI configuration utilility. For further details, refer to ! idlefork.sourceforge.net. ! ! """, ! ! cmdclass = {'build_py':IDLE_Builder, ! 'install_lib':IDLE_Installer}, ! package_dir = {pkgname: package_dir}, ! packages = [pkgname], ! scripts = [os.path.join(package_dir, idle_name)] ) From kbk@users.sourceforge.net Sat Dec 21 21:03:09 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sat, 21 Dec 2002 13:03:09 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.41,1.42 idle,1.4,1.5 setup.py,1.7,1.8 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv29372 Modified Files: PyShell.py idle setup.py Log Message: M PyShell.py M idle M setup.py To be able to run from the source directory or from an installed version of IDLE, and also to allow the subprocess to find run(), Python needs to have the idlelib package on its path. 1. Modify setup.py to supply a .pth file living at same level as idlelib 2. Move boolcheck to PyShell.py 3. Remove boolcheck and path setting code from the "idle" script Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** PyShell.py 20 Dec 2002 04:24:42 -0000 1.41 --- PyShell.py 21 Dec 2002 21:03:05 -0000 1.42 *************** *** 30,33 **** --- 30,35 ---- import RemoteDebugger + import boolcheck + IDENTCHARS = string.ascii_letters + string.digits + "_" Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** idle 20 Dec 2002 04:24:43 -0000 1.4 --- idle 21 Dec 2002 21:03:06 -0000 1.5 *************** *** 1,33 **** #! /usr/bin/env python ! # Add IDLE.app/Contents/Resources/idlelib to path. ! # __file__ refers to this file when it is used as a module, sys.argv[0] ! # refers to this file when it is used as a script (pythonw macosx_main.py) ! import sys ! from os.path import split, join ! try: ! __file__ ! except NameError: ! __file__ = sys.argv[0] ! idlelib = join(split(__file__)[0], 'idlelib') ! if os.path.isdir(idlelib): ! sys.path.append(idlelib) ! # Make sure True, False, bool() builtins exist. ! # - preserves 2.2 compatibility - 2.2.1 includes bool, 2.2 does not. ! # - important for Mac OS X because it ships python 2.2 ! import boolcheck ! ! # see if we are being asked to execute the subprocess code ! if '-p' in sys.argv: ! # run expects only the port number in sys.argv ! sys.argv.remove('-p') # this module will become the namepsace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, boolcheck, split, join __import__('run').main() else: ! # start the application. import PyShell PyShell.main() --- 1,17 ---- #! /usr/bin/env python ! import sys as _sys ! # See if we are being asked to execute the subprocess code ! if '-p' in _sys.argv: ! # run expects only the port number in _sys.argv ! _sys.argv.remove('-p') # this module will become the namepsace used by the interactive # interpreter; remove all variables we have defined. ! del _sys __import__('run').main() else: ! # Start the IDLE GUI import PyShell PyShell.main() Index: setup.py =================================================================== RCS file: /cvsroot/idlefork/idle/setup.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** setup.py 20 Dec 2002 22:40:30 -0000 1.7 --- setup.py 21 Dec 2002 21:03:06 -0000 1.8 *************** *** 32,35 **** --- 32,44 ---- 'config-keys.def', 'config-main.def'] Icons = glob.glob1("Icons","*.gif") + + # Create a .pth file to live in site-packages; Python will add IDLE to + # sys.path: + + pathfile = idle_name + ".pth" + pfile = open(pathfile, 'w') + pfile.write(pkgname +'\n') + pfile.close() + class IDLE_Builder(build_py): def get_plain_outfile(self, build_dir, package, file): *************** *** 55,58 **** --- 64,73 ---- self.copy_file(os.path.join("Icons", name), outfile, preserve_mode = 0) + # Copy the .pth file to the same level as the package directory + outfile = self.get_plain_outfile(self.build_lib, [], pathfile) + dir = os.path.dirname(outfile) + self.mkpath(dir) + self.copy_file(os.path.join(package_dir, pathfile), outfile, + preserve_mode=0) def get_source_files(self): From kbk@users.sourceforge.net Sat Dec 21 21:39:13 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sat, 21 Dec 2002 13:39:13 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.42,1.43 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv7706 Modified Files: PyShell.py Log Message: When IDLE is installed and run from a startup script, the script's directory becomes sys.path[0]. What is wanted is the directory from which IDLE was called. Insert the current working directory in the path if it isn't there already. Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -r1.42 -r1.43 *** PyShell.py 21 Dec 2002 21:03:05 -0000 1.42 --- PyShell.py 21 Dec 2002 21:39:11 -0000 1.43 *************** *** 30,33 **** --- 30,34 ---- import RemoteDebugger + # Preserve 2.2 compatibility for Mac OS X: import boolcheck *************** *** 1170,1173 **** --- 1171,1178 ---- if not dir in sys.path: sys.path.insert(0, dir) + else: + dir = os.getcwd() + if not dir in sys.path: + sys.path.insert(0, dir) # check the IDLE settings configuration (but command line overrides) edit_start = idleConf.GetOption('main', 'General', From kbk@users.sourceforge.net Sun Dec 22 01:48:30 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sat, 21 Dec 2002 17:48:30 -0800 Subject: [Idle-dev] CVS: idle setup.cfg,NONE,1.1 setup.py,1.8,1.9 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv2778 Modified Files: setup.py Added Files: setup.cfg Log Message: Add configuration for packaging. --- NEW FILE: setup.cfg --- [bdist_rpm] release = 1 packager = Kurt B. Kaiser requires = python2, python2-tkinter Index: setup.py =================================================================== RCS file: /cvsroot/idlefork/idle/setup.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** setup.py 21 Dec 2002 21:03:06 -0000 1.8 --- setup.py 22 Dec 2002 01:48:28 -0000 1.9 *************** *** 105,108 **** --- 105,111 ---- author = "Guido van Rossum et. al.", author_email = "idle-dev@python.org", + maintainer = "Kurt B. Kaiser", + maintainer_email = "kbk@shore.net", + license = "PSF: www.python.org", url = "https://sourceforge.net/projects/idlefork/", long_description = From kbk@shore.net Mon Dec 23 03:10:37 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 22 Dec 2002 22:10:37 -0500 Subject: [Idle-dev] Re: Startup In-Reply-To: References: Message-ID: Tony Lownds writes: > >This failed to start the subprocess because the subprocess Python > >can't see run() since it's not on the path (when you don't start in > >Tools/idlefork). > > > >If I change PyShell.ModifiedInterpreter.build_subprocess_args() to say > > > > + ["-c", "__import__('idlelib.run').main()", str(self.port)] > > > >then we can't startup in Tools/idlefork via python2 idle.py, > > I think the second element should be: "__import__('idlelib.run').run.main()" > > """ > __import__(name, globals, locals, fromlist) -> module > > [...] > When importing a module from a package, note that __import__('A.B', ...) > returns package A when fromlist is empty, but its submodule B when > fromlist is not empty. > """ > > Perhaps it would be cleaner to arrange for idlelib to be a package > while developing (in Tools/idlefork via python2 idle.py) than have > the idle codebase > work in two different modes. How do you do that? To get back to basics, the standard way of running IDLE is to start Python and somehow pass it a script which causes it to import PyShell and then run PyShell.main(). In the case of the subprocess, start Python and cause it to import run and then execute run.main(). To do this, Python has to be able to find PyShell.py and run.py somewhere on sys.path. That's no problem if you are working in the IDLE source directory, but once IDLE is installed you could be anywhere in the file system. The system path finds Python and sys.path finds IDLE. The key to this is site-packages. Note that ...Tools/... is never on sys.path unless explicitly inserted by starting a script in, say, ...Tools/idle/ . For example, if I start in / on Linux, then the subprocess sees: ** cwd: / ** sys.path: ['', '/usr/lib/python2.2', '/usr/lib/python2.2/plat-linux2', '/usr/lib/python2.2/lib-tk', '/usr/lib/python2.2/lib-dynload', '/usr/lib/python2.2/site-packages', '/usr/lib/python2.2/site-packages/idleforklib'] The user process is the same except it also has /usr/bin on the path (that's the location of the idlefork script.) The only way _Python_ can find PyShell or run is via site-packages or possibly in the directory of /an/ IDLE script, as with Windows icons targeted at ..../Tools/idle/idle.pyw Idlelib is an install time entity. It doesn't exist until IDLE has been installed. Executing out of the source tree(i.e. Tools/idle), as is still done on Windows (at least in 2.2) in spite of the recent addition of site-packages to the Windows directory structure, is IMHO a bit of a kludge. Currently I've got IDLEfork installed with an idlefork.pth and idleforklib directory in site-packages. This works well with Linux RPMs and the Windows Installer, once you discover the stealth distutils option "extra_path". The IDLEfork installation doesn't appear to conflict with Python IDLE, and the subprocess etc. is running ok on both (with and without the .pyw start :). However, I'm not wedded to this. You point out that the .pth approach is not the best way for the Mac. It is possible to set up IDLE as a package and I suspect I can figure out a way to start the subprocess when idlelib doesn't (yet) exist: probably something in run.run() like try: __import__ idlelib.run except: __import__ run and something similar in idle.py so IDLE will work from the source tree before it's installed. Slightly kludgey but no one's going to turn into a pillar of salt. .pth files are kludges, too. I think I'll check in what I've got so I don't lose it, and then experiment a bit more with this. What do you guys think? I'm ready for alpha on Linux and Windows. Moving this discussion out to idle-dev. Regards, KBK From kbk@users.sourceforge.net Mon Dec 23 03:31:51 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 22 Dec 2002 19:31:51 -0800 Subject: [Idle-dev] CVS: idle MANIFEST.in,1.1,1.2 PyShell.py,1.43,1.44 idlever.py,1.6,1.7 setup.py,1.9,1.10 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv12963 Modified Files: MANIFEST.in PyShell.py idlever.py setup.py Log Message: M MANIFEST.in M PyShell.py M idlever.py M setup.py 1. Update MANIFEST.in to include all non-pure Python files 2. PyShell and idlever reflect Rev 0.9a0 3. setup.py modified to install IDLE as a collection of modules with a .pth file living at the idlelib level in site-packages. This was done to make it easier to run from the source directory prior to installing IDLE. This approach may change back to the package technique depending on what happens with the Mac installation development. Index: MANIFEST.in =================================================================== RCS file: /cvsroot/idlefork/idle/MANIFEST.in,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** MANIFEST.in 30 Nov 2002 17:51:41 -0000 1.1 --- MANIFEST.in 23 Dec 2002 03:31:49 -0000 1.2 *************** *** 1,2 **** --- 1,9 ---- + # Many of these entries are unnecessary because of the extra file copying + # built into IDLE's setup.py. However, if that should change, they may + # become necessary and meanwhile do no harm. + include *.bat + include *.def + include *.gif + include *.pyw include *.txt include idle Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -r1.43 -r1.44 *** PyShell.py 21 Dec 2002 21:39:11 -0000 1.43 --- PyShell.py 23 Dec 2002 03:31:49 -0000 1.44 *************** *** 800,804 **** def begin(self): self.resetoutput() ! self.write("Python %s on %s\n%s\nGRPC IDLE Fork %s\n" % (sys.version, sys.platform, self.COPYRIGHT, idlever.IDLE_VERSION)) --- 800,804 ---- def begin(self): self.resetoutput() ! self.write("Python %s on %s\n%s\nIDLEfork %s\n" % (sys.version, sys.platform, self.COPYRIGHT, idlever.IDLE_VERSION)) Index: idlever.py =================================================================== RCS file: /cvsroot/idlefork/idle/idlever.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** idlever.py 14 Sep 2002 04:24:43 -0000 1.6 --- idlever.py 23 Dec 2002 03:31:49 -0000 1.7 *************** *** 1 **** ! IDLE_VERSION = "0.8.9" --- 1 ---- ! IDLE_VERSION = "0.9a0" Index: setup.py =================================================================== RCS file: /cvsroot/idlefork/idle/setup.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** setup.py 22 Dec 2002 01:48:28 -0000 1.9 --- setup.py 23 Dec 2002 03:31:49 -0000 1.10 *************** *** 7,10 **** --- 7,19 ---- idle_name = "idle" + # IDLE not being imported as a package by its script. It is now being + # installed as a collection of modules in a directory in .../site-packages/, + # with a .pth file which will add IDLE to sys.path + + # Name of 'package' to be installed in site-packages: + pkgname = idle_name + "lib" + + pkg_dir = "." + try: pos = sys.argv.index("--check-tkinter") *************** *** 19,43 **** raise SystemExit ! try: ! package_dir = os.path.join(os.environ["SRCDIR"], "Tools", idle_name) ! except KeyError: ! package_dir = "." ! ! # name of package to be installed in site-packages ! pkgname = idle_name + "lib" ! ! # the normal build_py would not incorporate the .txt or config files ! txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt'] txt_files += ['config-extensions.def', 'config-highlight.def', 'config-keys.def', 'config-main.def'] ! Icons = glob.glob1("Icons","*.gif") ! ! # Create a .pth file to live in site-packages; Python will add IDLE to ! # sys.path: ! pathfile = idle_name + ".pth" ! pfile = open(pathfile, 'w') ! pfile.write(pkgname +'\n') ! pfile.close() class IDLE_Builder(build_py): --- 28,39 ---- raise SystemExit ! # the normal build_py would not incorporate anything but .py files ! txt_files = ['extend.txt', 'help.txt', 'CREDITS.txt', 'LICENSE.txt', ! 'README.txt'] txt_files += ['config-extensions.def', 'config-highlight.def', 'config-keys.def', 'config-main.def'] ! txt_files += [idle_name + '.bat', idle_name + '.pyw'] ! Icons = glob.glob1("Icons","*.gif") class IDLE_Builder(build_py): *************** *** 50,78 **** # Copies all .py files, then also copies the txt and gif files build_py.run(self) - assert self.packages == [pkgname] for name in txt_files: ! outfile = self.get_plain_outfile(self.build_lib, [pkgname], name) dir = os.path.dirname(outfile) self.mkpath(dir) ! self.copy_file(os.path.join(package_dir, name), outfile, preserve_mode = 0) for name in Icons: outfile = self.get_plain_outfile(self.build_lib, ! [pkgname, "Icons"], name) dir = os.path.dirname(outfile) self.mkpath(dir) self.copy_file(os.path.join("Icons", name), outfile, preserve_mode = 0) - # Copy the .pth file to the same level as the package directory - outfile = self.get_plain_outfile(self.build_lib, [], pathfile) - dir = os.path.dirname(outfile) - self.mkpath(dir) - self.copy_file(os.path.join(package_dir, pathfile), outfile, - preserve_mode=0) def get_source_files(self): # returns the .py files, the .txt and .def files, and the icons ! icons = [os.path.join(package_dir, "Icons",name) for name in Icons] ! txts = [os.path.join(package_dir, name) for name in txt_files] return build_py.get_source_files(self) + txt_files + icons --- 46,67 ---- # Copies all .py files, then also copies the txt and gif files build_py.run(self) for name in txt_files: ! outfile = self.get_plain_outfile(self.build_lib, [], name) dir = os.path.dirname(outfile) self.mkpath(dir) ! self.copy_file(os.path.join(pkg_dir, name), outfile, preserve_mode = 0) for name in Icons: outfile = self.get_plain_outfile(self.build_lib, ! ["Icons"], name) dir = os.path.dirname(outfile) self.mkpath(dir) self.copy_file(os.path.join("Icons", name), outfile, preserve_mode = 0) def get_source_files(self): # returns the .py files, the .txt and .def files, and the icons ! icons = [os.path.join(pkg_dir, "Icons",name) for name in Icons] ! txts = [os.path.join(pkg_dir, name) for name in txt_files] return build_py.get_source_files(self) + txt_files + icons *************** *** 83,92 **** return outputs for name in txt_files: ! filename = self.get_plain_outfile(self.build_lib, ! [pkgname], name) outputs.append(filename) for name in Icons: filename = self.get_plain_outfile(self.build_lib, ! [pkgname, "Icons"], name) outputs.append(filename) return outputs --- 72,80 ---- return outputs for name in txt_files: ! filename = self.get_plain_outfile(self.build_lib, [], name) outputs.append(filename) for name in Icons: filename = self.get_plain_outfile(self.build_lib, ! ["Icons"], name) outputs.append(filename) return outputs *************** *** 105,131 **** author = "Guido van Rossum et. al.", author_email = "idle-dev@python.org", - maintainer = "Kurt B. Kaiser", - maintainer_email = "kbk@shore.net", license = "PSF: www.python.org", url = "https://sourceforge.net/projects/idlefork/", long_description = ! """IDLE is a Tkinter based IDE for Python. It is written in 100% pure Python ! and works both on Windows and Unix. It features a multi-window text editor with ! multiple undo, Python colorizing, and many other things, as well as a Python ! shell window and a debugger. ! ! IDLEfork is a separate line of development which was initiated by D. Scherer ! at CMU as part of Visual Python. It features execution in a separate process ! which is newly initiated for each run. At version 0.9 the RPC was changed to ! incorporate code by GvR, which supports the debugger. IDLEfork also ! incorporates a GUI configuration utilility. For further details, refer to ! idlefork.sourceforge.net. ! """, cmdclass = {'build_py':IDLE_Builder, 'install_lib':IDLE_Installer}, ! package_dir = {pkgname: package_dir}, ! packages = [pkgname], ! scripts = [os.path.join(package_dir, idle_name)] ) --- 93,117 ---- author = "Guido van Rossum et. al.", author_email = "idle-dev@python.org", license = "PSF: www.python.org", url = "https://sourceforge.net/projects/idlefork/", long_description = ! """IDLE is a Tkinter based IDE for Python. It is written in 100% pure ! Python and works both on Windows and Unix. It features a multi-window ! text editor with multiple undo, Python colorizing, and many other ! things, as well as a Python shell window and a debugger. ! ! IDLEfork is a separate line of development which was initiated by ! D. Scherer at CMU as part of Visual Python. It features execution in a ! separate process which is newly initiated for each run. At version 0.9 ! the RPC was changed to incorporate code by GvR, which supports the ! debugger. IDLEfork also incorporates a GUI configuration utilility. ! For further details, refer to idlefork.sourceforge.net. """, cmdclass = {'build_py':IDLE_Builder, 'install_lib':IDLE_Installer}, ! package_dir = {pkgname: pkg_dir}, ! extra_path = pkgname, ! py_modules = [f.split('.')[0] for f in glob.glob("*.py")], ! scripts = [os.path.join(pkg_dir, idle_name)] ) From kbk@users.sourceforge.net Mon Dec 23 03:35:29 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 22 Dec 2002 19:35:29 -0800 Subject: [Idle-dev] CVS: idle config-extensions.def,1.8,1.9 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv13753 Modified Files: config-extensions.def Log Message: Alt-H was conflicting with the Help menu on Windows. Let's try Alt-2.... Index: config-extensions.def =================================================================== RCS file: /cvsroot/idlefork/idle/config-extensions.def,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** config-extensions.def 3 Dec 2002 20:34:43 -0000 1.8 --- config-extensions.def 23 Dec 2002 03:35:27 -0000 1.9 *************** *** 27,31 **** enable=1 [ZoomHeight_cfgBindings] ! zoom-height= [ScriptBinding] --- 27,31 ---- enable=1 [ZoomHeight_cfgBindings] ! zoom-height= [ScriptBinding] From neal@metaslash.com Mon Dec 23 16:19:11 2002 From: neal@metaslash.com (Neal Norwitz) Date: Mon, 23 Dec 2002 11:19:11 -0500 Subject: [Idle-dev] Re: Startup In-Reply-To: References: Message-ID: <20021223161911.GQ12063@epoch.metaslash.com> On Sun, Dec 22, 2002 at 10:10:37PM -0500, Kurt B. Kaiser wrote: > > What do you guys think? I'm ready for alpha on Linux and Windows. Great! I'd like to see the alpha. Your approach seems reasonable. Neal From tonylownds@users.sourceforge.net Mon Dec 23 18:11:31 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Mon, 23 Dec 2002 10:11:31 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.44,1.45 macosx_main.py,1.2,1.3 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv5818 Modified Files: PyShell.py macosx_main.py Log Message: Move boolcheck to PyShell Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.44 retrieving revision 1.45 diff -C2 -r1.44 -r1.45 *** PyShell.py 23 Dec 2002 03:31:49 -0000 1.44 --- PyShell.py 23 Dec 2002 18:11:26 -0000 1.45 *************** *** 13,16 **** --- 13,18 ---- import exceptions + import boolcheck + import linecache from code import InteractiveInterpreter Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** macosx_main.py 20 Dec 2002 04:26:00 -0000 1.2 --- macosx_main.py 23 Dec 2002 18:11:28 -0000 1.3 *************** *** 28,36 **** sys.path.append(idlelib) - # Make sure True, False, bool() builtins exist. - # - preserves 2.2 compatibility - 2.2.1 includes bool, 2.2 does not. - # - important for Mac OS X because it ships python 2.2 - import boolcheck - # see if we are being asked to execute the subprocess code if '-p' in sys.argv: --- 28,31 ---- *************** *** 38,42 **** sys.argv.remove('-p') ! # this module will become the namepsace used by the interactive # interpreter; remove all variables we have defined. del sys, __file__, boolcheck, split, join, isdir --- 33,37 ---- sys.argv.remove('-p') ! # this module will become the namespace used by the interactive # interpreter; remove all variables we have defined. del sys, __file__, boolcheck, split, join, isdir *************** *** 44,46 **** else: # Load idlelib/idle.py which starts the application. ! import idle --- 39,41 ---- else: # Load idlelib/idle.py which starts the application. ! import idle From tonylownds@users.sourceforge.net Mon Dec 23 18:12:43 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Mon, 23 Dec 2002 10:12:43 -0800 Subject: [Idle-dev] CVS: idle idle,1.5,1.6 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv7146 Modified Files: idle Log Message: Revert to revision 1.3; Mac OS X has a platform specific startup script, macosx_main.py Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** idle 21 Dec 2002 21:03:06 -0000 1.5 --- idle 23 Dec 2002 18:12:41 -0000 1.6 *************** *** 1,17 **** #! /usr/bin/env python ! import sys as _sys ! ! # See if we are being asked to execute the subprocess code ! if '-p' in _sys.argv: ! # run expects only the port number in _sys.argv ! _sys.argv.remove('-p') ! ! # this module will become the namepsace used by the interactive ! # interpreter; remove all variables we have defined. ! del _sys ! __import__('run').main() ! else: ! # Start the IDLE GUI ! import PyShell ! PyShell.main() --- 1,4 ---- #! /usr/bin/env python ! import PyShell ! PyShell.main() From tonylownds@users.sourceforge.net Mon Dec 23 18:36:16 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Mon, 23 Dec 2002 10:36:16 -0800 Subject: [Idle-dev] CVS: idle macosx_main.py,1.3,1.4 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv30588 Modified Files: macosx_main.py Log Message: Make this script execute using pythonw Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** macosx_main.py 23 Dec 2002 18:11:28 -0000 1.3 --- macosx_main.py 23 Dec 2002 18:36:14 -0000 1.4 *************** *** 1,2 **** --- 1,3 ---- + #!/usr/bin/env pythonw """IDLE.app From tony@lownds.com Mon Dec 23 18:40:01 2002 From: tony@lownds.com (Tony Lownds) Date: Mon, 23 Dec 2002 10:40:01 -0800 Subject: [Idle-dev] Re: Startup In-Reply-To: References: Message-ID: >However, I'm not wedded to this. You point out that the .pth approach >is not the best way for the Mac. It should not be a problem if .pth files are used on Windows or Linux though. > It is possible to set up IDLE as a >package and I suspect I can figure out a way to start the subprocess >when idlelib doesn't (yet) exist: probably something in run.run() like >try: __import__ idlelib.run except: __import__ run and something >similar in idle.py so IDLE will work from the source tree before it's >installed. Slightly kludgey but no one's going to turn into a pillar >of salt. .pth files are kludges, too. Sounds good to me. Here is one approach (tested) Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.6 diff -u -r1.6 idle --- idle 23 Dec 2002 18:12:41 -0000 1.6 +++ idle 23 Dec 2002 18:27:56 -0000 @@ -1,4 +1,7 @@ #! /usr/bin/env python -import PyShell +try: + from idlelib import PyShell +except ImportError: + import PyShell PyShell.main() Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.45 diff -u -r1.45 PyShell.py --- PyShell.py 23 Dec 2002 18:11:26 -0000 1.45 +++ PyShell.py 23 Dec 2002 18:27:59 -0000 @@ -322,8 +322,12 @@ return [sys.executable, '-p', str(self.port)] else: w = ['-W' + s for s in sys.warnoptions] + if __name__ == 'idlelib.PyShell': + command = "__import__('idlelib.run').run.main()" + else: + command = "__import__('run').main()" return [sys.executable] + w \ - + ["-c", "__import__('run').main()", str(self.port)] + + ["-c", command, str(self.port)] def start_subprocess(self): addr = ("localhost", self.port) >What do you guys think? I'm ready for alpha on Linux and Windows. Cool. I'm ready here. -Tony From kbk@users.sourceforge.net Mon Dec 23 22:51:06 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 23 Dec 2002 14:51:06 -0800 Subject: [Idle-dev] CVS: idle rpc.py,1.10,1.11 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv24784 Modified Files: rpc.py Log Message: Remove debugging connection message Index: rpc.py =================================================================== RCS file: /cvsroot/idlefork/idle/rpc.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** rpc.py 6 Dec 2002 21:45:24 -0000 1.10 --- rpc.py 23 Dec 2002 22:51:03 -0000 1.11 *************** *** 410,418 **** def accept(self): working_sock, address = self.listening_sock.accept() if address[0] == '127.0.0.1': - print>>sys.__stderr__, "Idle accepted connection from ", address SocketIO.__init__(self, working_sock) else: ! print>>sys.__stderr__, "Invalid host: ", address raise socket.error --- 410,419 ---- def accept(self): working_sock, address = self.listening_sock.accept() + if self.debugging: + print>>sys.__stderr__, "** Connection request from ", address if address[0] == '127.0.0.1': SocketIO.__init__(self, working_sock) else: ! print>>sys.__stderr__, "** Invalid host: ", address raise socket.error From kbk@users.sourceforge.net Tue Dec 24 00:51:07 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 23 Dec 2002 16:51:07 -0800 Subject: [Idle-dev] CVS: idle Bindings.py,1.12,1.13 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv25182 Modified Files: Bindings.py Log Message: Uniform Capitalization in Menus Index: Bindings.py =================================================================== RCS file: /cvsroot/idlefork/idle/Bindings.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Bindings.py 15 Sep 2002 21:38:20 -0000 1.12 --- Bindings.py 24 Dec 2002 00:51:05 -0000 1.13 *************** *** 12,20 **** # underscore prefixes character to underscore ('file', [ ! ('_New window', '<>'), ('_Open...', '<>'), ! ('Open _module...', '<>'), ! ('Class _browser', '<>'), ! ('_Path browser', '<>'), None, ('_Save', '<>'), --- 12,20 ---- # underscore prefixes character to underscore ('file', [ ! ('_New Window', '<>'), ('_Open...', '<>'), ! ('Open _Module...', '<>'), ! ('Class _Browser', '<>'), ! ('_Path Browser', '<>'), None, ('_Save', '<>'), *************** *** 22,26 **** ('Save Co_py As...', '<>'), None, ! ('_Print window', '<>'), None, ('_Close', '<>'), --- 22,26 ---- ('Save Co_py As...', '<>'), None, ! ('_Print Window', '<>'), None, ('_Close', '<>'), *************** *** 37,64 **** None, ('_Find...', '<>'), ! ('Find a_gain', '<>'), ! ('Find _selection', '<>'), ('Find in Files...', '<>'), ('R_eplace...', '<>'), ! ('Go to _line', '<>'), ]), ('format', [ ! ('_Indent region', '<>'), ! ('_Dedent region', '<>'), ! ('Comment _out region', '<>'), ! ('U_ncomment region', '<>'), ! ('Tabify region', '<>'), ! ('Untabify region', '<>'), ! ('Toggle tabs', '<>'), ! ('New indent width', '<>'), ]), ('run',[ ! ('Python shell', '<>'), ]), ('debug', [ ! ('_Go to file/line', '<>'), ! ('_Stack viewer', '<>'), ('!_Debugger', '<>'), ! ('!_Auto-open stack viewer', '<>' ), ]), ('settings', [ --- 37,64 ---- None, ('_Find...', '<>'), ! ('Find A_gain', '<>'), ! ('Find _Selection', '<>'), ('Find in Files...', '<>'), ('R_eplace...', '<>'), ! ('Go to _Line', '<>'), ]), ('format', [ ! ('_Indent Region', '<>'), ! ('_Dedent Region', '<>'), ! ('Comment _Out Region', '<>'), ! ('U_ncomment Region', '<>'), ! ('Tabify Region', '<>'), ! ('Untabify Region', '<>'), ! ('Toggle Tabs', '<>'), ! ('New Indent Width', '<>'), ]), ('run',[ ! ('Python Shell', '<>'), ]), ('debug', [ ! ('_Go to File/Line', '<>'), ! ('_Stack Viewer', '<>'), ('!_Debugger', '<>'), ! ('!_Auto-open Stack Viewer', '<>' ), ]), ('settings', [ From kbk@users.sourceforge.net Tue Dec 24 00:57:24 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 23 Dec 2002 16:57:24 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.45,1.46 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv25766 Modified Files: PyShell.py Log Message: 1. RPC stack levels were not pruned from traceback unless IDLE was started from its source directory. 2. Replace final traceback '?' with '-toplevel-' 3. Remove duplicated import boolcheck Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -r1.45 -r1.46 *** PyShell.py 23 Dec 2002 18:11:26 -0000 1.45 --- PyShell.py 24 Dec 2002 00:57:22 -0000 1.46 *************** *** 13,18 **** import exceptions - import boolcheck - import linecache from code import InteractiveInterpreter --- 13,16 ---- *************** *** 218,222 **** return lines ! # XXX 13 Dec 2020 KBK Not used currently # def saved_change_hook(self): # "Extend base method - clear breaks if module is modified" --- 216,220 ---- return lines ! # XXX 13 Dec 2002 KBK Not used currently # def saved_change_hook(self): # "Extend base method - clear breaks if module is modified" *************** *** 396,408 **** mod, name, args, tb = what print >>file, 'Traceback (most recent call last):' ! while tb and tb[0][0] in ("run.py", "rpc.py"): ! del tb[0] ! while tb and tb[-1][0] in ("run.py", "rpc.py"): ! del tb[-1] ! for i in range(len(tb)): ! fn, ln, nm, line = tb[i] ! if not line and fn.startswith(">file, 'Traceback (most recent call last):' ! exclude = ("run.py", "rpc.py") ! self.cleanup_traceback(tb, exclude) traceback.print_list(tb, file=file) # try to reinstantiate the exception, stuff in the args: *************** *** 425,428 **** --- 416,443 ---- print >>file, errmsg, what self.tkconsole.endexecuting() + + def cleanup_traceback(self, tb, exclude): + "Remove excluded traces from beginning/end of tb; get cached lines" + while tb: + for rpcfile in exclude: + if tb[0][0].count(rpcfile): + break # found an exclude, break for: and delete tb[0] + else: + break # no excludes, have left RPC code, break while: + del tb[0] + while tb: + for rpcfile in exclude: + if tb[-1][0].count(rpcfile): + break + else: + break + del tb[-1] + for i in range(len(tb)): + fn, ln, nm, line = tb[i] + if nm == '?': + nm = "-toplevel-" + if not line and fn.startswith(" Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv3836 Modified Files: PyShell.py Log Message: IDLE should exit if it fails to connect with the execution server subprocess. Currently it opens a dead shell window. Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -r1.46 -r1.47 *** PyShell.py 24 Dec 2002 00:57:22 -0000 1.46 --- PyShell.py 24 Dec 2002 03:33:12 -0000 1.47 *************** *** 341,345 **** else: display_port_binding_error() ! return # Accept the connection from the Python execution server self.rpcclt.accept() --- 341,345 ---- else: display_port_binding_error() ! sys.exit() # Accept the connection from the Python execution server self.rpcclt.accept() From kbk@users.sourceforge.net Tue Dec 24 06:36:21 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 23 Dec 2002 22:36:21 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.47,1.48 idle,1.6,1.7 idle.py,1.4,1.5 idle.pyw,1.3,1.4 setup.py,1.10,1.11 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv18403 Modified Files: PyShell.py idle idle.py idle.pyw setup.py Log Message: M PyShell.py M idle M idle.py M idle.pyw M setup.py Switch back to installing IDLE as a package. The IDLE GUI and the subprocess will both attempt to start up via the package mechanism, but if IDLE is not yet installed it is possible to run by calling python idle.py in the IDLE source directory, or to add the source directory to sys.path. One advantage of doing it this way is IDLE stays off sys.path. Developed in collaboration with Tony Lownds. Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -r1.47 -r1.48 *** PyShell.py 24 Dec 2002 03:33:12 -0000 1.47 --- PyShell.py 24 Dec 2002 06:36:19 -0000 1.48 *************** *** 320,326 **** return [sys.executable, '-p', str(self.port)] else: ! w = ['-W' + s for s in sys.warnoptions] ! return [sys.executable] + w \ ! + ["-c", "__import__('run').main()", str(self.port)] def start_subprocess(self): --- 320,332 ---- return [sys.executable, '-p', str(self.port)] else: ! w = ['-W' + s for s in sys.warnoptions] ! # Maybe IDLE is installed and is being accessed via sys.path, ! # or maybe it's not installed and the idle.py script is being ! # run from the IDLE source directory. ! if __name__ == 'idlelib.PyShell': ! command = "__import__('idlelib.run').run.main()" ! else: ! command = "__import__('run').main()" ! return [sys.executable] + w + ["-c", command, str(self.port)] def start_subprocess(self): Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** idle 23 Dec 2002 18:12:41 -0000 1.6 --- idle 24 Dec 2002 06:36:19 -0000 1.7 *************** *** 1,4 **** #! /usr/bin/env python ! import PyShell ! PyShell.main() --- 1,9 ---- #! /usr/bin/env python ! try: ! import idlelib.PyShell ! idlelib.PyShell.main() ! except: ! # IDLE is not installed, but maybe PyShell is on sys.path: ! import PyShell ! PyShell.main() Index: idle.py =================================================================== RCS file: /cvsroot/idlefork/idle/idle.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** idle.py 14 Jul 2001 05:21:37 -0000 1.4 --- idle.py 24 Dec 2002 06:36:19 -0000 1.5 *************** *** 1,4 **** #! /usr/bin/env python ! import PyShell ! PyShell.main() --- 1,9 ---- #! /usr/bin/env python ! try: ! import idlelib.PyShell ! idlelib.PyShell.main() ! except: ! # IDLE is not installed, but maybe PyShell is on sys.path: ! import PyShell ! PyShell.main() Index: idle.pyw =================================================================== RCS file: /cvsroot/idlefork/idle/idle.pyw,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** idle.pyw 19 Sep 2002 19:54:55 -0000 1.3 --- idle.pyw 24 Dec 2002 06:36:19 -0000 1.4 *************** *** 1,4 **** #! /usr/bin/env python ! import PyShell ! PyShell.main() --- 1,9 ---- #! /usr/bin/env python ! try: ! import idlelib.PyShell ! idlelib.PyShell.main() ! except: ! # IDLE is not installed, but maybe PyShell is on sys.path: ! import PyShell ! PyShell.main() Index: setup.py =================================================================== RCS file: /cvsroot/idlefork/idle/setup.py,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -r1.10 -r1.11 *** setup.py 23 Dec 2002 03:31:49 -0000 1.10 --- setup.py 24 Dec 2002 06:36:19 -0000 1.11 *************** *** 47,51 **** build_py.run(self) for name in txt_files: ! outfile = self.get_plain_outfile(self.build_lib, [], name) dir = os.path.dirname(outfile) self.mkpath(dir) --- 47,51 ---- build_py.run(self) for name in txt_files: ! outfile = self.get_plain_outfile(self.build_lib, [pkgname], name) dir = os.path.dirname(outfile) self.mkpath(dir) *************** *** 54,58 **** for name in Icons: outfile = self.get_plain_outfile(self.build_lib, ! ["Icons"], name) dir = os.path.dirname(outfile) self.mkpath(dir) --- 54,58 ---- for name in Icons: outfile = self.get_plain_outfile(self.build_lib, ! [pkgname, "Icons"], name) dir = os.path.dirname(outfile) self.mkpath(dir) *************** *** 72,80 **** return outputs for name in txt_files: ! filename = self.get_plain_outfile(self.build_lib, [], name) outputs.append(filename) for name in Icons: filename = self.get_plain_outfile(self.build_lib, ! ["Icons"], name) outputs.append(filename) return outputs --- 72,80 ---- return outputs for name in txt_files: ! filename = self.get_plain_outfile(self.build_lib, [pkgname], name) outputs.append(filename) for name in Icons: filename = self.get_plain_outfile(self.build_lib, ! [pkgname, "Icons"], name) outputs.append(filename) return outputs *************** *** 112,117 **** 'install_lib':IDLE_Installer}, package_dir = {pkgname: pkg_dir}, ! extra_path = pkgname, ! py_modules = [f.split('.')[0] for f in glob.glob("*.py")], scripts = [os.path.join(pkg_dir, idle_name)] ) --- 112,116 ---- 'install_lib':IDLE_Installer}, package_dir = {pkgname: pkg_dir}, ! packages = [pkgname], scripts = [os.path.join(pkg_dir, idle_name)] ) From tony@lownds.com Tue Dec 24 17:20:25 2002 From: tony@lownds.com (Tony Lownds) Date: Tue, 24 Dec 2002 09:20:25 -0800 Subject: [Idle-dev] Strange error Message-ID: --============_-1171372026==_ma============ Content-Type: text/plain; charset="us-ascii" ; format="flowed" Hi, I'm seeing a strange bug. When I start up IDLE, and enter a line into the untitled window, I get this message: Exception in Tkinter callback Traceback (most recent call last): File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/lib-tk/Tkinter.py", line 1292, in __call__ return apply(self.func, args) File "idlelib/EditorWindow.py", line 1014, in newline_and_indent_event if line == sys.ps1: AttributeError: 'module' object has no attribute 'ps1' The error stops happening if I have opened a Python Shell window. Anyone else seeing this? -Tony --============_-1171372026==_ma============ Content-Type: text/html; charset="us-ascii" Strange error
Hi,

I'm seeing a strange bug.

When I start up IDLE, and enter a line into the untitled window, I get this message:

Exception in Tkinter callback
Traceback (most recent call last):
  File "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/lib-tk/Tkinter.py", line 1292, in __call__
    return apply(self.func, args)
  File "idlelib/EditorWindow.py", line 1014, in newline_and_indent_event
    if line == sys.ps1:
AttributeError: 'module' object has no attribute 'ps1'

The error stops happening if I have opened a Python Shell window.

Anyone else seeing this?

-Tony
--============_-1171372026==_ma============-- From tonylownds@users.sourceforge.net Tue Dec 24 17:21:46 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Tue, 24 Dec 2002 09:21:46 -0800 Subject: [Idle-dev] CVS: idle PyShell.py,1.48,1.49 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv14652 Modified Files: PyShell.py Log Message: Move boolcheck before import of other IDLE modules Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** PyShell.py 24 Dec 2002 06:36:19 -0000 1.48 --- PyShell.py 24 Dec 2002 17:21:43 -0000 1.49 *************** *** 19,22 **** --- 19,25 ---- import tkMessageBox + # Preserve 2.2 compatibility for Mac OS X: + import boolcheck + from EditorWindow import EditorWindow, fixwordbreaks from FileList import FileList *************** *** 29,35 **** import rpc import RemoteDebugger - - # Preserve 2.2 compatibility for Mac OS X: - import boolcheck IDENTCHARS = string.ascii_letters + string.digits + "_" --- 32,35 ---- From tonylownds@users.sourceforge.net Tue Dec 24 17:22:55 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Tue, 24 Dec 2002 09:22:55 -0800 Subject: [Idle-dev] CVS: idle macosx_main.py,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv15077 Modified Files: macosx_main.py Log Message: boolcheck cannot be deleted here. Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** macosx_main.py 23 Dec 2002 18:36:14 -0000 1.4 --- macosx_main.py 24 Dec 2002 17:22:53 -0000 1.5 *************** *** 36,40 **** # this module will become the namespace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, boolcheck, split, join, isdir __import__('run').main() else: --- 36,40 ---- # this module will become the namespace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, split, join, isdir __import__('run').main() else: From kbk@shore.net Tue Dec 24 20:15:19 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 24 Dec 2002 15:15:19 -0500 Subject: [Idle-dev] Strange error In-Reply-To: References: Message-ID: Tony Lownds writes: > I'm seeing a strange bug. > > When I start up IDLE, and enter a line into the untitled window, I get > this message: > > Exception in Tkinter callback > Traceback (most recent call last): > File > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/lib-tk/Tkinter.py", > line 1292, in __call__ > return apply(self.func, args) > File "idlelib/EditorWindow.py", line 1014, in newline_and_indent_event > if line == sys.ps1: > AttributeError: 'module' object has no attribute 'ps1' > > The error stops happening if I have opened a Python Shell window. > > Anyone else seeing this? Good one. It's caused by the change I made at EditorWindow.py Rev 1.37 to fix the beep at the prompt and allow a tab to be backspaced. I usually start with the shell window so I didn't see it. It's caused by sys.ps1 not being set until the shell starts. Workaround, select start with the shell. I'll fix it. -- KBK From Jean-Baptiste.cazier@decode.is Wed Dec 25 16:09:58 2002 From: Jean-Baptiste.cazier@decode.is (Jean-Baptiste Cazier) Date: Wed, 25 Dec 2002 16:09:58 +0000 Subject: [Idle-dev] VI feel in IDLE ? Message-ID: <20021225160958.6b4bfe71.Jean-Baptiste.cazier@decode.is> S=E6l ! I have seen a lot of discussion and questions about idle file editor but fe= w answer on VI Is there any development going on to give IDLE a VI feel ? I do not mean to give it by default, but to add that option How much effort would it be to develop such an extension ? Thanks And Happy New Year ! :) Cheers ! Jean-Baptiste --=20 ----------------------------- Jean-Baptiste.Cazier@decode.is Department of Statistics deCODE genetics Sturlugata,8 570 2993 101 Reykjav=EDk From kbk@shore.net Wed Dec 25 22:16:25 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 25 Dec 2002 17:16:25 -0500 Subject: [Idle-dev] VI feel in IDLE ? In-Reply-To: <20021225160958.6b4bfe71.Jean-Baptiste.cazier@decode.is> References: <20021225160958.6b4bfe71.Jean-Baptiste.cazier@decode.is> Message-ID: Jean-Baptiste Cazier writes: > I have seen a lot of discussion and questions about idle file editor > but few answer on VI Is there any development going on to give IDLE > a VI feel ? I do not mean to give it by default, but to add that > option > > How much effort would it be to develop such an extension ? IDLEfork (which will soon be the new IDLE) has a configuration utility which allows user-defined keybindings. You can use that to set IDLEfork up the way you like. If you come up with a set of vi-like bindings, please post them and maybe we'll add them to the distribution. __ KBK From kbk@users.sourceforge.net Sun Dec 29 22:03:40 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 29 Dec 2002 14:03:40 -0800 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.39,1.40 PyShell.py,1.49,1.50 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv16359 Modified Files: EditorWindow.py PyShell.py Log Message: M EditorWindow.py M PyShell.py 1. PyShell Rev 1.39, EditorWindow Rev 1.37 fix was not handling a multiline prompt. 2. The same fix introduced a bug where hitting at a previous prompt-only line would copy the prompt to the iomark. 3. Move the setting of sys.ps1 earlier, into PyShell.main(), to allow this code to work before a shell is started up. 4. If cursor is on the input line in the prompt, and you hit , process the line instead of complaining. 5. If line has no stdin range (this includes the last line before shell restart) strip any prompt before recalling. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -r1.39 -r1.40 *** EditorWindow.py 20 Dec 2002 19:37:09 -0000 1.39 --- EditorWindow.py 29 Dec 2002 22:03:38 -0000 1.40 *************** *** 953,959 **** assert have > 0 want = ((have - 1) // self.indentwidth) * self.indentwidth ncharsdeleted = 0 while 1: ! if chars == sys.ps1: break chars = chars[:-1] --- 953,961 ---- assert have > 0 want = ((have - 1) // self.indentwidth) * self.indentwidth + # Debug prompt is multilined.... + last_line_of_prompt = sys.ps1.split('\n')[-1] ncharsdeleted = 0 while 1: ! if chars == last_line_of_prompt: break chars = chars[:-1] *************** *** 1012,1028 **** line = text.get("insert linestart", "insert") i, n = 0, len(line) - if line == sys.ps1: - return "break" while i < n and line[i] in " \t": i = i+1 if i == n: ! # the cursor is in or at leading indentation; just inject ! # an empty line at the start text.insert("insert linestart", '\n') return "break" indent = line[:i] ! # strip whitespace before insert point i = 0 ! while line and line[-1] in " \t": line = line[:-1] i = i+1 --- 1014,1029 ---- line = text.get("insert linestart", "insert") i, n = 0, len(line) while i < n and line[i] in " \t": i = i+1 if i == n: ! # the cursor is in or at leading indentation in a continuation ! # line; just inject an empty line at the start text.insert("insert linestart", '\n') return "break" indent = line[:i] ! # strip whitespace before insert point unless it's in the prompt i = 0 ! last_line_of_prompt = sys.ps1.split('\n')[-1] ! while line and line[-1] in " \t" and line != last_line_of_prompt: line = line[:-1] i = i+1 Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** PyShell.py 24 Dec 2002 17:21:43 -0000 1.49 --- PyShell.py 29 Dec 2002 22:03:38 -0000 1.50 *************** *** 826,833 **** (sys.version, sys.platform, self.COPYRIGHT, idlever.IDLE_VERSION)) - try: - sys.ps1 - except AttributeError: - sys.ps1 = ">>> " self.showprompt() import Tkinter --- 826,829 ---- *************** *** 944,955 **** self.recall(self.text.get(next[0], next[1])) return "break" ! # No stdin mark -- just get the current line ! self.recall(self.text.get("insert linestart", "insert lineend")) return "break" # If we're between the beginning of the line and the iomark, i.e. ! # in the prompt area, complain. if self.text.compare("insert", "<", "iomark"): ! self.text.bell() ! return "break" # If we're in the current input and there's only whitespace # beyond the cursor, erase that whitespace first --- 940,954 ---- self.recall(self.text.get(next[0], next[1])) return "break" ! # No stdin mark -- just get the current line, less any prompt ! line = self.text.get("insert linestart", "insert lineend") ! last_line_of_prompt = sys.ps1.split('\n')[-1] ! if line.startswith(last_line_of_prompt): ! line = line[len(last_line_of_prompt):] ! self.recall(line) return "break" # If we're between the beginning of the line and the iomark, i.e. ! # in the prompt area, move to the end of the prompt if self.text.compare("insert", "<", "iomark"): ! self.text.mark_set("insert", "iomark") # If we're in the current input and there's only whitespace # beyond the cursor, erase that whitespace first *************** *** 1136,1139 **** --- 1135,1142 ---- script = None startup = False + try: + sys.ps1 + except AttributeError: + sys.ps1 = '>>> ' try: opts, args = getopt.getopt(sys.argv[1:], "c:deihr:st:") From kbk@shore.net Sun Dec 29 22:11:16 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 29 Dec 2002 17:11:16 -0500 Subject: [Idle-dev] Strange error In-Reply-To: References: Message-ID: kbk@shore.net (Kurt B. Kaiser) writes: > > When I start up IDLE, and enter a line into the untitled window, I get > > this message: > > > > Exception in Tkinter callback > > Traceback (most recent call last): > > File > > "/BinaryCache/python/python-3.root~193/usr/lib/python2.2/lib-tk/Tkinter.py", > > line 1292, in __call__ > > return apply(self.func, args) > > File "idlelib/EditorWindow.py", line 1014, in newline_and_indent_event > > if line == sys.ps1: > > AttributeError: 'module' object has no attribute 'ps1' Fixed, along with a couple of other things which turned out to be real bears to track down. Give it a try. __ KBK From kbk@users.sourceforge.net Sun Dec 29 22:48:54 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sun, 29 Dec 2002 14:48:54 -0800 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.40,1.41 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv7638 Modified Files: EditorWindow.py Log Message: Remove some old debugging print statements. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -r1.40 -r1.41 *** EditorWindow.py 29 Dec 2002 22:03:38 -0000 1.40 --- EditorWindow.py 29 Dec 2002 22:48:52 -0000 1.41 *************** *** 140,146 **** self.color = color = self.ColorDelegator() per.insertfilter(color) - ##print "Initial colorizer" else: - ##print "No initial colorizer" self.color = None --- 140,144 ---- *************** *** 460,464 **** if self.color: return - ##print "Add colorizer" self.per.removefilter(self.undo) self.color = self.ColorDelegator() --- 458,461 ---- *************** *** 469,473 **** if not self.color: return - ##print "Remove colorizer" self.per.removefilter(self.undo) self.per.removefilter(self.color) --- 466,469 ---- *************** *** 760,764 **** text.keydefs = keydefs for event, keylist in keydefs.items(): - ##print>>sys.__stderr__, "event, list: ", event, keylist if keylist: apply(text.event_add, (event,) + tuple(keylist)) --- 756,759 ---- *************** *** 773,777 **** if keydefs is None: keydefs = self.Bindings.default_keydefs - ##print>>sys.__stderr__, "*keydefs: " , keydefs menudict = self.menudict text = self.text --- 768,771 ---- *************** *** 789,793 **** label = label[1:] underline, label = prepstr(label) - ##print>>sys.__stderr__, "*Event: " , event accelerator = get_accelerator(keydefs, event) def command(text=text, event=event): --- 783,786 ---- *************** *** 799,805 **** variable=var) else: - ##print>>sys.__stderr__, "label, ul, cmd, accel: ", - ## label, underline, command, - ## accelerator menu.add_command(label=label, underline=underline, command=command, --- 792,795 ---- From jessw@netwood.net Sun Dec 29 23:08:35 2002 From: jessw@netwood.net (Jesse W) Date: Sun, 29 Dec 2002 15:08:35 -0800 Subject: [Idle-dev] RFE: option to switch output from shell window to output window Message-ID: <3E0F0FF3.1696.A39AEE9@localhost> Pardon me if this is already been done, but here is an RFE that I would like to see added to IDLEfork. I may even code it myself. In earlier versions of IDLE, output from programs that were run as scripts was sent to a new window called *Output*; the results of Search in Files... is still sent to such a window. It would be very convientient in some circumstances to be able to redirect standard output(and possibly standard error) to such a window via a key or menu option. For example, if a program spits out a big bunch of text, it's unpleasent to splash it all over the shell window, so it would be nice to be able to see it in it's own window. I expect this would be pretty simple to code up; just make a toggle function to set sys.stdout to the write method of a new "*Output*" window, or to the Shell window, then insert the function into the menus or apply it to a keybinding. I do not have a SourceForge account, so if someone else could make a bug report for this, it would be appreciated. Thanks for all your work, Jesse Weinstein From guido@python.org Tue Dec 31 15:18:31 2002 From: guido@python.org (Guido van Rossum) Date: Tue, 31 Dec 2002 10:18:31 -0500 Subject: [Idle-dev] Re: [Python-Dev] Python 2.3a1 release status In-Reply-To: Your message of "31 Dec 2002 15:46:51 +0100." References: <200212311402.gBVE2XR14339@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <200212311518.gBVFIV914092@odiug.zope.com> > > I'm planning for a release by 6pm EST today. > > It appears that IDLEfork will not be merged for 2.3a1. Is there a plan > to merge it for 2.3? Yes, I hope they'll be ready for 2.3a2. --Guido van Rossum (home page: http://www.python.org/~guido/) From kbk@users.sourceforge.net Tue Dec 31 15:59:19 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 31 Dec 2002 07:59:19 -0800 Subject: [Idle-dev] CVS: idle CallTipWindow.py,1.6,1.7 CallTips.py,1.8,1.9 ColorDelegator.py,1.9,1.10 Debugger.py,1.18,1.19 EditorWindow.py,1.41,1.42 IOBinding.py,1.11,1.12 OutputWindow.py,1.7,1.8 PyShell.py,1.50,1.51 RemoteDebugger.py,1.7,1.8 ScriptBinding.py,1.14,1.15 ZoomHeight.py,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv28296 Modified Files: CallTipWindow.py CallTips.py ColorDelegator.py Debugger.py EditorWindow.py IOBinding.py OutputWindow.py PyShell.py RemoteDebugger.py ScriptBinding.py ZoomHeight.py Log Message: Whitespace Normalization Index: CallTipWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/CallTipWindow.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** CallTipWindow.py 12 Dec 2002 19:15:39 -0000 1.6 --- CallTipWindow.py 31 Dec 2002 15:59:14 -0000 1.7 *************** *** 38,42 **** # Without it, call tips intrude on the typing process by grabbing # the focus. ! tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w, "help", "noActivates") except TclError: --- 38,42 ---- # Without it, call tips intrude on the typing process by grabbing # the focus. ! tw.tk.call("::tk::unsupported::MacWindowStyle", "style", tw._w, "help", "noActivates") except TclError: Index: CallTips.py =================================================================== RCS file: /cvsroot/idlefork/idle/CallTips.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** CallTips.py 12 Dec 2002 19:15:39 -0000 1.8 --- CallTips.py 31 Dec 2002 15:59:14 -0000 1.9 *************** *** 82,89 **** i -= 1 return str[i:] ! def fetch_tip(self, name): ! """Return the argument list and docstring of a function or class ! If there is a Python subprocess, get the calltip there. Otherwise, either fetch_tip() is running in the subprocess itself or it was called --- 82,89 ---- i -= 1 return str[i:] ! def fetch_tip(self, name): ! """Return the argument list and docstring of a function or class ! If there is a Python subprocess, get the calltip there. Otherwise, either fetch_tip() is running in the subprocess itself or it was called *************** *** 94,98 **** module may be inoperative if the module was not the last to run. ! """ try: rpcclt = self.editwin.flist.pyshell.interp.rpcclt --- 94,98 ---- module may be inoperative if the module was not the last to run. ! """ try: rpcclt = self.editwin.flist.pyshell.interp.rpcclt *************** *** 212,216 **** tc = TC() ! tests = (t1, t2, t3, t4, t5, t6, TC, tc.t1, tc.t2, tc.t3, tc.t4, tc.t5, tc.t6) --- 212,216 ---- tc = TC() ! tests = (t1, t2, t3, t4, t5, t6, TC, tc.t1, tc.t2, tc.t3, tc.t4, tc.t5, tc.t6) Index: ColorDelegator.py =================================================================== RCS file: /cvsroot/idlefork/idle/ColorDelegator.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** ColorDelegator.py 17 Dec 2002 21:16:12 -0000 1.9 --- ColorDelegator.py 31 Dec 2002 15:59:14 -0000 1.10 *************** *** 53,57 **** apply(self.tag_configure, (tag,), cnf) self.tag_raise('sel') ! def LoadTagDefs(self): theme = idleConf.GetOption('main','Theme','name') --- 53,57 ---- apply(self.tag_configure, (tag,), cnf) self.tag_raise('sel') ! def LoadTagDefs(self): theme = idleConf.GetOption('main','Theme','name') *************** *** 68,72 **** "hit": idleConf.GetHighlight(theme, "hit"), } ! if DEBUG: print 'tagdefs',tagdefs --- 68,72 ---- "hit": idleConf.GetHighlight(theme, "hit"), } ! if DEBUG: print 'tagdefs',tagdefs Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** Debugger.py 14 Dec 2002 04:38:51 -0000 1.18 --- Debugger.py 31 Dec 2002 15:59:14 -0000 1.19 *************** *** 16,23 **** co_filename = frame.f_code.co_filename ! co_name = frame.f_code.co_name ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name ! ## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ## print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno ## print>>sys.__stderr__, "*name: ", co_name --- 16,23 ---- co_filename = frame.f_code.co_filename ! co_name = frame.f_code.co_name ## print>>sys.__stderr__, "*function: ", frame.f_code.co_name ! ## print>>sys.__stderr__, "*file: ", frame.f_code.co_filename ## print>>sys.__stderr__, "*line number: ", frame.f_code.co_firstlineno ## print>>sys.__stderr__, "*name: ", co_name *************** *** 26,30 **** try: # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the ! # XXX currently running function. If the function has an # attribute called "DebuggerStepThrough", prevent the debugger # from stepping through Idle code. The following doesn't work --- 26,30 ---- try: # XXX 12 Dec 2002 CGT TO DO: Find way to get a reference to the ! # XXX currently running function. If the function has an # attribute called "DebuggerStepThrough", prevent the debugger # from stepping through Idle code. The following doesn't work *************** *** 76,80 **** self.make_gui() self.interacting = 0 ! def run(self, *args): try: --- 76,80 ---- self.make_gui() self.interacting = 0 ! def run(self, *args): try: Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** EditorWindow.py 29 Dec 2002 22:48:52 -0000 1.41 --- EditorWindow.py 31 Dec 2002 15:59:14 -0000 1.42 *************** *** 112,116 **** text.bind("<>",self.toggle_tabs_event) text.bind("<>",self.change_indentwidth_event) ! if flist: flist.inversedict[self] = key --- 112,116 ---- text.bind("<>",self.toggle_tabs_event) text.bind("<>",self.change_indentwidth_event) ! if flist: flist.inversedict[self] = key *************** *** 187,191 **** self.extensions['AutoIndent'].set_indentation_params( self.ispythonsource(filename)) ! def set_status_bar(self): self.status_bar = self.MultiStatusBar(self.top) --- 187,191 ---- self.extensions['AutoIndent'].set_indentation_params( self.ispythonsource(filename)) ! def set_status_bar(self): self.status_bar = self.MultiStatusBar(self.top) *************** *** 274,281 **** def about_dialog(self, event=None): aboutDialog.AboutDialog(self.top,'About IDLEfork') ! def config_dialog(self, event=None): configDialog.ConfigDialog(self.top,'Settings') ! def good_advice(self, event=None): tkMessageBox.showinfo('Advice', "Don't Panic!", master=self.text) --- 274,281 ---- def about_dialog(self, event=None): aboutDialog.AboutDialog(self.top,'About IDLEfork') ! def config_dialog(self, event=None): configDialog.ConfigDialog(self.top,'Settings') ! def good_advice(self, event=None): tkMessageBox.showinfo('Advice', "Don't Panic!", master=self.text) *************** *** 283,292 **** def view_readme(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'README.txt') ! textView.TextViewer(self.top,'IDLEfork - README',fn) def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') ! textView.TextViewer(self.top,'Help',fn) ! help_url = "http://www.python.org/doc/current/" if sys.platform[:3] == "win": --- 283,292 ---- def view_readme(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'README.txt') ! textView.TextViewer(self.top,'IDLEfork - README',fn) def help_dialog(self, event=None): fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),'help.txt') ! textView.TextViewer(self.top,'Help',fn) ! help_url = "http://www.python.org/doc/current/" if sys.platform[:3] == "win": *************** *** 470,474 **** self.color = None self.per.insertfilter(self.undo) ! def ResetColorizer(self): "Update the colour theme if it is changed" --- 470,474 ---- self.color = None self.per.insertfilter(self.undo) ! def ResetColorizer(self): "Update the colour theme if it is changed" *************** *** 479,483 **** def ResetFont(self): ! "Update the text widgets' font if it is changed" # Called from configDialog.py fontWeight='normal' --- 479,483 ---- def ResetFont(self): ! "Update the text widgets' font if it is changed" # Called from configDialog.py fontWeight='normal' *************** *** 536,548 **** command=self.__DisplayExtraHelpCallback(menuItem[1])) else: #no extra help items ! if hasattr(self,'menuExtraHelp'): ! helpMenu.delete(cascadeIndex-1) del(self.menuExtraHelp) ! def __DisplayExtraHelpCallback(self,helpFile): def DisplayExtraHelp(helpFile=helpFile): self.display_docs(helpFile) return DisplayExtraHelp ! def UpdateRecentFilesList(self,newFile=None): "Load or update the recent files list, and menu if required" --- 536,548 ---- command=self.__DisplayExtraHelpCallback(menuItem[1])) else: #no extra help items ! if hasattr(self,'menuExtraHelp'): ! helpMenu.delete(cascadeIndex-1) del(self.menuExtraHelp) ! def __DisplayExtraHelpCallback(self,helpFile): def DisplayExtraHelp(helpFile=helpFile): self.display_docs(helpFile) return DisplayExtraHelp ! def UpdateRecentFilesList(self,newFile=None): "Load or update the recent files list, and menu if required" *************** *** 554,558 **** finally: RFfile.close() ! if newFile: newFile=os.path.abspath(newFile)+'\n' if newFile in rfList: --- 554,558 ---- finally: RFfile.close() ! if newFile: newFile=os.path.abspath(newFile)+'\n' if newFile in rfList: *************** *** 568,572 **** menu = instance.menuRecentFiles menu.delete(1,END) ! i = 0 ; ul = 0; ullen = len(ullist) for file in rfList: fileName=file[0:-1] --- 568,572 ---- menu = instance.menuRecentFiles menu.delete(1,END) ! i = 0 ; ul = 0; ullen = len(ullist) for file in rfList: fileName=file[0:-1] *************** *** 578,582 **** underline=ul) i += 1 ! def __CleanRecentFiles(self,rfList): origRfList=rfList[:] --- 578,582 ---- underline=ul) i += 1 ! def __CleanRecentFiles(self,rfList): origRfList=rfList[:] *************** *** 584,588 **** nonFiles=[] for path in rfList: ! if not os.path.exists(path[0:-1]): nonFiles.append(count) count=count+1 --- 584,588 ---- nonFiles=[] for path in rfList: ! if not os.path.exists(path[0:-1]): nonFiles.append(count) count=count+1 *************** *** 600,609 **** RFfile.close() return rfList ! def __RecentFileCallback(self,fileName): def OpenRecentFile(fileName=fileName): self.io.open(editFile=fileName) return OpenRecentFile ! def saved_change_hook(self): short = self.short_title() --- 600,609 ---- RFfile.close() return rfList ! def __RecentFileCallback(self,fileName): def OpenRecentFile(fileName=fileName): self.io.open(editFile=fileName) return OpenRecentFile ! def saved_change_hook(self): short = self.short_title() *************** *** 673,677 **** if self.io: if not self.get_saved(): ! if self.top.state()!='normal': self.top.deiconify() self.top.lower() --- 673,677 ---- if self.io: if not self.get_saved(): ! if self.top.state()!='normal': self.top.deiconify() self.top.lower() Index: IOBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/IOBinding.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** IOBinding.py 14 Dec 2002 04:38:51 -0000 1.11 --- IOBinding.py 31 Dec 2002 15:59:14 -0000 1.12 *************** *** 104,108 **** self.fileencoding = None self.__id_print = self.text.bind("<>", self.print_window) ! def close(self): # Undo command bindings --- 104,108 ---- self.fileencoding = None self.__id_print = self.text.bind("<>", self.print_window) ! def close(self): # Undo command bindings *************** *** 367,371 **** master = self.text) return chars ! def fixlastline(self): c = self.text.get("end-2c") --- 367,371 ---- master = self.text) return chars ! def fixlastline(self): c = self.text.get("end-2c") *************** *** 404,411 **** tkMessageBox.showerror("Print status", output, master=self.text) else: #no printing for this platform ! message="Printing is not enabled for this platform: %s" % platform tkMessageBox.showinfo("Print status", message, master=self.text) return "break" ! opendialog = None savedialog = None --- 404,411 ---- tkMessageBox.showerror("Print status", output, master=self.text) else: #no printing for this platform ! message="Printing is not enabled for this platform: %s" % platform tkMessageBox.showinfo("Print status", message, master=self.text) return "break" ! opendialog = None savedialog = None Index: OutputWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/OutputWindow.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** OutputWindow.py 27 Sep 2002 00:34:31 -0000 1.7 --- OutputWindow.py 31 Dec 2002 15:59:14 -0000 1.8 *************** *** 147,155 **** # def flush(self): # pass - - - - - - - --- 147,148 ---- Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -r1.50 -r1.51 *** PyShell.py 29 Dec 2002 22:03:38 -0000 1.50 --- PyShell.py 31 Dec 2002 15:59:14 -0000 1.51 *************** *** 63,67 **** orig_checkcache() cache.update(save) ! # Patch linecache.checkcache(): linecache.checkcache = extended_linecache_checkcache --- 63,67 ---- orig_checkcache() cache.update(save) ! # Patch linecache.checkcache(): linecache.checkcache = extended_linecache_checkcache *************** *** 195,199 **** for line in lines: if line.startswith(filename + '='): ! breakpoint_linenumbers = eval(line[len(filename)+1:]) for breakpoint_linenumber in breakpoint_linenumbers: self.set_breakpoint(breakpoint_linenumber) --- 195,199 ---- for line in lines: if line.startswith(filename + '='): ! breakpoint_linenumbers = eval(line[len(filename)+1:]) for breakpoint_linenumber in breakpoint_linenumbers: self.set_breakpoint(breakpoint_linenumber) *************** *** 227,231 **** self.clear_file_breaks() EditorWindow._close(self) ! class PyShellFileList(FileList): --- 227,231 ---- self.clear_file_breaks() EditorWindow._close(self) ! class PyShellFileList(FileList): *************** *** 247,251 **** class ModifiedColorDelegator(ColorDelegator): "Extend base class: colorizer for the shell window itself" ! def __init__(self): ColorDelegator.__init__(self) --- 247,251 ---- class ModifiedColorDelegator(ColorDelegator): "Extend base class: colorizer for the shell window itself" ! def __init__(self): ColorDelegator.__init__(self) *************** *** 256,260 **** self.tag_add("SYNC", "1.0", "iomark") ColorDelegator.recolorize_main(self) ! def LoadTagDefs(self): ColorDelegator.LoadTagDefs(self) --- 256,260 ---- self.tag_add("SYNC", "1.0", "iomark") ColorDelegator.recolorize_main(self) ! def LoadTagDefs(self): ColorDelegator.LoadTagDefs(self) *************** *** 301,305 **** rpcpid = None ! def spawn_subprocess(self): args = self.build_subprocess_arglist() self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) --- 301,305 ---- rpcpid = None ! def spawn_subprocess(self): args = self.build_subprocess_arglist() self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args) *************** *** 313,317 **** # # framework applet: sys.executable + -p is correct ! # python 2.2 + pure python main applet: # sys.executable + -p is correct # pythonw idle.py: sys.executable + -c is correct --- 313,317 ---- # # framework applet: sys.executable + -p is correct ! # python 2.2 + pure python main applet: # sys.executable + -p is correct # pythonw idle.py: sys.executable + -c is correct *************** *** 361,365 **** debug = self.getdebugger() if debug: ! RemoteDebugger.close_subprocess_debugger(self.rpcclt) # kill subprocess, spawn a new one, accept connection self.rpcclt.close() --- 361,365 ---- debug = self.getdebugger() if debug: ! RemoteDebugger.close_subprocess_debugger(self.rpcclt) # kill subprocess, spawn a new one, accept connection self.rpcclt.close() *************** *** 435,439 **** for rpcfile in exclude: if tb[-1][0].count(rpcfile): ! break else: break --- 435,439 ---- for rpcfile in exclude: if tb[-1][0].count(rpcfile): ! break else: break *************** *** 526,530 **** linecache.cache[filename] = len(source)+1, 0, lines, filename return filename ! def showsyntaxerror(self, filename=None): """Extend base class method: Add Colorizing --- 526,530 ---- linecache.cache[filename] = len(source)+1, 0, lines, filename return filename ! def showsyntaxerror(self, filename=None): """Extend base class method: Add Colorizing *************** *** 588,592 **** "please wait until it is finished.", master=self.tkconsole.text) ! def runcommand(self, code): "Run the code without invoking the debugger" --- 588,592 ---- "please wait until it is finished.", master=self.tkconsole.text) ! def runcommand(self, code): "Run the code without invoking the debugger" *************** *** 1076,1083 **** usage_msg = """\ ! USAGE: idle [-deis] [-t title] [file]* idle [-ds] [-t title] (-c cmd | -r file) [arg]* idle [-ds] [-t title] - [arg]* ! -h print this help message and exit --- 1076,1083 ---- usage_msg = """\ ! USAGE: idle [-deis] [-t title] [file]* idle [-ds] [-t title] (-c cmd | -r file) [arg]* idle [-ds] [-t title] - [arg]* ! -h print this help message and exit *************** *** 1176,1180 **** cmd = sys.stdin.read() enable_shell = True ! use_subprocess = True --- 1176,1180 ---- cmd = sys.stdin.read() enable_shell = True ! use_subprocess = True *************** *** 1203,1209 **** # check the IDLE settings configuration (but command line overrides) edit_start = idleConf.GetOption('main', 'General', ! 'editor-on-startup', type='bool') enable_edit = enable_edit or edit_start ! enable_shell = enable_shell or not edit_start # start editor and/or shell windows: root = Tk(className="Idle") --- 1203,1209 ---- # check the IDLE settings configuration (but command line overrides) edit_start = idleConf.GetOption('main', 'General', ! 'editor-on-startup', type='bool') enable_edit = enable_edit or edit_start ! enable_shell = enable_shell or not edit_start # start editor and/or shell windows: root = Tk(className="Idle") *************** *** 1259,1263 **** IDLE makes and accepts connections only with this computer, and does not ! communicate over the internet in any way. Its use of port 8833 should not be a security risk on a single-user machine. """ --- 1259,1263 ---- IDLE makes and accepts connections only with this computer, and does not ! communicate over the internet in any way. Its use of port 8833 should not be a security risk on a single-user machine. """ Index: RemoteDebugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/RemoteDebugger.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** RemoteDebugger.py 5 Sep 2002 02:31:20 -0000 1.7 --- RemoteDebugger.py 31 Dec 2002 15:59:14 -0000 1.8 *************** *** 122,126 **** msg = self.idb.clear_all_file_breaks(filename) return msg ! #----------called by a FrameProxy---------- --- 122,126 ---- msg = self.idb.clear_all_file_breaks(filename) return msg ! #----------called by a FrameProxy---------- *************** *** 367,371 **** is deleted in PyShell.close_remote_debugger().) ! """ close_subprocess_debugger(rpcclt) rpcclt.unregister(gui_adap_oid) --- 367,371 ---- is deleted in PyShell.close_remote_debugger().) ! """ close_subprocess_debugger(rpcclt) rpcclt.unregister(gui_adap_oid) *************** *** 378,380 **** (gui_adap_oid,), {}) assert idb_adap_oid_ret == idb_adap_oid, 'Idb restarted with different oid' - --- 378,379 ---- Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/ScriptBinding.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** ScriptBinding.py 19 Dec 2002 03:25:34 -0000 1.14 --- ScriptBinding.py 31 Dec 2002 15:59:14 -0000 1.15 *************** *** 100,104 **** "There's an error in your program:\n" + msg) return False ! def colorize_syntax_error(self, msg, lineno, offset): text = self.editwin.text --- 100,104 ---- "There's an error in your program:\n" + msg) return False ! def colorize_syntax_error(self, msg, lineno, offset): text = self.editwin.text *************** *** 113,117 **** text.mark_set("insert", pos + "+1c") text.see(pos) ! def run_script_event(self, event): "Check syntax, if ok run the script in the shell top level" --- 113,117 ---- text.mark_set("insert", pos + "+1c") text.see(pos) ! def run_script_event(self, event): "Check syntax, if ok run the script in the shell top level" Index: ZoomHeight.py =================================================================== RCS file: /cvsroot/idlefork/idle/ZoomHeight.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** ZoomHeight.py 20 Dec 2002 01:22:01 -0000 1.4 --- ZoomHeight.py 31 Dec 2002 15:59:14 -0000 1.5 *************** *** 11,15 **** ]) ] ! def __init__(self, editwin): self.editwin = editwin --- 11,15 ---- ]) ] ! def __init__(self, editwin): self.editwin = editwin *************** *** 34,38 **** newy = 0 #newheight = newheight - 96 ! newheight = newheight - 88 if height >= newheight: newgeom = "" --- 34,38 ---- newy = 0 #newheight = newheight - 96 ! newheight = newheight - 88 if height >= newheight: newgeom = "" From kbk@users.sourceforge.net Tue Dec 31 16:03:28 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 31 Dec 2002 08:03:28 -0800 Subject: [Idle-dev] CVS: idle aboutDialog.py,1.8,1.9 boolcheck.py,1.1,1.2 configDialog.py,1.48,1.49 configHandler.py,1.26,1.27 configHelpSourceEdit.py,1.2,1.3 configSectionNameDialog.py,1.2,1.3 dynOptionMenuWidget.py,1.4,1.5 keybindingDialog.py,1.9,1.10 macosx_main.py,1.5,1.6 rpc.py,1.11,1.12 tabpage.py,1.4,1.5 textView.py,1.2,1.3 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv30934 Modified Files: aboutDialog.py boolcheck.py configDialog.py configHandler.py configHelpSourceEdit.py configSectionNameDialog.py dynOptionMenuWidget.py keybindingDialog.py macosx_main.py rpc.py tabpage.py textView.py Log Message: Whitespace Normalization Index: aboutDialog.py =================================================================== RCS file: /cvsroot/idlefork/idle/aboutDialog.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** aboutDialog.py 30 Nov 2002 19:12:41 -0000 1.8 --- aboutDialog.py 31 Dec 2002 16:03:22 -0000 1.9 *************** *** 11,15 **** """ modal about dialog for idle ! """ def __init__(self,parent,title): Toplevel.__init__(self, parent) --- 11,15 ---- """ modal about dialog for idle ! """ def __init__(self,parent,title): Toplevel.__init__(self, parent) *************** *** 19,23 **** self.bg="#707070" self.fg="#ffffff" ! self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) --- 19,23 ---- self.bg="#707070" self.fg="#ffffff" ! self.CreateWidgets() self.resizable(height=FALSE,width=FALSE) *************** *** 34,38 **** self.bind('',self.Ok) #dismiss dialog self.wait_window() ! def CreateWidgets(self): frameMain = Frame(self,borderwidth=2,relief=SUNKEN) --- 34,38 ---- self.bind('',self.Ok) #dismiss dialog self.wait_window() ! def CreateWidgets(self): frameMain = Frame(self,borderwidth=2,relief=SUNKEN) *************** *** 84,88 **** tkVer = `TkVersion`.split('.') tkVer[len(tkVer)-1] = str('%.3g' % (float('.'+tkVer[len(tkVer)-1])))[2:] ! if tkVer[len(tkVer)-1] == '': tkVer[len(tkVer)-1] = '0' tkVer = string.join(tkVer,'.') --- 84,88 ---- tkVer = `TkVersion`.split('.') tkVer[len(tkVer)-1] = str('%.3g' % (float('.'+tkVer[len(tkVer)-1])))[2:] ! if tkVer[len(tkVer)-1] == '': tkVer[len(tkVer)-1] = '0' tkVer = string.join(tkVer,'.') *************** *** 106,110 **** def ShowLicense(self): self.ViewFile('About - License','LICENSE.txt') ! def ShowCredits(self): self.ViewFile('About - Credits','CREDITS.txt') --- 106,110 ---- def ShowLicense(self): self.ViewFile('About - License','LICENSE.txt') ! def ShowCredits(self): self.ViewFile('About - Credits','CREDITS.txt') *************** *** 116,120 **** def Ok(self, event=None): self.destroy() ! if __name__ == '__main__': #test the dialog --- 116,120 ---- def Ok(self, event=None): self.destroy() ! if __name__ == '__main__': #test the dialog Index: boolcheck.py =================================================================== RCS file: /cvsroot/idlefork/idle/boolcheck.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** boolcheck.py 20 Dec 2002 04:24:43 -0000 1.1 --- boolcheck.py 31 Dec 2002 16:03:22 -0000 1.2 *************** *** 1,4 **** "boolcheck - import this module to ensure True, False, bool() builtins exist." ! try: True except NameError: --- 1,4 ---- "boolcheck - import this module to ensure True, False, bool() builtins exist." ! try: True except NameError: *************** *** 8,10 **** from operator import truth __builtin__.bool = truth - --- 8,9 ---- Index: configDialog.py =================================================================== RCS file: /cvsroot/idlefork/idle/configDialog.py,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -r1.48 -r1.49 *** configDialog.py 4 Nov 2002 03:17:45 -0000 1.48 --- configDialog.py 31 Dec 2002 16:03:22 -0000 1.49 *************** *** 15,19 **** """ configuration dialog for idle ! """ def __init__(self,parent,title): Toplevel.__init__(self, parent) --- 15,19 ---- """ configuration dialog for idle ! """ def __init__(self,parent,title): Toplevel.__init__(self, parent) *************** *** 23,27 **** #Theme Elements. Each theme element key is it's display name. #The first value of the tuple is the sample area tag name. ! #The second value is the display name list sort index. self.themeElements={'Normal Text':('normal','00'), 'Python Keywords':('keyword','01'), --- 23,27 ---- #Theme Elements. Each theme element key is it's display name. #The first value of the tuple is the sample area tag name. ! #The second value is the display name list sort index. self.themeElements={'Normal Text':('normal','00'), 'Python Keywords':('keyword','01'), *************** *** 49,55 **** #self.bind('',self.Help) #context help self.LoadConfigs() ! self.AttachVarCallbacks() #avoid callbacks during LoadConfigs self.wait_window() ! def CreateWidgets(self): self.tabPages = TabPageSet(self, --- 49,55 ---- #self.bind('',self.Help) #context help self.LoadConfigs() ! self.AttachVarCallbacks() #avoid callbacks during LoadConfigs self.wait_window() ! def CreateWidgets(self): self.tabPages = TabPageSet(self, *************** *** 76,80 **** frameActionButtons.pack(side=BOTTOM) self.tabPages.pack(side=TOP,expand=TRUE,fill=BOTH) ! def CreatePageFontTab(self): #tkVars --- 76,80 ---- frameActionButtons.pack(side=BOTTOM) self.tabPages.pack(side=TOP,expand=TRUE,fill=BOTH) ! def CreatePageFontTab(self): #tkVars *************** *** 84,88 **** self.spaceNum=IntVar(self) #self.tabCols=IntVar(self) ! self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation --- 84,88 ---- self.spaceNum=IntVar(self) #self.tabCols=IntVar(self) ! self.indentBySpaces=BooleanVar(self) self.editFont=tkFont.Font(self,('courier',12,'normal')) ##widget creation *************** *** 169,173 **** self.colour=StringVar(self) self.fontName=StringVar(self) ! self.themeIsBuiltin=BooleanVar(self) self.highlightTarget=StringVar(self) ##widget creation --- 169,173 ---- self.colour=StringVar(self) self.fontName=StringVar(self) ! self.themeIsBuiltin=BooleanVar(self) self.highlightTarget=StringVar(self) ##widget creation *************** *** 195,199 **** for txTa in textAndTags: text.insert(END,txTa[0],txTa[1]) ! for element in self.themeElements.keys(): text.tag_bind(self.themeElements[element][0],'', lambda event,elem=element: event.widget.winfo_toplevel() --- 195,199 ---- for txTa in textAndTags: text.insert(END,txTa[0],txTa[1]) ! for element in self.themeElements.keys(): text.tag_bind(self.themeElements[element][0],'', lambda event,elem=element: event.widget.winfo_toplevel() *************** *** 212,216 **** value=0,text='Background',command=self.SetColourSampleBinding) self.fgHilite.set(1) ! buttonSaveCustomTheme=Button(frameCustom, text='Save as New Custom Theme',command=self.SaveAsNewTheme) #frameTheme --- 212,216 ---- value=0,text='Background',command=self.SetColourSampleBinding) self.fgHilite.set(1) ! buttonSaveCustomTheme=Button(frameCustom, text='Save as New Custom Theme',command=self.SaveAsNewTheme) #frameTheme *************** *** 241,245 **** self.radioFg.pack(side=LEFT,anchor=E) self.radioBg.pack(side=RIGHT,anchor=W) ! buttonSaveCustomTheme.pack(side=BOTTOM,fill=X,padx=5,pady=5) #frameTheme labelThemeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) --- 241,245 ---- self.radioFg.pack(side=LEFT,anchor=E) self.radioBg.pack(side=RIGHT,anchor=W) ! buttonSaveCustomTheme.pack(side=BOTTOM,fill=X,padx=5,pady=5) #frameTheme labelThemeTitle.pack(side=TOP,anchor=W,padx=5,pady=5) *************** *** 257,261 **** self.builtinKeys=StringVar(self) self.customKeys=StringVar(self) ! self.keysAreBuiltin=BooleanVar(self) self.keyBinding=StringVar(self) ##widget creation --- 257,261 ---- self.builtinKeys=StringVar(self) self.customKeys=StringVar(self) ! self.keysAreBuiltin=BooleanVar(self) self.keyBinding=StringVar(self) ##widget creation *************** *** 301,306 **** #frameCustom labelCustomTitle.pack(side=TOP,anchor=W,padx=5,pady=5) ! buttonSaveCustomKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) ! self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) #frame target --- 301,306 ---- #frameCustom labelCustomTitle.pack(side=TOP,anchor=W,padx=5,pady=5) ! buttonSaveCustomKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) ! self.buttonNewKeys.pack(side=BOTTOM,fill=X,padx=5,pady=5) frameTarget.pack(side=LEFT,padx=5,pady=5,expand=TRUE,fill=BOTH) #frame target *************** *** 322,329 **** def CreatePageGeneral(self): ! #tkVars ! self.winWidth=StringVar(self) self.winHeight=StringVar(self) ! self.startupEdit=IntVar(self) self.userHelpBrowser=BooleanVar(self) self.helpBrowser=StringVar(self) --- 322,329 ---- def CreatePageGeneral(self): ! #tkVars ! self.winWidth=StringVar(self) self.winHeight=StringVar(self) ! self.startupEdit=IntVar(self) self.userHelpBrowser=BooleanVar(self) self.helpBrowser=StringVar(self) *************** *** 331,335 **** #body frame=self.tabPages.pages['General']['page'] ! #body section frames frameRun=Frame(frame,borderwidth=2,relief=GROOVE) frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) --- 331,335 ---- #body frame=self.tabPages.pages['General']['page'] ! #body section frames frameRun=Frame(frame,borderwidth=2,relief=GROOVE) frameWinSize=Frame(frame,borderwidth=2,relief=GROOVE) *************** *** 384,388 **** labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioStartupEdit.pack(side=LEFT,anchor=W,padx=5,pady=5) ! radioStartupShell.pack(side=LEFT,anchor=W,padx=5,pady=5) #frameWinSize labelWinSizeTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) --- 384,388 ---- labelRunChoiceTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) radioStartupEdit.pack(side=LEFT,anchor=W,padx=5,pady=5) ! radioStartupShell.pack(side=LEFT,anchor=W,padx=5,pady=5) #frameWinSize labelWinSizeTitle.pack(side=LEFT,anchor=W,padx=5,pady=5) *************** *** 415,424 **** self.builtinTheme.trace_variable('w',self.VarChanged_builtinTheme) self.customTheme.trace_variable('w',self.VarChanged_customTheme) ! self.themeIsBuiltin.trace_variable('w',self.VarChanged_themeIsBuiltin) self.highlightTarget.trace_variable('w',self.VarChanged_highlightTarget) self.keyBinding.trace_variable('w',self.VarChanged_keyBinding) self.builtinKeys.trace_variable('w',self.VarChanged_builtinKeys) self.customKeys.trace_variable('w',self.VarChanged_customKeys) ! self.keysAreBuiltin.trace_variable('w',self.VarChanged_keysAreBuiltin) self.winWidth.trace_variable('w',self.VarChanged_winWidth) self.winHeight.trace_variable('w',self.VarChanged_winHeight) --- 415,424 ---- self.builtinTheme.trace_variable('w',self.VarChanged_builtinTheme) self.customTheme.trace_variable('w',self.VarChanged_customTheme) ! self.themeIsBuiltin.trace_variable('w',self.VarChanged_themeIsBuiltin) self.highlightTarget.trace_variable('w',self.VarChanged_highlightTarget) self.keyBinding.trace_variable('w',self.VarChanged_keyBinding) self.builtinKeys.trace_variable('w',self.VarChanged_builtinKeys) self.customKeys.trace_variable('w',self.VarChanged_customKeys) ! self.keysAreBuiltin.trace_variable('w',self.VarChanged_keysAreBuiltin) self.winWidth.trace_variable('w',self.VarChanged_winWidth) self.winHeight.trace_variable('w',self.VarChanged_winHeight) *************** *** 428,432 **** value=self.fontSize.get() self.AddChangedItem('main','EditorWindow','font-size',value) ! def VarChanged_fontName(self,*params): value=self.fontName.get() --- 428,432 ---- value=self.fontSize.get() self.AddChangedItem('main','EditorWindow','font-size',value) ! def VarChanged_fontName(self,*params): value=self.fontName.get() *************** *** 473,477 **** def VarChanged_highlightTarget(self,*params): self.SetHighlightTarget() ! def VarChanged_keyBinding(self,*params): value=self.keyBinding.get() --- 473,477 ---- def VarChanged_highlightTarget(self,*params): self.SetHighlightTarget() ! def VarChanged_keyBinding(self,*params): value=self.keyBinding.get() *************** *** 485,489 **** extKeybindSection=extName+'_cfgBindings' self.AddChangedItem('extensions',extKeybindSection,event,value) ! def VarChanged_builtinKeys(self,*params): value=self.builtinKeys.get() --- 485,489 ---- extKeybindSection=extName+'_cfgBindings' self.AddChangedItem('extensions',extKeybindSection,event,value) ! def VarChanged_builtinKeys(self,*params): value=self.builtinKeys.get() *************** *** 498,504 **** def VarChanged_keysAreBuiltin(self,*params): ! value=self.keysAreBuiltin.get() self.AddChangedItem('main','Keys','default',value) ! if value: self.VarChanged_builtinKeys() else: --- 498,504 ---- def VarChanged_keysAreBuiltin(self,*params): ! value=self.keysAreBuiltin.get() self.AddChangedItem('main','Keys','default',value) ! if value: self.VarChanged_builtinKeys() else: *************** *** 519,524 **** def ResetChangedItems(self): #When any config item is changed in this dialog, an entry ! #should be made in the relevant section (config type) of this ! #dictionary. The key should be the config file section name and the #value a dictionary, whose key:value pairs are item=value pairs for #that config file section. --- 519,524 ---- def ResetChangedItems(self): #When any config item is changed in this dialog, an entry ! #should be made in the relevant section (config type) of this ! #dictionary. The key should be the config file section name and the #value a dictionary, whose key:value pairs are item=value pairs for #that config file section. *************** *** 528,534 **** value=str(value) #make sure we use a string if not self.changedItems[type].has_key(section): ! self.changedItems[type][section]={} self.changedItems[type][section][item]=value ! def GetDefaultItems(self): dItems={'main':{},'highlight':{},'keys':{},'extensions':{}} --- 528,534 ---- value=str(value) #make sure we use a string if not self.changedItems[type].has_key(section): ! self.changedItems[type][section]={} self.changedItems[type][section][item]=value ! def GetDefaultItems(self): dItems={'main':{},'highlight':{},'keys':{},'extensions':{}} *************** *** 538,546 **** dItems[configType][section]={} options=idleConf.defaultCfg[configType].GetOptionList(section) ! for option in options: dItems[configType][section][option]=( idleConf.defaultCfg[configType].Get(section,option)) return dItems ! def SetThemeType(self): if self.themeIsBuiltin.get(): --- 538,546 ---- dItems[configType][section]={} options=idleConf.defaultCfg[configType].GetOptionList(section) ! for option in options: dItems[configType][section][option]=( idleConf.defaultCfg[configType].Get(section,option)) return dItems ! def SetThemeType(self): if self.themeIsBuiltin.get(): *************** *** 564,575 **** self.optMenuKeysCustom.config(state=NORMAL) self.buttonDeleteCustomKeys.config(state=NORMAL) ! def GetNewKeys(self): listIndex=self.listBindings.index(ANCHOR) binding=self.listBindings.get(listIndex) bindName=binding.split()[0] #first part, up to first space ! if self.keysAreBuiltin.get(): currentKeySetName=self.builtinKeys.get() ! else: currentKeySetName=self.customKeys.get() currentBindings=idleConf.GetCurrentKeySet() --- 564,575 ---- self.optMenuKeysCustom.config(state=NORMAL) self.buttonDeleteCustomKeys.config(state=NORMAL) ! def GetNewKeys(self): listIndex=self.listBindings.index(ANCHOR) binding=self.listBindings.get(listIndex) bindName=binding.split()[0] #first part, up to first space ! if self.keysAreBuiltin.get(): currentKeySetName=self.builtinKeys.get() ! else: currentKeySetName=self.customKeys.get() currentBindings=idleConf.GetCurrentKeySet() *************** *** 590,595 **** self.listBindings.select_anchor(listIndex) return ! else: #create new custom key set based on previously active key set ! self.CreateNewKeySet(newKeySet) self.listBindings.delete(listIndex) self.listBindings.insert(listIndex,bindName+' - '+newKeys) --- 590,595 ---- self.listBindings.select_anchor(listIndex) return ! else: #create new custom key set based on previously active key set ! self.CreateNewKeySet(newKeySet) self.listBindings.delete(listIndex) self.listBindings.insert(listIndex,bindName+' - '+newKeys) *************** *** 607,611 **** message,usedNames).result return newKeySet ! def SaveAsNewKeySet(self): newKeysName=self.GetNewKeysName('New Key Set Name:') --- 607,611 ---- message,usedNames).result return newKeySet ! def SaveAsNewKeySet(self): newKeysName=self.GetNewKeysName('New Key Set Name:') *************** *** 619,625 **** #creates new custom key set based on the previously active key set, #and makes the new key set active ! if self.keysAreBuiltin.get(): prevKeySetName=self.builtinKeys.get() ! else: prevKeySetName=self.customKeys.get() prevKeys=idleConf.GetCoreKeys(prevKeySetName) --- 619,625 ---- #creates new custom key set based on the previously active key set, #and makes the new key set active ! if self.keysAreBuiltin.get(): prevKeySetName=self.builtinKeys.get() ! else: prevKeySetName=self.customKeys.get() prevKeys=idleConf.GetCoreKeys(prevKeySetName) *************** *** 642,646 **** self.keysAreBuiltin.set(0) self.SetKeysType() ! def LoadKeysList(self,keySetName): reselect=0 --- 642,646 ---- self.keysAreBuiltin.set(0) self.SetKeysType() ! def LoadKeysList(self,keySetName): reselect=0 *************** *** 653,657 **** bindNames.sort() self.listBindings.delete(0,END) ! for bindName in bindNames: key=string.join(keySet[bindName]) #make key(s) into a string bindName=bindName[2:-2] #trim off the angle brackets --- 653,657 ---- bindNames.sort() self.listBindings.delete(0,END) ! for bindName in bindNames: key=string.join(keySet[bindName]) #make key(s) into a string bindName=bindName[2:-2] #trim off the angle brackets *************** *** 691,695 **** self.Apply() self.SetKeysType() ! def DeleteCustomTheme(self): themeName=self.customTheme.get() --- 691,695 ---- self.Apply() self.SetKeysType() ! def DeleteCustomTheme(self): themeName=self.customTheme.get() *************** *** 723,727 **** rgbTuplet, colourString = tkColorChooser.askcolor(parent=self, title='Pick new colour for : '+target,initialcolor=prevColour) ! if colourString and (colourString!=prevColour): #user didn't cancel, and they chose a new colour if self.themeIsBuiltin.get(): #current theme is a built-in --- 723,727 ---- rgbTuplet, colourString = tkColorChooser.askcolor(parent=self, title='Pick new colour for : '+target,initialcolor=prevColour) ! if colourString and (colourString!=prevColour): #user didn't cancel, and they chose a new colour if self.themeIsBuiltin.get(): #current theme is a built-in *************** *** 731,740 **** if not newTheme: #user cancelled custom theme creation return ! else: #create new custom theme based on previously active theme ! self.CreateNewTheme(newTheme) self.colour.set(colourString) else: #current theme is user defined self.colour.set(colourString) ! def OnNewColourSet(self): newColour=self.colour.get() --- 731,740 ---- if not newTheme: #user cancelled custom theme creation return ! else: #create new custom theme based on previously active theme ! self.CreateNewTheme(newTheme) self.colour.set(colourString) else: #current theme is user defined self.colour.set(colourString) ! def OnNewColourSet(self): newColour=self.colour.get() *************** *** 755,759 **** message,usedNames).result return newTheme ! def SaveAsNewTheme(self): newThemeName=self.GetNewThemeName('New Theme Name:') --- 755,759 ---- message,usedNames).result return newTheme ! def SaveAsNewTheme(self): newThemeName=self.GetNewThemeName('New Theme Name:') *************** *** 764,771 **** #creates new custom theme based on the previously active theme, #and makes the new theme active ! if self.themeIsBuiltin.get(): themeType='default' themeName=self.builtinTheme.get() ! else: themeType='user' themeName=self.customTheme.get() --- 764,771 ---- #creates new custom theme based on the previously active theme, #and makes the new theme active ! if self.themeIsBuiltin.get(): themeType='default' themeName=self.builtinTheme.get() ! else: themeType='user' themeName=self.customTheme.get() *************** *** 784,797 **** self.themeIsBuiltin.set(0) self.SetThemeType() ! def OnListFontButtonRelease(self,event): self.fontName.set(self.listFontName.get(ANCHOR)) self.SetFontSample() ! def SetFontSample(self,event=None): fontName=self.fontName.get() ! if self.fontBold.get(): fontWeight=tkFont.BOLD ! else: fontWeight=tkFont.NORMAL self.editFont.config(size=self.fontSize.get(), --- 784,797 ---- self.themeIsBuiltin.set(0) self.SetThemeType() ! def OnListFontButtonRelease(self,event): self.fontName.set(self.listFontName.get(ANCHOR)) self.SetFontSample() ! def SetFontSample(self,event=None): fontName=self.fontName.get() ! if self.fontBold.get(): fontWeight=tkFont.BOLD ! else: fontWeight=tkFont.NORMAL self.editFont.config(size=self.fontSize.get(), *************** *** 808,815 **** self.fgHilite.set(1) self.SetColourSample() ! def SetColourSampleBinding(self,*args): self.SetColourSample() ! def SetColourSample(self): #set the colour smaple area --- 808,815 ---- self.fgHilite.set(1) self.SetColourSample() ! def SetColourSampleBinding(self,*args): self.SetColourSample() ! def SetColourSample(self): #set the colour smaple area *************** *** 819,823 **** colour=self.textHighlightSample.tag_cget(tag,plane) self.frameColourSet.config(bg=colour) ! def PaintThemeSample(self): if self.themeIsBuiltin.get(): #a default theme --- 819,823 ---- colour=self.textHighlightSample.tag_cget(tag,plane) self.frameColourSet.config(bg=colour) ! def PaintThemeSample(self): if self.themeIsBuiltin.get(): #a default theme *************** *** 829,833 **** colours=idleConf.GetHighlight(theme,element) if element=='cursor': #cursor sample needs special painting ! colours['background']=idleConf.GetHighlight(theme, 'normal', fgBg='bg') #handle any unsaved changes to this theme --- 829,833 ---- colours=idleConf.GetHighlight(theme,element) if element=='cursor': #cursor sample needs special painting ! colours['background']=idleConf.GetHighlight(theme, 'normal', fgBg='bg') #handle any unsaved changes to this theme *************** *** 840,844 **** apply(self.textHighlightSample.tag_config,(element,),colours) self.SetColourSample() ! def OnCheckUserHelpBrowser(self): if self.userHelpBrowser.get(): --- 840,844 ---- apply(self.textHighlightSample.tag_config,(element,),colours) self.SetColourSample() ! def OnCheckUserHelpBrowser(self): if self.userHelpBrowser.get(): *************** *** 846,853 **** else: self.entryHelpBrowser.config(state=DISABLED) ! def HelpSourceSelected(self,event): self.SetHelpListButtonStates() ! def SetHelpListButtonStates(self): if self.listHelp.size()<1: #no entries in list --- 846,853 ---- else: self.entryHelpBrowser.config(state=DISABLED) ! def HelpSourceSelected(self,event): self.SetHelpListButtonStates() ! def SetHelpListButtonStates(self): if self.listHelp.size()<1: #no entries in list *************** *** 869,873 **** self.UpdateUserHelpChangedItems() self.SetHelpListButtonStates() ! def HelpListItemEdit(self): itemIndex=self.listHelp.index(ANCHOR) --- 869,873 ---- self.UpdateUserHelpChangedItems() self.SetHelpListButtonStates() ! def HelpListItemEdit(self): itemIndex=self.listHelp.index(ANCHOR) *************** *** 882,886 **** self.UpdateUserHelpChangedItems() self.SetHelpListButtonStates() ! def HelpListItemRemove(self): itemIndex=self.listHelp.index(ANCHOR) --- 882,886 ---- self.UpdateUserHelpChangedItems() self.SetHelpListButtonStates() ! def HelpListItemRemove(self): itemIndex=self.listHelp.index(ANCHOR) *************** *** 889,893 **** self.UpdateUserHelpChangedItems() self.SetHelpListButtonStates() ! def UpdateUserHelpChangedItems(self): #clear and rebuild the HelpFiles secion in self.changedItems --- 889,893 ---- self.UpdateUserHelpChangedItems() self.SetHelpListButtonStates() ! def UpdateUserHelpChangedItems(self): #clear and rebuild the HelpFiles secion in self.changedItems *************** *** 897,901 **** self.AddChangedItem('main','HelpFiles',str(num), string.join(self.userHelpList[num-1],';')) ! def LoadFontCfg(self): ##base editor font selection list --- 897,901 ---- self.AddChangedItem('main','HelpFiles',str(num), string.join(self.userHelpList[num-1],';')) ! def LoadFontCfg(self): ##base editor font selection list *************** *** 920,926 **** self.fontBold.set(idleConf.GetOption('main','EditorWindow', 'font-bold',default=0,type='bool')) ! ##font sample self.SetFontSample() ! def LoadTabCfg(self): ##indent type radiobuttons --- 920,926 ---- self.fontBold.set(idleConf.GetOption('main','EditorWindow', 'font-bold',default=0,type='bool')) ! ##font sample self.SetFontSample() ! def LoadTabCfg(self): ##indent type radiobuttons *************** *** 935,939 **** self.spaceNum.set(spaceNum) #self.tabCols.set(tabCols) ! def LoadThemeCfg(self): ##current theme type radiobutton --- 935,939 ---- self.spaceNum.set(spaceNum) #self.tabCols.set(tabCols) ! def LoadThemeCfg(self): ##current theme type radiobutton *************** *** 951,955 **** if not itemList: self.radioThemeCustom.config(state=DISABLED) ! self.customTheme.set('- no custom themes -') else: self.optMenuThemeCustom.SetMenu(itemList,itemList[0]) --- 951,955 ---- if not itemList: self.radioThemeCustom.config(state=DISABLED) ! self.customTheme.set('- no custom themes -') else: self.optMenuThemeCustom.SetMenu(itemList,itemList[0]) *************** *** 965,977 **** themeNames=self.themeElements.keys() themeNames.sort(self.__ThemeNameIndexCompare) ! self.optMenuHighlightTarget.SetMenu(themeNames,themeNames[0]) self.PaintThemeSample() self.SetHighlightTarget() ! def __ThemeNameIndexCompare(self,a,b): if self.themeElements[a][1]>' extKeys[event]=binding ! return extKeys ! def GetExtensionBindings(self,extensionName): """ Returns a dictionary of all the event bindings for a particular extension. The configurable keybindings are returned as they exist in ! the dictionary returned by GetCurrentKeySet; that is, where re-used keybindings are disabled. """ --- 423,433 ---- event='<<'+eventName+'>>' extKeys[event]=binding ! return extKeys ! def GetExtensionBindings(self,extensionName): """ Returns a dictionary of all the event bindings for a particular extension. The configurable keybindings are returned as they exist in ! the dictionary returned by GetCurrentKeySet; that is, where re-used keybindings are disabled. """ *************** *** 442,453 **** event='<<'+eventName+'>>' extBinds[event]=binding ! ! return extBinds ! def GetKeyBinding(self, keySetName, eventStr): """ returns the keybinding for a specific event. keySetName - string, name of key binding set ! eventStr - string, the virtual event we want the binding for, represented as a string, eg. '<>' """ --- 442,453 ---- event='<<'+eventName+'>>' extBinds[event]=binding ! ! return extBinds ! def GetKeyBinding(self, keySetName, eventStr): """ returns the keybinding for a specific event. keySetName - string, name of key binding set ! eventStr - string, the virtual event we want the binding for, represented as a string, eg. '<>' """ *************** *** 458,465 **** def GetCurrentKeySet(self): return self.GetKeySet(self.CurrentKeys()) ! def GetKeySet(self,keySetName): """ ! Returns a dictionary of: all requested core keybindings, plus the keybindings for all currently active extensions. If a binding defined in an extension is already in use, that binding is disabled. --- 458,465 ---- def GetCurrentKeySet(self): return self.GetKeySet(self.CurrentKeys()) ! def GetKeySet(self,keySetName): """ ! Returns a dictionary of: all requested core keybindings, plus the keybindings for all currently active extensions. If a binding defined in an extension is already in use, that binding is disabled. *************** *** 484,488 **** """ return ('<<'+virtualEvent+'>>') in self.GetCoreKeys().keys() ! def GetCoreKeys(self, keySetName=None): """ --- 484,488 ---- """ return ('<<'+virtualEvent+'>>') in self.GetCoreKeys().keys() ! def GetCoreKeys(self, keySetName=None): """ *************** *** 505,509 **** '<>': [''], '<>': [''], ! '<>': [''], '<>': [''], '<>': [''], --- 505,509 ---- '<>': [''], '<>': [''], ! '<>': [''], '<>': [''], '<>': [''], *************** *** 528,532 **** '<>': [''], '<>': [''], ! '<>': [''], '<>': [''], '<>': [' '], --- 528,532 ---- '<>': [''], '<>': [''], ! '<>': [''], '<>': [''], '<>': [' '], *************** *** 553,557 **** sys.stderr.write(warning) return keyBindings ! def GetExtraHelpSourceList(self,configSet): """ --- 553,557 ---- sys.stderr.write(warning) return keyBindings ! def GetExtraHelpSourceList(self,configSet): """ *************** *** 560,568 **** , or an empty list if there are none. Returned tuples are of the form form (menu_item , path_to_help_file , option). ! """ helpSources=[] if configSet=='user': cfgParser=self.userCfg['main'] ! elif configSet=='default': cfgParser=self.defaultCfg['main'] else: --- 560,568 ---- , or an empty list if there are none. Returned tuples are of the form form (menu_item , path_to_help_file , option). ! """ helpSources=[] if configSet=='user': cfgParser=self.userCfg['main'] ! elif configSet=='default': cfgParser=self.defaultCfg['main'] else: *************** *** 584,602 **** def GetAllExtraHelpSourcesList(self): """ ! Returns a list of tuples containing the details of all additional help sources configured, or an empty list if there are none. Tuples are of the format returned by GetExtraHelpSourceList. ! """ ! allHelpSources=( self.GetExtraHelpSourceList('default')+ self.GetExtraHelpSourceList('user') ) ! return allHelpSources ! def LoadCfgFiles(self): ! """ load all configuration files. """ for key in self.defaultCfg.keys(): ! self.defaultCfg[key].Load() ! self.userCfg[key].Load() #same keys def SaveUserCfgFiles(self): --- 584,602 ---- def GetAllExtraHelpSourcesList(self): """ ! Returns a list of tuples containing the details of all additional help sources configured, or an empty list if there are none. Tuples are of the format returned by GetExtraHelpSourceList. ! """ ! allHelpSources=( self.GetExtraHelpSourceList('default')+ self.GetExtraHelpSourceList('user') ) ! return allHelpSources ! def LoadCfgFiles(self): ! """ load all configuration files. """ for key in self.defaultCfg.keys(): ! self.defaultCfg[key].Load() ! self.userCfg[key].Load() #same keys def SaveUserCfgFiles(self): *************** *** 605,609 **** """ for key in self.userCfg.keys(): ! self.userCfg[key].Save() idleConf=IdleConf() --- 605,609 ---- """ for key in self.userCfg.keys(): ! self.userCfg[key].Save() idleConf=IdleConf() *************** *** 619,623 **** for section in sections: options=cfg[key].options(section) ! print section print options for option in options: --- 619,623 ---- for section in sections: options=cfg[key].options(section) ! print section print options for option in options: Index: configHelpSourceEdit.py =================================================================== RCS file: /cvsroot/idlefork/idle/configHelpSourceEdit.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** configHelpSourceEdit.py 27 Mar 2002 02:24:54 -0000 1.2 --- configHelpSourceEdit.py 31 Dec 2002 16:03:23 -0000 1.3 *************** *** 28,32 **** self.update_idletasks() #needs to be done here so that the winfo_reqwidth is valid ! self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), --- 28,32 ---- self.update_idletasks() #needs to be done here so that the winfo_reqwidth is valid ! self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), *************** *** 64,68 **** def MenuOk(self): ! #simple validity check for a sensible #menu item name menuOk=1 --- 64,68 ---- def MenuOk(self): ! #simple validity check for a sensible #menu item name menuOk=1 *************** *** 81,87 **** menuOk=0 return menuOk ! def PathOk(self): ! #simple validity check for menu file path pathOk=1 path=self.path.get() --- 81,87 ---- menuOk=0 return menuOk ! def PathOk(self): ! #simple validity check for menu file path pathOk=1 path=self.path.get() *************** *** 98,108 **** pathOk=0 return pathOk ! def Ok(self, event=None): if self.MenuOk(): if self.PathOk(): ! self.result=( self.menu.get().strip(),self.path.get().strip() ) self.destroy() ! def Cancel(self, event=None): self.result=None --- 98,108 ---- pathOk=0 return pathOk ! def Ok(self, event=None): if self.MenuOk(): if self.PathOk(): ! self.result=( self.menu.get().strip(),self.path.get().strip() ) self.destroy() ! def Cancel(self, event=None): self.result=None *************** *** 118,121 **** Button(root,text='Dialog',command=run).pack() root.mainloop() - - --- 118,119 ---- Index: configSectionNameDialog.py =================================================================== RCS file: /cvsroot/idlefork/idle/configSectionNameDialog.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** configSectionNameDialog.py 5 Feb 2002 04:52:32 -0000 1.2 --- configSectionNameDialog.py 31 Dec 2002 16:03:23 -0000 1.3 *************** *** 28,32 **** #needs to be done here so that the winfo_reqwidth is valid self.messageInfo.config(width=self.frameMain.winfo_reqwidth()) ! self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), --- 28,32 ---- #needs to be done here so that the winfo_reqwidth is valid self.messageInfo.config(width=self.frameMain.winfo_reqwidth()) ! self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), *************** *** 57,61 **** def NameOk(self): ! #simple validity check for a sensible #ConfigParser file section name nameOk=1 --- 57,61 ---- def NameOk(self): ! #simple validity check for a sensible #ConfigParser file section name nameOk=1 *************** *** 76,85 **** nameOk=0 return nameOk ! def Ok(self, event=None): if self.NameOk(): self.result=self.name.get().strip() self.destroy() ! def Cancel(self, event=None): self.result='' --- 76,85 ---- nameOk=0 return nameOk ! def Ok(self, event=None): if self.NameOk(): self.result=self.name.get().strip() self.destroy() ! def Cancel(self, event=None): self.result='' *************** *** 96,99 **** Button(root,text='Dialog',command=run).pack() root.mainloop() - - --- 96,97 ---- Index: dynOptionMenuWidget.py =================================================================== RCS file: /cvsroot/idlefork/idle/dynOptionMenuWidget.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** dynOptionMenuWidget.py 19 Jan 2002 00:29:54 -0000 1.4 --- dynOptionMenuWidget.py 31 Dec 2002 16:03:23 -0000 1.5 *************** *** 21,30 **** self.variable=variable self.command=kwargs.get('command') ! def SetMenu(self,valueList,value=None): """ clear and reload the menu with a new set of options. valueList - list of new options ! value - initial value to set the optionmenu's menubutton to """ self['menu'].delete(0,'end') --- 21,30 ---- self.variable=variable self.command=kwargs.get('command') ! def SetMenu(self,valueList,value=None): """ clear and reload the menu with a new set of options. valueList - list of new options ! value - initial value to set the optionmenu's menubutton to """ self['menu'].delete(0,'end') Index: keybindingDialog.py =================================================================== RCS file: /cvsroot/idlefork/idle/keybindingDialog.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** keybindingDialog.py 29 Sep 2002 00:23:08 -0000 1.9 --- keybindingDialog.py 31 Dec 2002 16:03:23 -0000 1.10 *************** *** 1,4 **** """ ! dialog for building tkinter accelerator key bindings """ from Tkinter import * --- 1,4 ---- """ ! dialog for building tkinter accelerator key bindings """ from Tkinter import * *************** *** 12,16 **** mapped to currentKeys - list, a list of all key sequence lists currently mapped ! to virtual events, for overlap checking """ Toplevel.__init__(self, parent) --- 12,16 ---- mapped to currentKeys - list, a list of all key sequence lists currently mapped ! to virtual events, for overlap checking """ Toplevel.__init__(self, parent) *************** *** 37,41 **** self.withdraw() #hide while setting geometry self.update_idletasks() ! self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), --- 37,41 ---- self.withdraw() #hide while setting geometry self.update_idletasks() ! self.geometry("+%d+%d" % ((parent.winfo_rootx()+((parent.winfo_width()/2) -(self.winfo_reqwidth()/2)), *************** *** 44,48 **** self.deiconify() #geometry set, unhide self.wait_window() ! def CreateWidgets(self): frameMain = Frame(self,borderwidth=2,relief=SUNKEN) --- 44,48 ---- self.deiconify() #geometry set, unhide self.wait_window() ! def CreateWidgets(self): frameMain = Frame(self,borderwidth=2,relief=SUNKEN) *************** *** 144,152 **** self.buttonLevel.config(text='Advanced Key Binding Entry >>') self.frameKeySeqBasic.lift() ! self.frameControlsBasic.lift() ! def FinalKeySelected(self,event): self.BuildKeyString() ! def BuildKeyString(self): keyList=[] --- 144,152 ---- self.buttonLevel.config(text='Advanced Key Binding Entry >>') self.frameKeySeqBasic.lift() ! self.frameControlsBasic.lift() ! def FinalKeySelected(self,event): self.BuildKeyString() ! def BuildKeyString(self): keyList=[] *************** *** 155,160 **** if modifiers: modifiers[0]='<'+modifiers[0] keyList=keyList+modifiers ! if finalKey: ! if (not modifiers) and (finalKey not in self.alphanumKeys+self.punctuationKeys): finalKey='<'+self.TranslateKey(finalKey) --- 155,160 ---- if modifiers: modifiers[0]='<'+modifiers[0] keyList=keyList+modifiers ! if finalKey: ! if (not modifiers) and (finalKey not in self.alphanumKeys+self.punctuationKeys): finalKey='<'+self.TranslateKey(finalKey) *************** *** 164,168 **** keyStr=string.join(keyList,'-') self.keyString.set(keyStr) ! def GetModifiers(self): modList = [variable.get() for variable in self.modifier_vars] --- 164,168 ---- keyStr=string.join(keyList,'-') self.keyString.set(keyStr) ! def GetModifiers(self): modList = [variable.get() for variable in self.modifier_vars] *************** *** 175,179 **** variable.set('') self.keyString.set('') ! def LoadFinalKeyList(self): #these tuples are also available for use in validity checks --- 175,179 ---- variable.set('') self.keyString.set('') ! def LoadFinalKeyList(self): #these tuples are also available for use in validity checks *************** *** 191,195 **** apply(self.listKeysFinal.insert, (END,)+keys) ! def TranslateKey(self,key): #translate from key list value to tkinter key-id --- 191,195 ---- apply(self.listKeysFinal.insert, (END,)+keys) ! def TranslateKey(self,key): #translate from key list value to tkinter key-id *************** *** 207,220 **** key='Key-'+key return key ! def Ok(self, event=None): if self.KeysOk(): self.result=self.keyString.get() self.destroy() ! def Cancel(self, event=None): self.result='' self.destroy() ! def KeysOk(self): #simple validity check --- 207,220 ---- key='Key-'+key return key ! def Ok(self, event=None): if self.KeysOk(): self.result=self.keyString.get() self.destroy() ! def Cancel(self, event=None): self.result='' self.destroy() ! def KeysOk(self): #simple validity check *************** *** 233,237 **** message='No final key specified.') keysOk=0 ! elif (not modifiers) and (finalKey in self.alphanumKeys+self.punctuationKeys): #modifier required --- 233,237 ---- message='No final key specified.') keysOk=0 ! elif (not modifiers) and (finalKey in self.alphanumKeys+self.punctuationKeys): #modifier required *************** *** 239,243 **** message='No modifier key(s) specified.') keysOk=0 ! elif (modifiers==['Shift']) and (finalKey not in self.functionKeys+('Tab',)): #shift alone is only a useful modifier with a function key --- 239,243 ---- message='No modifier key(s) specified.') keysOk=0 ! elif (modifiers==['Shift']) and (finalKey not in self.functionKeys+('Tab',)): #shift alone is only a useful modifier with a function key *************** *** 251,255 **** keysOk=0 return keysOk ! if __name__ == '__main__': #test the dialog --- 251,255 ---- keysOk=0 return keysOk ! if __name__ == '__main__': #test the dialog Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** macosx_main.py 24 Dec 2002 17:22:53 -0000 1.5 --- macosx_main.py 31 Dec 2002 16:03:23 -0000 1.6 *************** *** 4,9 **** Installation: see the install_IDLE target in python/dist/src/Mac/OSX/Makefile ! ! Usage: 1. Double clicking IDLE icon will open IDLE. --- 4,9 ---- Installation: see the install_IDLE target in python/dist/src/Mac/OSX/Makefile ! ! Usage: 1. Double clicking IDLE icon will open IDLE. *************** *** 27,31 **** idlelib = join(split(__file__)[0], 'idlelib') if isdir(idlelib): ! sys.path.append(idlelib) # see if we are being asked to execute the subprocess code --- 27,31 ---- idlelib = join(split(__file__)[0], 'idlelib') if isdir(idlelib): ! sys.path.append(idlelib) # see if we are being asked to execute the subprocess code Index: rpc.py =================================================================== RCS file: /cvsroot/idlefork/idle/rpc.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** rpc.py 23 Dec 2002 22:51:03 -0000 1.11 --- rpc.py 31 Dec 2002 16:03:23 -0000 1.12 *************** *** 57,61 **** # assert isinstance(fn, type.FunctionType) # return `fn` ! copy_reg.pickle(types.CodeType, pickle_code, unpickle_code) # copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function) --- 57,61 ---- # assert isinstance(fn, type.FunctionType) # return `fn` ! copy_reg.pickle(types.CodeType, pickle_code, unpickle_code) # copy_reg.pickle(types.FunctionType, pickle_function, unpickle_function) *************** *** 76,80 **** def server_activate(self): """Override TCPServer method, connect() instead of listen() ! Due to the reversed connection, self.server_address is actually the address of the Idle Client to which we are connecting. --- 76,80 ---- def server_activate(self): """Override TCPServer method, connect() instead of listen() ! Due to the reversed connection, self.server_address is actually the address of the Idle Client to which we are connecting. *************** *** 82,86 **** """ self.socket.connect(self.server_address) ! def get_request(self): "Override TCPServer method, return already connected socket" --- 82,86 ---- """ self.socket.connect(self.server_address) ! def get_request(self): "Override TCPServer method, return already connected socket" *************** *** 127,131 **** def localcall(self, request): ! self.debug("localcall:", request) try: how, (oid, methodname, args, kwargs) = request --- 127,131 ---- def localcall(self, request): ! self.debug("localcall:", request) try: how, (oid, methodname, args, kwargs) = request *************** *** 175,179 **** def remotecall(self, oid, methodname, args, kwargs): ! self.debug("remotecall:") seq = self.asynccall(oid, methodname, args, kwargs) return self.asyncreturn(seq) --- 175,179 ---- def remotecall(self, oid, methodname, args, kwargs): ! self.debug("remotecall:") seq = self.asynccall(oid, methodname, args, kwargs) return self.asyncreturn(seq) *************** *** 216,220 **** raise name, args if how == "ERROR": ! self.debug("decoderesponse: Internal ERROR:", what) raise RuntimeError, what raise SystemError, (how, what) --- 216,220 ---- raise name, args if how == "ERROR": ! self.debug("decoderesponse: Internal ERROR:", what) raise RuntimeError, what raise SystemError, (how, what) *************** *** 360,364 **** self.statelock.release() continue ! #----------------- end class SocketIO -------------------- --- 360,364 ---- self.statelock.release() continue ! #----------------- end class SocketIO -------------------- *************** *** 466,470 **** attr = getattr(obj, name) if not callable(attr): ! attributes[name] = 1 class MethodProxy: --- 466,470 ---- attr = getattr(obj, name) if not callable(attr): ! attributes[name] = 1 class MethodProxy: *************** *** 487,491 **** class RemotePerson: def __init__(self,name): ! self.name = name def greet(self, name): print "(someone called greet)" --- 487,491 ---- class RemotePerson: def __init__(self,name): ! self.name = name def greet(self, name): print "(someone called greet)" *************** *** 494,498 **** def getName(self): print "(someone called getName)" ! print return self.name def greet_this_guy(self, name): --- 494,498 ---- def getName(self): print "(someone called getName)" ! print return self.name def greet_this_guy(self, name): *************** *** 503,507 **** print "Done." print ! person = RemotePerson("Thomas Edison") svr = RPCServer(addr) --- 503,507 ---- print "Done." print ! person = RemotePerson("Thomas Edison") svr = RPCServer(addr) *************** *** 527,536 **** #clt.remotecall("thomas","greet",("Alexander Bell",), {}) print "Done." ! print time.sleep(2) # demonstrates remote server calling local instance class LocalPerson: def __init__(self,name): ! self.name = name def greet(self, name): print "You've greeted me!" --- 527,536 ---- #clt.remotecall("thomas","greet",("Alexander Bell",), {}) print "Done." ! print time.sleep(2) # demonstrates remote server calling local instance class LocalPerson: def __init__(self,name): ! self.name = name def greet(self, name): print "You've greeted me!" *************** *** 552,555 **** if __name__ == '__main__': test() - - --- 552,553 ---- Index: tabpage.py =================================================================== RCS file: /cvsroot/idlefork/idle/tabpage.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** tabpage.py 30 Nov 2002 19:10:19 -0000 1.4 --- tabpage.py 31 Dec 2002 16:03:23 -0000 1.5 *************** *** 11,15 **** """ a 'page tab' like framed button ! """ def __init__(self,parent): Frame.__init__(self, parent,borderwidth=2,relief=RIDGE) --- 11,15 ---- """ a 'page tab' like framed button ! """ def __init__(self,parent): Frame.__init__(self, parent,borderwidth=2,relief=RIDGE) *************** *** 18,31 **** borderwidth=0,selectcolor=self.cget('bg')) self.button.pack() ! class TabPageSet(Frame): """ a set of 'pages' with TabButtons for controlling their display ! """ def __init__(self,parent,pageNames=[],**kw): """ pageNames - a list of strings, each string will be the dictionary key ! to a page's data, and the name displayed on the page's tab. Should be ! specified in desired page order. The first page will be the default and first active page. """ --- 18,31 ---- borderwidth=0,selectcolor=self.cget('bg')) self.button.pack() ! class TabPageSet(Frame): """ a set of 'pages' with TabButtons for controlling their display ! """ def __init__(self,parent,pageNames=[],**kw): """ pageNames - a list of strings, each string will be the dictionary key ! to a page's data, and the name displayed on the page's tab. Should be ! specified in desired page order. The first page will be the default and first active page. """ *************** *** 49,58 **** raise InvalidTabPage, 'Invalid TabPage Name' ## pop up the active 'tab' only ! for page in self.pages.keys(): self.pages[page]['tab'].config(relief=RIDGE) self.pages[self.GetActivePage()]['tab'].config(relief=RAISED) ## switch page self.pages[self.GetActivePage()]['page'].lift() ! def GetActivePage(self): return self.activePage.get() --- 49,58 ---- raise InvalidTabPage, 'Invalid TabPage Name' ## pop up the active 'tab' only ! for page in self.pages.keys(): self.pages[page]['tab'].config(relief=RIDGE) self.pages[self.GetActivePage()]['tab'].config(relief=RAISED) ## switch page self.pages[self.GetActivePage()]['page'].lift() ! def GetActivePage(self): return self.activePage.get() *************** *** 68,72 **** self.pages[pageName]['tab'].pack(side=LEFT) self.pages[pageName]['page'].grid(row=1,column=0,sticky=NSEW) ! if len(self.pages)==1: # adding first page self.defaultPage=pageName self.activePage.set(self.defaultPage) --- 68,72 ---- self.pages[pageName]['tab'].pack(side=LEFT) self.pages[pageName]['page'].grid(row=1,column=0,sticky=NSEW) ! if len(self.pages)==1: # adding first page self.defaultPage=pageName self.activePage.set(self.defaultPage) *************** *** 84,92 **** if not self.pages: # removed last remaining page self.defaultPage='' ! return if pageName==self.defaultPage: # set a new default page self.defaultPage=\ self.tabBar.winfo_children()[0].button.cget('text') ! if pageName==self.GetActivePage(): # set a new active page self.activePage.set(self.defaultPage) self.ChangePage() --- 84,92 ---- if not self.pages: # removed last remaining page self.defaultPage='' ! return if pageName==self.defaultPage: # set a new default page self.defaultPage=\ self.tabBar.winfo_children()[0].button.cget('text') ! if pageName==self.GetActivePage(): # set a new active page self.activePage.set(self.defaultPage) self.ChangePage() *************** *** 112,114 **** tabPage.ChangePage() root.mainloop() - --- 112,113 ---- Index: textView.py =================================================================== RCS file: /cvsroot/idlefork/idle/textView.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** textView.py 31 Jul 2001 10:46:53 -0000 1.2 --- textView.py 31 Dec 2002 16:03:23 -0000 1.3 *************** *** 1,7 **** ##---------------------------------------------------------------------------## ## ! ## idle - simple text view dialog ## elguavas ! ## ##---------------------------------------------------------------------------## """ --- 1,7 ---- ##---------------------------------------------------------------------------## ## ! ## idle - simple text view dialog ## elguavas ! ## ##---------------------------------------------------------------------------## """ *************** *** 14,18 **** """ simple text viewer dialog for idle ! """ def __init__(self,parent,title,fileName): """ --- 14,18 ---- """ simple text viewer dialog for idle ! """ def __init__(self,parent,title,fileName): """ *************** *** 40,44 **** self.textView.config(state=DISABLED) self.wait_window() ! def LoadTextFile(self, fileName): textFile = None --- 40,44 ---- self.textView.config(state=DISABLED) self.wait_window() ! def LoadTextFile(self, fileName): textFile = None *************** *** 50,54 **** else: self.textView.insert(0.0,textFile.read()) ! def CreateWidgets(self): frameText = Frame(self) --- 50,54 ---- else: self.textView.insert(0.0,textFile.read()) ! def CreateWidgets(self): frameText = Frame(self) *************** *** 66,70 **** frameButtons.pack(side=BOTTOM,fill=X) frameText.pack(side=TOP,expand=TRUE,fill=BOTH) ! def Ok(self, event=None): self.destroy() --- 66,70 ---- frameButtons.pack(side=BOTTOM,fill=X) frameText.pack(side=TOP,expand=TRUE,fill=BOTH) ! def Ok(self, event=None): self.destroy() From tonylownds@users.sourceforge.net Tue Dec 31 16:52:47 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Tue, 31 Dec 2002 08:52:47 -0800 Subject: [Idle-dev] CVS: idle macosx_main.py,1.6,1.7 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv9873 Modified Files: macosx_main.py Log Message: Keep __main__ namespace clean Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** macosx_main.py 31 Dec 2002 16:03:23 -0000 1.6 --- macosx_main.py 31 Dec 2002 16:52:44 -0000 1.7 *************** *** 36,40 **** # this module will become the namespace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, split, join, isdir __import__('run').main() else: --- 36,40 ---- # this module will become the namespace used by the interactive # interpreter; remove all variables we have defined. ! del sys, __file__, split, join, isdir, idlelib __import__('run').main() else: From noreply@sourceforge.net Tue Dec 31 17:52:39 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 31 Dec 2002 09:52:39 -0800 Subject: [Idle-dev] [ idlefork-Bugs-629986 ] Doesn't work with pythonw.exe Message-ID: Bugs item #629986, was opened at 2002-10-28 12:31 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629986&group_id=9579 Category: None Group: None >Status: Closed Resolution: Accepted Priority: 5 Submitted By: Guido van Rossum (gvanrossum) >Assigned to: Kurt B. Kaiser (kbk) Summary: Doesn't work with pythonw.exe Initial Comment: When I try to start IDLE using Pythonw.exe, IDLE doesn't seem to start; no window ever pops up. I think it's because of the debug messages written to the real stdout or stderr, but it could be deeper. (I only tested this on Win98.) ---------------------------------------------------------------------- >Comment By: Kurt B. Kaiser (kbk) Date: 2002-12-31 12:52 Message: Logged In: YES user_id=149084 May have been related to path issues with subprocess. Works OK now. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629986&group_id=9579 From kbk@users.sourceforge.net Tue Dec 31 17:56:21 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 31 Dec 2002 09:56:21 -0800 Subject: [Idle-dev] CVS: idle INSTALL.txt,1.2,1.3 README.txt,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv21161 Modified Files: INSTALL.txt README.txt Log Message: Update for Alpha 0 Release Index: INSTALL.txt =================================================================== RCS file: /cvsroot/idlefork/idle/INSTALL.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** INSTALL.txt 12 Sep 2002 20:55:43 -0000 1.2 --- INSTALL.txt 31 Dec 2002 17:56:18 -0000 1.3 *************** *** 1,58 **** ! IDLEfork INSTALL notes ! ====================== ! The emphasis in IDLEfork is now for the project to be able to be run ! directly from the unpacked source directory. This is to enable easy testing ! of (and hacking on) IDLEfork, and will also prevent interfering with the ! stable Python IDLE set up in any way. ! To install IDLEfork just unpack the archive into its own directory wherever ! you like. To run IDLEfork just go to the directory you unpacked IDLEfork ! into and then run 'python idle.py' in an xterm under unix/linux, or ! 'idle.pyw' under windows 98/2000. Remember that IDLEfork 0.8.1 and greater ! require python 2.1 or greater. ! See README.txt and NEWS.txt for more details on this version of IDLEfork. - INSTALLATION notes from IDLE fork 0.7.1 : - ========================================= - IDLE Fork Installation on Linux: - Until the tarball is released, you must download a CVS copy. An excellent - place for it is - /usr/local/src/PythonX.X/Tools/idlefork, assuming that's where your Python - source is located. Put the correct version in for X.X . - # cd /usr/local/src/PythonX.X/Tools - Now do the CVS login and checkout: - - # cvs -d:pserver:anonymous@cvs.idlefork.sourceforge.net:/cvsroot/idlefork login - - Type an for the password. - - # cvs -z3 -d:pserver:anonymous@cvs.idlefork.sourceforge.net:/cvsroot/idlefork \ - -d idlefork checkout idle - - The -d option to checkout puts the files in an idlefork directory, so you don't - step on "official" idle. - - # cd idlefork - # su to root - - # python setup.py install - - # echo idlelib >> /usr/local/lib/pythonX.X/site-packages/site-packages.pth - - This last is necessary so idle can find itself. I hope we can create/append - this file via setup.py at some point, but it needs to be done manually now, and - it only needs to be done once (unless you totally remove and reinstall python - itself). (Replace X.X with the correct version for your Python.) - - # exit from root - - NOTE that the above procedure will install idlefork IDLE on top of any - "official" IDLE that may be already installed. --- 1,39 ---- ! IDLEfork Installation Notes ! =========================== ! IDLEfork requires Python Version 2.2 or later. ! There are several distribution files (where xx is the subversion): ! IDLEfork-0.9xx.win32.exe ! This is a Windows installer which will install IDLEfork in ! ..../site-packages/idleforklib/ and place the idefork startup script ! at ..../scripts/idlefork. Rename this to idlefork.pyw and ! point your launcher icons at it. Installation is as idlefork ! to avoid conflict with the original Python IDLE. ! ! IDLEfork-0.9xx-1.noarch.rpm ! This is an rpm which is designed to install as idleforklib in the ! /usr/lib/python2.2 tree created by the Python2 rpm. It requires ! python2 and python2-tkinter rpms. It installs as idlefork to avoid ! conflict with Python IDLE. ! ! IDLEfork-0.9xx.tar.gz ! This is a distutils sdist (source) tarfile which can be used to make ! installations on platforms not supported by the above files. ! It is configured to install as IDLE, not IDLEfork. ! ! Unpack in ..../Tools/, cd to the IDLEfork directory created, and ! to install as IDLE. If you don't want to ! step on Python IDLE, it is also possible to simply run ! to test in the IDLEfork source directory without installation. In this ! case, IDLEfork will not be on your PATH unless you are in the source ! directory. + See README.txt for more details on this version of IDLEfork. Index: README.txt =================================================================== RCS file: /cvsroot/idlefork/idle/README.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** README.txt 20 Jul 2001 01:35:47 -0000 1.4 --- README.txt 31 Dec 2002 17:56:18 -0000 1.5 *************** *** 3,158 **** IDLEfork is an official experimental fork of Python's Integrated ! DeveLopment Environment IDLE. Worthwhile and successful changes and ! additions will go back into the Python distribution's IDLE at some ! later stage. There is no spanish inquisition. ! As David Scherer aptly put it in the original IDLE fork README (below), ! "It is alpha software and might be unstable. If it breaks, you get to ! keep both pieces." One of the aims of IDLEfork now is for it to be able ! to be uncompressed into its own directory and run from there, that way ! you can play with (or hack on) IDLEfork without any further installation, ! and entirely separately from your stable python IDLE distribution. ! ! If you find bugs or undesired behaviour please code nifty patches and ! submit them to the IDLEfork SourceForge patch manager, 8^) or let us ! know about it in one of the appropriate fora. See the IDLEfork home ! page at ! ! http://idlefork.sourceforge.net ! ! for details on the various ways to give input to or contact the project. ! ! Please see the files NEWS.txt and ChangeLog for more up to date ! information on changes in this release of IDLEfork. ! ! ! Thanks for trying IDLEfork, ! Stephen M. Gava. ! ! ! ! ! README from IDLE fork 0.7.1 : ! ============================= ! ! EXPERIMENTAL LOADER IDLE 2000-05-29 ! ----------------------------------- ! ! David Scherer ! ! This is a modification of the CVS version of IDLE 0.5, updated as of ! 2000-03-09. It is alpha software and might be unstable. If it breaks, ! you get to keep both pieces. ! ! If you have problems or suggestions, you should either contact me or ! post to the list at http://www.python.org/mailman/listinfo/idle-dev ! (making it clear that you are using this modified version of IDLE). ! ! Changes: ! The ExecBinding module, a replacement for ScriptBinding, executes ! programs in a separate process, piping standard I/O through an RPC ! mechanism to an OnDemandOutputWindow in IDLE. It supports executing ! unnamed programs (through a temporary file). It does not yet support ! debugging. ! When running programs with ExecBinding, tracebacks will be clipped ! to exclude system modules. If, however, a system module calls back ! into the user program, that part of the traceback will be shown. ! ! The OnDemandOutputWindow class has been improved. In particular, ! it now supports a readline() function used to implement user input, ! and a scroll_clear() operation which is used to hide the output of ! a previous run by scrolling it out of the window. ! ! Startup behavior has been changed. By default IDLE starts up with ! just a blank editor window, rather than an interactive window. Opening ! a file in such a blank window replaces the (nonexistent) contents of ! that window instead of creating another window. Because of the need to ! have a well-known port for the ExecBinding protocol, only one copy of ! IDLE can be running. Additional invocations use the RPC mechanism to ! report their command line arguments to the copy already running. ! ! The menus have been reorganized. In particular, the excessively large ! 'edit' menu has been split up into 'edit', 'format', and 'run'. ! ! 'Python Documentation' now works on Windows, if the win32api module is ! present. ! ! A few key bindings have been changed: F1 now loads Python Documentation ! instead of the IDLE help; shift-TAB is now a synonym for unindent. ! ! New modules: ! ExecBinding.py Executes program through loader ! loader.py Bootstraps user program ! protocol.py RPC protocol ! Remote.py User-process interpreter ! spawn.py OS-specific code to start programs ! ! Files modified: ! autoindent.py ( bindings tweaked ) ! bindings.py ( menus reorganized ) ! config.txt ( execbinding enabled ) ! editorwindow.py ( new menus, fixed 'Python Documentation' ) ! filelist.py ( hook for "open in same window" ) ! formatparagraph.py ( bindings tweaked ) ! idle.bat ( removed absolute pathname ) ! idle.pyw ( weird bug due to import with same name? ) ! iobinding.py ( open in same window, EOL convention ) ! keydefs.py ( bindings tweaked ) ! outputwindow.py ( readline, scroll_clear, etc ) ! pyshell.py ( changed startup behavior ) ! readme.txt ( ) ! ! IDLE 0.5 - February 2000 ! ------------------------ ! ! This is an early release of IDLE, my own attempt at a Tkinter-based ! IDE for Python. ! ! For news about this release, see the file NEWS.txt. (For a more ! detailed change log, see the file ChangeLog.) ! ! FEATURES ! ! IDLE has the following features: ! ! - coded in 100% pure Python, using the Tkinter GUI toolkit (i.e. Tcl/Tk) ! - cross-platform: works on Windows and Unix (on the Mac, there are ! currently problems with Tcl/Tk) ! - multi-window text editor with multiple undo, Python colorizing ! and many other features, e.g. smart indent and call tips ! - Python shell window (a.k.a. interactive interpreter) ! - debugger (not complete, but you can set breakpoints, view and step) ! USAGE - The main program is in the file "idle.py"; on Unix, you should be able - to run it by typing "./idle.py" to your shell. On Windows, you can - run it by double-clicking it; you can use idle.pyw to avoid popping up - a DOS console. If you want to pass command line arguments on Windows, - use the batch file idle.bat. ! Command line arguments: files passed on the command line are executed, ! not opened for editing, unless you give the -e command line option. ! Try "./idle.py -h" to see other command line options. ! IDLE requires Python 1.5.2, so it is currently only usable with a ! Python 1.5.2 distribution. (An older version of IDLE is distributed ! with Python 1.5.2; you can drop this version on top of it.) ! COPYRIGHT ! IDLE is covered by the standard Python copyright notice ! (http://www.python.org/doc/Copyright.html). ! FEEDBACK ! (removed, since Guido probably doesn't want complaints about my ! changes) ! --Guido van Rossum (home page: http://www.python.org/~guido/) --- 3,56 ---- IDLEfork is an official experimental fork of Python's Integrated ! DeveLopment Environment IDLE. The biggest change is to execute ! Python code in a separate process, which is /restarted/ for each ! Run (F5) initiated from an editor window. This enhancement of ! IDLE has often been requested, and is now finally available, ! complete with debugger. ! There is also a new GUI configuration manager which makes it easy ! to select fonts, colors, and startup options. ! IDLEfork will be merged back into the Python distribution in the ! near future (probably 2.3), replacing the current version of IDLE. ! As David Scherer aptly put it in the original IDLEfork README, ! "It is alpha software and might be unstable. If it breaks, you get to ! keep both pieces." ! If you find bugs let us know about them by using the IDLEfork Bug ! Tracker. See the IDLEfork home page at ! http://idlefork.sourceforge.net ! for details. Patches are always appreciated at the IDLEfork Patch ! Tracker. ! Please see the files NEWS.txt and ChangeLog for more up to date ! information on changes in this release of IDLEfork. ! Thanks for trying IDLEfork. ! IDLEfork 0.9 Alpha 0 ! -------------------------------- ! Introduced the new RPC implementation, which includes a debugger. The ! output of user code is to the shell, and the shell may be used to ! inspect the environment after the run has finished. (In version 0.8.1 ! the shell environment was separate from the environment of the user ! code.) ! Introduced the configuration GUI and a new About dialog. ! Adapted to the Mac platform. ! Multiple bug fixes and usability enhancements. ! Known issues: ! - Can't kill a tight loop in the Windows version: Use the Task Manager! ! - Printing under Linux may be problematic. ! - The debugger is pretty slow. ! - RPC stack levels are not being pruned from debugger tracebacks. ! - Changelog and NEWS.txt are incomplete. From kbk@users.sourceforge.net Tue Dec 31 17:57:48 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 31 Dec 2002 09:57:48 -0800 Subject: [Idle-dev] CVS: idle HISTORY.txt,NONE,1.1 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv22164 Added Files: HISTORY.txt Log Message: Move history to HISTORY.txt --- NEW FILE: HISTORY.txt --- IDLE History ============ This file contains the release messages for previous IDLE releases. As you read on you go back to the dark ages of IDLE's history. IDLE fork 0.7.1 - 29 May 2000 ----------------------------- David Scherer This is a modification of the CVS version of IDLE 0.5, updated as of 2000-03-09. It is alpha software and might be unstable. If it breaks, you get to keep both pieces. If you have problems or suggestions, you should either contact me or post to the list at http://www.python.org/mailman/listinfo/idle-dev (making it clear that you are using this modified version of IDLE). Changes: The ExecBinding module, a replacement for ScriptBinding, executes programs in a separate process, piping standard I/O through an RPC mechanism to an OnDemandOutputWindow in IDLE. It supports executing unnamed programs (through a temporary file). It does not yet support debugging. When running programs with ExecBinding, tracebacks will be clipped to exclude system modules. If, however, a system module calls back into the user program, that part of the traceback will be shown. The OnDemandOutputWindow class has been improved. In particular, it now supports a readline() function used to implement user input, and a scroll_clear() operation which is used to hide the output of a previous run by scrolling it out of the window. Startup behavior has been changed. By default IDLE starts up with just a blank editor window, rather than an interactive window. Opening a file in such a blank window replaces the (nonexistent) contents of that window instead of creating another window. Because of the need to have a well-known port for the ExecBinding protocol, only one copy of IDLE can be running. Additional invocations use the RPC mechanism to report their command line arguments to the copy already running. The menus have been reorganized. In particular, the excessively large 'edit' menu has been split up into 'edit', 'format', and 'run'. 'Python Documentation' now works on Windows, if the win32api module is present. A few key bindings have been changed: F1 now loads Python Documentation instead of the IDLE help; shift-TAB is now a synonym for unindent. New modules: ExecBinding.py Executes program through loader loader.py Bootstraps user program protocol.py RPC protocol Remote.py User-process interpreter spawn.py OS-specific code to start programs Files modified: autoindent.py ( bindings tweaked ) bindings.py ( menus reorganized ) config.txt ( execbinding enabled ) editorwindow.py ( new menus, fixed 'Python Documentation' ) filelist.py ( hook for "open in same window" ) formatparagraph.py ( bindings tweaked ) idle.bat ( removed absolute pathname ) idle.pyw ( weird bug due to import with same name? ) iobinding.py ( open in same window, EOL convention ) keydefs.py ( bindings tweaked ) outputwindow.py ( readline, scroll_clear, etc ) pyshell.py ( changed startup behavior ) readme.txt ( ) IDLE 0.5 - February 2000 ------------------------ This is an early release of IDLE, my own attempt at a Tkinter-based IDE for Python. For news about this release, see the file NEWS.txt. (For a more detailed change log, see the file ChangeLog.) FEATURES IDLE has the following features: - coded in 100% pure Python, using the Tkinter GUI toolkit (i.e. Tcl/Tk) - cross-platform: works on Windows and Unix (on the Mac, there are currently problems with Tcl/Tk) - multi-window text editor with multiple undo, Python colorizing and many other features, e.g. smart indent and call tips - Python shell window (a.k.a. interactive interpreter) - debugger (not complete, but you can set breakpoints, view and step) USAGE The main program is in the file "idle.py"; on Unix, you should be able to run it by typing "./idle.py" to your shell. On Windows, you can run it by double-clicking it; you can use idle.pyw to avoid popping up a DOS console. If you want to pass command line arguments on Windows, use the batch file idle.bat. Command line arguments: files passed on the command line are executed, not opened for editing, unless you give the -e command line option. Try "./idle.py -h" to see other command line options. IDLE requires Python 1.5.2, so it is currently only usable with a Python 1.5.2 distribution. (An older version of IDLE is distributed with Python 1.5.2; you can drop this version on top of it.) COPYRIGHT IDLE is covered by the standard Python copyright notice (http://www.python.org/doc/Copyright.html). From kbk@users.sourceforge.net Tue Dec 31 18:12:07 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 31 Dec 2002 10:12:07 -0800 Subject: [Idle-dev] CVS: idle NEWS.txt,1.5,1.6 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv32234 Modified Files: NEWS.txt Log Message: Update (slightly) for Alpha release Index: NEWS.txt =================================================================== RCS file: /cvsroot/idlefork/idle/NEWS.txt,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** NEWS.txt 21 Jul 2001 09:50:55 -0000 1.5 --- NEWS.txt 31 Dec 2002 18:12:04 -0000 1.6 *************** *** 4,7 **** --- 4,14 ---- --------------------------------------------------------- + IDLEfork 0.9 Alpha 0 (31 DEC 2002) + ---------------------------------- + + First Alpha release with GvR RPC and Configuration GUI. + + This file will be updated at next Alpha release. Meanwhile, see README.txt. + IDLEfork 0.8.1 (22 JUL 2001) From tonylownds@users.sourceforge.net Tue Dec 31 18:22:40 2002 From: tonylownds@users.sourceforge.net (Tony Lownds) Date: Tue, 31 Dec 2002 10:22:40 -0800 Subject: [Idle-dev] CVS: idle macosx_main.py,1.7,1.8 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv6225 Modified Files: macosx_main.py Log Message: Don't let the docstring end up in __main__.__doc__ Index: macosx_main.py =================================================================== RCS file: /cvsroot/idlefork/idle/macosx_main.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** macosx_main.py 31 Dec 2002 16:52:44 -0000 1.7 --- macosx_main.py 31 Dec 2002 18:22:37 -0000 1.8 *************** *** 1,17 **** #!/usr/bin/env pythonw ! """IDLE.app ! ! Installation: ! see the install_IDLE target in python/dist/src/Mac/OSX/Makefile ! ! Usage: ! ! 1. Double clicking IDLE icon will open IDLE. ! 2. Dropping file on IDLE icon will open that file in IDLE. ! 3. Launch from command line with files with this command-line: ! ! /Applications/Python/IDLE.app/Contents/MacOS/python file1 file2 file3 ! ! """ # Add IDLE.app/Contents/Resources/idlelib to path. --- 1,17 ---- #!/usr/bin/env pythonw ! # IDLE.app ! # ! # Installation: ! # see the install_IDLE target in python/dist/src/Mac/OSX/Makefile ! # ! # Usage: ! # ! # 1. Double clicking IDLE icon will open IDLE. ! # 2. Dropping file on IDLE icon will open that file in IDLE. ! # 3. Launch from command line with files with this command-line: ! # ! # /Applications/Python/IDLE.app/Contents/MacOS/python file1 file2 file3 ! # ! # # Add IDLE.app/Contents/Resources/idlelib to path. From kbk@shore.net Tue Dec 31 18:43:51 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 31 Dec 2002 13:43:51 -0500 Subject: [Idle-dev] Tagged Alpha 0 Release in CVS Message-ID: I just tagged the Alpha 0 Release as r09a0 -- KBK From noreply@sourceforge.net Tue Dec 31 19:12:49 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 31 Dec 2002 11:12:49 -0800 Subject: [Idle-dev] [ idlefork-Bugs-629986 ] Doesn't work with pythonw.exe Message-ID: Bugs item #629986, was opened at 2002-10-28 12:31 You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629986&group_id=9579 Category: None Group: None Status: Closed Resolution: Accepted Priority: 5 Submitted By: Guido van Rossum (gvanrossum) Assigned to: Kurt B. Kaiser (kbk) Summary: Doesn't work with pythonw.exe Initial Comment: When I try to start IDLE using Pythonw.exe, IDLE doesn't seem to start; no window ever pops up. I think it's because of the debug messages written to the real stdout or stderr, but it could be deeper. (I only tested this on Win98.) ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2002-12-31 14:12 Message: Logged In: YES user_id=6380 Thanks, this now works fine! ---------------------------------------------------------------------- Comment By: Kurt B. Kaiser (kbk) Date: 2002-12-31 12:52 Message: Logged In: YES user_id=149084 May have been related to path issues with subprocess. Works OK now. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=109579&aid=629986&group_id=9579 From kbk@users.sourceforge.net Tue Dec 31 23:18:03 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 31 Dec 2002 15:18:03 -0800 Subject: [Idle-dev] CVS: idle idle,1.7,1.8 idle.py,1.5,1.6 idle.pyw,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/idle In directory sc8-pr-cvs1:/tmp/cvs-serv1669 Modified Files: idle idle.py idle.pyw Log Message: Improve exception handling. Index: idle =================================================================== RCS file: /cvsroot/idlefork/idle/idle,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** idle 24 Dec 2002 06:36:19 -0000 1.7 --- idle 31 Dec 2002 23:18:00 -0000 1.8 *************** *** 1,8 **** ! #! /usr/bin/env python try: import idlelib.PyShell idlelib.PyShell.main() ! except: # IDLE is not installed, but maybe PyShell is on sys.path: import PyShell --- 1,8 ---- ! #!/usr/bin/python try: import idlelib.PyShell idlelib.PyShell.main() ! except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: import PyShell Index: idle.py =================================================================== RCS file: /cvsroot/idlefork/idle/idle.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** idle.py 24 Dec 2002 06:36:19 -0000 1.5 --- idle.py 31 Dec 2002 23:18:00 -0000 1.6 *************** *** 1,8 **** ! #! /usr/bin/env python try: import idlelib.PyShell idlelib.PyShell.main() ! except: # IDLE is not installed, but maybe PyShell is on sys.path: import PyShell --- 1,8 ---- ! #!/usr/bin/python try: import idlelib.PyShell idlelib.PyShell.main() ! except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: import PyShell Index: idle.pyw =================================================================== RCS file: /cvsroot/idlefork/idle/idle.pyw,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** idle.pyw 24 Dec 2002 06:36:19 -0000 1.4 --- idle.pyw 31 Dec 2002 23:18:00 -0000 1.5 *************** *** 1,8 **** ! #! /usr/bin/env python try: import idlelib.PyShell idlelib.PyShell.main() ! except: # IDLE is not installed, but maybe PyShell is on sys.path: import PyShell --- 1,8 ---- ! #!/usr/bin/python try: import idlelib.PyShell idlelib.PyShell.main() ! except ImportError: # IDLE is not installed, but maybe PyShell is on sys.path: import PyShell