<br><div class="gmail_quote">On Mon, Apr 9, 2012 at 4:37 PM, Larry Shaffer <span dir="ltr">&lt;<a href="mailto:larrys@dakotacarto.com">larrys@dakotacarto.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Tim,<br><br><div class="gmail_quote">On Mon, Apr 9, 2012 at 1:00 PM, Tim Sutton <span dir="ltr">&lt;<a href="mailto:lists@linfiniti.com" target="_blank">lists@linfiniti.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
...<br></blockquote><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
2) What I would really *love* is to have QGIS api completion (and<br>
other standard python modules if it is easy to achieve) in the built<br>
in python console that is activeated from the QGIS plugins menu. I<br>
often like to demo stuff to people using the python console and always<br>
flap around trying to remember syntax. Obviously this would add a<br>
qsctintilla dependency to QGIS core - how do others feel about this?<br>
Given the other work you are busy with that dependency is probably<br>
coming anyway....<br></blockquote><div><br> :^)  Porting the QTextEdit of PyQGIS console.py to QScintilla was what I was going to look into next. I have already bootlegged it into Plugin Editor and done some customizations.<br>

<br>The Eric editor has a nice Python console based on QScintilla (syntax coloring, code completion and call tips), but I had difficulty trying to port it to Plugin Editor, because it leverages Eric&#39;s entrenched debugger classes. The ported base debugger I tried consistently crashed QGIS. Maybe it can be included in a later version.<br>

<br>Currently I have code completion and call tips working well in Plugin Editor [0]. The compiled API files I am testing with are:<br><br>    PyQt4-Qt4.8.api, Python-2.7.api, QScintilla2.api<br>    qgis.analysis.api, qgis.console.api, qgis.core.api, qgis.gui.api, qgis.utils.api<br>

<br>The compiled API &#39;python.pap&#39; file for a given QScintilla editor widget is ~37,500 api items total, and 900 KB in size (yet is still quite responsive).<br></div></div></blockquote><div><br><br>Having played around with the code completion, I added another .api file for the qgis.utils.iface instance [0]. This allows direct access to the 149 QgisInterface slots/functions when typing just &#39;iface&#39; [1], which is common.<br>
<br>@Tim - I have recently added templates (built-in and custom) to Plugin Editor as well. Using the run_script() template (formulated as per Script Runner) you can quickly open a test script, with code completion and call tips, type a few lines and run it within the Editor. Also, you can copy text selections via drag/drop to the PyQGIS console for running. Those steps would help you to show some example code quickly.<br>
<br>Switching from QTextEdit to QScintilla for the console looks like about a 50% rewrite, plus some refactoring. Certainly an all-weekend kinda project, considering new features would be added, too.<br></div></div><br>Regards,<br>
<br>Larry Shaffer<br>Dakota Cartography<br>Black Hills, South Dakota<br><br>[0] <a href="http://dl.dropbox.com/u/4058089/qgis/qgis.utils.iface.api">http://dl.dropbox.com/u/4058089/qgis/qgis.utils.iface.api</a><br>[1] <a href="http://dl.dropbox.com/u/4058089/qgis/qgis-qsci-iface.png">http://dl.dropbox.com/u/4058089/qgis/qgis-qsci-iface.png</a><br>
<br>