On 3/25/07, <b class="gmail_sendername">Keith R. Fieldhouse</b> &lt;<a href="mailto:idle@rexmere.com">idle@rexmere.com</a>&gt; wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>I work on a project that uses Python as the basis for a very domain<br>specific development environment.<br><br>For documentation and training purposes I&#39;d like to use IDLE as the<br>initial development tool.&nbsp;&nbsp;In other words, my &quot;getting started&quot;
<br>documentation and class exercises for example, would be produced in<br>terms of IDLE.<br><br>Thus far, this works quite well, IDLE strikes the right balance between<br>simplicity, accessibility and capability.</blockquote>
<div><br>I&#39;m glad to hear - it means IDLE meets its goals :)<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;">One issue is that our development environment has a number of domain
<br>specific text files used in the process of developing applications.<br>Naturally, IDLE is able to edit these files with no problem.&nbsp;&nbsp;I would,<br>however, now like to add syntax colorization and possibly indentation<br>
support for these text files.<br><br>Has any one done this?&nbsp;&nbsp;Any thoughts on the proper approach or other<br>hints would be greatly appreciated.&nbsp;&nbsp; If there is some reason that this<br>would be a Bad Idea, let me know that as well...
</blockquote><div><br>AFAIK and as far as 10 minutes of Google-ing can tell, this hasn&#39;t been done. But I don&#39;t see any reason why this would be a Bad Idea.<br><br>As for thoughts on the proper approach: This could be an IDLE &quot;extension&quot;. See idlelib/extend.txt for an introduction to extensions, and check out some of the built-in extensions, like ParenMatch and CodeContext.
<br><br><br>For some technical details, check out EditorWindow.py:<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.per = per = self.Percolator(text)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if self.ispythonsource(filename):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.color = color = self.ColorDelegator
()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; per.insertfilter(color)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; else:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.color = None<br><br>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.<br><br><br></div>Feel free to bug me with questions, I&#39;d be glad to help :)<br><br>- Tal Einat<br></div>