interactive prompt

Hi,

I would like to develop interactive prompt using wxPython with these features:

* auto-complete program name (binaries are located in the given directory)
* auto-complete program's arguments, program usage is described as XML
file, e.g. [1, 2]
* auto-complete option values

E.g.

d.e<tab>
d.erase c<tab>
d.erase color=<tab>
d.erase color=bla<tab>
d.erase color=black

I would like to ask you where to start - any hits welcomed!

Thanks in the advance!

Best regards, Martin

[1] d.erase --help

Description:
Erase the contents of the active display frame with user defined color

Keywords:
display

Usage:
d.erase [-fx] [color=string] [--verbose] [--quiet]

Flags:
  -f Remove all frames and erase the screen
  -x Don't add to list of commands in monitor
--v Verbose module output
--q Quiet module output

Parameters:
  color Color to erase with, either a standard GRASS color or R:G:B
triplet (separated by colons)
          default: white

[2] d.erase --interface-description

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task SYSTEM "grass-interface.dtd">
<task name="d.erase">
  <description>
    Erase the contents of the active display frame with user defined color
  </description>
  <keywords>
    display
  </keywords>
  <parameter name="color" type="string" required="no" multiple="no">
    <description>
      Color to erase with, either a standard GRASS color or R:G:B triplet
(separated by colons)
    </description>
    <gisprompt age="old_color" element="color" prompt="color" />
    <default>
      white
    </default>
  </parameter>
  <flag name="f">
    <description>
      Remove all frames and erase the screen
    </description>
  </flag>
  <flag name="x">
    <description>
      Don't add to list of commands in monitor
    </description>
  </flag>
  <flag name="verbose">
    <description>
      Verbose module output
    </description>
  </flag>
  <flag name="quiet">
    <description>
      Quiet module output
    </description>
  </flag>
</task>

···

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa

Hi Martin,

Hi,

I would like to develop interactive prompt using wxPython with these features:

* auto-complete program name (binaries are located in the given directory)
* auto-complete program's arguments, program usage is described as XML
file, e.g. [1, 2]
* auto-complete option values

E.g.

d.e<tab>
d.erase c<tab>
d.erase color=<tab>
d.erase color=bla<tab>
d.erase color=black

I would like to ask you where to start - any hits welcomed!

Thanks in the advance!

Best regards, Martin

For autocomplete in a TextCtrl, there's a long article on the wiki: http://wiki.wxpython.org/TextCtrlAutoComplete

If you are looking for an editor that auto-completes, look at Editra's code. It's included with wxPython (at least with the demos...) and it does Python autocompletion, among others. Or check out its features here: editra.org

···

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Hello,

Hi Martin,

Hi,

I would like to develop interactive prompt using wxPython with these
features:

* auto-complete program name (binaries are located in the given directory)
* auto-complete program's arguments, program usage is described as XML
file, e.g. [1, 2]
* auto-complete option values

The StyledTextCtrl is probably the best base to use for this sort of
control. The python shell under wx.py is an example of an interactive
prompt using it.

I also wrote a terminal emulator using it to some success (one of my
many partially complete projects). The shell works quite well on Unix
like platforms (Linux/OSX) and alright on windows. It is not much more
than a proof of concept but it is usable and can be seen here
(Google Code Archive - Long-term storage for Google Code Project Hosting.).
There may be some bit rot as I have not had time to look at it in the
last year.

Cody

···

On Mon, May 18, 2009 at 11:13 AM, Mike Driscoll <mike@pythonlibrary.org> wrote:

Hi,

[...]

For autocomplete in a TextCtrl, there's a long article on the wiki:
http://wiki.wxpython.org/TextCtrlAutoComplete

If you are looking for an editor that auto-completes, look at Editra's code.
It's included with wxPython (at least with the demos...) and it does Python
autocompletion, among others. Or check out its features here:
editra.org

Thanks for valuable pointers...

Now it's up to me to implement my wish :wink:

Martin

···

2009/5/18 Mike Driscoll <mike@pythonlibrary.org>:

--
Martin Landa <landa.martin gmail.com> * http://gama.fsv.cvut.cz/~landa