Re: [PyCrust] Significant refactoring
Brought to you by:
pobrien
From: Chin H. W. <ch...@mi...> - 2001-08-20 04:21:12
|
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. ----- Original Message ----- From: "Patrick K. O'Brien" <po...@or...> To: <pyc...@li...> Sent: Saturday, August 18, 2001 10:04 PM Subject: RE: [PyCrust] Significant refactoring > Yeah, the AlaCarte demo is temporarily broken. I probably need to refactor > the Interpreter class as well to account for the changes to the shell and > loss of the editor class. Your question about the RIGHT way of subclassing > the Interpreter class is a good one. I don't have an answer for you tonight. > Could you tell me what you want to accomplish by subclassing so that I can > work on an answer for you? > > --- > 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: Saturday, August 18, 2001 11:13 PM > To: pyc...@li... > Subject: [PyCrust] Significant refactoring > > I just download the PyCrust-0.5.3 and the demos/PyCrustAlaCarte is now > broken due to the non-existence of Editor class and module. My plan is to > subclass Interpreter class. But because the Editor class is gone and with it > the writeOut, writeErr, and readIn has been moved to Shell class. So what is > the RIGHT way of subclassing the Interpreter class? > > > > > _______________________________________________ > PyCrust-users mailing list > PyC...@li... > http://lists.sourceforge.net/lists/listinfo/pycrust-users > > > _______________________________________________ > PyCrust-users mailing list > PyC...@li... > http://lists.sourceforge.net/lists/listinfo/pycrust-users |