From idle at rexmere.com Sun Mar 25 15:52:11 2007 From: idle at rexmere.com (Keith R. Fieldhouse) Date: Sun, 25 Mar 2007 09:52:11 -0400 Subject: [Idle-dev] Adapting IDLE for different file types Message-ID: <46067E8B.2030104@rexmere.com> Hello, I work on a project that uses Python as the basis for a very domain specific development environment. For documentation and training purposes I'd like to use IDLE as the initial development tool. In other words, my "getting started" documentation and class exercises for example, would be produced in terms of IDLE. Thus far, this works quite well, IDLE strikes the right balance between simplicity, accessibility and capability. One issue is that our development environment has a number of domain specific text files used in the process of developing applications. Naturally, IDLE is able to edit these files with no problem. I would, however, now like to add syntax colorization and possibly indentation support for these text files. Has any one done this? Any thoughts on the proper approach or other hints would be greatly appreciated. If there is some reason that this would be a Bad Idea, let me know that as well... Best regards, Keith Fieldhouse From taleinat at gmail.com Sun Mar 25 21:05:47 2007 From: taleinat at gmail.com (Tal Einat) Date: Sun, 25 Mar 2007 21:05:47 +0200 Subject: [Idle-dev] Adapting IDLE for different file types In-Reply-To: <46067E8B.2030104@rexmere.com> References: <46067E8B.2030104@rexmere.com> Message-ID: <7afdee2f0703251205g12b6ee69r563974243b350de1@mail.gmail.com> On 3/25/07, Keith R. Fieldhouse wrote: > > Hello, > > I work on a project that uses Python as the basis for a very domain > specific development environment. > > For documentation and training purposes I'd like to use IDLE as the > initial development tool. In other words, my "getting started" > documentation and class exercises for example, would be produced in > terms of IDLE. > > Thus far, this works quite well, IDLE strikes the right balance between > simplicity, accessibility and capability. I'm glad to hear - it means IDLE meets its goals :) One issue is that our development environment has a number of domain > specific text files used in the process of developing applications. > Naturally, IDLE is able to edit these files with no problem. I would, > however, now like to add syntax colorization and possibly indentation > support for these text files. > > Has any one done this? Any thoughts on the proper approach or other > hints would be greatly appreciated. If there is some reason that this > would be a Bad Idea, let me know that as well... AFAIK and as far as 10 minutes of Google-ing can tell, this hasn't been done. But I don't see any reason why this would be a Bad Idea. As for thoughts on the proper approach: This could be an IDLE "extension". See idlelib/extend.txt for an introduction to extensions, and check out some of the built-in extensions, like ParenMatch and CodeContext. For some technical details, check out EditorWindow.py: self.per = per = self.Percolator(text) if self.ispythonsource(filename): self.color = color = self.ColorDelegator() per.insertfilter(color) else: self.color = None What your extension should do is call per.insertfilter(custom_colorizer), where custom_colorizer would be your colorizer object. Your colorizer class should inherit Delegator - see Delegator.py. Also see the implementation of ColorDelegator in ColorDelegator.py, for a starting point. Feel free to bug me with questions, I'd be glad to help :) - Tal Einat -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/idle-dev/attachments/20070325/aa1bf548/attachment.htm From zoukyle at gmail.com Mon Mar 19 18:58:27 2007 From: zoukyle at gmail.com (Liang Zou) Date: Mon, 19 Mar 2007 10:58:27 -0700 Subject: [Idle-dev] A Question about idle Message-ID: <45fecf4a.13743ceb.04b9.ffffa238@mx.google.com> Hi, When I set the new indent width to 2, it won't be saved. When I open a new window next time, it will reset to 4. I was wondering if I can save the default indent width to 2. I tried to use the set indentation defaults function in the option dialog, but it doesn't work at all. I'm using idle 1.1.1 Thank you very much for your help. Sincerely yours, Liang Zou -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/idle-dev/attachments/20070319/97847225/attachment.htm