RE: [PyCrust] Significant refactoring
Brought to you by:
pobrien
|
From: Patrick K. O'B. <po...@or...> - 2001-08-20 20:49:29
|
I have changed the Shell class to allow you to pass an
Interpreter-compatible class (or subclass of Interpreter) and any number of
additional parameters required by your class. PyCrustAlaCarte.py was also
fixed and now uses a subclass of PyCrust.interpreter.Interpreter called
InterpreterAlaCarte. I think this should give you the flexibility you are
looking for. If not, holler.
The changes have been checked into CVS and are available there now. A zip
file release should be available later this week. Let me know if you can't
do CVS and need the files sooner.
P.S. Is there any chance you'd like to share your program? It sounds like
you might have some interesting enhancements.
---
Patrick K. O'Brien
Orbtech
"I am, therefore I think."
-----Original Message-----
From: pyc...@li...
[mailto:pyc...@li...]On Behalf Of Chin H. Wu
Sent: Sunday, August 19, 2001 11:24 PM
To: pyc...@li...
Subject: Re: [PyCrust] Significant refactoring
I have a program that runs from the command line. This program is a hybrid
of cmd.py and code.py that I can take an arbitrary program and turns that
into something like a builtin keyword. For example, I have a command called
foo, which will prints out the input contents:
def foo(in):
print in
And I can call this command like:
Python > foo 1
or
Python > foo a
where "a" is a defined variable.
But it goes beyond calling the commands in a simple statement like above, I
can also do this:
for i in range(3):
foo i
For all practical purpose, the command behaves like a builtin keyword like
'print'. It is very similar to PyCrust.pseudo.PseudoKeyword if you know what
I means.
I wrote the program by modifying the code.py and by subclassing the
InteractiveInterpreter. The idea is very similar to Interpreter class in
PyCrust. In PyCrust-0.5.1, I can make minimum modification to my program and
make it work with PyCrust and wxPython. This doesn't work with PyCrust-0.5.3
because I don't see an easy way to subclass the Interpreter class. I like
some of the features PyCrust provides and wish to make my program work with
PyCrust. Hence I would petition to keep the Interpreter class subclassable.
That opens a lot of possiblity.
|