[PyCrust] Small request
Brought to you by:
pobrien
|
From: Raul C. <co...@uc...> - 2002-06-10 21:20:19
|
Hi,
Not long ago I asked about keeping the wxStyledCtrl as the stdin so I
could switch to the CommandInterface I use. Then I realized that the
CommandInterface could benefit a lot from all the support already
provided by shell.py if I wrapped my CommandInterface to behave like a
Python Interpreter. (i.e. Create a class with the methods:
I did so and now I call shell with my own Interpreter class as a
parameter, the only problem is that in my case, not only ord('.')
triggers autocomplete, but also ord('/') and ord(' '). I must say that
it works like a charm !!! Nice work in PyCrust !!
My request, if possible, is:
In the __init__ method of shell, the line
self.autoCompKeys = [ord('.')]
In the OnChar method of shell, the lines:
if key in self.autoCompKeys:
command = self.GetTextRange(stoppos, currpos) + chr(key)
self.write(chr(key))
if self.autoComplete: self.autoCompleteShow(command)
That way I can change self.autoCompKeys to self.autoCompKeys =
[ord('.'), ord(' '), ord('/')] .
In the ideal case I'd like a method of the type
self.autoCompKeys = self.interp.GetAutoCompKeys()
That way, the interpreter decides which keys it supports when running
the method self.interp.getAutoCompleteList. But that's perhaps too much
to ask ang drifts away from the original concept of shell.
BTW, I noticed that the ShellFrame doesn't do something like:
EVT_CLOSE(self, self.OnCloseWindow)
def OnCloseWindow(self, event):
self.shell.destroy()
self.Destroy()
And for my interpreter I definitely need to call self.shell.destroy() to
CleanUp myInterpreterClass
Thanks a lot
Raul
|