From elguavas@users.sourceforge.net Wed Jun 5 01:22:50 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 05 Jun 2002 10:22:50 +1000 Subject: [Idle-dev] idlefork update Message-ID: <1023236570.510.38.camel@oberon> Hi all, as readers of the list may have noticed we now have a few active developers on idlefork (hooray!) so I thought I'd post here to let those interested know what's happening now on the project. Basically, there are five main areas that need to be fully sorted out before we can release the next stable idlefork version (of course we plan to make some testing releases before that though). I'll briefly detail these areas below. The new RPC/SPE system ====================== Current state of implementation: about 55% The Separate Process Execution code in idlefork is being moved into a more general model that supports more required important features (like debugging). Chui Tey has already checked a first cut of the new code (based on an implementation by GvR) into cvs and we are currently considering whether to leave the old code on a branch and move forward with the new code on the trunk or something similar. As this is a fundamental area of the code which must be got right Kurt B. Kaiser and Chui Tey are going to work on this in tandem to get it sorted out, with Kurt initially working on stabilising and reversing the role of the client and server and Chui helping out as his time permits. Expect brokenness in cvs on the branch this code is being worked on in (most likely the trunk, we'll let you know). The new configuration system ============================ Current state of implementation: about 85% I have about 5% implementation left to do on this (like moving the autoindent code into idlefork core as discussed with GvR, and a few other things), and then the 10% of 'finishing off', like stabilising, debugging, tweaking etc., that always takes the most time. The program startup mess ========================= Current state of implementation: 0% In the course of idlefork's development program startup code (initialisation, commandline arg handling, user notification of said, etc. ) has ended up spread through several modules, with some redundancy and other 'uncleanness' resulting. Raymond Hettinger has volunteered to work on cleaning this up and fixing it as his first task. The run results/shell system ============================ Current state of implementation: 0% The current code implements a system whereby results printed by code run from the ide are printed in a separate 'output window' which is delimited on each run. This could be better handled by integrating the output window code with the python shell window, to improve functionality and remove redundancy, so that results for run programs be output to a real python shell window to allow interactive inspection of results etc.. The results will have to be delimited in some way and different outputs for code run from different editor windows handled. Raymond has indicated that he is happy to have this as the third item on his list if no-one else gets a chance to move onto this before then. The documentation/help situation ================================ Current state of implementation: 0% This mainly comprises writing a new section of the standard python documentation that covers idle(fork) and making that into the idlefork help. (A simple version of this, for idle, has already made it into the python docs now.) Another string to this bow is the possibility of implementing context help lookup of python language elements from the idlefork editor directly to the relevant section of the python help files. This latter is a considerably more ambitious undertaking that will likely best left as a future improvement. The current help text is completely out of date and useless and changing to presenting a python doc style html help document will also make how help is browsed a no brainer. This is something that has to be addressed before we reach a real end user releasable state. Raymond has claimed this as the number two item on his task list. Ok, that's the sate of play. I'll update the 'Current Tasks' page on the website when I get a chance. Now that there is more than one active developer on the project we will be moving more of our discussion of coding issues on to idle-dev so that it can be archived. Regards, Stephen. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From elguavas@users.sourceforge.net Wed Jun 5 01:43:23 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 05 Jun 2002 10:43:23 +1000 Subject: [Idle-dev] Re: idlefork - update, current tasks In-Reply-To: References: <1021961645.3543.9.camel@oberon> <200205211721.g4LHLZ019747@odiug.zope.com> <1022024623.497.17.camel@oberon> <1022200924.3040.34.camel@oberon> <002801c208bd$9b756b40$d061accf@othello> <1022995454.510.262.camel@oberon> Message-ID: <1023237804.510.57.camel@oberon> Kurt B. Kaiser wrote: [... on the new rpc/spe] > It seems to me that we two are likely to break Idlefork pretty badly > at times at first, which would slow down the work that you and Raymond > are doing. In addition, I would expect the two versions to start to > diverge, especially in the output window (see below). > > Therefore, might I also suggest that we fork the current version just > before Chui's merge and that you and Raymond work I tagged the files in idle/ and below with TAG_pre_teyc_gvr_rpc_patch just before Chui's commit of this. > This has the advantage that a relatively stable version would be > available in the interim for comparison and also for end user > downloads. > The argument parsing in PyShell.main.main() appears to be OK and met > GvR's requests last July. The args passed to PyShell.main.remote() > would seem to be a subset, but it's unfinished. The call in > PyShell.main.__init__ also has some redundancy, the usageError stuff > probably could be diked out. The help message needs to be made > consistent with the usage message. > > The code for the new design will probably have different start up > functionality, though. > > The idea is that results for run programs be output to a real python > > shell window to allow interactive inspection of results etc.. The > > results would have to be delimited in some way and different outputs for > > code run from different editor windows handled. Guido says he likes the > > way this is done in TeachScheme, although I must admit I haven't had the > > chance to look at that. > > I have used DrScheme. They have a good system in which once the code > is run in the remote window you can use that window as a shell to > examine the environment and define and run procedures, like you would > in the Python shell. It doesn't disconnect like the DS code does. > However, if you change the text in the Edit window, the remote window > is marked as out of synch and you have to re-run the code. Doing that > restarts the remote REPL with a fresh environment. One nice thing > with DrScheme is you can cut/paste back and forth between the two > windows. Last I heard, a new version was in alpha. > > http://www.cs.rice.edu/CS/PLT/packages/drscheme/tour/slide10.htm > > I think that is close to what Guido wanted: > > http://mail.python.org/pipermail/idle-dev/2001-July/000504.html > http://mail.python.org/pipermail/idle-dev/2001-July/000506.html > > and, as you suggest, with that approach we don't need a separate > shell. Perhaps if you F5 an empty edit window it brings up a shell? We absolutely need to retain the functionality of having a separate, and directly accessible from the menus 'shell only' window that can be opened as desired for tooling around in. > In our case, do I understand that the presence of the shell > at startup is now a user config? That only relates to the default choice of having a shell or an editor open up first, which is overridden by the command line spec of files to edit or specific switches. > Would you like me to update the Idle vendor branch so a formal merge > could be done, as before, but using the diff between now and last summer? Do you mean a merge from python idle? This should be unnecessary since I've tracked every change to python idle since then. In fact I think there have been fixes and behavioural improvements in idlefork that aren't in idle. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From elguavas@users.sourceforge.net Wed Jun 5 01:49:34 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 05 Jun 2002 10:49:34 +1000 Subject: [Idle-dev] RE: idlefork - update, current tasks In-Reply-To: <9DB60AFDAB1A5E4093762030DBB3897814FB17@WEBSERVER.advdata.com.au> References: <9DB60AFDAB1A5E4093762030DBB3897814FB17@WEBSERVER.advdata.com.au> Message-ID: <1023238174.510.63.camel@oberon> Chui G. Tey wrote: > Kurt is welcome to start first on the client/server problem. I work on > idle opportunistically over weekends so KBK taking over for a few weeks > would not be a problem. I will be busy with other things for at least a > few weeks, so KBK's help would be appreciated. > > However, I'd suggest getting the breakpoints working again would be more > useful, and would be a good way to get familiar with the code. It would > also improve the speed of remote debugging, since single stepping would > not be necessary. Single stepping through the remote debugger is > actually not too slow if stack trace and locals() watch is turned off. Sounds like a good thing to move on first. Kurt? > Being able to query variables when stepping through code is a very > useful concept. > I attach a screenshot of how this is implemented in Visual Basic. > http://www.zope.org/Members/teyc/VB_ImmediateWindow.gif Agree that's a very useful ability to have. Thankfully available in way more places than just vb though. ;^) -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From elguavas@users.sourceforge.net Wed Jun 5 03:00:41 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 05 Jun 2002 12:00:41 +1000 Subject: [Idle-dev] Re: idlefork tasks In-Reply-To: References: <1022983188.510.74.camel@oberon> <1023080322.1335.90.camel@oberon> Message-ID: <1023242441.511.135.camel@oberon> Kurt B. Kaiser wrote: > > > I can see that the RPC is modeled after > > > some spec, maybe the Sun RPC spec, but it's though a glass, very > > > darkly. It seems to be more general than needed to do the job. > > > > Well as one of your references mentionned, Guido even suggested xmlrpc, > > but then someone else thought that might be too heavy weight. > > Drake, I think. The parsing might slow it down compared to cPickle. > We don't need the generality, xmlrpc is good for talking between > different languages on different OS on different machines. > > > I'll leave these kind of things up to you and Chui (and Guido) to > > decide since I can't afford the time to get too deeply into the > > rpc/spe stuff as well. > > [...] > We probably should add comment strings to the sections of code we're > working on. > > > I think so. I also think a good doc string at the top of each class > > and method, that documents the in and outs, is a huge benefit to > > those coming later. > > What are your and Guido's thoughts on cleaning code as we work on it? > An advantage is purer code, a disadvantage is obscuring the changes in > the CVS. > > > I like to hack something that works, then tidy it up and improve the > > algorithms etc.. I do often nit pick here and there in what I'm forced > > to revisit also, but I'm very very wary in 'cleaning up' code I didn't > > write unless I'm 1000% certain of every possible ramification. (great > > maths there) > > Yes, good point. But sometimes I see what appears to be excess > factoring such that a three line def is only used in one place and > could easily be in-lined for improved clarity. Certainly I think we should all try to stick to some basic procedures (which, in my rush to get some code out the door I didn't always do in my earliest config stuff :( ) for commenting, such as: using docstrings as mentioned above, commenting new code where we think there could be later confusion, and, to my mind most importantly of all, and at the very least, using meaningful and descriptive variable/attribute and function/method and class names, _even if it means they are longer_ (ie forget everything you ever knew about naming when coding in c ;). As far as applying this to existing code, certainly clean up where you are _certain_ there are no 'implications', but also if you happen to penetrate the mysteries of a particularly 'intense' ;) piece of existing code by all means comment it so others can benefit from your enlightenment. Stephen. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From kbk@shore.net Wed Jun 5 03:51:58 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 04 Jun 2002 22:51:58 -0400 Subject: [Idle-dev] Re: idlefork - update, current tasks In-Reply-To: <1023238174.510.63.camel@oberon> References: <9DB60AFDAB1A5E4093762030DBB3897814FB17@WEBSERVER.advdata.com.au> <1023238174.510.63.camel@oberon> Message-ID: "Stephen M. Gava" writes: > Chui G. Tey wrote: > > Kurt is welcome to start first [...] > Sounds like a good thing to move on first. Kurt? Fine. I'm looking at it now. From elguavas@users.sourceforge.net Wed Jun 5 04:09:10 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 05 Jun 2002 13:09:10 +1000 Subject: [Idle-dev] idlefork updates Message-ID: <1023246555.510.150.camel@oberon> Ok, that brings the list, and the archives, up to date with the recent salient idlefork developer discussions. From now on this stuff will go straight on idle-dev as appropriate. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From kbk@shore.net Wed Jun 5 04:18:08 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 04 Jun 2002 23:18:08 -0400 Subject: [Idle-dev] Re: idlefork - update, current tasks In-Reply-To: <1023237804.510.57.camel@oberon> References: <1021961645.3543.9.camel@oberon> <200205211721.g4LHLZ019747@odiug.zope.com> <1022024623.497.17.camel@oberon> <1022200924.3040.34.camel@oberon> <002801c208bd$9b756b40$d061accf@othello> <1022995454.510.262.camel@oberon> <1023237804.510.57.camel@oberon> Message-ID: "Stephen M. Gava" writes: > We absolutely need to retain the functionality of having a separate, > and directly accessible from the menus 'shell only' window that can > be opened as desired for tooling around in. Does that mean that if I run a program in the remote window, which will have interactive shell functionality after the program finishes, that I can start _another_ shell in a separate window? And that the latter shell will not be affected by restarting the program in the first shell? Maybe just run another copy of Idle to get the second shell? [...] > > Would you like me to update the Idle vendor branch so a formal merge > > could be done, as before, but using the diff between now and last summer? > > Do you mean a merge from python idle? This should be unnecessary since > I've tracked every change to python idle since then. In fact I think > there have been fixes and behavioural improvements in idlefork that > aren't in idle. Oh, sure, I was just wondering if merging the Python Idle changes since last summer via diffs using the CVS was of interest to you. One certainly wouldn't want to revert the improvements! If you have already made all the changes, then the process would come up with "nothing to do." Regards, KBK From guido@python.org Wed Jun 5 13:20:43 2002 From: guido@python.org (Guido van Rossum) Date: Wed, 05 Jun 2002 08:20:43 -0400 Subject: [Idle-dev] Running a program In-Reply-To: Your message of "02 Jun 2002 22:22:51 EDT." References: <1021961645.3543.9.camel@oberon> <200205211721.g4LHLZ019747@odiug.zope.com> <1022024623.497.17.camel@oberon> <1022200924.3040.34.camel@oberon> <002801c208bd$9b756b40$d061accf@othello> <1022995454.510.262.camel@oberon> Message-ID: <200206051220.g55CKil02775@pcp02138704pcs.reston01.va.comcast.net> (Changing the subject, widening the audience.) [KBK:] > I have used DrScheme. They have a good system in which once the code > is run in the remote window you can use that window as a shell to > examine the environment and define and run procedures, like you would > in the Python shell. It doesn't disconnect like the DS code does. > However, if you change the text in the Edit window, the remote window > is marked as out of synch and you have to re-run the code. Doing that > restarts the remote REPL with a fresh environment. One nice thing > with DrScheme is you can cut/paste back and forth between the two > windows. Last I heard, a new version was in alpha. > > http://www.cs.rice.edu/CS/PLT/packages/drscheme/tour/slide10.htm > > I think that is close to what Guido wanted: > > http://mail.python.org/pipermail/idle-dev/2001-July/000504.html > http://mail.python.org/pipermail/idle-dev/2001-July/000506.html > > and, as you suggest, with that approach we don't need a separate > shell. Perhaps if you F5 an empty edit window it brings up a shell? > With DrScheme, the shell is always present and attached below the edit > window. In our case, do I understand that the presence of the shell > at startup is now a user config? > > http://mail.python.org/pipermail/idle-dev/2001-October/000663.html > > Personally, I don't think the DrScheme design is a very good use of > the screen and I would rather see side by side windows (maybe with a > tabbed Edit window?) or floating windows. If the latter, they should > remember their positions and sizes between sessions. I've thought some more about what I think I would like. (You never know if I'll like it once I have it of course. :-) - The presence of the PythonShell window corresponds with the presence of a subprocess running user code. Close the window, the subprocess exits. - There can only be one PythonShell window at any time. (This is not technically necessary, but makes it easier for the user to avoid confusion. If we can technically allow multiple windows, expert users can turn this on.) - It's configurable whether initially you get a PythonShell window or a blank, "new file" window. I think for historic continuity the default should be a blank window in IDLEFORK, but if/when all is backported to the Python CVS tree, the default should be a PythonShell. There should be a command line option to force either choice (overriding the user's configured preference). - When you invoke idle with one or more filename arguments, those files are edited and no PythonShell window pops up (also no blank window of course). - If you edit a file and hit F5, the program's output appears in the PythonShell window and after that the user can interact with the PythonShell. - F5 should first save the buffer, without asking. If there's no filename yet, it should silently save to a temp file. (Or maybe it should always save to a temp file so that if you have unsaved changes you can run the program without making the permanent? This could be a useful feature.) - If there was alread a PythonShell window when you hit F5, I'm not sure what should happen; either a separator should be appended and the new output should be appended, or the window should be cleared first. I now think that I like clearing first better. Maybe make this configurable? - (Very important, based on user testing!) If you hit F5 while the current window is the PythonShell, the program that was last run should be run again. If no program was run yet, a simple error box should pop up. (Hm, maybe you could pop up a file selector box to select the file to run, but that's probably not what the user wanted.) - I don't want the "transparent" property of DrScheme from the rice.edu URL quoted above (warnings when you type in the shell after editing your program). - I don't like DrScheme's multiple panes approach; let the PythonShell window be a totally separate window. - It's a good idea to remember window positions across sessions. - If you hit control-F5, a dialog box pops up that lets you change some things: - a checkbox to enable the debugger - you can type command line arguments that are parsed and stored in sys.argv of your program - If after using control-F5, you run your program again with F5, the settings from the dialog box are used. That's all I can come up with for now. (Oh, when the program ends with a traceback, maybe you should be thrown into the debugger? Or at least this could be an option? Or maybe the "stack viewer" thingy could be the default behavior? Hm, the stack viewer is more powerful than the regular debugger when inspecting objects -- the debugger should use this too.) --Guido van Rossum (home page: http://www.python.org/~guido/) From basherwo@unity.ncsu.edu Wed Jun 5 14:30:27 2002 From: basherwo@unity.ncsu.edu (Bruce Sherwood) Date: Wed, 05 Jun 2002 09:30:27 -0400 Subject: [Idle-dev] Running a program In-Reply-To: <200206051220.g55CKil02775@pcp02138704pcs.reston01.va.comca st.net> References: <1021961645.3543.9.camel@oberon> <200205211721.g4LHLZ019747@odiug.zope.com> <1022024623.497.17.camel@oberon> <1022200924.3040.34.camel@oberon> <002801c208bd$9b756b40$d061accf@othello> <1022995454.510.262.camel@oberon> Message-ID: <5.1.0.14.0.20020605092537.00b17d50@basherwo.mail.ncsu.edu> There's one other environment behavior that may need some attention and which hasn't been mentioned explicitly. When a compile or execution error occurs, it is important that the window containing the error message come forward. At present it can happen that the error is not visible because its window is occluded. I've found that exhortations to nonexpert programmers to keep the idlefork window open in a clear part of the screen are not very effective, so this window-forward behavior is important. Also, on Linux I have seen the open-file dialog box come up behind other windows, which is both confusing and inconvenient. Bruce Sherwood From kbk@shore.net Wed Jun 5 21:38:12 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 05 Jun 2002 16:38:12 -0400 Subject: [Idle-dev] Running a program In-Reply-To: <200206051220.g55CKil02775@pcp02138704pcs.reston01.va.comcast.net> References: <1021961645.3543.9.camel@oberon> <200205211721.g4LHLZ019747@odiug.zope.com> <1022024623.497.17.camel@oberon> <1022200924.3040.34.camel@oberon> <002801c208bd$9b756b40$d061accf@othello> <1022995454.510.262.camel@oberon> <200206051220.g55CKil02775@pcp02138704pcs.reston01.va.comcast.net> Message-ID: Guido van Rossum writes: [...] > - If there was alread a PythonShell window when you hit F5, I'm not > sure what should happen; either a separator should be appended and > the new output should be appended, or the window should be cleared > first. I now think that I like clearing first better. Maybe make > this configurable? Python has a neat feature in the shell whereby hitting enter on a line before the I/O mark causes it to be copied to the I/O mark. This is very useful for testing - you don't have to re-type the test expressions :) I realize these expressions could be put in the edit window but they tend to change rapidy as development proceeds and I just leave them behind in the shell, no clean up necessary. I'd hate to see that feature go away. We had discussed setting the old output off by changing its color, maybe dark red, and also possibly by drawing a separator between runs. [...] All the rest sounds great. Regards, KBK From guido@python.org Wed Jun 5 22:04:05 2002 From: guido@python.org (Guido van Rossum) Date: Wed, 05 Jun 2002 17:04:05 -0400 Subject: [Idle-dev] Running a program In-Reply-To: Your message of "05 Jun 2002 16:38:12 EDT." References: <1021961645.3543.9.camel@oberon> <200205211721.g4LHLZ019747@odiug.zope.com> <1022024623.497.17.camel@oberon> <1022200924.3040.34.camel@oberon> <002801c208bd$9b756b40$d061accf@othello> <1022995454.510.262.camel@oberon> <200206051220.g55CKil02775@pcp02138704pcs.reston01.va.comcast.net> Message-ID: <200206052104.g55L45F04456@pcp02138704pcs.reston01.va.comcast.net> > Python has a neat feature in the shell whereby hitting enter on a line > before the I/O mark causes it to be copied to the I/O mark. This is > very useful for testing - you don't have to re-type the test > expressions :) > > I realize these expressions could be put in the edit window but they > tend to change rapidy as development proceeds and I just leave them > behind in the shell, no clean up necessary. I'd hate to see that > feature go away. > > We had discussed setting the old output off by changing its color, > maybe dark red, and also possibly by drawing a separator between runs. Hm, you're right. Maybe "empty shell window" should be an option in the control-F5 dialog? --Guido van Rossum (home page: http://www.python.org/~guido/) From kbk@shore.net Wed Jun 5 22:50:21 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 05 Jun 2002 17:50:21 -0400 Subject: [Idle-dev] Created the Branch for DS RPC Message-ID: I just created a new branch rooted at TAG_pre_teyc_gvr_rpc_patch. The branch is labelled DS_RPC_BRANCH It is intended to be the stable branch of Idlefork while work proceeds integrating the GvR RPC code. Users are invited to try both branches. Please note that the MAIN trunk is liable to be severely broken for awhile :) We will occasionally place tags on MAIN indicating relatively stable test versions; it may take awhile to get to the first one :) To check out a copy of the stable branch (if you don't already have a copy of Idlefork): cvs co -rDS_RPC_BRANCH idlefork To move from the MAIN (GvR RPC) to the stable (DS RPC) branch: cvs up -rDS_RPC_BRANCH To move back to MAIN (GvR RPC): cvs up -A I'm now going to re-apply Geiger Ho's patch, which occurred after the branch, to DS_RPC_BRANCH. The plan is to continue non-RPC development on DS_RPC_BRANCH. I will merge that work into MAIN occasionally. Work specific to the new RPC design would be done on HEAD, of course. KBK From kbk@users.sourceforge.net Wed Jun 5 23:02:21 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Wed, 05 Jun 2002 15:02:21 -0700 Subject: [Idle-dev] CVS: idle TreeWidget.py,1.2,1.2.2.1 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv2601 Modified Files: Tag: DS_RPC_BRANCH TreeWidget.py Log Message: Reapply Geiger Ho's patch for better subclassing Branch occurred before patch on MAIN, so update DS_RPC_BRANCH Index: TreeWidget.py =================================================================== RCS file: /cvsroot/idlefork/idle/TreeWidget.py,v retrieving revision 1.2 retrieving revision 1.2.2.1 diff -C2 -r1.2 -r1.2.2.1 *** TreeWidget.py 4 Jul 2001 03:15:10 -0000 1.2 --- TreeWidget.py 5 Jun 2002 22:02:19 -0000 1.2.2.1 *************** *** 188,192 **** return y+17 for item in sublist: ! child = TreeNode(self.canvas, self, item) self.children.append(child) cx = x+20 --- 188,192 ---- return y+17 for item in sublist: ! child = self.__class__(self.canvas, self, item) self.children.append(child) cx = x+20 From kbk@users.sourceforge.net Wed Jun 5 23:09:12 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Wed, 05 Jun 2002 15:09:12 -0700 Subject: [Idle-dev] CVS: idle INSTALL.txt,1.1,1.1.2.1 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv7226 Modified Files: Tag: DS_RPC_BRANCH INSTALL.txt Log Message: Specify correct directory; append rather than overwrite Index: INSTALL.txt =================================================================== RCS file: /cvsroot/idlefork/idle/INSTALL.txt,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -r1.1 -r1.1.2.1 *** INSTALL.txt 21 Jul 2001 09:50:55 -0000 1.1 --- INSTALL.txt 5 Jun 2002 22:09:10 -0000 1.1.2.1 *************** *** 46,55 **** # python setup.py install ! # echo "idle" > /usr/local/lib/pythonX.X/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). # exit from root --- 46,55 ---- # 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 From gvanrossum@users.sourceforge.net Thu Jun 6 01:44:18 2002 From: gvanrossum@users.sourceforge.net (Guido van Rossum) Date: Wed, 05 Jun 2002 17:44:18 -0700 Subject: [Idle-dev] CVS: idle keybindingDialog.py,1.7,1.8 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv24138 Modified Files: keybindingDialog.py Log Message: CRLF -> LF Index: keybindingDialog.py =================================================================== RCS file: /cvsroot/idlefork/idle/keybindingDialog.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** keybindingDialog.py 5 Mar 2002 00:25:58 -0000 1.7 --- keybindingDialog.py 6 Jun 2002 00:44:16 -0000 1.8 *************** *** 1,256 **** ! """ ! dialog for building tkinter accelerator key bindings ! """ ! from Tkinter import * ! import tkMessageBox ! import string, os ! ! class GetKeysDialog(Toplevel): ! def __init__(self,parent,title,action,currentKeySequences): ! """ ! action - string, the name of the virtual event these keys will be ! mapped to ! currentKeys - list, a list of all key sequence lists currently mapped ! to virtual events, for overlap checking ! """ ! Toplevel.__init__(self, parent) ! self.configure(borderwidth=5) ! self.resizable(height=FALSE,width=FALSE) ! self.title(title) ! self.transient(parent) ! self.grab_set() ! self.protocol("WM_DELETE_WINDOW", self.Cancel) ! self.parent = parent ! self.action=action ! self.currentKeySequences=currentKeySequences ! self.result='' ! self.keyString=StringVar(self) ! self.keyString.set('') ! self.keyCtrl=StringVar(self) ! self.keyCtrl.set('') ! self.keyAlt=StringVar(self) ! self.keyAlt.set('') ! self.keyShift=StringVar(self) ! self.keyShift.set('') ! self.CreateWidgets() ! self.LoadFinalKeyList() ! self.withdraw() #hide while setting geometry ! self.update_idletasks() ! self.geometry("+%d+%d" % ! ((parent.winfo_rootx()+((parent.winfo_width()/2) ! -(self.winfo_reqwidth()/2)), ! parent.winfo_rooty()+((parent.winfo_height()/2) ! -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent ! self.deiconify() #geometry set, unhide ! self.wait_window() ! ! def CreateWidgets(self): ! frameMain = Frame(self,borderwidth=2,relief=SUNKEN) ! frameMain.pack(side=TOP,expand=TRUE,fill=BOTH) ! frameButtons=Frame(self) ! frameButtons.pack(side=BOTTOM,fill=X) ! self.buttonOk = Button(frameButtons,text='Ok', ! width=8,command=self.Ok) ! self.buttonOk.grid(row=0,column=0,padx=5,pady=5) ! self.buttonCancel = Button(frameButtons,text='Cancel', ! width=8,command=self.Cancel) ! self.buttonCancel.grid(row=0,column=1,padx=5,pady=5) ! self.frameKeySeqBasic = Frame(frameMain) ! self.frameKeySeqAdvanced = Frame(frameMain) ! self.frameControlsBasic = Frame(frameMain) ! self.frameHelpAdvanced = Frame(frameMain) ! self.frameKeySeqAdvanced.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.lift() ! self.frameHelpAdvanced.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.lift() ! self.buttonLevel = Button(frameMain,command=self.ToggleLevel, ! text='Advanced Key Binding Entry >>') ! self.buttonLevel.grid(row=2,column=0,stick=EW,padx=5,pady=5) ! labelTitleBasic = Label(self.frameKeySeqBasic, ! text="New keys for '"+self.action+"' :") ! labelTitleBasic.pack(anchor=W) ! labelKeysBasic = Label(self.frameKeySeqBasic,justify=LEFT, ! textvariable=self.keyString,relief=GROOVE,borderwidth=2) ! labelKeysBasic.pack(ipadx=5,ipady=5,fill=X) ! checkCtrl=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Ctrl',variable=self.keyCtrl,onvalue='Control',offvalue='') ! checkCtrl.grid(row=0,column=0,padx=2,sticky=W) ! checkAlt=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Alt',variable=self.keyAlt,onvalue='Alt',offvalue='') ! checkAlt.grid(row=0,column=1,padx=2,sticky=W) ! checkShift=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Shift',variable=self.keyShift,onvalue='Shift',offvalue='') ! checkShift.grid(row=0,column=3,padx=2,sticky=W) ! labelFnAdvice=Label(self.frameControlsBasic,justify=LEFT, ! text="Select the desired modifier\n"+ ! "keys above, and final key\n"+ ! "from the list on the right.") ! labelFnAdvice.grid(row=1,column=0,columnspan=4,padx=2,sticky=W) ! self.listKeysFinal=Listbox(self.frameControlsBasic,width=15,height=10, ! selectmode=SINGLE) ! self.listKeysFinal.bind('',self.FinalKeySelected) ! self.listKeysFinal.grid(row=0,column=4,rowspan=4,sticky=NS) ! scrollKeysFinal=Scrollbar(self.frameControlsBasic,orient=VERTICAL, ! command=self.listKeysFinal.yview) ! self.listKeysFinal.config(yscrollcommand=scrollKeysFinal.set) ! scrollKeysFinal.grid(row=0,column=5,rowspan=4,sticky=NS) ! self.buttonClear=Button(self.frameControlsBasic, ! text='Clear Keys',command=self.ClearKeySeq) ! self.buttonClear.grid(row=2,column=0,columnspan=4) ! labelTitleAdvanced = Label(self.frameKeySeqAdvanced,justify=LEFT, ! text="Enter new binding(s) for '"+self.action+"' :\n"+ ! "(will not be checked for validity)") ! labelTitleAdvanced.pack(anchor=W) ! self.entryKeysAdvanced=Entry(self.frameKeySeqAdvanced, ! textvariable=self.keyString) ! self.entryKeysAdvanced.pack(fill=X) ! labelHelpAdvanced=Label(self.frameHelpAdvanced,justify=LEFT, ! text="Key bindings are specified using tkinter key id's as\n"+ ! "in these samples: , , ,\n" ! ", , .\n\n"+ ! "'Emacs style' multi-keystroke bindings are specified as\n"+ ! "follows: or .\n\n"+ ! "Multiple separate bindings for one action should be\n"+ ! "separated by a space, eg., ." ) ! labelHelpAdvanced.grid(row=0,column=0,sticky=NSEW) ! ! def ToggleLevel(self): ! if self.buttonLevel.cget('text')[:8]=='Advanced': ! self.ClearKeySeq() ! self.buttonLevel.config(text='<< Basic Key Binding Entry') ! self.frameKeySeqAdvanced.lift() ! self.frameHelpAdvanced.lift() ! self.entryKeysAdvanced.focus_set() ! else: ! self.ClearKeySeq() ! self.buttonLevel.config(text='Advanced Key Binding Entry >>') ! self.frameKeySeqBasic.lift() ! self.frameControlsBasic.lift() ! ! def FinalKeySelected(self,event): ! self.BuildKeyString() ! ! def BuildKeyString(self): ! keyList=[] ! modifiers=self.GetModifiers() ! finalKey=self.listKeysFinal.get(ANCHOR) ! 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) ! else: ! finalKey=self.TranslateKey(finalKey) ! keyList.append(finalKey+'>') ! keyStr=string.join(keyList,'-') ! self.keyString.set(keyStr) ! ! def GetModifiers(self): ! modList=[] ! ctrl=self.keyCtrl.get() ! alt=self.keyAlt.get() ! shift=self.keyShift.get() ! if ctrl: modList.append(ctrl) ! if alt: modList.append(alt) ! if shift: modList.append(shift) ! return modList ! ! def ClearKeySeq(self): ! self.listKeysFinal.select_clear(0,END) ! self.listKeysFinal.yview(MOVETO, '0.0') ! self.keyCtrl.set('') ! self.keyAlt.set(''), ! self.keyShift.set('') ! self.keyString.set('') ! ! def LoadFinalKeyList(self): ! #these tuples are also available for use in validity checks ! self.functionKeys=('F1','F2','F2','F4','F5','F6','F7','F8','F9', ! 'F10','F11','F12') ! self.alphanumKeys=tuple(string.ascii_lowercase+string.digits) ! self.punctuationKeys=tuple('~!@#%^&*()_-+={}[]|;:,.<>/?') ! self.whitespaceKeys=('Tab','Space','Return') ! self.editKeys=('BackSpace','Delete','Insert') ! self.moveKeys=('Home','End','Page Up','Page Down','Left Arrow', ! 'Right Arrow','Up Arrow','Down Arrow') ! #make a tuple of most of the useful common 'final' keys ! keys=(self.alphanumKeys+self.punctuationKeys+self.functionKeys+ ! self.whitespaceKeys+self.editKeys+self.moveKeys) ! apply(self.listKeysFinal.insert, ! (END,)+keys) ! ! def TranslateKey(self,key): ! #translate from key list value to tkinter key-id ! translateDict={'~':'asciitilde','!':'exclam','@':'at','#':'numbersign', ! '%':'percent','^':'asciicircum','&':'ampersand','*':'asterisk', ! '(':'parenleft',')':'parenright','_':'underscore','-':'minus', ! '+':'plus','=':'equal','{':'braceleft','}':'braceright', ! '[':'bracketleft',']':'bracketright','|':'bar',';':'semicolon', ! ':':'colon',',':'comma','.':'period','<':'less','>':'greater', ! '/':'slash','?':'question','Page Up':'Prior','Page Down':'Next', ! 'Left Arrow':'Left','Right Arrow':'Right','Up Arrow':'Up', ! 'Down Arrow': 'Down'} ! if key in translateDict.keys(): ! key=translateDict[key] ! 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 ! keysOk=1 ! keys=self.keyString.get() ! keys.strip() ! finalKey=self.listKeysFinal.get(ANCHOR) ! modifiers=self.GetModifiers() ! keySequence=keys.split()#make into a key sequence list for overlap check ! if not keys: #no keys specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No keys specified.') ! keysOk=0 ! elif not keys.endswith('>'): #no final key specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No final key specified.') ! keysOk=0 ! elif (not modifiers) and (finalKey in ! self.alphanumKeys+self.punctuationKeys): ! #modifier required ! tkMessageBox.showerror(title='Key Sequence Error', ! 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 ! tkMessageBox.showerror(title='Key Sequence Error', ! message='Shift alone is not a useful modifier '+ ! 'when used with this final key key.') ! keysOk=0 ! elif keySequence in self.currentKeySequences: #keys combo already in use ! tkMessageBox.showerror(title='Key Sequence Error', ! message='This key combination is already in use.') ! keysOk=0 ! return keysOk ! ! if __name__ == '__main__': ! #test the dialog ! root=Tk() ! def run(): ! keySeq='' ! dlg=GetKeysDialog(root,'Get Keys','find-again',[]) ! print dlg.result ! Button(root,text='Dialog',command=run).pack() ! root.mainloop() --- 1,256 ---- ! """ ! dialog for building tkinter accelerator key bindings ! """ ! from Tkinter import * ! import tkMessageBox ! import string, os ! ! class GetKeysDialog(Toplevel): ! def __init__(self,parent,title,action,currentKeySequences): ! """ ! action - string, the name of the virtual event these keys will be ! mapped to ! currentKeys - list, a list of all key sequence lists currently mapped ! to virtual events, for overlap checking ! """ ! Toplevel.__init__(self, parent) ! self.configure(borderwidth=5) ! self.resizable(height=FALSE,width=FALSE) ! self.title(title) ! self.transient(parent) ! self.grab_set() ! self.protocol("WM_DELETE_WINDOW", self.Cancel) ! self.parent = parent ! self.action=action ! self.currentKeySequences=currentKeySequences ! self.result='' ! self.keyString=StringVar(self) ! self.keyString.set('') ! self.keyCtrl=StringVar(self) ! self.keyCtrl.set('') ! self.keyAlt=StringVar(self) ! self.keyAlt.set('') ! self.keyShift=StringVar(self) ! self.keyShift.set('') ! self.CreateWidgets() ! self.LoadFinalKeyList() ! self.withdraw() #hide while setting geometry ! self.update_idletasks() ! self.geometry("+%d+%d" % ! ((parent.winfo_rootx()+((parent.winfo_width()/2) ! -(self.winfo_reqwidth()/2)), ! parent.winfo_rooty()+((parent.winfo_height()/2) ! -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent ! self.deiconify() #geometry set, unhide ! self.wait_window() ! ! def CreateWidgets(self): ! frameMain = Frame(self,borderwidth=2,relief=SUNKEN) ! frameMain.pack(side=TOP,expand=TRUE,fill=BOTH) ! frameButtons=Frame(self) ! frameButtons.pack(side=BOTTOM,fill=X) ! self.buttonOk = Button(frameButtons,text='Ok', ! width=8,command=self.Ok) ! self.buttonOk.grid(row=0,column=0,padx=5,pady=5) ! self.buttonCancel = Button(frameButtons,text='Cancel', ! width=8,command=self.Cancel) ! self.buttonCancel.grid(row=0,column=1,padx=5,pady=5) ! self.frameKeySeqBasic = Frame(frameMain) ! self.frameKeySeqAdvanced = Frame(frameMain) ! self.frameControlsBasic = Frame(frameMain) ! self.frameHelpAdvanced = Frame(frameMain) ! self.frameKeySeqAdvanced.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.lift() ! self.frameHelpAdvanced.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.lift() ! self.buttonLevel = Button(frameMain,command=self.ToggleLevel, ! text='Advanced Key Binding Entry >>') ! self.buttonLevel.grid(row=2,column=0,stick=EW,padx=5,pady=5) ! labelTitleBasic = Label(self.frameKeySeqBasic, ! text="New keys for '"+self.action+"' :") ! labelTitleBasic.pack(anchor=W) ! labelKeysBasic = Label(self.frameKeySeqBasic,justify=LEFT, ! textvariable=self.keyString,relief=GROOVE,borderwidth=2) ! labelKeysBasic.pack(ipadx=5,ipady=5,fill=X) ! checkCtrl=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Ctrl',variable=self.keyCtrl,onvalue='Control',offvalue='') ! checkCtrl.grid(row=0,column=0,padx=2,sticky=W) ! checkAlt=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Alt',variable=self.keyAlt,onvalue='Alt',offvalue='') ! checkAlt.grid(row=0,column=1,padx=2,sticky=W) ! checkShift=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Shift',variable=self.keyShift,onvalue='Shift',offvalue='') ! checkShift.grid(row=0,column=3,padx=2,sticky=W) ! labelFnAdvice=Label(self.frameControlsBasic,justify=LEFT, ! text="Select the desired modifier\n"+ ! "keys above, and final key\n"+ ! "from the list on the right.") ! labelFnAdvice.grid(row=1,column=0,columnspan=4,padx=2,sticky=W) ! self.listKeysFinal=Listbox(self.frameControlsBasic,width=15,height=10, ! selectmode=SINGLE) ! self.listKeysFinal.bind('',self.FinalKeySelected) ! self.listKeysFinal.grid(row=0,column=4,rowspan=4,sticky=NS) ! scrollKeysFinal=Scrollbar(self.frameControlsBasic,orient=VERTICAL, ! command=self.listKeysFinal.yview) ! self.listKeysFinal.config(yscrollcommand=scrollKeysFinal.set) ! scrollKeysFinal.grid(row=0,column=5,rowspan=4,sticky=NS) ! self.buttonClear=Button(self.frameControlsBasic, ! text='Clear Keys',command=self.ClearKeySeq) ! self.buttonClear.grid(row=2,column=0,columnspan=4) ! labelTitleAdvanced = Label(self.frameKeySeqAdvanced,justify=LEFT, ! text="Enter new binding(s) for '"+self.action+"' :\n"+ ! "(will not be checked for validity)") ! labelTitleAdvanced.pack(anchor=W) ! self.entryKeysAdvanced=Entry(self.frameKeySeqAdvanced, ! textvariable=self.keyString) ! self.entryKeysAdvanced.pack(fill=X) ! labelHelpAdvanced=Label(self.frameHelpAdvanced,justify=LEFT, ! text="Key bindings are specified using tkinter key id's as\n"+ ! "in these samples: , , ,\n" ! ", , .\n\n"+ ! "'Emacs style' multi-keystroke bindings are specified as\n"+ ! "follows: or .\n\n"+ ! "Multiple separate bindings for one action should be\n"+ ! "separated by a space, eg., ." ) ! labelHelpAdvanced.grid(row=0,column=0,sticky=NSEW) ! ! def ToggleLevel(self): ! if self.buttonLevel.cget('text')[:8]=='Advanced': ! self.ClearKeySeq() ! self.buttonLevel.config(text='<< Basic Key Binding Entry') ! self.frameKeySeqAdvanced.lift() ! self.frameHelpAdvanced.lift() ! self.entryKeysAdvanced.focus_set() ! else: ! self.ClearKeySeq() ! self.buttonLevel.config(text='Advanced Key Binding Entry >>') ! self.frameKeySeqBasic.lift() ! self.frameControlsBasic.lift() ! ! def FinalKeySelected(self,event): ! self.BuildKeyString() ! ! def BuildKeyString(self): ! keyList=[] ! modifiers=self.GetModifiers() ! finalKey=self.listKeysFinal.get(ANCHOR) ! 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) ! else: ! finalKey=self.TranslateKey(finalKey) ! keyList.append(finalKey+'>') ! keyStr=string.join(keyList,'-') ! self.keyString.set(keyStr) ! ! def GetModifiers(self): ! modList=[] ! ctrl=self.keyCtrl.get() ! alt=self.keyAlt.get() ! shift=self.keyShift.get() ! if ctrl: modList.append(ctrl) ! if alt: modList.append(alt) ! if shift: modList.append(shift) ! return modList ! ! def ClearKeySeq(self): ! self.listKeysFinal.select_clear(0,END) ! self.listKeysFinal.yview(MOVETO, '0.0') ! self.keyCtrl.set('') ! self.keyAlt.set(''), ! self.keyShift.set('') ! self.keyString.set('') ! ! def LoadFinalKeyList(self): ! #these tuples are also available for use in validity checks ! self.functionKeys=('F1','F2','F2','F4','F5','F6','F7','F8','F9', ! 'F10','F11','F12') ! self.alphanumKeys=tuple(string.ascii_lowercase+string.digits) ! self.punctuationKeys=tuple('~!@#%^&*()_-+={}[]|;:,.<>/?') ! self.whitespaceKeys=('Tab','Space','Return') ! self.editKeys=('BackSpace','Delete','Insert') ! self.moveKeys=('Home','End','Page Up','Page Down','Left Arrow', ! 'Right Arrow','Up Arrow','Down Arrow') ! #make a tuple of most of the useful common 'final' keys ! keys=(self.alphanumKeys+self.punctuationKeys+self.functionKeys+ ! self.whitespaceKeys+self.editKeys+self.moveKeys) ! apply(self.listKeysFinal.insert, ! (END,)+keys) ! ! def TranslateKey(self,key): ! #translate from key list value to tkinter key-id ! translateDict={'~':'asciitilde','!':'exclam','@':'at','#':'numbersign', ! '%':'percent','^':'asciicircum','&':'ampersand','*':'asterisk', ! '(':'parenleft',')':'parenright','_':'underscore','-':'minus', ! '+':'plus','=':'equal','{':'braceleft','}':'braceright', ! '[':'bracketleft',']':'bracketright','|':'bar',';':'semicolon', ! ':':'colon',',':'comma','.':'period','<':'less','>':'greater', ! '/':'slash','?':'question','Page Up':'Prior','Page Down':'Next', ! 'Left Arrow':'Left','Right Arrow':'Right','Up Arrow':'Up', ! 'Down Arrow': 'Down'} ! if key in translateDict.keys(): ! key=translateDict[key] ! 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 ! keysOk=1 ! keys=self.keyString.get() ! keys.strip() ! finalKey=self.listKeysFinal.get(ANCHOR) ! modifiers=self.GetModifiers() ! keySequence=keys.split()#make into a key sequence list for overlap check ! if not keys: #no keys specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No keys specified.') ! keysOk=0 ! elif not keys.endswith('>'): #no final key specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No final key specified.') ! keysOk=0 ! elif (not modifiers) and (finalKey in ! self.alphanumKeys+self.punctuationKeys): ! #modifier required ! tkMessageBox.showerror(title='Key Sequence Error', ! 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 ! tkMessageBox.showerror(title='Key Sequence Error', ! message='Shift alone is not a useful modifier '+ ! 'when used with this final key key.') ! keysOk=0 ! elif keySequence in self.currentKeySequences: #keys combo already in use ! tkMessageBox.showerror(title='Key Sequence Error', ! message='This key combination is already in use.') ! keysOk=0 ! return keysOk ! ! if __name__ == '__main__': ! #test the dialog ! root=Tk() ! def run(): ! keySeq='' ! dlg=GetKeysDialog(root,'Get Keys','find-again',[]) ! print dlg.result ! Button(root,text='Dialog',command=run).pack() ! root.mainloop() From elguavas@users.sourceforge.net Thu Jun 6 02:48:44 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: Wed, 05 Jun 2002 18:48:44 -0700 Subject: [Idle-dev] CVS: website tasklist.txt,1.3,1.4 Message-ID: Update of /cvsroot/idlefork/website In directory usw-pr-cvs1:/tmp/cvs-serv3337 Modified Files: tasklist.txt Log Message: updated for new developers / tasks Index: tasklist.txt =================================================================== RCS file: /cvsroot/idlefork/website/tasklist.txt,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** tasklist.txt 22 May 2002 00:36:48 -0000 1.3 --- tasklist.txt 6 Jun 2002 01:48:42 -0000 1.4 *************** *** 1,50 **** IDLEfork - Current Tasks ! ================================================================== Task Main Subtask Developer(s) ! ================================================================== CVS Maintenance ! Weekly (approx.) merges from stable IDLE. ? ! ------------------------------------------------------------------ Documentation ! New Section of Python Standard Documentation Stephen M. Gava ! on IDLE. For reference and use as in-program ! help. IDLEfork website. Stephen M. Gava - ------------------------------------------------------------------ - Separate Process Execution - for programs being developed in IDLE - - Compare / evaluate David Scherer (currently ? - in IDLEfork) v. GvR code for this and - implement best solution. - - Solve rpc security problems. ? - - Make sure things work properly with shell - window and debugging. ? - ------------------------------------------------------------------ - Stabilisation ! Get debugging working properly! ? Bug fixing. Everyone Testing. Everyone ! ------------------------------------------------------------------ Edit/Shell/Output window interaction ! Output window from run to be shell window ? ! (as done in TeachScheme) so that globals ! etc. can be examined interactively. ! ! Fix shell environment reset for each run ? ! / delimit and scroll for each run. ! ------------------------------------------------------------------ User Configuration / UI Improvements --- 1,73 ---- IDLEfork - Current Tasks ! ==================================================================== Task Main Subtask Developer(s) ! ==================================================================== ! General / Admin ! ! Project Admins. Guido van Rossum ! Stephen M. Gava ! ! Project Manager / Coordinator. Stephen M. Gava ! ! Release manager. Stephen M. Gava ! ! Mentor, Adviser, Final Arbiter. Guido van Rossum ! -------------------------------------------------------------------- CVS Maintenance ! Ongoing branching, splicing & maintenance. Kurt B. Kaiser ! ! Tracking changes to stable python IDLE. Stephen M. Gava ! Everyone ! -------------------------------------------------------------------- Documentation ! New Section of Python Standard Documentation Raymond Hettinger ! on IDLE(fork). For reference and use as ! in-program help. IDLEfork website. Stephen M. Gava ! Context sensitive language/library help ? ! (by python documentation lookup). ! -------------------------------------------------------------------- ! Separate Process Execution / RPC ! for code being run from IDLEfork ! ! Compare / evaluate available implementations Chui Tey ! of this and implement best solution. Kurt B. Kaiser ! ! Solve rpc security problems, including Kurt B. Kaiser ! client / server issues Chui Tey ! ! Make sure things work properly with shell Chui Tey ! window and debugging. Kurt B. Kaiser ! ! Improve performance and stabilty of new Kurt B. Kaiser ! implementation. Chui Tey ! -------------------------------------------------------------------- ! Stabilisation / Cleanups Bug fixing. Everyone Testing. Everyone ! ! Docstrings, commentary, tidyups. Everyone ! -------------------------------------------------------------------- Edit/Shell/Output window interaction ! Output window from run to be shell window Raymond Hettinger ! (as done in TeachScheme) so that results (possibly) ! can be examined interactively. ! ! Fix shell environment reset for each run, Raymond Hettinger ! delimit for each run. (possibly) ! ! General improvements to shell / output Raymond Hettinger ! functionality. (possibly) ! -------------------------------------------------------------------- User Configuration / UI Improvements *************** *** 64,79 **** About box. Stephen M. Gava ! Context sensitive language/library help ? ! (by python documentation lookup). ! ------------------------------------------------------------------ ! Program Startup ! Rationalise multiple startup methods/files. Stephen M. Gava ! Re-implement command line handling sanely. Stephen M. Gava ! ------------------------------------------------------------------ ! Releases ! ! Release manager. Stephen M. Gava ! ================================================================== --- 87,97 ---- About box. Stephen M. Gava + -------------------------------------------------------------------- + Program Startup Cleanup ! Rationalise multiple startup methods/files. Raymond Hettinger ! Re-implement command line handling sanely. Raymond Hettinger ! Re-implement user starup messages sanely. Raymond Hettinger ! ==================================================================== From elguavas@users.sourceforge.net Thu Jun 6 02:56:17 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: Wed, 05 Jun 2002 18:56:17 -0700 Subject: [Idle-dev] CVS: website news.html,1.1,1.2 Message-ID: Update of /cvsroot/idlefork/website In directory usw-pr-cvs1:/tmp/cvs-serv5082 Modified Files: news.html Log Message: new news item Index: news.html =================================================================== RCS file: /cvsroot/idlefork/website/news.html,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** news.html 24 Jul 2001 12:33:20 -0000 1.1 --- news.html 6 Jun 2002 01:56:14 -0000 1.2 *************** *** 126,129 **** --- 126,131 ----

