<br><br><div><span class="gmail_quote">On 8/7/07, <b class="gmail_sendername">Tal Einat</b> <<a href="mailto:taleinat@gmail.com">taleinat@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On 8/7/07, Jameson Chema Quinn <<a href="mailto:jquinn@cs.oberlin.edu">jquinn@cs.oberlin.edu</a>> wrote:<br>> I'm hacking at my own version of IDLE to try to implement language support<br>> in Python. I found a bug.
<br>><br>> 1. The bug.<br>> I'm using IDLE to work on a copy of IDLE in my home directory. I copy the<br>> idlelib directory to ~/jqidlelib , add "jq" to lines 2 and 22 of idle.py,<br>> open it in IDLE, and start hacking on the other files. If a hacked version
<br>> of some other module is not open in IDLE and I press F5 to run idle.py, I<br>> get the desired behaviour (the modules are loaded from my hacked copies) but<br>> the error display is wacky. Errors refer to the line numbers of my hacked
<br>> versions, but they give the path and code snippets from the actual IDLE<br>> directory.<br><br>If you do a directory-wide search for 'idlelib' you'll find that it is<br>mentioned in PyShell.py as well. I haven't tried this myself, so
<br>please inform us whether or not this works :)</blockquote><div><br>Changing it there has no effect. In the intervening time, I'm getting even weirder behavior: with my hacked EditorWindow open, I fix the bug in my code and save it. Then I press F5 in the
idle.py window again. I get:<br><br>Traceback (most recent call last):<br> File "/home/compaq/jqidlelib/idle.py", line 22, in <module><br> jqidlelib.PyShell.main()<br> File "/usr/lib/python2.5/idlelib/PyShell.py", line 1406, in main
<br> return # couldn't open shell<br> File "/usr/lib/python2.5/idlelib/PyShell.py", line 275, in open_shell<br> self.pyshell = PyShell(self)<br> File "/usr/lib/python2.5/idlelib/PyShell.py", line 813, in __init__
<br> OutputWindow.__init__(self, flist, None, None)<br> File "idlelib/OutputWindow.py", line 16, in __init__<br> EditorWindow.__init__(self, *args)<br> File "/home/compaq/jqidlelib/EditorWindow.py", line 56, in __init__
<br> if EditorWindow.help_url is None:<br>NameError: global name 'trns' is not defined<br><br>The "trns" is from the previous version of EditorWindow which NO LONGER EXISTS on the disk, which is why the code snippet doesn't mention it. Also, note that the paths for the call stack show a mix between idlelib and jqidlelib, depending on which files I have open. This is just FALSE - all modules are actually being loaded from jqidlelib, as I can easily tell if I introduce a syntax error and then close the file.
<br></div><br>Meanwhile, I can work around by just closing and reopening idle. Annoying, though.<br><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
> 2. My idea<br>> [snip]<br><br>Awesome! I'll be glad to answer any questions you might have regarding<br>IDLE's internals.<br><br>An early pointer: IDLE doesn't currently allow unicode input, so<br>you'll have to rework that bit if you want unicode input support.
</blockquote><div><br>I can afford to wait on that, as my first test case is Spanish, and Idle only has minor complaints about accents. Thanks for the heads up, though - this will need to be fixed for py3k anyway, what's the status on that?
<br></div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Good luck, and please keep us posted on developments,<br>- Tal<br></blockquote>
</div>Thanks,<br>Jameson<br><br>ps. here's my idle version stuff:<br>Python 2.5.1 (r251:54863, May 2 2007, 16:56:35) <br>[GCC 4.1.2 (Ubuntu 4.1.2-0ubuntu4)] on linux2<br>Type "copyright", "credits" or "license()" for more information.
<br><br> ****************************************************************<br> Personal firewall software may warn about the connection IDLE<br> makes to its subprocess using this computer's internal loopback<br>
interface. This connection is not visible on any external<br> interface and no data is sent to or received from the Internet.<br> ****************************************************************<br> <br>IDLE
1.2.1 ==== No Subprocess ====<br>