Project News

+
6th June 2002 +

The IDLEfork project welcomes some new and returning developers aboard! IDLEfork website 'Current Tasks' page updated.

24th July 2001

New IDLEfork project web pages now online.

From elguavas@users.sourceforge.net Thu Jun 6 03:11:02 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: Wed, 05 Jun 2002 19:11:02 -0700 Subject: [Idle-dev] CVS: website tasklist.txt,1.4,1.5 Message-ID: Update of /cvsroot/idlefork/website In directory usw-pr-cvs1:/tmp/cvs-serv7986 Modified Files: tasklist.txt Log Message: fix whitespace oops Index: tasklist.txt =================================================================== RCS file: /cvsroot/idlefork/website/tasklist.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** tasklist.txt 6 Jun 2002 01:48:42 -0000 1.4 --- tasklist.txt 6 Jun 2002 02:11:00 -0000 1.5 *************** *** 8,15 **** General / Admin ! Project Admins. Guido van Rossum Stephen M. Gava ! Project Manager / Coordinator. Stephen M. Gava Release manager. Stephen M. Gava --- 8,15 ---- General / Admin ! Project Admins. Guido van Rossum Stephen M. Gava ! Project Manager / Coordinator. Stephen M. Gava Release manager. Stephen M. Gava *************** *** 19,23 **** CVS Maintenance ! Ongoing branching, splicing & maintenance. Kurt B. Kaiser Tracking changes to stable python IDLE. Stephen M. Gava --- 19,23 ---- CVS Maintenance ! Ongoing branching, splicing & maintenance. Kurt B. Kaiser Tracking changes to stable python IDLE. Stephen M. Gava From elguavas@users.sourceforge.net Thu Jun 6 03:16:08 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 06 Jun 2002 12:16:08 +1000 Subject: [Idle-dev] idlefork website updates Message-ID: <1023329768.1671.2.camel@oberon> For anyone who's interested I just updated the website 'Current Tasks List' (and news) to reflect what's happening on the project now that we have some more active developers. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From kbk@users.sourceforge.net Thu Jun 6 03:48:11 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Wed, 05 Jun 2002 19:48:11 -0700 Subject: [Idle-dev] CVS: idle keybindingDialog.py,1.7,1.7.2.1 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv14512 Modified Files: Tag: DS_RPC_BRANCH keybindingDialog.py Log Message: Apply CRLF->LF patch to DS_RPC_BRANCH Index: keybindingDialog.py =================================================================== RCS file: /cvsroot/idlefork/idle/keybindingDialog.py,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -r1.7 -r1.7.2.1 *** keybindingDialog.py 5 Mar 2002 00:25:58 -0000 1.7 --- keybindingDialog.py 6 Jun 2002 02:48:09 -0000 1.7.2.1 *************** *** 1,256 **** ! """ ! dialog for building tkinter accelerator key bindings ! """ ! from Tkinter import * ! import tkMessageBox ! import string, os ! ! class GetKeysDialog(Toplevel): ! def __init__(self,parent,title,action,currentKeySequences): ! """ ! action - string, the name of the virtual event these keys will be ! mapped to ! currentKeys - list, a list of all key sequence lists currently mapped ! to virtual events, for overlap checking ! """ ! Toplevel.__init__(self, parent) ! self.configure(borderwidth=5) ! self.resizable(height=FALSE,width=FALSE) ! self.title(title) ! self.transient(parent) ! self.grab_set() ! self.protocol("WM_DELETE_WINDOW", self.Cancel) ! self.parent = parent ! self.action=action ! self.currentKeySequences=currentKeySequences ! self.result='' ! self.keyString=StringVar(self) ! self.keyString.set('') ! self.keyCtrl=StringVar(self) ! self.keyCtrl.set('') ! self.keyAlt=StringVar(self) ! self.keyAlt.set('') ! self.keyShift=StringVar(self) ! self.keyShift.set('') ! self.CreateWidgets() ! self.LoadFinalKeyList() ! self.withdraw() #hide while setting geometry ! self.update_idletasks() ! self.geometry("+%d+%d" % ! ((parent.winfo_rootx()+((parent.winfo_width()/2) ! -(self.winfo_reqwidth()/2)), ! parent.winfo_rooty()+((parent.winfo_height()/2) ! -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent ! self.deiconify() #geometry set, unhide ! self.wait_window() ! ! def CreateWidgets(self): ! frameMain = Frame(self,borderwidth=2,relief=SUNKEN) ! frameMain.pack(side=TOP,expand=TRUE,fill=BOTH) ! frameButtons=Frame(self) ! frameButtons.pack(side=BOTTOM,fill=X) ! self.buttonOk = Button(frameButtons,text='Ok', ! width=8,command=self.Ok) ! self.buttonOk.grid(row=0,column=0,padx=5,pady=5) ! self.buttonCancel = Button(frameButtons,text='Cancel', ! width=8,command=self.Cancel) ! self.buttonCancel.grid(row=0,column=1,padx=5,pady=5) ! self.frameKeySeqBasic = Frame(frameMain) ! self.frameKeySeqAdvanced = Frame(frameMain) ! self.frameControlsBasic = Frame(frameMain) ! self.frameHelpAdvanced = Frame(frameMain) ! self.frameKeySeqAdvanced.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.lift() ! self.frameHelpAdvanced.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.lift() ! self.buttonLevel = Button(frameMain,command=self.ToggleLevel, ! text='Advanced Key Binding Entry >>') ! self.buttonLevel.grid(row=2,column=0,stick=EW,padx=5,pady=5) ! labelTitleBasic = Label(self.frameKeySeqBasic, ! text="New keys for '"+self.action+"' :") ! labelTitleBasic.pack(anchor=W) ! labelKeysBasic = Label(self.frameKeySeqBasic,justify=LEFT, ! textvariable=self.keyString,relief=GROOVE,borderwidth=2) ! labelKeysBasic.pack(ipadx=5,ipady=5,fill=X) ! checkCtrl=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Ctrl',variable=self.keyCtrl,onvalue='Control',offvalue='') ! checkCtrl.grid(row=0,column=0,padx=2,sticky=W) ! checkAlt=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Alt',variable=self.keyAlt,onvalue='Alt',offvalue='') ! checkAlt.grid(row=0,column=1,padx=2,sticky=W) ! checkShift=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Shift',variable=self.keyShift,onvalue='Shift',offvalue='') ! checkShift.grid(row=0,column=3,padx=2,sticky=W) ! labelFnAdvice=Label(self.frameControlsBasic,justify=LEFT, ! text="Select the desired modifier\n"+ ! "keys above, and final key\n"+ ! "from the list on the right.") ! labelFnAdvice.grid(row=1,column=0,columnspan=4,padx=2,sticky=W) ! self.listKeysFinal=Listbox(self.frameControlsBasic,width=15,height=10, ! selectmode=SINGLE) ! self.listKeysFinal.bind('',self.FinalKeySelected) ! self.listKeysFinal.grid(row=0,column=4,rowspan=4,sticky=NS) ! scrollKeysFinal=Scrollbar(self.frameControlsBasic,orient=VERTICAL, ! command=self.listKeysFinal.yview) ! self.listKeysFinal.config(yscrollcommand=scrollKeysFinal.set) ! scrollKeysFinal.grid(row=0,column=5,rowspan=4,sticky=NS) ! self.buttonClear=Button(self.frameControlsBasic, ! text='Clear Keys',command=self.ClearKeySeq) ! self.buttonClear.grid(row=2,column=0,columnspan=4) ! labelTitleAdvanced = Label(self.frameKeySeqAdvanced,justify=LEFT, ! text="Enter new binding(s) for '"+self.action+"' :\n"+ ! "(will not be checked for validity)") ! labelTitleAdvanced.pack(anchor=W) ! self.entryKeysAdvanced=Entry(self.frameKeySeqAdvanced, ! textvariable=self.keyString) ! self.entryKeysAdvanced.pack(fill=X) ! labelHelpAdvanced=Label(self.frameHelpAdvanced,justify=LEFT, ! text="Key bindings are specified using tkinter key id's as\n"+ ! "in these samples: , , ,\n" ! ", , .\n\n"+ ! "'Emacs style' multi-keystroke bindings are specified as\n"+ ! "follows: or .\n\n"+ ! "Multiple separate bindings for one action should be\n"+ ! "separated by a space, eg., ." ) ! labelHelpAdvanced.grid(row=0,column=0,sticky=NSEW) ! ! def ToggleLevel(self): ! if self.buttonLevel.cget('text')[:8]=='Advanced': ! self.ClearKeySeq() ! self.buttonLevel.config(text='<< Basic Key Binding Entry') ! self.frameKeySeqAdvanced.lift() ! self.frameHelpAdvanced.lift() ! self.entryKeysAdvanced.focus_set() ! else: ! self.ClearKeySeq() ! self.buttonLevel.config(text='Advanced Key Binding Entry >>') ! self.frameKeySeqBasic.lift() ! self.frameControlsBasic.lift() ! ! def FinalKeySelected(self,event): ! self.BuildKeyString() ! ! def BuildKeyString(self): ! keyList=[] ! modifiers=self.GetModifiers() ! finalKey=self.listKeysFinal.get(ANCHOR) ! 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) ! else: ! finalKey=self.TranslateKey(finalKey) ! keyList.append(finalKey+'>') ! keyStr=string.join(keyList,'-') ! self.keyString.set(keyStr) ! ! def GetModifiers(self): ! modList=[] ! ctrl=self.keyCtrl.get() ! alt=self.keyAlt.get() ! shift=self.keyShift.get() ! if ctrl: modList.append(ctrl) ! if alt: modList.append(alt) ! if shift: modList.append(shift) ! return modList ! ! def ClearKeySeq(self): ! self.listKeysFinal.select_clear(0,END) ! self.listKeysFinal.yview(MOVETO, '0.0') ! self.keyCtrl.set('') ! self.keyAlt.set(''), ! self.keyShift.set('') ! self.keyString.set('') ! ! def LoadFinalKeyList(self): ! #these tuples are also available for use in validity checks ! self.functionKeys=('F1','F2','F2','F4','F5','F6','F7','F8','F9', ! 'F10','F11','F12') ! self.alphanumKeys=tuple(string.ascii_lowercase+string.digits) ! self.punctuationKeys=tuple('~!@#%^&*()_-+={}[]|;:,.<>/?') ! self.whitespaceKeys=('Tab','Space','Return') ! self.editKeys=('BackSpace','Delete','Insert') ! self.moveKeys=('Home','End','Page Up','Page Down','Left Arrow', ! 'Right Arrow','Up Arrow','Down Arrow') ! #make a tuple of most of the useful common 'final' keys ! keys=(self.alphanumKeys+self.punctuationKeys+self.functionKeys+ ! self.whitespaceKeys+self.editKeys+self.moveKeys) ! apply(self.listKeysFinal.insert, ! (END,)+keys) ! ! def TranslateKey(self,key): ! #translate from key list value to tkinter key-id ! translateDict={'~':'asciitilde','!':'exclam','@':'at','#':'numbersign', ! '%':'percent','^':'asciicircum','&':'ampersand','*':'asterisk', ! '(':'parenleft',')':'parenright','_':'underscore','-':'minus', ! '+':'plus','=':'equal','{':'braceleft','}':'braceright', ! '[':'bracketleft',']':'bracketright','|':'bar',';':'semicolon', ! ':':'colon',',':'comma','.':'period','<':'less','>':'greater', ! '/':'slash','?':'question','Page Up':'Prior','Page Down':'Next', ! 'Left Arrow':'Left','Right Arrow':'Right','Up Arrow':'Up', ! 'Down Arrow': 'Down'} ! if key in translateDict.keys(): ! key=translateDict[key] ! 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 ! keysOk=1 ! keys=self.keyString.get() ! keys.strip() ! finalKey=self.listKeysFinal.get(ANCHOR) ! modifiers=self.GetModifiers() ! keySequence=keys.split()#make into a key sequence list for overlap check ! if not keys: #no keys specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No keys specified.') ! keysOk=0 ! elif not keys.endswith('>'): #no final key specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No final key specified.') ! keysOk=0 ! elif (not modifiers) and (finalKey in ! self.alphanumKeys+self.punctuationKeys): ! #modifier required ! tkMessageBox.showerror(title='Key Sequence Error', ! 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 ! tkMessageBox.showerror(title='Key Sequence Error', ! message='Shift alone is not a useful modifier '+ ! 'when used with this final key key.') ! keysOk=0 ! elif keySequence in self.currentKeySequences: #keys combo already in use ! tkMessageBox.showerror(title='Key Sequence Error', ! message='This key combination is already in use.') ! keysOk=0 ! return keysOk ! ! if __name__ == '__main__': ! #test the dialog ! root=Tk() ! def run(): ! keySeq='' ! dlg=GetKeysDialog(root,'Get Keys','find-again',[]) ! print dlg.result ! Button(root,text='Dialog',command=run).pack() ! root.mainloop() --- 1,256 ---- ! """ ! dialog for building tkinter accelerator key bindings ! """ ! from Tkinter import * ! import tkMessageBox ! import string, os ! ! class GetKeysDialog(Toplevel): ! def __init__(self,parent,title,action,currentKeySequences): ! """ ! action - string, the name of the virtual event these keys will be ! mapped to ! currentKeys - list, a list of all key sequence lists currently mapped ! to virtual events, for overlap checking ! """ ! Toplevel.__init__(self, parent) ! self.configure(borderwidth=5) ! self.resizable(height=FALSE,width=FALSE) ! self.title(title) ! self.transient(parent) ! self.grab_set() ! self.protocol("WM_DELETE_WINDOW", self.Cancel) ! self.parent = parent ! self.action=action ! self.currentKeySequences=currentKeySequences ! self.result='' ! self.keyString=StringVar(self) ! self.keyString.set('') ! self.keyCtrl=StringVar(self) ! self.keyCtrl.set('') ! self.keyAlt=StringVar(self) ! self.keyAlt.set('') ! self.keyShift=StringVar(self) ! self.keyShift.set('') ! self.CreateWidgets() ! self.LoadFinalKeyList() ! self.withdraw() #hide while setting geometry ! self.update_idletasks() ! self.geometry("+%d+%d" % ! ((parent.winfo_rootx()+((parent.winfo_width()/2) ! -(self.winfo_reqwidth()/2)), ! parent.winfo_rooty()+((parent.winfo_height()/2) ! -(self.winfo_reqheight()/2)) )) ) #centre dialog over parent ! self.deiconify() #geometry set, unhide ! self.wait_window() ! ! def CreateWidgets(self): ! frameMain = Frame(self,borderwidth=2,relief=SUNKEN) ! frameMain.pack(side=TOP,expand=TRUE,fill=BOTH) ! frameButtons=Frame(self) ! frameButtons.pack(side=BOTTOM,fill=X) ! self.buttonOk = Button(frameButtons,text='Ok', ! width=8,command=self.Ok) ! self.buttonOk.grid(row=0,column=0,padx=5,pady=5) ! self.buttonCancel = Button(frameButtons,text='Cancel', ! width=8,command=self.Cancel) ! self.buttonCancel.grid(row=0,column=1,padx=5,pady=5) ! self.frameKeySeqBasic = Frame(frameMain) ! self.frameKeySeqAdvanced = Frame(frameMain) ! self.frameControlsBasic = Frame(frameMain) ! self.frameHelpAdvanced = Frame(frameMain) ! self.frameKeySeqAdvanced.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.grid(row=0,column=0,sticky=NSEW,padx=5,pady=5) ! self.frameKeySeqBasic.lift() ! self.frameHelpAdvanced.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.grid(row=1,column=0,sticky=NSEW,padx=5) ! self.frameControlsBasic.lift() ! self.buttonLevel = Button(frameMain,command=self.ToggleLevel, ! text='Advanced Key Binding Entry >>') ! self.buttonLevel.grid(row=2,column=0,stick=EW,padx=5,pady=5) ! labelTitleBasic = Label(self.frameKeySeqBasic, ! text="New keys for '"+self.action+"' :") ! labelTitleBasic.pack(anchor=W) ! labelKeysBasic = Label(self.frameKeySeqBasic,justify=LEFT, ! textvariable=self.keyString,relief=GROOVE,borderwidth=2) ! labelKeysBasic.pack(ipadx=5,ipady=5,fill=X) ! checkCtrl=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Ctrl',variable=self.keyCtrl,onvalue='Control',offvalue='') ! checkCtrl.grid(row=0,column=0,padx=2,sticky=W) ! checkAlt=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Alt',variable=self.keyAlt,onvalue='Alt',offvalue='') ! checkAlt.grid(row=0,column=1,padx=2,sticky=W) ! checkShift=Checkbutton(self.frameControlsBasic, ! command=self.BuildKeyString, ! text='Shift',variable=self.keyShift,onvalue='Shift',offvalue='') ! checkShift.grid(row=0,column=3,padx=2,sticky=W) ! labelFnAdvice=Label(self.frameControlsBasic,justify=LEFT, ! text="Select the desired modifier\n"+ ! "keys above, and final key\n"+ ! "from the list on the right.") ! labelFnAdvice.grid(row=1,column=0,columnspan=4,padx=2,sticky=W) ! self.listKeysFinal=Listbox(self.frameControlsBasic,width=15,height=10, ! selectmode=SINGLE) ! self.listKeysFinal.bind('',self.FinalKeySelected) ! self.listKeysFinal.grid(row=0,column=4,rowspan=4,sticky=NS) ! scrollKeysFinal=Scrollbar(self.frameControlsBasic,orient=VERTICAL, ! command=self.listKeysFinal.yview) ! self.listKeysFinal.config(yscrollcommand=scrollKeysFinal.set) ! scrollKeysFinal.grid(row=0,column=5,rowspan=4,sticky=NS) ! self.buttonClear=Button(self.frameControlsBasic, ! text='Clear Keys',command=self.ClearKeySeq) ! self.buttonClear.grid(row=2,column=0,columnspan=4) ! labelTitleAdvanced = Label(self.frameKeySeqAdvanced,justify=LEFT, ! text="Enter new binding(s) for '"+self.action+"' :\n"+ ! "(will not be checked for validity)") ! labelTitleAdvanced.pack(anchor=W) ! self.entryKeysAdvanced=Entry(self.frameKeySeqAdvanced, ! textvariable=self.keyString) ! self.entryKeysAdvanced.pack(fill=X) ! labelHelpAdvanced=Label(self.frameHelpAdvanced,justify=LEFT, ! text="Key bindings are specified using tkinter key id's as\n"+ ! "in these samples: , , ,\n" ! ", , .\n\n"+ ! "'Emacs style' multi-keystroke bindings are specified as\n"+ ! "follows: or .\n\n"+ ! "Multiple separate bindings for one action should be\n"+ ! "separated by a space, eg., ." ) ! labelHelpAdvanced.grid(row=0,column=0,sticky=NSEW) ! ! def ToggleLevel(self): ! if self.buttonLevel.cget('text')[:8]=='Advanced': ! self.ClearKeySeq() ! self.buttonLevel.config(text='<< Basic Key Binding Entry') ! self.frameKeySeqAdvanced.lift() ! self.frameHelpAdvanced.lift() ! self.entryKeysAdvanced.focus_set() ! else: ! self.ClearKeySeq() ! self.buttonLevel.config(text='Advanced Key Binding Entry >>') ! self.frameKeySeqBasic.lift() ! self.frameControlsBasic.lift() ! ! def FinalKeySelected(self,event): ! self.BuildKeyString() ! ! def BuildKeyString(self): ! keyList=[] ! modifiers=self.GetModifiers() ! finalKey=self.listKeysFinal.get(ANCHOR) ! 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) ! else: ! finalKey=self.TranslateKey(finalKey) ! keyList.append(finalKey+'>') ! keyStr=string.join(keyList,'-') ! self.keyString.set(keyStr) ! ! def GetModifiers(self): ! modList=[] ! ctrl=self.keyCtrl.get() ! alt=self.keyAlt.get() ! shift=self.keyShift.get() ! if ctrl: modList.append(ctrl) ! if alt: modList.append(alt) ! if shift: modList.append(shift) ! return modList ! ! def ClearKeySeq(self): ! self.listKeysFinal.select_clear(0,END) ! self.listKeysFinal.yview(MOVETO, '0.0') ! self.keyCtrl.set('') ! self.keyAlt.set(''), ! self.keyShift.set('') ! self.keyString.set('') ! ! def LoadFinalKeyList(self): ! #these tuples are also available for use in validity checks ! self.functionKeys=('F1','F2','F2','F4','F5','F6','F7','F8','F9', ! 'F10','F11','F12') ! self.alphanumKeys=tuple(string.ascii_lowercase+string.digits) ! self.punctuationKeys=tuple('~!@#%^&*()_-+={}[]|;:,.<>/?') ! self.whitespaceKeys=('Tab','Space','Return') ! self.editKeys=('BackSpace','Delete','Insert') ! self.moveKeys=('Home','End','Page Up','Page Down','Left Arrow', ! 'Right Arrow','Up Arrow','Down Arrow') ! #make a tuple of most of the useful common 'final' keys ! keys=(self.alphanumKeys+self.punctuationKeys+self.functionKeys+ ! self.whitespaceKeys+self.editKeys+self.moveKeys) ! apply(self.listKeysFinal.insert, ! (END,)+keys) ! ! def TranslateKey(self,key): ! #translate from key list value to tkinter key-id ! translateDict={'~':'asciitilde','!':'exclam','@':'at','#':'numbersign', ! '%':'percent','^':'asciicircum','&':'ampersand','*':'asterisk', ! '(':'parenleft',')':'parenright','_':'underscore','-':'minus', ! '+':'plus','=':'equal','{':'braceleft','}':'braceright', ! '[':'bracketleft',']':'bracketright','|':'bar',';':'semicolon', ! ':':'colon',',':'comma','.':'period','<':'less','>':'greater', ! '/':'slash','?':'question','Page Up':'Prior','Page Down':'Next', ! 'Left Arrow':'Left','Right Arrow':'Right','Up Arrow':'Up', ! 'Down Arrow': 'Down'} ! if key in translateDict.keys(): ! key=translateDict[key] ! 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 ! keysOk=1 ! keys=self.keyString.get() ! keys.strip() ! finalKey=self.listKeysFinal.get(ANCHOR) ! modifiers=self.GetModifiers() ! keySequence=keys.split()#make into a key sequence list for overlap check ! if not keys: #no keys specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No keys specified.') ! keysOk=0 ! elif not keys.endswith('>'): #no final key specified ! tkMessageBox.showerror(title='Key Sequence Error', ! message='No final key specified.') ! keysOk=0 ! elif (not modifiers) and (finalKey in ! self.alphanumKeys+self.punctuationKeys): ! #modifier required ! tkMessageBox.showerror(title='Key Sequence Error', ! 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 ! tkMessageBox.showerror(title='Key Sequence Error', ! message='Shift alone is not a useful modifier '+ ! 'when used with this final key key.') ! keysOk=0 ! elif keySequence in self.currentKeySequences: #keys combo already in use ! tkMessageBox.showerror(title='Key Sequence Error', ! message='This key combination is already in use.') ! keysOk=0 ! return keysOk ! ! if __name__ == '__main__': ! #test the dialog ! root=Tk() ! def run(): ! keySeq='' ! dlg=GetKeysDialog(root,'Get Keys','find-again',[]) ! print dlg.result ! Button(root,text='Dialog',command=run).pack() ! root.mainloop() From kbk@users.sourceforge.net Thu Jun 6 04:15:55 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Wed, 05 Jun 2002 20:15:55 -0700 Subject: [Idle-dev] CVS: idle PyShell.py,1.13,1.13.2.1 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv19845 Modified Files: Tag: DS_RPC_BRANCH PyShell.py Log Message: CRLF -> LF on the stable branch Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -C2 -r1.13 -r1.13.2.1 *** PyShell.py 27 Mar 2002 00:51:53 -0000 1.13 --- PyShell.py 6 Jun 2002 03:15:53 -0000 1.13.2.1 *************** *** 1,908 **** ! #! /usr/bin/env python ! ! # changes by dscherer@cmu.edu ! ! # The main() function has been replaced by a whole class, in order to ! # address the constraint that only one process can sit on the port ! # hard-coded into the loader. ! ! # It attempts to load the RPC protocol server and publish itself. If ! # that fails, it assumes that some other copy of IDLE is already running [...1787 lines suppressed...] ! 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() ! ! self.idle() ! root.mainloop() ! root.destroy() ! ! ! if __name__ == "__main__": ! main() From elguavas@users.sourceforge.net Tue Jun 11 05:44:00 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: Mon, 10 Jun 2002 21:44:00 -0700 Subject: [Idle-dev] CVS: idle IOBinding.py,1.5,1.6 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv16988 Modified Files: IOBinding.py Log Message: add a version of GvR's q&d python idle printing patch, slightly tweaked and modified for the idlefork config system Index: IOBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/IOBinding.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** IOBinding.py 22 Apr 2002 00:42:42 -0000 1.5 --- IOBinding.py 11 Jun 2002 04:43:58 -0000 1.6 *************** *** 7,13 **** --- 7,15 ---- import os + import tempfile import tkFileDialog import tkMessageBox import re + from configHandler import idleConf #$ event <> *************** *** 23,26 **** --- 25,32 ---- #$ unix + #$ event <> + #$ win + #$ unix + #$ event <> #$ win *************** *** 39,43 **** self.__id_savecopy = self.text.bind("<>", self.save_a_copy) ! def close(self): # Undo command bindings --- 45,50 ---- self.__id_savecopy = self.text.bind("<>", self.save_a_copy) ! self.__id_print = self.text.bind("<>", self.print_window) ! def close(self): # Undo command bindings *************** *** 46,49 **** --- 53,57 ---- self.text.unbind("<>",self.__id_saveas) self.text.unbind("<>", self.__id_savecopy) + self.text.unbind("<>", self.__id_print) # Break cycles self.editwin = None *************** *** 188,192 **** master=self.text) return 0 ! def fixlastline(self): c = self.text.get("end-2c") --- 196,233 ---- master=self.text) return 0 ! ! def print_window(self, event): ! tempfilename = None ! if self.get_saved(): ! filename = self.filename ! else: ! filename = tempfilename = tempfile.mktemp() ! if not self.writefile(filename): ! os.unlink(tempfilename) ! return "break" ! platform=os.name ! printPlatform=1 ! if platform == 'posix': #posix platform ! command = idleConf.GetOption('main','General','print-command-posix') ! command = command + " 2>&1" ! elif platform == 'nt': #win32 platform ! command = idleConf.GetOption('main','General','print-command-win') ! else: #no printing for this platform ! printPlatform=0 ! if printPlatform: #we can try to print for this platform ! command = command % filename ! pipe = os.popen(command, "r") ! output = pipe.read().strip() ! status = pipe.close() ! if status: ! output = "Printing failed (exit status 0x%x)\n" % status + output ! if output: ! output = "Printing command: %s\n" % repr(command) + output ! 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" ! def fixlastline(self): c = self.text.get("end-2c") From elguavas@users.sourceforge.net Tue Jun 11 05:45:38 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: Mon, 10 Jun 2002 21:45:38 -0700 Subject: [Idle-dev] CVS: idle Bindings.py,1.9,1.10 configHandler.py,1.22,1.23 config-main.def,1.11,1.12 config-keys.def,1.9,1.10 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv17259 Modified Files: Bindings.py configHandler.py config-main.def config-keys.def Log Message: add a version of GvR's q&d python idle printing patch, slightly tweaked and modified for the idlefork config system Index: Bindings.py =================================================================== RCS file: /cvsroot/idlefork/idle/Bindings.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** Bindings.py 18 Feb 2002 01:45:43 -0000 1.9 --- Bindings.py 11 Jun 2002 04:45:32 -0000 1.10 *************** *** 31,34 **** --- 31,36 ---- ('Save Co_py As...', '<>'), None, + ('_Print window', '<>'), + None, ('_Close', '<>'), ('E_xit', '<>'), Index: configHandler.py =================================================================== RCS file: /cvsroot/idlefork/idle/configHandler.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -r1.22 -r1.23 *** configHandler.py 2 Mar 2002 07:12:54 -0000 1.22 --- configHandler.py 11 Jun 2002 04:45:32 -0000 1.23 *************** *** 508,511 **** --- 508,512 ---- '<>': [''], '<>': [''], + '<>': [''], '<>': [''], '<>': [''], Index: config-main.def =================================================================== RCS file: /cvsroot/idlefork/idle/config-main.def,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** config-main.def 27 Mar 2002 02:25:44 -0000 1.11 --- config-main.def 11 Jun 2002 04:45:33 -0000 1.12 *************** *** 29,32 **** --- 29,34 ---- [General] editor-on-startup= 1 + print-command-posix=lpr %s + print-command-win=start /min notepad /p %s [EditorWindow] Index: config-keys.def =================================================================== RCS file: /cvsroot/idlefork/idle/config-keys.def,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -r1.9 -r1.10 *** config-keys.def 27 Mar 2002 02:25:44 -0000 1.9 --- config-keys.def 11 Jun 2002 04:45:34 -0000 1.10 *************** *** 27,30 **** --- 27,31 ---- open-window-from-file= plain-newline-and-indent= + print-window= redo= remove-selection= *************** *** 32,36 **** save-window-as-file= save-window= ! select-all= toggle-auto-coloring= undo= --- 33,37 ---- save-window-as-file= save-window= ! select-all= toggle-auto-coloring= undo= *************** *** 60,63 **** --- 61,65 ---- open-window-from-file= plain-newline-and-indent= + print-window= python-docs= python-context-help= From noreply@sourceforge.net Tue Jun 11 05:52:01 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Mon, 10 Jun 2002 21:52:01 -0700 Subject: [Idle-dev] [ idlefork-Patches-567216 ] shell window binding cleanup Message-ID: Patches item #567216, was opened at 2002-06-11 14:52 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=309579&aid=567216&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stephen M. Gava (elguavas) Assigned to: Nobody/Anonymous (nobody) Summary: shell window binding cleanup Initial Comment: this is a todo reminder. the following patch was applied to python idle a while back, something like this needs to be done in idlfork too but exactly what will depend on how the shell/output window restructure is handled: =========== Update of /cvsroot/python/python/dist/src/Tools/idle In directory usw-pr-cvs1:/tmp/cvs-serv32112 Modified Files: EditorWindow.py PyShell.py ScriptBinding.py Log Message: Patch 543222. Disable script bindings in shell window. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/EditorWindow.py,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** EditorWindow.py 14 Apr 2002 10:30:51 -0000 1.41 --- EditorWindow.py 21 May 2002 17:00:19 -0000 1.42 *************** *** 96,99 **** --- 96,100 ---- vars = {} + runnable = False # Shell window cannot Import Module or Run Script def __init__(self, flist=None, filename=None, key=None, root=None): Index: PyShell.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/PyShell.py,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** PyShell.py 4 Apr 2002 22:55:58 -0000 1.36 --- PyShell.py 21 May 2002 17:00:20 -0000 1.37 *************** *** 77,80 **** --- 77,81 ---- # Regular text edit window when a shell is present # XXX ought to merge with regular editor window + runnable = True # Shell not present, enable Import Module and Run Script def __init__(self, *args): Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Tools/idle/ScriptBinding.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** ScriptBinding.py 7 Aug 2001 17:15:36 -0000 1.11 --- ScriptBinding.py 21 May 2002 17:00:20 -0000 1.12 *************** *** 52,55 **** --- 52,58 ---- def __init__(self, editwin): + if not editwin.runnable: + self.menudefs = [] + self.keydefs = {} self.editwin = editwin # Provide instance variables referenced by Debugger ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=309579&aid=567216&group_id=9579 From elguavas@users.sourceforge.net Wed Jun 12 01:09:17 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 12 Jun 2002 10:09:17 +1000 Subject: [Idle-dev] [Fwd: Re: Idlefork] Message-ID: <1023840557.9256.1.camel@oberon> Moving this discussion on to idle-dev. -----Forwarded Message----- From: Stephen M. Gava To: Kurt B. Kaiser Cc: Raymond Hettinger , Chui Tey , Guido van Rossum Subject: Re: Idlefork Date: 12 Jun 2002 09:37:04 +1000 > I saw the printing checkin and sync'd up to it. > > You checked it in on the MAIN branch, I'm not sure if that that was > your intention. Yeah I noticed that MAIN hadn't changed so I just committed there. > I'm planning on doing a checkin today which will pull > the rug out from under the MAIN branch, so I'd recommend that you > > cvs up -r DS_RPC_BRANCH > > to get over there and do further non-GvR-rpc related checkins on that > branch. I guess I should do that. My feelings about the branching arrangement were a bit mixed, but I was thinking of just committing my own stuff straight to MAIN whenever you had indicated that it was in at least a semi-stable state. The thing is, if DS_RPC_BRANCH is meant to be a relatively stable branch that users can do checkouts from, then I don't know if I should be committing further config stuff there, since I'm just as liable to be breaking things as anybody else. Maybe my thinking isn't being particularly clear on this. I thought you mentioned at one stage that maybe all new work should continue on MAIN and DS_RPC_BRANCH should be left for stable checkout and historical comparison purposes, in which case I wondered why did we even need to branch since the idle tree was already tagged before that point. I meant to ask you about that when we were still discussing the branching but then I got distracted. Probably I'm failing to see some important point entirely. > I've been pulling my hair out for the past week on the RPC stuff but I > see light at the end of the tunnel. Don't _think_ it's the train. *L* Hopefully if it is it'll stop to pick you up. BTW, while I'm on the subject of getting distracted and forgetting to do stuff, I also meant to mention _everyone_ that not only is python 2.2.x or better required to work on (or even run) idlefork at the moment, but that Guido has made a clear statement that we are not to bother at all about writing code especially to be compatible with earlier python versions. If there are useful 2.2.x + constructs for the job at hand then use them. If and when idlefork becomes the new idle it will be to accompany the then current and future python versions. Older python versions will have the previous idle versions. Stephen. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From stemiga@optushome.com.au Wed Jun 12 01:11:02 2002 From: stemiga@optushome.com.au (Stephen M. Gava) Date: 12 Jun 2002 10:11:02 +1000 Subject: [Idle-dev] [Fwd: Re: Idlefork] Message-ID: <1023840663.9260.4.camel@oberon> Moving this discussion on to idle-dev. -----Forwarded Message----- From: Guido van Rossum To: elguavas@users.sourceforge.net Cc: Kurt B. Kaiser , Raymond Hettinger , Chui Tey Subject: Re: Idlefork Date: 11 Jun 2002 19:59:30 -0400 > The thing is, if DS_RPC_BRANCH is meant to be a relatively stable > branch that users can do checkouts from, then I don't know if I > should be committing further config stuff there, since I'm just as > liable to be breaking things as anybody else. But the kind of thing you would check in there is miles more reliable than what Kurt is planning for the trunk. So I agree with Kurt that you should be fine doing this on the branch. > Maybe my thinking isn't being particularly clear on this. I thought > you mentioned at one stage that maybe all new work should continue > on MAIN and DS_RPC_BRANCH should be left for stable checkout and > historical comparison purposes, in which case I wondered why did we > even need to branch since the idle tree was already tagged before > that point. I meant to ask you about that when we were still > discussing the branching but then I got distracted. Probably I'm > failing to see some important point entirely. You're close. The arrangement seems very similar to what we've adopted for Python: development goes onto the trunk (unless someone wants to have a "sandbox" branch -- we don't do this very often for Python, but e.g. Zope uses this a lot), but for past releases there's a maintenance branch from which every once in a while a bugfix release is cut. I'd say even if you don't plan to do bugfix releases, maintaining the branch is a fine idea -- you never know when you decide that you *should* do a bugfix release. > BTW, while I'm on the subject of getting distracted and forgetting > to do stuff, I also meant to mention _everyone_ that not only is > python 2.2.x or better required to work on (or even run) idlefork at > the moment, but that Guido has made a clear statement that we are > not to bother at all about writing code especially to be compatible > with earlier python versions. If there are useful 2.2.x + constructs > for the job at hand then use them. If and when idlefork becomes the > new idle it will be to accompany the then current and future python > versions. Older python versions will have the previous idle > versions. Yup. BTW, why aren't we discussing this on idle-dev? Everyone there should benefit (even if it's just us by now :-). --Guido van Rossum (home page: http://www.python.org/~guido/) From elguavas@users.sourceforge.net Wed Jun 12 01:32:31 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 12 Jun 2002 10:32:31 +1000 Subject: [Idle-dev] [Fwd: Re: Idlefork] In-Reply-To: <1023840663.9260.4.camel@oberon> References: <1023840663.9260.4.camel@oberon> Message-ID: <1023841951.9260.21.camel@oberon> > The arrangement seems very similar to what we've > adopted for Python: development goes onto the trunk (unless someone > wants to have a "sandbox" branch -- we don't do this very often for > Python, but e.g. Zope uses this a lot), but for past releases there's > a maintenance branch from which every once in a while a bugfix release > is cut. > > I'd say even if you don't plan to do bugfix releases, maintaining the > branch is a fine idea -- you never know when you decide that you > *should* do a bugfix release. Makes sense. Ok, then if it's possible to use cvs admin to change branch tag names then I'd like DS_RPC_BRANCH to be changed to 0_8_2_MAINT_BRANCH or something similar. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From guido@python.org Wed Jun 12 02:55:37 2002 From: guido@python.org (Guido van Rossum) Date: Tue, 11 Jun 2002 21:55:37 -0400 Subject: [Idle-dev] [Fwd: Re: Idlefork] In-Reply-To: Your message of "12 Jun 2002 10:32:31 +1000." <1023841951.9260.21.camel@oberon> References: <1023840663.9260.4.camel@oberon> <1023841951.9260.21.camel@oberon> Message-ID: <200206120155.g5C1tbc05431@pcp02138704pcs.reston01.va.comcast.net> > Makes sense. Ok, then if it's possible to use cvs admin to change branch > tag names then I'd like DS_RPC_BRANCH to be changed to > 0_8_2_MAINT_BRANCH or something similar. I don't think you can do that. I experimented with this once and ended up creating additional branches by accident. :-( It's not so bad that it's called this. --Guido van Rossum (home page: http://www.python.org/~guido/) From kbk@shore.net Wed Jun 12 04:17:57 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 11 Jun 2002 23:17:57 -0400 Subject: [Idle-dev] RPC Investigations Message-ID: I spent some time comparing the four versions of Idle. Python Idle, as expected, runs in one process. It can be difficult to break into a tightly looping "pass" loop. I recreated GvR's version of Python Idle with his RPC changes. This, again as expected, runs in two processes. One owns the Shell and any other edit windows, the other is the execute server. When the code in the edit window is run, the output appears in the Shell. The remote environment is not cleared between runs as yet. It is easy to break into a tight loop with ctrl-c. Idlefork with DS RPC: Starting an edit window causes three processes to listen on port 7454. Only one gets any cpu cycles. When you start a Shell, and run an empty loop, the execution is handled locally by that same process. Running code from the edit window causes an additional five processes to start up. One of these is accessing X resources and one is the remote server. The other three don't get any cycles. The Shell continues to execute locally and does not know about the client/server process or the program is is running. The environment can't be inspected and all state is lost between runs. It is difficult to break a tight loop. Idlefork with GvR RPC as checked in by Chui: Get the same 3 and 5 processes, when run without -r, it's using the DS RPC. When run with the -r and a script it uses GvR RPC and starts up a Shell and an edit window using three processes. When code is executed in the Shell, one new, smaller process is created which handles the remote computation. Display is in an output window, not the Shell, "interactive" code is split between the Shell and the output window. State is maintained between runs. In all four versions of Idle a print loop is limited by the scrolling speed of the Tk widget once the window fills up, and they all have similar performance, limited by X/Tk. Having both DS RPC and GvR RPC in the same code is quite confusing and difficult to debug. Also, we want the Shell to process remotely, receive its own output and be able to inspect the environment after code is executed. So I bit the bullet and reworked the code to have only the GvR RPC, and with output to the Shell instead of a separate output window. It works very much like Python Idle at this point, except that execution is remote and the GUI is enhanced by Stephen's changes. There are two processes, all user code is executed remotely, and state is inspectable by the Shell. The remote server is not yet restarted following an F5 invocation. That is what I'm checking in tonight on the MAIN branch. The stack viewer is working now. Next, get the remote debugger working. KBK From kbk@users.sourceforge.net Wed Jun 12 04:29:00 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 11 Jun 2002 20:29:00 -0700 Subject: [Idle-dev] CVS: idle EditorWindow.py,1.23,1.24 OutputWindow.py,1.3,1.4 PyShell.py,1.14,1.15 ScriptBinding.py,1.5,1.6 config-extensions.def,1.5,1.6 config.txt,1.4,1.5 ExecBinding.py,1.3,NONE Remote.py,1.2,NONE loader.py,1.2,NONE protocol.py,1.3,NONE spawn.py,1.4,NONE Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv27665 Modified Files: EditorWindow.py OutputWindow.py PyShell.py ScriptBinding.py config-extensions.def config.txt Removed Files: ExecBinding.py Remote.py loader.py protocol.py spawn.py Log Message: Rework the code to have only the GvR RPC. Output from execution of user code is directed to the Shell. Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -r1.23 -r1.24 *** EditorWindow.py 22 Apr 2002 00:38:26 -0000 1.23 --- EditorWindow.py 12 Jun 2002 03:28:57 -0000 1.24 *************** *** 1,8 **** - # changes by dscherer@cmu.edu - # - created format and run menus - # - added silly advice dialog (apologies to Douglas Adams) - # - made Python Documentation work on Windows (requires win32api to - # do a ShellExecute(); other ways of starting a web browser are awkward) - import sys import os --- 1,2 ---- Index: OutputWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/OutputWindow.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** OutputWindow.py 23 Feb 2002 23:27:08 -0000 1.3 --- OutputWindow.py 12 Jun 2002 03:28:57 -0000 1.4 *************** *** 1,12 **** - # changes by dscherer@cmu.edu - # - OutputWindow and OnDemandOutputWindow have been hastily - # extended to provide readline() support, an "iomark" separate - # from the "insert" cursor, and scrolling to clear the window. - # These changes are used by the ExecBinding module to provide - # standard input and output for user programs. Many of the new - # features are very similar to features of PyShell, which is a - # subclass of OutputWindow. Someone should make some sense of - # this. - from Tkinter import * from EditorWindow import EditorWindow --- 1,2 ---- *************** *** 14,63 **** import tkMessageBox ! from UndoDelegator import UndoDelegator ! class OutputUndoDelegator(UndoDelegator): ! reading = 0 ! # Forbid insert/delete before the I/O mark, in the blank lines after ! # the output, or *anywhere* if we are not presently doing user input ! def insert(self, index, chars, tags=None): ! try: ! if (self.delegate.compare(index, "<", "iomark") or ! self.delegate.compare(index, ">", "endmark") or ! (index!="iomark" and not self.reading)): ! self.delegate.bell() ! return ! except TclError: ! pass ! UndoDelegator.insert(self, index, chars, tags) ! def delete(self, index1, index2=None): ! try: ! if (self.delegate.compare(index1, "<", "iomark") or ! self.delegate.compare(index1, ">", "endmark") or ! (index2 and self.delegate.compare(index2, ">=", "endmark")) or ! not self.reading): ! self.delegate.bell() ! return ! except TclError: ! pass ! UndoDelegator.delete(self, index1, index2) ! class OutputWindow(EditorWindow): ! """An editor window that can serve as an input and output file. ! The input support has been rather hastily hacked in, and should ! not be trusted. """ ! UndoDelegator = OutputUndoDelegator ! source_window = None ! ! def __init__(self, *args, **keywords): ! if keywords.has_key('source_window'): ! self.source_window = keywords['source_window'] apply(EditorWindow.__init__, (self,) + args) self.text.bind("<>", self.goto_file_line) - self.text.bind("<>", self.enter_callback) - self.text.mark_set("iomark","1.0") - self.text.mark_gravity("iomark", LEFT) - self.text.mark_set("endmark","1.0") # Customize EditorWindow --- 4,18 ---- import tkMessageBox ! class OutputWindow(EditorWindow): ! """An editor window that can serve as an output file. ! Also the future base class for the Python shell window. ! This class has no input facilities. """ ! def __init__(self, *args): apply(EditorWindow.__init__, (self,) + args) self.text.bind("<>", self.goto_file_line) # Customize EditorWindow *************** *** 70,76 **** return "Output" - def long_title(self): - return "" - def maybesave(self): # Override base class method -- don't ask any questions --- 25,28 ---- *************** *** 80,140 **** return "no" - # Act as input file - incomplete - - def set_line_and_column(self, event=None): - index = self.text.index(INSERT) - if (self.text.compare(index, ">", "endmark")): - self.text.mark_set("insert", "endmark") - self.text.see("insert") - EditorWindow.set_line_and_column(self) - - reading = 0 - canceled = 0 - endoffile = 0 - - def readline(self): - save = self.reading - try: - self.reading = self.undo.reading = 1 - self.text.mark_set("insert", "iomark") - self.text.see("insert") - self.top.mainloop() - finally: - self.reading = self.undo.reading = save - line = self.text.get("input", "iomark") - if self.canceled: - self.canceled = 0 - raise KeyboardInterrupt - if self.endoffile: - self.endoffile = 0 - return "" - return line or '\n' - - def close(self): - self.interrupt() - return EditorWindow.close(self) - - def interrupt(self): - if self.reading: - self.endoffile = 1 - self.top.quit() - - def enter_callback(self, event): - if self.reading and self.text.compare("insert", ">=", "iomark"): - self.text.mark_set("input", "iomark") - self.text.mark_set("iomark", "insert") - self.write('\n',"iomark") - self.text.tag_add("stdin", "input", "iomark") - self.text.update_idletasks() - self.top.quit() # Break out of recursive mainloop() in raw_input() - - return "break" - # Act as output file ! def write(self, s, tags=(), mark="iomark"): ! self.text.mark_gravity(mark, RIGHT) ! self.text.insert(mark, s, tags) ! self.text.mark_gravity(mark, LEFT) self.text.see(mark) self.text.update() --- 32,39 ---- return "no" # Act as output file ! def write(self, s, tags=(), mark="insert"): ! self.text.insert(mark, str(s), tags) self.text.see(mark) self.text.update() *************** *** 184,195 **** return filename, lineno = result ! edit = self.untitled(filename) or self.flist.open(filename) edit.gotoline(lineno) - edit.wakeup() - - def untitled(self, filename): - if filename!='Untitled' or not self.source_window or self.source_window.io.filename: - return None - return self.source_window def _file_line_helper(self, line): --- 83,88 ---- return filename, lineno = result ! edit = self.flist.open(filename) edit.gotoline(lineno) def _file_line_helper(self, line): *************** *** 201,210 **** return None filename, lineno = m.group(1, 2) ! if not self.untitled(filename): ! try: ! f = open(filename, "r") ! f.close() ! except IOError: ! return None try: return filename, int(lineno) --- 94,102 ---- return None filename, lineno = m.group(1, 2) ! try: ! f = open(filename, "r") ! f.close() ! except IOError: ! return None try: return filename, int(lineno) *************** *** 212,279 **** return None ! # This classes now used by ExecBinding.py: class OnDemandOutputWindow: - source_window = None tagdefs = { # XXX Should use IdlePrefs.ColorPrefs - "stdin": {"foreground": "black"}, "stdout": {"foreground": "blue"}, ! "stderr": {"foreground": "red"}, ! } ! def __init__(self, flist): self.flist = flist self.owin = None - self.title = "Output" - self.close_hook = None - self.old_close = None - - def owclose(self): - if self.close_hook: - self.close_hook() - if self.old_close: - self.old_close() - - def set_title(self, title): - self.title = title - if self.owin and self.owin.text: - self.owin.saved_change_hook() ! def write(self, s, tags=(), mark="iomark"): ! if not self.owin or not self.owin.text: self.setup() self.owin.write(s, tags, mark) - def readline(self): - if not self.owin or not self.owin.text: - self.setup() - return self.owin.readline() - - def scroll_clear(self): - if self.owin and self.owin.text: - lineno = self.owin.getlineno("endmark") - self.owin.text.mark_set("insert","endmark") - self.owin.text.yview(float(lineno)) - self.owin.wakeup() - def setup(self): ! self.owin = owin = OutputWindow(self.flist, source_window = self.source_window) ! owin.short_title = lambda self=self: self.title text = owin.text - - self.old_close = owin.close_hook - owin.close_hook = self.owclose - - # xxx Bad hack: 50 blank lines at the bottom so that - # we can scroll the top of the window to the output - # cursor in scroll_clear(). There must be a better way... - owin.text.mark_gravity('endmark', LEFT) - owin.text.insert('iomark', '\n'*50) - owin.text.mark_gravity('endmark', RIGHT) - for tag, cnf in self.tagdefs.items(): if cnf: apply(text.tag_configure, (tag,), cnf) text.tag_raise('sel') --- 104,155 ---- return None ! # These classes are currently not used but might come in handy class OnDemandOutputWindow: tagdefs = { # XXX Should use IdlePrefs.ColorPrefs "stdout": {"foreground": "blue"}, ! "stderr": {"foreground": "#007700"}, ! } ! def __init__(self, flist): self.flist = flist self.owin = None ! def write(self, s, tags, mark): ! if not self.owin: self.setup() self.owin.write(s, tags, mark) def setup(self): ! self.owin = owin = OutputWindow(self.flist) text = owin.text for tag, cnf in self.tagdefs.items(): if cnf: apply(text.tag_configure, (tag,), cnf) text.tag_raise('sel') + self.write = self.owin.write + + #class PseudoFile: + # + # def __init__(self, owin, tags, mark="end"): + # self.owin = owin + # self.tags = tags + # self.mark = mark + + # def write(self, s): + # self.owin.write(s, self.tags, self.mark) + + # def writelines(self, l): + # map(self.write, l) + + # def flush(self): + # pass + + + + + + + Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -r1.14 -r1.15 *** PyShell.py 26 May 2002 13:36:41 -0000 1.14 --- PyShell.py 12 Jun 2002 03:28:57 -0000 1.15 *************** *** 1,33 **** #! /usr/bin/env python - # changes by dscherer@cmu.edu - - # The main() function has been replaced by a whole class, in order to - # address the constraint that only one process can sit on the port - # hard-coded into the loader. - - # It attempts to load the RPC protocol server and publish itself. If - # that fails, it assumes that some other copy of IDLE is already running - # on the port and attempts to contact it. It then uses the RPC mechanism - # to ask that copy to do whatever it was instructed (via the command - # line) to do. (Think netscape -remote). The handling of command line - # arguments for remotes is still very incomplete. - - # Default behavior (no command line options) is to open an editor window - # instead of starting the Python Shell. However, if called as - # Pyshell.main(0), the Shell will be started instead of the editor window. - - # In the default editor mode, if files are specified, they are opened. - - # If any command line options are specified, a shell does appear, and if - # the -e option is used, both a shell and an editor window open. - import os - import spawn import sys import string import getopt import re - import protocol import socket import time --- 1,9 ---- *************** *** 45,49 **** from ColorDelegator import ColorDelegator from UndoDelegator import UndoDelegator ! from OutputWindow import OutputWindow, OnDemandOutputWindow from configHandler import idleConf import idlever --- 21,25 ---- from ColorDelegator import ColorDelegator from UndoDelegator import UndoDelegator ! from OutputWindow import OutputWindow from configHandler import idleConf import idlever *************** *** 51,55 **** import rpc ! use_subprocess = 0 # Set to 1 to spawn subprocess for command execution # Change warnings module to write to sys.__stderr__ --- 27,32 ---- import rpc ! # 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__ *************** *** 205,211 **** self.save_warnings_filters = None - global flist - self.output = OnDemandOutputWindow(flist) - rpcclt = None rpcpid = None --- 182,185 ---- *************** *** 227,238 **** print >>sys.__stderr__, "Socket error:", err, "; retry..." else: ! # XXX Make this a dialog? print >>sys.__stderr__, "Can't spawn subprocess!" return ! self.output.stdout=PseudoFile(self.output, "stdout") ! self.output.stderr=PseudoFile(self.output, "stderr") ! self.rpcclt.register("stdin", self.output) ! self.rpcclt.register("stdout", self.output.stdout) ! self.rpcclt.register("stderr", self.output.stderr) self.rpcclt.register("flist", self.tkconsole.flist) self.poll_subprocess() --- 201,212 ---- print >>sys.__stderr__, "Socket error:", err, "; retry..." else: ! # XXX Make this a dialog? #GvR print >>sys.__stderr__, "Can't spawn subprocess!" + # XXX Add Stephen's error msg, resolve the two later... KBK 09Jun02 + display_port_binding_error() return ! self.rpcclt.register("stdin", self.tkconsole) ! self.rpcclt.register("stdout", self.tkconsole.stdout) ! self.rpcclt.register("stderr", self.tkconsole.stderr) self.rpcclt.register("flist", self.tkconsole.flist) self.poll_subprocess() *************** *** 630,634 **** def begin(self): self.resetoutput() ! self.write("Python %s on %s\n%s\nIDLE Fork %s -- press F1 for help\n" % (sys.version, sys.platform, self.COPYRIGHT, idlever.IDLE_VERSION)) --- 604,608 ---- 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)) *************** *** 796,801 **** line = line[:i] more = self.interp.runsource(line) ! if not more: ! self.showprompt() def cancel_check(self, frame, what, args, --- 770,776 ---- line = line[:i] more = self.interp.runsource(line) ! # XXX This was causing extra prompt with shell KBK ! # if not more: ! # self.showprompt() def cancel_check(self, frame, what, args, *************** *** 877,880 **** --- 852,856 ---- return 1 + usage_msg = """\ usage: idle.py [-c command] [-d] [-i] [-r script] [-s] [-t title] [arg] ... *************** *** 887,891 **** -i open an interactive shell -i file(s) open a shell and also an editor window for each file ! -r script use experimental remote (subprocess) execution feature -s run $IDLESTARTUP or $PYTHONSTARTUP before anything else -t title set title of shell window --- 863,867 ---- -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 *************** *** 894,1078 **** """ ! class usageError: ! def __init__(self, string): self.string = string ! def __repr__(self): return self.string ! ! class main: ! def __init__(self, noshell=1): ! ! global flist, root ! root = Tk(className="Idle") ! fixwordbreaks(root) ! root.withdraw() ! flist = PyShellFileList(root) ! ! # the following causes lockups and silent failures when debugging ! # changes to EditorWindow.__init__ ; the console works fine for idle ! # debugging in any case, so disable this unnescesary stuff. ! #dbg=OnDemandOutputWindow(flist) ! #dbg.set_title('IDLE Debugging Messages') ! #sys.stdout = PseudoFile(dbg,['stdout']) ! #sys.stderr = PseudoFile(dbg,['stderr']) ! ! try: ! self.server = protocol.Server(connection_hook = self.address_ok) ! protocol.publish( 'IDLE', self.connect ) ! self.main(sys.argv[1:], noshell) ! return ! except protocol.connectionLost: ! try: ! client = protocol.Client() ! IDLE = client.getobject('IDLE') ! if IDLE: ! try: ! IDLE.remote( sys.argv[1:] ) ! except usageError, msg: ! sys.stderr.write("Error: %s\n" % str(msg)) ! sys.stderr.write(usage_msg) ! return ! except protocol.connectionLost: ! pass ! ! #maybe the following should be handled by a tkmessagebox for ! #users who don't start idle from a console?? ! print """\ ! IDLE cannot run. ! ! IDLE needs to use a specific TCP/IP port (7454) 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. Another copy of IDLE stopped responding but is still bound to the port ! 4. 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. It's use of port 7454 should not ! be a security risk on a single-user machine. ! """ ! dbg.owin.gotoline(1) ! dbg.owin.remove_selection() ! root.mainloop() # wait for user to read message ! ! def idle(self): ! spawn.kill_zombies() ! self.server.rpc_loop() ! root.after(25, self.idle) ! ! # We permit connections from localhost only ! def address_ok(self, addr): ! return addr[0] == '127.0.0.1' ! ! def connect(self, client, addr): ! return self ! ! def remote( self, argv ): ! # xxx Should make this behavior match the behavior in main, or redo ! # command line options entirely. ! try: ! opts, args = getopt.getopt(argv, "c:deist:") ! except getopt.error, msg: ! raise usageError(msg) for filename in args: flist.open(filename) if not args: flist.new() ! def main(self, argv, noshell): ! cmd = None ! edit = 0 ! debug = 0 ! interactive = 0 ! script = None ! startup = 0 ! global use_subprocess ! ! 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: ! noshell = 0 # There are options, bring up a shell ! if o == '-c': ! cmd = a ! if o == '-d': ! debug = 1 ! if o == '-e': ! edit = 1 ! if o == '-i': ! interactive = 1 ! if o == '-r': ! edit = 1 ! script = a ! use_subprocess = 1 ! if o == '-s': ! startup = 1 ! if o == '-t': ! PyShell.shell_title = a ! ! if noshell: edit=1 ! if interactive and 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) ! ! 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 [""] ! if noshell: ! flist.pyshell = None ! else: ! 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() ! ! self.idle() ! root.mainloop() ! root.destroy() if __name__ == "__main__": --- 870,975 ---- """ ! 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(): ! print """\ ! 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. + """ if __name__ == "__main__": Index: ScriptBinding.py =================================================================== RCS file: /cvsroot/idlefork/idle/ScriptBinding.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** ScriptBinding.py 26 May 2002 13:36:40 -0000 1.5 --- ScriptBinding.py 12 Jun 2002 03:28:57 -0000 1.6 *************** *** 1,16 **** """Extension to execute code outside the Python shell window. ! This adds the following commands (to the Edit menu, until there's a ! separate Python menu): ! - Check module (Alt-F5) does a full syntax check of the current module. It also runs the tabnanny to catch any inconsistent tabs. ! - Import module (F5) is equivalent to either import or reload of the current module. The window must have been saved previously. The module is added to sys.modules, and is also added to the __main__ namespace. Output goes to the shell window. ! - Run module (Control-F5) does the same but executes the module's code in the __main__ namespace. --- 1,15 ---- """Extension to execute code outside the Python shell window. ! This adds the following commands: ! - Check module does a full syntax check of the current module. It also runs the tabnanny to catch any inconsistent tabs. ! - Import module is equivalent to either import or reload of the current module. The window must have been saved previously. The module is added to sys.modules, and is also added to the __main__ namespace. Output goes to the shell window. ! - Run module does the same but executes the module's code in the __main__ namespace. *************** *** 42,51 **** by Untabify Region (both in the Edit menu).""" class ScriptBinding: menudefs = [ ! ('edit', [None, ! ('Check module', '<>'), ! ('Import module', '<>'), ('Run script', '<>'), ] --- 41,52 ---- by Untabify Region (both in the Edit menu).""" + + # XXX TBD Implement stop-execution KBK 11Jun02 class ScriptBinding: menudefs = [ ! ('run', [None, ! # ('Check module', '<>'), ! # ('Import module', '<>'), ('Run script', '<>'), ] Index: config-extensions.def =================================================================== RCS file: /cvsroot/idlefork/idle/config-extensions.def,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** config-extensions.def 11 Feb 2002 03:45:22 -0000 1.5 --- config-extensions.def 12 Jun 2002 03:28:57 -0000 1.6 *************** *** 43,57 **** zoom-height= ! [ExecBinding] ! enable=1 ! [ExecBinding_cfgBindings] ! run-complete-script= ! stop-execution= ! #[ScriptBinding] #currently ExecBinding has replaced ScriptBinding ! #enable=0 ! #[ScriptBinding_cfgBindings] ! #run-script= ! #check-module= #import-module= --- 43,57 ---- zoom-height= ! #[ExecBinding] # Revert to ScriptBinding ! #enable=1 ! #[ExecBinding_cfgBindings] ! #run-complete-script= ! #stop-execution= ! [ScriptBinding] ! enable=1 ! [ScriptBinding_cfgBindings] ! run-script= ! #check-module= #import-module= Index: config.txt =================================================================== RCS file: /cvsroot/idlefork/idle/config.txt,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** config.txt 3 Jan 2002 12:00:34 -0000 1.4 --- config.txt 12 Jun 2002 03:28:57 -0000 1.5 *************** *** 52,58 **** #[ZoomHeight] ! #[ScriptBinding] # disabled in favor of ExecBinding ! ! [ExecBinding] [CallTips] --- 52,56 ---- #[ZoomHeight] ! [ScriptBinding] [CallTips] --- ExecBinding.py DELETED --- --- Remote.py DELETED --- --- loader.py DELETED --- --- protocol.py DELETED --- --- spawn.py DELETED --- From elguavas@users.sourceforge.net Wed Jun 12 05:54:12 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 12 Jun 2002 14:54:12 +1000 Subject: [Idle-dev] RPC Investigations In-Reply-To: References: Message-ID: <1023857653.13176.25.camel@oberon> Kurt B. Kaiser wrote: > I spent some time comparing the four versions of Idle. [...] > The stack viewer is working now. Next, get the remote debugger > working. Great work Kurt. You seem to have ended up with a result similar to a possible 'restart' for idlefork that I discussed with Guido a few months ago. At that time I suggested to him that if I'd taken the time to familiarise myself enough with the codebase when first starting 'son of idlefork', I believe I would have decided it was better to rule a line after release 0.8.1, move it onto a branch or into the attic, and merge the changes and bugfixes I'd made at that stage, along with a cut of the GvR rpc stuff, into a fresh checkin of the current python idle at that time. Although GvR okayed going ahead with that idea, and in fact I mentioned to Chui when he first volunteered some time for the rpc stuff that we would likely be doing things that way, it turned out work circumstances stole a lot of the free time I'd had available, and I decided against making such sweeping reforms pretty much on my own when I wouldn't be sure to have the time to follow through with repairing the inevitable breakages etc.. So, anyway, to cut to the chase, I think some more heavy duty refactoring along the lines you've taken is precisely the way we should go and I'm really pleased to see it happening. Stephen. -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From kbk@users.sourceforge.net Sun Jun 16 04:32:26 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Sat, 15 Jun 2002 20:32:26 -0700 Subject: [Idle-dev] CVS: idle Debugger.py,1.5,1.6 OldStackViewer.py,1.2,1.3 PyShell.py,1.15,1.16 RemoteDebugger.py,1.1,1.2 rpc.py,1.1,1.2 run.py,1.1,1.2 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv15129 Modified Files: Debugger.py OldStackViewer.py PyShell.py RemoteDebugger.py rpc.py run.py Log Message: Polish RemoteDebugger code. Use a repr() on the subprocess side when fetching dict values for stack. The various dict entities are not needed by the debugger GUI, only their representation. Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** Debugger.py 26 May 2002 13:36:40 -0000 1.5 --- Debugger.py 16 Jun 2002 03:32:23 -0000 1.6 *************** *** 53,57 **** class Debugger: ! interacting = 0 vstack = vsource = vlocals = vglobals = None --- 53,57 ---- class Debugger: ! # interacting = 0 # XXX KBK 14Jun02 move to __init__ vstack = vsource = vlocals = vglobals = None *************** *** 61,66 **** self.pyshell = pyshell self.idb = idb self.make_gui() ! def run(self, *args): try: --- 61,68 ---- self.pyshell = pyshell self.idb = idb + self.frame = None self.make_gui() ! self.interacting = 0 ! def run(self, *args): try: *************** *** 156,160 **** self.show_globals() ! frame = None def interaction(self, message, frame, info=None): --- 158,162 ---- self.show_globals() ! # frame = None # XXX KBK 14Jun02 Move to __init__ def interaction(self, message, frame, info=None): *************** *** 301,308 **** if lv and gv and ldict is gdict: ldict = None if lv: ! lv.load_dict(ldict, force) if gv: ! gv.load_dict(gdict, force) def set_breakpoint_here(self, edit): --- 303,311 ---- if lv and gv and ldict is gdict: ldict = None + # Calls OldStackviewer.NamespaceViewer.load_dict(): if lv: ! lv.load_dict(ldict, force, self.pyshell.interp.rpcclt) if gv: ! gv.load_dict(gdict, force, self.pyshell.interp.rpcclt) def set_breakpoint_here(self, edit): *************** *** 313,317 **** return lineno = int(float(text.index("insert"))) ! msg = self.set_break(filename, lineno) if msg: text.bell() --- 316,320 ---- return lineno = int(float(text.index("insert"))) ! msg = self.idb.set_break(filename, lineno) if msg: text.bell() Index: OldStackViewer.py =================================================================== RCS file: /cvsroot/idlefork/idle/OldStackViewer.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** OldStackViewer.py 4 Jul 2001 03:15:10 -0000 1.2 --- OldStackViewer.py 16 Jun 2002 03:32:23 -0000 1.3 *************** *** 233,237 **** dict = -1 ! def load_dict(self, dict, force=0): if dict is self.dict and not force: return --- 233,237 ---- dict = -1 ! def load_dict(self, dict, force=0, rpc_client=None): if dict is self.dict and not force: return *************** *** 251,254 **** --- 251,258 ---- value = dict[name] svalue = self.repr.repr(value) # repr(value) + # Strip extra quotes caused by calling repr on the (already) + # repr'd value sent across the RPC interface: + if rpc_client: + svalue = svalue[1:-1] l = Label(subframe, text=name) l.grid(row=row, column=0, sticky="nw") Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -r1.15 -r1.16 *** PyShell.py 12 Jun 2002 03:28:57 -0000 1.15 --- PyShell.py 16 Jun 2002 03:32:24 -0000 1.16 *************** *** 530,533 **** --- 530,536 ---- def open_debugger(self): + # XXX KBK 13Jun02 An RPC client always exists now? Open remote + # debugger and return...dike the rest of this fcn and combine + # with open_remote_debugger? if self.interp.rpcclt: return self.open_remote_debugger() Index: RemoteDebugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/RemoteDebugger.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** RemoteDebugger.py 26 May 2002 13:36:40 -0000 1.1 --- RemoteDebugger.py 16 Jun 2002 03:32:24 -0000 1.2 *************** *** 25,28 **** --- 25,30 ---- import Debugger + debugging = 0 + # In the PYTHON subprocess *************** *** 44,50 **** class GUIProxy: ! def __init__(self, conn, oid): self.conn = conn ! self.oid = oid def interaction(self, message, frame, info=None): --- 46,52 ---- class GUIProxy: ! def __init__(self, conn, gui_adap_oid): self.conn = conn ! self.oid = gui_adap_oid def interaction(self, message, frame, info=None): *************** *** 129,150 **** dict = dicttable[did] value = dict[key] ! try: ! # Test for picklability ! import cPickle ! cPickle.dumps(value) ! except: ! value = None return value ! def start_debugger(conn, gui_oid): ! # ! # launched in the python subprocess ! # ! gui = GUIProxy(conn, gui_oid) ! idb = Debugger.Idb(gui) ! ada = IdbAdapter(idb) ! ada_oid = "idb_adapter" ! conn.register(ada_oid, ada) ! return ada_oid # In the IDLE process --- 131,153 ---- dict = dicttable[did] value = dict[key] ! value = repr(value) ! # try: ! # # Test for picklability ! # import cPickle ! # pklstr = cPickle.dumps(value) ! # except: ! # print >>sys.__stderr__, "** dict_item pickle failed: ", value ! # raise ! # #value = None return value ! def start_debugger(conn, gui_adap_oid): ! "Launch debugger in the remote python subprocess" ! gui_proxy = GUIProxy(conn, gui_adap_oid) ! idb = Debugger.Idb(gui_proxy) ! idb_adap = IdbAdapter(idb) ! idb_adap_oid = "idb_adapter" ! conn.register(idb_adap_oid, idb_adap) ! return idb_adap_oid # In the IDLE process *************** *** 224,228 **** raise AttributeError, name ! class GUIAdaper: def __init__(self, conn, gui): --- 227,231 ---- raise AttributeError, name ! class GUIAdapter: def __init__(self, conn, gui): *************** *** 231,235 **** def interaction(self, message, fid, iid): ! print "interaction(%s, %s, %s)" % (`message`, `fid`, `iid`) frame = FrameProxy(self.conn, fid) info = None # XXX for now --- 234,238 ---- def interaction(self, message, fid, iid): ! ##print "interaction: (%s, %s, %s)" % (`message`,`fid`, `iid`) frame = FrameProxy(self.conn, fid) info = None # XXX for now *************** *** 273,287 **** def start_remote_debugger(conn, pyshell): ! # ! # instruct the (remote) subprocess to create ! # a debugger instance, and lets it know that ! # the local GUIAdapter called "gui_adapter" ! # is waiting notification of debugging events ! # ! ada_oid = "gui_adapter" ! idb_oid = conn.remotecall("exec", "start_debugger", (ada_oid,), {}) ! idb = IdbProxy(conn, idb_oid) ! gui = Debugger.Debugger(pyshell, idb) ! ada = GUIAdaper(conn, gui) ! conn.register(ada_oid, ada) return gui --- 276,297 ---- def start_remote_debugger(conn, pyshell): ! """Start the subprocess debugger, initialize the debugger GUI and RPC link ! ! Start the debugger in the remote Python process. Instantiate IdbProxy, ! Debugger GUI, and Debugger GUIAdapter objects, and link them together. ! ! The GUIAdapter will handle debugger GUI interaction requests coming from ! the subprocess debugger via the GUIProxy. ! ! The IdbAdapter will pass execution and environment requests coming from the ! Idle debugger GUI to the subprocess debugger via the IdbProxy. ! ! """ ! gui_adap_oid = "gui_adapter" ! idb_adap_oid = conn.remotecall("exec", "start_the_debugger",\ ! (gui_adap_oid,), {}) ! idb_proxy = IdbProxy(conn, idb_adap_oid) ! gui = Debugger.Debugger(pyshell, idb_proxy) ! gui_adap = GUIAdapter(conn, gui) ! conn.register(gui_adap_oid, gui_adap) return gui Index: rpc.py =================================================================== RCS file: /cvsroot/idlefork/idle/rpc.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** rpc.py 26 May 2002 13:36:40 -0000 1.1 --- rpc.py 16 Jun 2002 03:32:24 -0000 1.2 *************** *** 120,124 **** def localcall(self, request): ! ##self.debug("localcall:", request) try: how, (oid, methodname, args, kwargs) = request --- 120,124 ---- def localcall(self, request): ! self.debug("localcall:", request) try: how, (oid, methodname, args, kwargs) = request *************** *** 166,169 **** --- 166,170 ---- def remotecall(self, oid, methodname, args, kwargs): + self.debug("remotecall:", oid, methodname, args, kwargs) seq = self.asynccall(oid, methodname, args, kwargs) return self.asyncreturn(seq) *************** *** 198,205 **** else: raise getattr(__import__(mod), name)(*args) ! else: ! if mod: ! name = mod + "." + name ! raise name, args if how == "ERROR": raise RuntimeError, what --- 199,208 ---- else: raise getattr(__import__(mod), name)(*args) ! # XXX KBK 15Jun02 mod is False here, also want to raise remaining exceptions ! # else: ! # if mod: ! # name = mod + "." + name ! # raise name, args ! raise name, args if how == "ERROR": raise RuntimeError, what Index: run.py =================================================================== RCS file: /cvsroot/idlefork/idle/run.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** run.py 26 May 2002 13:36:40 -0000 1.1 --- run.py 16 Jun 2002 03:32:24 -0000 1.2 *************** *** 31,37 **** exec code in self.locals ! def start_debugger(self, gui_oid): import RemoteDebugger ! return RemoteDebugger.start_debugger(self.conn, gui_oid) def stackviewer(self, flist_oid=None): --- 31,37 ---- exec code in self.locals ! def start_the_debugger(self, gui_adap_oid): import RemoteDebugger ! return RemoteDebugger.start_debugger(self.conn, gui_adap_oid) def stackviewer(self, flist_oid=None): From noreply@sourceforge.net Wed Jun 19 02:50:05 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Tue, 18 Jun 2002 18:50:05 -0700 Subject: [Idle-dev] [ idlefork-Bugs-558687 ] Printing arrays misses elements Message-ID: Bugs item #558687, was opened at 2002-05-21 14:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Williams (mikewilliams) Assigned to: Nobody/Anonymous (nobody) Summary: Printing arrays misses elements Initial Comment: IDLEfork seems to be missing out an inconsistent number of the final few elements of a Numeric array when asked to print them. This has been replicated on both Linux and Solaris with Python2.2.1 and IDLEfork 0.8.1 Consider the following code snippet (problem exhibited both if run from module or typed at shell): from Numeric import * #Import Numeric (an array #library) xx = zeros(100, Float) #Create an empty array of #100 floats for i in range(100): xx[i] = i #Put numbers 0 to 99 in the #array print xx #Print the array (see the #problem?) print xx[99] #Although xx[99] does exist! This problem doesn't seem to occur much below 100 element arrays (although see, e.g. 87), but seems to get more severe above it. See, for example 102-108 (not 109 or 110), 150, 200, 1000 (which prints the first 947 elements!). I could not find a corellation between window width and the number of elements that were printed (which appears to be constant). Ther seems to be some reluctance to start a new line when printing until there are sufficient elements to put on it. This is a medium severity problem, especially for interactive work. ---------------------------------------------------------------------- Comment By: Bruce Sherwood (bsherwood) Date: 2002-06-19 01:50 Message: Logged In: YES user_id=34881 I'm using idlefork-0.8.1 for daily work. I cannot reproduce this problem; the test routine gives the correct output on RedHat Linux 7.2. This is with a version of Numeric from a few months ago. ---------------------------------------------------------------------- Comment By: Michael Williams (mikewilliams) Date: 2002-05-21 14:36 Message: Logged In: YES user_id=258804 This does not occur in the IDLE distributed with the Python source. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 From noreply@sourceforge.net Wed Jun 19 13:33:37 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Jun 2002 05:33:37 -0700 Subject: [Idle-dev] [ idlefork-Bugs-558687 ] Printing arrays misses elements Message-ID: Bugs item #558687, was opened at 2002-05-21 10:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Williams (mikewilliams) Assigned to: Nobody/Anonymous (nobody) Summary: Printing arrays misses elements Initial Comment: IDLEfork seems to be missing out an inconsistent number of the final few elements of a Numeric array when asked to print them. This has been replicated on both Linux and Solaris with Python2.2.1 and IDLEfork 0.8.1 Consider the following code snippet (problem exhibited both if run from module or typed at shell): from Numeric import * #Import Numeric (an array #library) xx = zeros(100, Float) #Create an empty array of #100 floats for i in range(100): xx[i] = i #Put numbers 0 to 99 in the #array print xx #Print the array (see the #problem?) print xx[99] #Although xx[99] does exist! This problem doesn't seem to occur much below 100 element arrays (although see, e.g. 87), but seems to get more severe above it. See, for example 102-108 (not 109 or 110), 150, 200, 1000 (which prints the first 947 elements!). I could not find a corellation between window width and the number of elements that were printed (which appears to be constant). Ther seems to be some reluctance to start a new line when printing until there are sufficient elements to put on it. This is a medium severity problem, especially for interactive work. ---------------------------------------------------------------------- >Comment By: Guido van Rossum (gvanrossum) Date: 2002-06-19 08:33 Message: Logged In: YES user_id=6380 Without looking at any code, I venture that this is more likely a bug in Numeric rather than in idle(fork). If you don't see this when using the regular python interpreter, that could be because in IDLE, str() is used to print numeric objects, while in the regular interpreter an internal print handler may be used. To verify that theory, you could use "print str(xx)" in a regular interpreter. If that has the same problem, please submit the bug report to the Numeric folks (and report back here in either case). ---------------------------------------------------------------------- Comment By: Bruce Sherwood (bsherwood) Date: 2002-06-18 21:50 Message: Logged In: YES user_id=34881 I'm using idlefork-0.8.1 for daily work. I cannot reproduce this problem; the test routine gives the correct output on RedHat Linux 7.2. This is with a version of Numeric from a few months ago. ---------------------------------------------------------------------- Comment By: Michael Williams (mikewilliams) Date: 2002-05-21 10:36 Message: Logged In: YES user_id=258804 This does not occur in the IDLE distributed with the Python source. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 From kbk@users.sourceforge.net Thu Jun 20 05:01:50 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Wed, 19 Jun 2002 21:01:50 -0700 Subject: [Idle-dev] CVS: idle Debugger.py,1.6,1.7 PyShell.py,1.16,1.17 RemoteDebugger.py,1.2,1.3 config-highlight.def,1.5,1.6 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv13088 Modified Files: Debugger.py PyShell.py RemoteDebugger.py config-highlight.def Log Message: 1. Debugger Breakpoints, finish implementation 2. Debugger Clear Breakpoints, implement 3. Nice yellow breakpoints for Chui :) Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -r1.6 -r1.7 *** Debugger.py 16 Jun 2002 03:32:23 -0000 1.6 --- Debugger.py 20 Jun 2002 04:01:47 -0000 1.7 *************** *** 53,57 **** class Debugger: - # interacting = 0 # XXX KBK 14Jun02 move to __init__ vstack = vsource = vlocals = vglobals = None --- 53,56 ---- *************** *** 158,162 **** self.show_globals() - # frame = None # XXX KBK 14Jun02 Move to __init__ def interaction(self, message, frame, info=None): --- 157,160 ---- *************** *** 322,336 **** text.tag_add("BREAK", "insert linestart", "insert lineend +1char") ! # A literal copy of Bdb.set_break() without the print statement at the end ! #def set_break(self, filename, lineno, temporary=0, cond = None): ! # import linecache # Import as late as possible ! # filename = self.canonic(filename) ! # line = linecache.getline(filename, lineno) ! # if not line: ! # return 'That line does not exist!' ! # if not self.breaks.has_key(filename): ! # self.breaks[filename] = [] ! # list = self.breaks[filename] ! # if not lineno in list: ! # list.append(lineno) ! # bp = bdb.Breakpoint(filename, lineno, temporary, cond) --- 320,336 ---- text.tag_add("BREAK", "insert linestart", "insert lineend +1char") ! def clear_breakpoint_here(self, edit): ! text = edit.text ! filename = edit.io.filename ! if not filename: ! text.bell() ! return ! lineno = int(float(text.index("insert"))) ! msg = self.idb.clear_break(filename, lineno) ! if msg: ! text.bell() ! return ! text.tag_remove("BREAK", "insert linestart",\ ! "insert lineend +1char") ! ! Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -r1.16 -r1.17 *** PyShell.py 16 Jun 2002 03:32:24 -0000 1.16 --- PyShell.py 20 Jun 2002 04:01:47 -0000 1.17 *************** *** 97,104 **** apply(EditorWindow.__init__, (self,) + args) self.text.bind("<>", self.set_breakpoint_here) self.text.bind("<>", self.flist.open_shell) rmenu_specs = [ ! ("Set breakpoint here", "<>"), ] --- 97,107 ---- apply(EditorWindow.__init__, (self,) + args) self.text.bind("<>", self.set_breakpoint_here) + self.text.bind("<>", + self.clear_breakpoint_here) self.text.bind("<>", self.flist.open_shell) rmenu_specs = [ ! ("Set Breakpoint", "<>"), ! ("Clear Breakpoint", "<>") ] *************** *** 109,112 **** --- 112,121 ---- self.flist.pyshell.interp.debugger.set_breakpoint_here(self) + def clear_breakpoint_here(self, event=None): + if not self.flist.pyshell or not self.flist.pyshell.interp.debugger: + self.text.bell() + return + self.flist.pyshell.interp.debugger.clear_breakpoint_here(self) + class PyShellFileList(FileList): Index: RemoteDebugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/RemoteDebugger.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** RemoteDebugger.py 16 Jun 2002 03:32:24 -0000 1.2 --- RemoteDebugger.py 20 Jun 2002 04:01:47 -0000 1.3 *************** *** 27,31 **** debugging = 0 ! # In the PYTHON subprocess frametable = {} --- 27,33 ---- debugging = 0 ! #======================================= ! # ! # In the PYTHON subprocess: frametable = {} *************** *** 60,63 **** --- 62,67 ---- self.idb = idb + #----------called by an IdbProxy---------- + def set_step(self): self.idb.set_step() *************** *** 91,94 **** --- 95,107 ---- self.idb.run(cmd, __main__.__dict__) + def set_break(self, filename, lineno): + msg = self.idb.set_break(filename, lineno) + return msg + + def clear_break(self, filename, lineno): + msg = self.idb.clear_break(filename, lineno) + + #----------called by a FrameProxy---------- + def frame_attr(self, fid, name): frame = frametable[fid] *************** *** 116,119 **** --- 129,134 ---- return cid + #----------called by a CodeProxy---------- + def code_name(self, cid): code = codetable[cid] *************** *** 124,127 **** --- 139,144 ---- return code.co_filename + #----------called by a DictProxy---------- + def dict_keys(self, did): dict = dicttable[did] *************** *** 142,147 **** return value def start_debugger(conn, gui_adap_oid): ! "Launch debugger in the remote python subprocess" gui_proxy = GUIProxy(conn, gui_adap_oid) idb = Debugger.Idb(gui_proxy) --- 159,174 ---- return value + #----------end class IdbAdapter---------- + + def start_debugger(conn, gui_adap_oid): ! """Start the debugger and its RPC link in the Python subprocess ! ! Start the subprocess side of the split debugger and set up that side of the ! RPC link by instantiating the GUIProxy, Idle debugger, and IdbAdapter ! objects and linking them together. Register the IdbAdapter to handle RPC ! requests from the split Debugger GUI via the IdbProxy. ! ! """ gui_proxy = GUIProxy(conn, gui_adap_oid) idb = Debugger.Idb(gui_proxy) *************** *** 151,155 **** return idb_adap_oid ! # In the IDLE process class FrameProxy: --- 178,186 ---- return idb_adap_oid ! ! #======================================= ! # ! # In the IDLE process: ! class FrameProxy: *************** *** 194,197 **** --- 225,229 ---- return dp + class CodeProxy: *************** *** 209,212 **** --- 241,245 ---- (self._cid,), {}) + class DictProxy: *************** *** 227,230 **** --- 260,264 ---- raise AttributeError, name + class GUIAdapter: *************** *** 239,242 **** --- 273,277 ---- self.gui.interaction(message, frame, info) + class IdbProxy: *************** *** 275,286 **** self.call("set_quit") def start_remote_debugger(conn, pyshell): """Start the subprocess debugger, initialize the debugger GUI and RPC link ! Start the debugger in the remote Python process. Instantiate IdbProxy, ! Debugger GUI, and Debugger GUIAdapter objects, and link them together. ! The GUIAdapter will handle debugger GUI interaction requests coming from ! the subprocess debugger via the GUIProxy. The IdbAdapter will pass execution and environment requests coming from the --- 310,329 ---- self.call("set_quit") + def set_break(self, filename, lineno): + msg = self.call("set_break", filename, lineno) + return msg + + def clear_break(self, filename, lineno): + msg = self.call("clear_break", filename, lineno) + def start_remote_debugger(conn, pyshell): """Start the subprocess debugger, initialize the debugger GUI and RPC link ! Request the RPCServer start the Python subprocess debugger and link. Set ! up the Idle side of the split debugger by instantiating the IdbProxy, ! Debugger GUI, and Debugger GUIAdapter objects and linking them together. ! Register the GUIAdapter to handle debugger GUI interaction requests coming ! from the subprocess debugger via the GUIProxy. The IdbAdapter will pass execution and environment requests coming from the Index: config-highlight.def =================================================================== RCS file: /cvsroot/idlefork/idle/config-highlight.def,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** config-highlight.def 11 Feb 2002 02:20:53 -0000 1.5 --- config-highlight.def 20 Jun 2002 04:01:47 -0000 1.6 *************** *** 15,20 **** hilite-foreground= #000000 hilite-background= gray ! break-foreground= #ff7777 ! break-background= #ffffff hit-foreground= #ffffff hit-background= #000000 --- 15,20 ---- hilite-foreground= #000000 hilite-background= gray ! break-foreground= black ! break-background= #ffff55 hit-foreground= #ffffff hit-background= #000000 *************** *** 44,49 **** hilite-foreground= #000000 hilite-background= gray ! break-foreground= #ff7777 ! break-background= #ffffff hit-foreground= #ffffff hit-background= #000000 --- 44,49 ---- hilite-foreground= #000000 hilite-background= gray ! break-foreground= black ! break-background= #ffff55 hit-foreground= #ffffff hit-background= #000000 From noreply@sourceforge.net Thu Jun 20 05:12:31 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Jun 2002 21:12:31 -0700 Subject: [Idle-dev] [ idlefork-Patches-571464 ] clearing breakpoints Message-ID: Patches item #571464, was opened at 2002-06-20 14:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=309579&aid=571464&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Stephen M. Gava (elguavas) Assigned to: Nobody/Anonymous (nobody) Summary: clearing breakpoints Initial Comment: This was submitted earlier this year to idle-dev by Edward K. Ream, but I forgot to copy it in here. Thanks to Edward for reminding me about it. ------------------ The following patch lets the user of IDLE clear breakpoints in exactly the same way that they are set, that is, by right-clicking a source line containing a breakpoint. (I've inserted backslashes so this doesn't get line-breaked to death.) 1. In PyShell.py, add the following two lines, indicated by # EKR: def __init__(self, *args): apply(EditorWindow.__init__, (self,) + args) self.text.bind("<>",\ self.set_breakpoint_here) self.text.bind("<>",\ self.clear_this_breakpoint) # EKR self.text.bind("<>", self.flist.open_shell) rmenu_specs = [ ("Set breakpoint here", "<>"), ("Clear this breakpoint", "<>"), # EKR ] 2. In PyShell.py, add the following method: def clear_this_breakpoint(self, event=None): if not self.flist.pyshell or \ not self.flist.pyshell.interp.debugger: self.text.bell() return self.flist.pyshell.interp.debugger.clear_this_breakpoint(self) 3. In Debugger.py, add the following method: def clear_this_breakpoint(self, edit): text = edit.text filename = edit.io.filename if not filename: text.bell() return lineno = int(float(text.index("insert"))) msg = self.clear_break(filename, lineno) if msg: text.bell() return text.tag_remove("BREAK", "insert linestart", \ "insert lineend+1char") ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=309579&aid=571464&group_id=9579 From elguavas@users.sourceforge.net Thu Jun 20 05:19:34 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 20 Jun 2002 14:19:34 +1000 Subject: [Idle-dev] CVS: idle Debugger.py,1.6,1.7 PyShell.py,1.16,1.17 RemoteDebugger.py,1.2,1.3 config-highlight.def,1.5,1.6 In-Reply-To: References: Message-ID: <1024546775.15197.21.camel@oberon> > Update of /cvsroot/idlefork/idle > In directory usw-pr-cvs1:/tmp/cvs-serv13088 > > Modified Files: > Debugger.py PyShell.py RemoteDebugger.py config-highlight.def > Log Message: > 1. Debugger Breakpoints, finish implementation > 2. Debugger Clear Breakpoints, implement > 3. Nice yellow breakpoints for Chui :) Heh, I just put a patch from Edward K. Ream for clearing breakpoints in the patch tracker, then when I checked my mail I noticed clearing breakpoints was part of this checkin you just made... 8^) maybe look at Edward's code and see if there is anything in there useful to your purposes on this. As usual you're miles ahead of me Kurt... ;^) -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From elguavas@users.sourceforge.net Thu Jun 20 05:21:19 2002 From: elguavas@users.sourceforge.net (Stephen M. Gava) Date: 20 Jun 2002 14:21:19 +1000 Subject: [Idle-dev] CVS: idle Debugger.py,1.6,1.7 PyShell.py,1.16,1.17 RemoteDebugger.py,1.2,1.3 config-highlight.def,1.5,1.6 In-Reply-To: References: Message-ID: <1024546879.15199.24.camel@oberon> > Update of /cvsroot/idlefork/idle > In directory usw-pr-cvs1:/tmp/cvs-serv13088 > > Modified Files: > Debugger.py PyShell.py RemoteDebugger.py config-highlight.def > Log Message: > 1. Debugger Breakpoints, finish implementation > 2. Debugger Clear Breakpoints, implement > 3. Nice yellow breakpoints for Chui :) Heh, I just put a patch from Edward K. Ream for clearing breakpoints in the patch tracker, then when I checked my mail I noticed clearing breakpoints was part of this checkin you just made... 8^) maybe look at Edward's code and see if there is anything in there useful to your purposes on this. As usual you're miles ahead of me Kurt... ;^) -- Stephen M. Gava IDLEfork ( http://idlefork.sourceforge.net ) " just like IDLE, only crunchy " From kbk@shore.net Thu Jun 20 05:45:11 2002 From: kbk@shore.net (Kurt B. Kaiser) Date: 20 Jun 2002 00:45:11 -0400 Subject: [Idle-dev] CVS: idle Debugger.py,1.6,1.7 PyShell.py,1.16,1.17 RemoteDebugger.py,1.2,1.3 config-highlight.def,1.5,1.6 In-Reply-To: <1024546879.15199.24.camel@oberon> References: <1024546879.15199.24.camel@oberon> Message-ID: "Stephen M. Gava" writes: > Heh, I just put a patch from Edward K. Ream for clearing breakpoints in > the patch tracker, then when I checked my mail I noticed clearing > breakpoints was part of this checkin you just made... 8^) maybe look at > Edward's code and see if there is anything in there useful to your > purposes on this. Yeah, looks very similar :) I'm setting/clearing in both the main process and the subprocess. I think you can go ahead and close Ed's patch as implemented. Hope he will check it out. Regards, KBK From noreply@sourceforge.net Thu Jun 20 05:53:54 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Wed, 19 Jun 2002 21:53:54 -0700 Subject: [Idle-dev] [ idlefork-Patches-571464 ] clearing breakpoints Message-ID: Patches item #571464, was opened at 2002-06-20 14:12 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=309579&aid=571464&group_id=9579 Category: None Group: None >Status: Closed >Resolution: Accepted Priority: 5 Submitted By: Stephen M. Gava (elguavas) Assigned to: Nobody/Anonymous (nobody) Summary: clearing breakpoints Initial Comment: This was submitted earlier this year to idle-dev by Edward K. Ream, but I forgot to copy it in here. Thanks to Edward for reminding me about it. ------------------ The following patch lets the user of IDLE clear breakpoints in exactly the same way that they are set, that is, by right-clicking a source line containing a breakpoint. (I've inserted backslashes so this doesn't get line-breaked to death.) 1. In PyShell.py, add the following two lines, indicated by # EKR: def __init__(self, *args): apply(EditorWindow.__init__, (self,) + args) self.text.bind("<>",\ self.set_breakpoint_here) self.text.bind("<>",\ self.clear_this_breakpoint) # EKR self.text.bind("<>", self.flist.open_shell) rmenu_specs = [ ("Set breakpoint here", "<>"), ("Clear this breakpoint", "<>"), # EKR ] 2. In PyShell.py, add the following method: def clear_this_breakpoint(self, event=None): if not self.flist.pyshell or \ not self.flist.pyshell.interp.debugger: self.text.bell() return self.flist.pyshell.interp.debugger.clear_this_breakpoint(self) 3. In Debugger.py, add the following method: def clear_this_breakpoint(self, edit): text = edit.text filename = edit.io.filename if not filename: text.bell() return lineno = int(float(text.index("insert"))) msg = self.clear_break(filename, lineno) if msg: text.bell() return text.tag_remove("BREAK", "insert linestart", \ "insert lineend+1char") ---------------------------------------------------------------------- >Comment By: Stephen M. Gava (elguavas) Date: 2002-06-20 14:53 Message: Logged In: YES user_id=75867 Pre-implemented for the new rpc structure via the psychic powers of Kurt Kaiser... how's that for service 8^) ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=309579&aid=571464&group_id=9579 From noreply@sourceforge.net Thu Jun 20 12:54:39 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Jun 2002 04:54:39 -0700 Subject: [Idle-dev] [ idlefork-Bugs-558687 ] Printing arrays misses elements Message-ID: Bugs item #558687, was opened at 2002-05-21 14:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Williams (mikewilliams) Assigned to: Nobody/Anonymous (nobody) Summary: Printing arrays misses elements Initial Comment: IDLEfork seems to be missing out an inconsistent number of the final few elements of a Numeric array when asked to print them. This has been replicated on both Linux and Solaris with Python2.2.1 and IDLEfork 0.8.1 Consider the following code snippet (problem exhibited both if run from module or typed at shell): from Numeric import * #Import Numeric (an array #library) xx = zeros(100, Float) #Create an empty array of #100 floats for i in range(100): xx[i] = i #Put numbers 0 to 99 in the #array print xx #Print the array (see the #problem?) print xx[99] #Although xx[99] does exist! This problem doesn't seem to occur much below 100 element arrays (although see, e.g. 87), but seems to get more severe above it. See, for example 102-108 (not 109 or 110), 150, 200, 1000 (which prints the first 947 elements!). I could not find a corellation between window width and the number of elements that were printed (which appears to be constant). Ther seems to be some reluctance to start a new line when printing until there are sufficient elements to put on it. This is a medium severity problem, especially for interactive work. ---------------------------------------------------------------------- >Comment By: Michael Williams (mikewilliams) Date: 2002-06-20 11:54 Message: Logged In: YES user_id=258804 OK. Tested again to convince myself I wasn't daydreaming and the problem is definitely there. Here's the output of a short IDLEfork session: >>> from Numeric import * >>> xx = zeros(100, Float) >>> for i in range(100): xx[i] = i >>> print xx [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98.] >>> xx array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40., 41., 42., 43., 44., 45., 46., 47., 48., 49., 50., 51., 52., 53., 54., 55., 56., 57., 58., 59., 60., 61., 62., 63., 64., 65., 66., 67., 68., 69., 70., 71., 72., 73., 74., 75., 76., 77., 78., 79., 80., 81., 82., 83., 84., 85., 86., 87., 88., 89., 90., 91., 92., 93., 94., 95., 96., 97., 98., 99.]) Sorry if line-wrapping hasn't worked! Anyway, the moral of the story is if you "print xx" the problem is exhibited but if you just "xx" it isn't. Does this suggest the likely origin of the problem? I checked with the regular Python intrerpreter (both through the old IDLE and from the command line) and this definitely isn't a problem there. Doing "print str(xx)" instead of "print xx" makes no difference; this enironment doesn't exhibit the problem. By the way, this is all with the latest Numeric which is version 21.0. Is this the same version you're using Bruce? If it would be useful I could try and replicate the problem with earlier Numerics. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-06-19 12:33 Message: Logged In: YES user_id=6380 Without looking at any code, I venture that this is more likely a bug in Numeric rather than in idle(fork). If you don't see this when using the regular python interpreter, that could be because in IDLE, str() is used to print numeric objects, while in the regular interpreter an internal print handler may be used. To verify that theory, you could use "print str(xx)" in a regular interpreter. If that has the same problem, please submit the bug report to the Numeric folks (and report back here in either case). ---------------------------------------------------------------------- Comment By: Bruce Sherwood (bsherwood) Date: 2002-06-19 01:50 Message: Logged In: YES user_id=34881 I'm using idlefork-0.8.1 for daily work. I cannot reproduce this problem; the test routine gives the correct output on RedHat Linux 7.2. This is with a version of Numeric from a few months ago. ---------------------------------------------------------------------- Comment By: Michael Williams (mikewilliams) Date: 2002-05-21 14:36 Message: Logged In: YES user_id=258804 This does not occur in the IDLE distributed with the Python source. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 From noreply@sourceforge.net Thu Jun 20 14:41:58 2002 From: noreply@sourceforge.net (noreply@sourceforge.net) Date: Thu, 20 Jun 2002 06:41:58 -0700 Subject: [Idle-dev] [ idlefork-Bugs-558687 ] Printing arrays misses elements Message-ID: Bugs item #558687, was opened at 2002-05-21 14:10 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Michael Williams (mikewilliams) Assigned to: Nobody/Anonymous (nobody) Summary: Printing arrays misses elements Initial Comment: IDLEfork seems to be missing out an inconsistent number of the final few elements of a Numeric array when asked to print them. This has been replicated on both Linux and Solaris with Python2.2.1 and IDLEfork 0.8.1 Consider the following code snippet (problem exhibited both if run from module or typed at shell): from Numeric import * #Import Numeric (an array #library) xx = zeros(100, Float) #Create an empty array of #100 floats for i in range(100): xx[i] = i #Put numbers 0 to 99 in the #array print xx #Print the array (see the #problem?) print xx[99] #Although xx[99] does exist! This problem doesn't seem to occur much below 100 element arrays (although see, e.g. 87), but seems to get more severe above it. See, for example 102-108 (not 109 or 110), 150, 200, 1000 (which prints the first 947 elements!). I could not find a corellation between window width and the number of elements that were printed (which appears to be constant). Ther seems to be some reluctance to start a new line when printing until there are sufficient elements to put on it. This is a medium severity problem, especially for interactive work. ---------------------------------------------------------------------- Comment By: Bruce Sherwood (bsherwood) Date: 2002-06-20 13:41 Message: Logged In: YES user_id=34881 With idlefork-0.8.1 on RedHat Linux 7.2 with Numeric 21.0, when I try running exactly the same test in the shell, I see no difference between "print xx" and "xx", and both are correct. No clue as to what might be different in your environment. ---------------------------------------------------------------------- Comment By: Michael Williams (mikewilliams) Date: 2002-06-20 11:54 Message: Logged In: YES user_id=258804 OK. Tested again to convince myself I wasn't daydreaming and the problem is definitely there. Here's the output of a short IDLEfork session: >>> from Numeric import * >>> xx = zeros(100, Float) >>> for i in range(100): xx[i] = i >>> print xx [ 0. 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51. 52. 53. 54. 55. 56. 57. 58. 59. 60. 61. 62. 63. 64. 65. 66. 67. 68. 69. 70. 71. 72. 73. 74. 75. 76. 77. 78. 79. 80. 81. 82. 83. 84. 85. 86. 87. 88. 89. 90. 91. 92. 93. 94. 95. 96. 97. 98.] >>> xx array([ 0., 1., 2., 3., 4., 5., 6., 7., 8., 9., 10., 11., 12., 13., 14., 15., 16., 17., 18., 19., 20., 21., 22., 23., 24., 25., 26., 27., 28., 29., 30., 31., 32., 33., 34., 35., 36., 37., 38., 39., 40., 41., 42., 43., 44., 45., 46., 47., 48., 49., 50., 51., 52., 53., 54., 55., 56., 57., 58., 59., 60., 61., 62., 63., 64., 65., 66., 67., 68., 69., 70., 71., 72., 73., 74., 75., 76., 77., 78., 79., 80., 81., 82., 83., 84., 85., 86., 87., 88., 89., 90., 91., 92., 93., 94., 95., 96., 97., 98., 99.]) Sorry if line-wrapping hasn't worked! Anyway, the moral of the story is if you "print xx" the problem is exhibited but if you just "xx" it isn't. Does this suggest the likely origin of the problem? I checked with the regular Python intrerpreter (both through the old IDLE and from the command line) and this definitely isn't a problem there. Doing "print str(xx)" instead of "print xx" makes no difference; this enironment doesn't exhibit the problem. By the way, this is all with the latest Numeric which is version 21.0. Is this the same version you're using Bruce? If it would be useful I could try and replicate the problem with earlier Numerics. ---------------------------------------------------------------------- Comment By: Guido van Rossum (gvanrossum) Date: 2002-06-19 12:33 Message: Logged In: YES user_id=6380 Without looking at any code, I venture that this is more likely a bug in Numeric rather than in idle(fork). If you don't see this when using the regular python interpreter, that could be because in IDLE, str() is used to print numeric objects, while in the regular interpreter an internal print handler may be used. To verify that theory, you could use "print str(xx)" in a regular interpreter. If that has the same problem, please submit the bug report to the Numeric folks (and report back here in either case). ---------------------------------------------------------------------- Comment By: Bruce Sherwood (bsherwood) Date: 2002-06-19 01:50 Message: Logged In: YES user_id=34881 I'm using idlefork-0.8.1 for daily work. I cannot reproduce this problem; the test routine gives the correct output on RedHat Linux 7.2. This is with a version of Numeric from a few months ago. ---------------------------------------------------------------------- Comment By: Michael Williams (mikewilliams) Date: 2002-05-21 14:36 Message: Logged In: YES user_id=258804 This does not occur in the IDLE distributed with the Python source. ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=109579&aid=558687&group_id=9579 From kbk@users.sourceforge.net Mon Jun 24 18:03:39 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 24 Jun 2002 10:03:39 -0700 Subject: [Idle-dev] CVS: idle Debugger.py,1.7,1.8 EditorWindow.py,1.24,1.25 PyShell.py,1.17,1.18 RemoteDebugger.py,1.3,1.4 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv4715 Modified Files: Debugger.py EditorWindow.py PyShell.py RemoteDebugger.py Log Message: Clear associated breakpoints when closing an edit window. M Debugger.py : Added clear_file_breaks() M EditorWindow.py : Clear breaks when closed, commments->docstrings, comment out some debugging print statements M PyShell.py : comments->docstrings ; clarify extending EditorWindow methods. M RemoteDebugger.py: Add clear_all_file_breaks() functionality, clarify some comments. Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -r1.7 -r1.8 *** Debugger.py 20 Jun 2002 04:01:47 -0000 1.7 --- Debugger.py 24 Jun 2002 17:03:35 -0000 1.8 *************** *** 321,336 **** def clear_breakpoint_here(self, edit): ! text = edit.text ! filename = edit.io.filename ! if not filename: ! text.bell() ! return ! lineno = int(float(text.index("insert"))) ! msg = self.idb.clear_break(filename, lineno) ! if msg: ! text.bell() ! return ! text.tag_remove("BREAK", "insert linestart",\ ! "insert lineend +1char") ! --- 321,346 ---- def clear_breakpoint_here(self, edit): ! text = edit.text ! filename = edit.io.filename ! if not filename: ! text.bell() ! return ! lineno = int(float(text.index("insert"))) ! msg = self.idb.clear_break(filename, lineno) ! if msg: ! text.bell() ! return ! text.tag_remove("BREAK", "insert linestart",\ ! "insert lineend +1char") + def clear_file_breaks(self, edit): + text = edit.text + filename = edit.io.filename + if not filename: + text.bell() + return + msg = self.idb.clear_all_file_breaks(filename) + if msg: + text.bell() + return + text.tag_delete("BREAK") Index: EditorWindow.py =================================================================== RCS file: /cvsroot/idlefork/idle/EditorWindow.py,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** EditorWindow.py 12 Jun 2002 03:28:57 -0000 1.24 --- EditorWindow.py 24 Jun 2002 17:03:37 -0000 1.25 *************** *** 491,496 **** def ResetColorizer(self): ! #this function is called from configDialog.py ! #to update the colour theme if it is changed if self.color: self.color = self.ColorDelegator() --- 491,496 ---- def ResetColorizer(self): ! "Update the colour theme if it is changed" ! # Called from configDialog.py if self.color: self.color = self.ColorDelegator() *************** *** 498,503 **** def ResetFont(self): ! #this function is called from configDialog.py ! #to update the text widgets' font if it is changed fontWeight='normal' if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'): --- 498,503 ---- def ResetFont(self): ! "Update the text widgets' font if it is changed" ! # Called from configDialog.py fontWeight='normal' if idleConf.GetOption('main','EditorWindow','font-bold',type='bool'): *************** *** 508,513 **** def ResetKeybindings(self): ! #this function is called from configDialog.py ! #to update the keybindings if they are changed self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs --- 508,513 ---- def ResetKeybindings(self): ! "Update the keybindings if they are changed" ! # Called from configDialog.py self.Bindings.default_keydefs=idleConf.GetCurrentKeySet() keydefs = self.Bindings.default_keydefs *************** *** 541,545 **** def ResetExtraHelpMenu(self): ! #load or update the Extra Help menu if required menuList=idleConf.GetAllExtraHelpSourcesList() helpMenu=self.menudict['help'] --- 541,545 ---- def ResetExtraHelpMenu(self): ! "Load or update the Extra Help menu if required" menuList=idleConf.GetAllExtraHelpSourcesList() helpMenu=self.menudict['help'] *************** *** 565,569 **** def UpdateRecentFilesList(self,newFile=None): ! #load or update the recent files list, and menu if required rfList=[] if os.path.exists(self.recentFilesPath): --- 565,569 ---- def UpdateRecentFilesList(self,newFile=None): ! "Load or update the recent files list, and menu if required" rfList=[] if os.path.exists(self.recentFilesPath): *************** *** 579,584 **** rfList.insert(0,newFile) rfList=self.__CleanRecentFiles(rfList) ! print self.top.instanceDict ! print self if rfList: for instance in self.top.instanceDict.keys(): --- 579,585 ---- rfList.insert(0,newFile) rfList=self.__CleanRecentFiles(rfList) ! #print self.flist.inversedict ! #print self.top.instanceDict ! #print self if rfList: for instance in self.top.instanceDict.keys(): *************** *** 696,703 **** def _close(self): ! print self.io.filename if self.io.filename: self.UpdateRecentFilesList(newFile=self.io.filename) ! WindowList.unregister_callback(self.postwindowsmenu) if self.close_hook: --- 697,706 ---- def _close(self): ! #print self.io.filename if self.io.filename: self.UpdateRecentFilesList(newFile=self.io.filename) ! shell = self.flist.pyshell ! if shell and shell.interp.debugger: ! shell.interp.debugger.clear_file_breaks(self) WindowList.unregister_callback(self.postwindowsmenu) if self.close_hook: *************** *** 757,761 **** if hasattr(ins, methodname): self.text.bind(vevent, getattr(ins, methodname)) - if hasattr(ins, "menudefs"): self.fill_menus(ins.menudefs, keydefs) --- 760,763 ---- *************** *** 772,777 **** def fill_menus(self, defs=None, keydefs=None): ! # Fill the menus. Menus that are absent or None in ! # self.menudict are ignored. if defs is None: defs = self.Bindings.menudefs --- 774,781 ---- def fill_menus(self, defs=None, keydefs=None): ! """Add appropriate entries to the menus and submenus ! ! Menus that are absent or None in self.menudict are ignored. ! """ if defs is None: defs = self.Bindings.menudefs Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -r1.17 -r1.18 *** PyShell.py 20 Jun 2002 04:01:47 -0000 1.17 --- PyShell.py 24 Jun 2002 17:03:37 -0000 1.18 *************** *** 120,125 **** class PyShellFileList(FileList): ! ! # File list when a shell is present EditorWindow = PyShellEditorWindow --- 120,124 ---- class PyShellFileList(FileList): ! "Extend base class: file list when a shell is present" EditorWindow = PyShellEditorWindow *************** *** 137,142 **** class ModifiedColorDelegator(ColorDelegator): ! ! # Colorizer for the shell window itself def __init__(self): --- 136,140 ---- class ModifiedColorDelegator(ColorDelegator): ! "Extend base class: colorizer for the shell window itself" def __init__(self): *************** *** 162,167 **** class ModifiedUndoDelegator(UndoDelegator): ! ! # Forbid insert/delete before the I/O mark def insert(self, index, chars, tags=None): --- 160,164 ---- class ModifiedUndoDelegator(UndoDelegator): ! "Extend base class: forbid insert/delete before the I/O mark" def insert(self, index, chars, tags=None): *************** *** 284,293 **** def execsource(self, source): ! # Like runsource() but assumes complete exec source filename = self.stuffsource(source) self.execfile(filename, source) def execfile(self, filename, source=None): ! # Execute an existing file if source is None: source = open(filename, "r").read() --- 281,290 ---- def execsource(self, source): ! "Like runsource() but assumes complete exec source" filename = self.stuffsource(source) self.execfile(filename, source) def execfile(self, filename, source=None): ! "Execute an existing file" if source is None: source = open(filename, "r").read() *************** *** 301,305 **** def runsource(self, source): ! # Extend base class to stuff the source in the line cache first filename = self.stuffsource(source) self.more = 0 --- 298,302 ---- def runsource(self, source): ! "Extend base class method: Stuff the source in the line cache first" filename = self.stuffsource(source) self.more = 0 *************** *** 314,318 **** def stuffsource(self, source): ! # Stuff source in the filename cache filename = "" % self.gid self.gid = self.gid + 1 --- 311,315 ---- def stuffsource(self, source): ! "Stuff source in the filename cache" filename = "" % self.gid self.gid = self.gid + 1 *************** *** 322,327 **** def showsyntaxerror(self, filename=None): ! # Extend base class to color the offending position ! # (instead of printing it and pointing at it with a caret) text = self.tkconsole.text stuff = self.unpackerror() --- 319,328 ---- def showsyntaxerror(self, filename=None): ! """Extend base class method: Add Colorizing ! ! Color the offending position instead of printing it and pointing at it ! with a caret. ! ! """ text = self.tkconsole.text stuff = self.unpackerror() *************** *** 358,362 **** def showtraceback(self): ! # Extend base class method to reset output properly self.tkconsole.resetoutput() self.checklinecache() --- 359,363 ---- def showtraceback(self): ! "Extend base class method to reset output properly" self.tkconsole.resetoutput() self.checklinecache() *************** *** 380,384 **** def runcommand(self, code): ! # This runs the code without invoking the debugger. # The code better not raise an exception! if self.tkconsole.executing: --- 381,385 ---- def runcommand(self, code): ! "Run the code without invoking the debugger" # The code better not raise an exception! if self.tkconsole.executing: *************** *** 396,400 **** def runcode(self, code): ! # Override base class method if self.tkconsole.executing: tkMessageBox.showerror( --- 397,401 ---- def runcode(self, code): ! "Override base class method" if self.tkconsole.executing: tkMessageBox.showerror( *************** *** 404,408 **** master=self.tkconsole.text) return ! self.checklinecache() if self.save_warnings_filters is not None: --- 405,409 ---- master=self.tkconsole.text) return ! # self.checklinecache() if self.save_warnings_filters is not None: *************** *** 415,419 **** (code,), {}) return ! try: self.tkconsole.beginexecuting() --- 416,420 ---- (code,), {}) return ! # try: self.tkconsole.beginexecuting() *************** *** 434,443 **** except: self.showtraceback() ! finally: self.tkconsole.endexecuting() def write(self, s): ! # Override base class write self.tkconsole.console.write(s) --- 435,444 ---- except: self.showtraceback() ! # finally: self.tkconsole.endexecuting() def write(self, s): ! "Override base class method" self.tkconsole.console.write(s) *************** *** 566,570 **** def endexecuting(self): ! # Helper for ModifiedInterpreter ##sys.settrace(None) ##self._cancel_check = None --- 567,571 ---- def endexecuting(self): ! "Helper for ModifiedInterpreter" ##sys.settrace(None) ##self._cancel_check = None *************** *** 574,578 **** def close(self): ! # Extend base class method if self.executing: # XXX Need to ask a question here --- 575,579 ---- def close(self): ! "Extend EditorWindow.close()" if self.executing: # XXX Need to ask a question here *************** *** 587,593 **** self.top.quit() return "cancel" ! return OutputWindow.close(self) def _close(self): self.close_debugger() self.interp.kill_subprocess() --- 588,595 ---- self.top.quit() return "cancel" ! return EditorWindow.close(self) def _close(self): + "Extend EditorWindow._close(), shut down debugger and execution server" self.close_debugger() self.interp.kill_subprocess() *************** *** 602,609 **** self.flist.pyshell = None self.history = None ! OutputWindow._close(self) # Really EditorWindow._close def ispythonsource(self, filename): ! # Override this so EditorWindow never removes the colorizer return 1 --- 604,611 ---- self.flist.pyshell = None self.history = None ! EditorWindow._close(self) def ispythonsource(self, filename): ! "Override EditorWindow method: never remove the colorizer" return 1 *************** *** 782,788 **** line = line[:i] more = self.interp.runsource(line) - # XXX This was causing extra prompt with shell KBK - # if not more: - # self.showprompt() def cancel_check(self, frame, what, args, --- 784,787 ---- Index: RemoteDebugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/RemoteDebugger.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** RemoteDebugger.py 20 Jun 2002 04:01:47 -0000 1.3 --- RemoteDebugger.py 24 Jun 2002 17:03:37 -0000 1.4 *************** *** 102,105 **** --- 102,108 ---- msg = self.idb.clear_break(filename, lineno) + def clear_all_file_breaks(self, filename): + msg = self.idb.clear_all_file_breaks(filename) + #----------called by a FrameProxy---------- *************** *** 149,160 **** value = dict[key] value = repr(value) - # try: - # # Test for picklability - # import cPickle - # pklstr = cPickle.dumps(value) - # except: - # print >>sys.__stderr__, "** dict_item pickle failed: ", value - # raise - # #value = None return value --- 152,155 ---- *************** *** 166,172 **** Start the subprocess side of the split debugger and set up that side of the ! RPC link by instantiating the GUIProxy, Idle debugger, and IdbAdapter objects and linking them together. Register the IdbAdapter to handle RPC ! requests from the split Debugger GUI via the IdbProxy. """ --- 161,167 ---- Start the subprocess side of the split debugger and set up that side of the ! RPC link by instantiating the GUIProxy, Idb debugger, and IdbAdapter objects and linking them together. Register the IdbAdapter to handle RPC ! requests from the split debugger GUI via the IdbProxy. """ *************** *** 317,320 **** --- 312,319 ---- msg = self.call("clear_break", filename, lineno) + def clear_all_file_breaks(self, filename): + msg = self.call("clear_all_file_breaks", filename) + + def start_remote_debugger(conn, pyshell): """Start the subprocess debugger, initialize the debugger GUI and RPC link *************** *** 322,326 **** Request the RPCServer start the Python subprocess debugger and link. Set up the Idle side of the split debugger by instantiating the IdbProxy, ! Debugger GUI, and Debugger GUIAdapter objects and linking them together. Register the GUIAdapter to handle debugger GUI interaction requests coming --- 321,325 ---- Request the RPCServer start the Python subprocess debugger and link. Set up the Idle side of the split debugger by instantiating the IdbProxy, ! debugger GUI, and debugger GUIAdapter objects and linking them together. Register the GUIAdapter to handle debugger GUI interaction requests coming From kbk@users.sourceforge.net Tue Jun 25 04:28:40 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Mon, 24 Jun 2002 20:28:40 -0700 Subject: [Idle-dev] CVS: idle Debugger.py,1.8,1.9 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv7570 Modified Files: Debugger.py Log Message: Remove all EditorWindow BREAK tags when closing Debugger Index: Debugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/Debugger.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -r1.8 -r1.9 *** Debugger.py 24 Jun 2002 17:03:35 -0000 1.8 --- Debugger.py 25 Jun 2002 03:28:38 -0000 1.9 *************** *** 77,81 **** --- 77,89 ---- if self.stackviewer: self.stackviewer.close(); self.stackviewer = None + # Remove all EditWindow BREAK tags when closing debugger: + edit_windows = self.pyshell.flist.inversedict.keys() + for window in edit_windows: + window.text.tag_remove("BREAK", 1.0, END) + # Clean up pyshell if user clicked debugger control close widget. + # (Causes a harmless extra cycle through close_debugger() if user + # toggled debugger from pyshell Debug menu) self.pyshell.close_debugger() + # Now close the debugger control window.... self.top.destroy() From kbk@users.sourceforge.net Wed Jun 26 03:32:11 2002 From: kbk@users.sourceforge.net (Kurt B. Kaiser) Date: Tue, 25 Jun 2002 19:32:11 -0700 Subject: [Idle-dev] CVS: idle PyShell.py,1.18,1.19 RemoteDebugger.py,1.4,1.5 rpc.py,1.2,1.3 run.py,1.2,1.3 Message-ID: Update of /cvsroot/idlefork/idle In directory usw-pr-cvs1:/tmp/cvs-serv27871 Modified Files: PyShell.py RemoteDebugger.py rpc.py run.py Log Message: Shutdown subprocess debugger and associated Proxies/Adapters when closing the Idle debugger. M PyShell.py : Call RemoteDebugger.close_remote_debugger() M RemoteDebugger.py: Add close_remote_debugger(); further polish code used to start the debugger sections. M rpc.py : Add comments on Idlefork methods register(), unregister() comment out unused methods M run.py : Add stop_the_debugger(); polish code Index: PyShell.py =================================================================== RCS file: /cvsroot/idlefork/idle/PyShell.py,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -r1.18 -r1.19 *** PyShell.py 24 Jun 2002 17:03:37 -0000 1.18 --- PyShell.py 26 Jun 2002 02:32:08 -0000 1.19 *************** *** 26,29 **** --- 26,30 ---- import rpc + import RemoteDebugger # XX hardwire this for now, remove later KBK 09Jun02 *************** *** 90,95 **** class PyShellEditorWindow(EditorWindow): ! ! # Regular text edit window when a shell is present # XXX ought to merge with regular editor window --- 91,95 ---- class PyShellEditorWindow(EditorWindow): ! "Regular text edit window when a shell is present" # XXX ought to merge with regular editor window *************** *** 533,536 **** --- 533,538 ---- self.interp.setdebugger(None) db.close() + if self.interp.rpcclt: + RemoteDebugger.close_remote_debugger(self.interp.rpcclt) self.resetoutput() self.console.write("[DEBUG OFF]\n") *************** *** 552,556 **** def open_remote_debugger(self): - import RemoteDebugger gui = RemoteDebugger.start_remote_debugger(self.interp.rpcclt, self) self.interp.setdebugger(gui) --- 554,557 ---- *************** *** 560,564 **** def beginexecuting(self): ! # Helper for ModifiedInterpreter self.resetoutput() self.executing = 1 --- 561,565 ---- def beginexecuting(self): ! "Helper for ModifiedInterpreter" self.resetoutput() self.executing = 1 Index: RemoteDebugger.py =================================================================== RCS file: /cvsroot/idlefork/idle/RemoteDebugger.py,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** RemoteDebugger.py 24 Jun 2002 17:03:37 -0000 1.4 --- RemoteDebugger.py 26 Jun 2002 02:32:09 -0000 1.5 *************** *** 53,56 **** --- 53,57 ---- def interaction(self, message, frame, info=None): + # calls rpc.SocketIO.remotecall() via run.MyHandler instance self.conn.remotecall(self.oid, "interaction", (message, wrap_frame(frame), wrap_info(info)), *************** *** 157,174 **** ! def start_debugger(conn, gui_adap_oid): """Start the debugger and its RPC link in the Python subprocess Start the subprocess side of the split debugger and set up that side of the RPC link by instantiating the GUIProxy, Idb debugger, and IdbAdapter ! objects and linking them together. Register the IdbAdapter to handle RPC ! requests from the split debugger GUI via the IdbProxy. """ ! gui_proxy = GUIProxy(conn, gui_adap_oid) idb = Debugger.Idb(gui_proxy) idb_adap = IdbAdapter(idb) idb_adap_oid = "idb_adapter" ! conn.register(idb_adap_oid, idb_adap) return idb_adap_oid --- 158,176 ---- ! def start_debugger(rpchandler, gui_adap_oid): """Start the debugger and its RPC link in the Python subprocess Start the subprocess side of the split debugger and set up that side of the RPC link by instantiating the GUIProxy, Idb debugger, and IdbAdapter ! objects and linking them together. Register the IdbAdapter with the ! RPCServer to handle RPC requests from the split debugger GUI via the ! IdbProxy. """ ! gui_proxy = GUIProxy(rpchandler, gui_adap_oid) idb = Debugger.Idb(gui_proxy) idb_adap = IdbAdapter(idb) idb_adap_oid = "idb_adapter" ! rpchandler.register(idb_adap_oid, idb_adap) return idb_adap_oid *************** *** 316,320 **** ! def start_remote_debugger(conn, pyshell): """Start the subprocess debugger, initialize the debugger GUI and RPC link --- 318,322 ---- ! def start_remote_debugger(rpcclt, pyshell): """Start the subprocess debugger, initialize the debugger GUI and RPC link *************** *** 323,328 **** debugger GUI, and debugger GUIAdapter objects and linking them together. ! Register the GUIAdapter to handle debugger GUI interaction requests coming ! from the subprocess debugger via the GUIProxy. The IdbAdapter will pass execution and environment requests coming from the --- 325,330 ---- debugger GUI, and debugger GUIAdapter objects and linking them together. ! Register the GUIAdapter with the RPCClient to handle debugger GUI ! interaction requests coming from the subprocess debugger via the GUIProxy. The IdbAdapter will pass execution and environment requests coming from the *************** *** 331,339 **** """ gui_adap_oid = "gui_adapter" ! idb_adap_oid = conn.remotecall("exec", "start_the_debugger",\ (gui_adap_oid,), {}) ! idb_proxy = IdbProxy(conn, idb_adap_oid) gui = Debugger.Debugger(pyshell, idb_proxy) ! gui_adap = GUIAdapter(conn, gui) ! conn.register(gui_adap_oid, gui_adap) return gui --- 333,355 ---- """ gui_adap_oid = "gui_adapter" ! idb_adap_oid = rpcclt.remotecall("exec", "start_the_debugger",\ (gui_adap_oid,), {}) ! idb_proxy = IdbProxy(rpcclt, idb_adap_oid) gui = Debugger.Debugger(pyshell, idb_proxy) ! gui_adap = GUIAdapter(rpcclt, gui) ! rpcclt.register(gui_adap_oid, gui_adap) return gui + + def close_remote_debugger(rpcclt): + """Shut down subprocess debugger and Idle side of debugger RPC link + + Request that the RPCServer shut down the subprocess debugger and link. + Unregister the GUIAdapter, which will cause a GC on the Idle process + debugger and RPC link objects. (The second reference to the debugger GUI + is deleted in PyShell.close_remote_debugger().) + + """ + idb_adap_oid = "idb_adapter" + rpcclt.remotecall("exec", "stop_the_debugger", (idb_adap_oid,), {}) + gui_adap_oid = "gui_adapter" + rpcclt.unregister(gui_adap_oid) Index: rpc.py =================================================================== RCS file: /cvsroot/idlefork/idle/rpc.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** rpc.py 16 Jun 2002 03:32:24 -0000 1.2 --- rpc.py 26 Jun 2002 02:32:09 -0000 1.3 *************** *** 56,78 **** if handlerclass is None: handlerclass = RPCHandler ! self.objtable = objecttable SocketServer.TCPServer.__init__(self, addr, handlerclass) ! def verify_request(self, request, client_address): ! host, port = client_address ! if host != "127.0.0.1": ! print "Disallowed host:", host ! return 0 ! else: ! return 1 ! ! def register(self, oid, object): ! self.objtable[oid] = object ! ! def unregister(self, oid): ! try: ! del self.objtable[oid] ! except KeyError: ! pass --- 56,101 ---- if handlerclass is None: handlerclass = RPCHandler ! # XXX KBK 25Jun02 Not used in Idlefork, see register/unregister note below. ! # self.objtable = objecttable SocketServer.TCPServer.__init__(self, addr, handlerclass) ! # XXX KBK 25Jun02 Following method is not used (yet) ! # def verify_request(self, request, client_address): ! # host, port = client_address ! # if host != "127.0.0.1": ! # print "Disallowed host:", host ! # return 0 ! # else: ! # return 1 ! ! # XXX KBK 25Jun02 The handlerclass is expected to provide register/unregister ! # methods. In Idle, RPCServer is instantiated with ! # handlerclass MyHandler, which in turn inherits the ! # register/unregister methods from the mix-in class SocketIO. ! # It is true that this is asymmetric with the RPCClient's use ! # of register/unregister, but I guess that's how a SocketServer ! # is supposed to work. ! ! # Exactly how this gets set up is convoluted. When the ! # TCPServer is instantiated, it creates an instance of ! # run.MyHandler and calls its handle() method. handle() ! # instantiates a run.Executive, passing it a reference to the ! # MyHandler object. That reference is saved as an attribute of ! # the Executive instance. The Executive methods have access to ! # the reference and can pass it on to entities that they ! # command (e.g. RemoteDebugger.Debugger.start_debugger()). The ! # latter, in turn, can call MyHandler(SocketIO) ! # register/unregister methods via the reference to register and ! # unregister themselves. Whew. ! ! # The following two methods are not currently used in Idlefork. ! # def register(self, oid, object): ! # self.objtable[oid] = object ! ! # def unregister(self, oid): ! # try: ! # del self.objtable[oid] ! # except KeyError: ! # pass *************** *** 199,207 **** else: raise getattr(__import__(mod), name)(*args) - # XXX KBK 15Jun02 mod is False here, also want to raise remaining exceptions - # else: - # if mod: - # name = mod + "." + name - # raise name, args raise name, args if how == "ERROR": --- 222,225 ---- Index: run.py =================================================================== RCS file: /cvsroot/idlefork/idle/run.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** run.py 16 Jun 2002 03:32:24 -0000 1.2 --- run.py 26 Jun 2002 02:32:09 -0000 1.3 *************** *** 24,28 **** def __init__(self, rpchandler): ! self.conn = rpchandler import __main__ self.locals = __main__.__dict__ --- 24,28 ---- def __init__(self, rpchandler): ! self.rpchandler = rpchandler import __main__ self.locals = __main__.__dict__ *************** *** 33,37 **** def start_the_debugger(self, gui_adap_oid): import RemoteDebugger ! return RemoteDebugger.start_debugger(self.conn, gui_adap_oid) def stackviewer(self, flist_oid=None): --- 33,41 ---- def start_the_debugger(self, gui_adap_oid): import RemoteDebugger ! return RemoteDebugger.start_debugger(self.rpchandler, gui_adap_oid) ! ! def stop_the_debugger(self, idb_adap_oid): ! "Unregister the Idb Adapter. Link objects and Idb then subject to GC" ! self.rpchandler.unregister(idb_adap_oid) def stackviewer(self, flist_oid=None): *************** *** 40,44 **** flist = None if flist_oid is not None: ! flist = self.conn.get_remote_proxy(flist_oid) import RemoteObjectBrowser import StackViewer --- 44,48 ---- flist = None if flist_oid is not None: ! flist = self.rpchandler.get_remote_proxy(flist_oid) import RemoteObjectBrowser import StackViewer From info@iwebrider.com Wed Jun 26 16:42:01 2002 From: info@iwebrider.com (info@iwebrider.com) Date: Wed, 26 Jun 2002 11:42:01 -0400 Subject: [Idle-dev] Web Design For The Wood Industry Message-ID: Hi, I would like to invite you over to our new website. http://www.iwebrider.com. We design websites for companies and organizations alike. We also do websites for individuals. We work with HTML, CGI, DHTML, JAVASCRIPT, JAVA Etc. Packages starting at $199.00. while at our site feel free to post a free classified ad. If you currently have a site, and would like to update it, or add some Interactivity to it, Like a guestbook, or auction or some other interactive feature, we can help. We will help you in all phases of your design project. If you come to some part of your project and need help, We are here. I look forward to answering any questions that you may have. Best Regards Cobby Meridan Design --------------------------------------------------- This is not an unsolicited email. Your email address has been submitted to us via on our website. If you do not wish to receive any future emails and would like to remove yourself from our mailing list, please reply to this e-mail with the words "UNSUBSCRIBE" in the subject field.