Re: [PyCrust] 0.6 in the oven, now with PyFilling, should be done cooking soon
Brought to you by:
pobrien
From: Raul C. <co...@uc...> - 2001-09-19 23:22:14
|
Well, I guess it has to do more with my very own way of implementing it in my application. Because the interpreter is just a page in a wxNotebook (with its own namespace, different to the rest of the application) so, if I'm in another page, it can send code to the interpreter (using the run method) or if i'm in the interpreter, and event is triggered to update the rest of the pages when I move to another page. So I can be doing stuff either in the interpreter or somewhere else and a user can forget to leave the cursor at the very end. But I guess this is a very specific case, so don't worry about it. Raul "Patrick K. O'Brien" wrote: > > On the one hand, adding code to set the current position to the end wouldn't > hurt anything, and would appear to be a good safeguard. On the other hand, I > can't picture how this would be necessary unless someone was messing with > the cursor position in their code, and I can't imagine why someone would do > this. Have you actually run into a situation where the output did not go at > the end? If you have, I'd love to hear what the situation was. If you > haven't, I'd be reluctant to add the code. Feel free to correct me if I'm > not seeing things the way you see them. > > --- > Patrick K. O'Brien > Orbtech (http://www.orbtech.com) > "I am, therefore I think." > > -----Original Message----- > From: pyc...@li... > [mailto:pyc...@li...]On Behalf Of Raul Cota > Sent: Wednesday, September 19, 2001 1:02 PM > To: pyc...@li... > Subject: Re: [PyCrust] 0.6 in the oven, now with PyFilling, should be done > cooking soon > > Well... I took me a while to get back to normal after last week. > > Patrick: > I think the "run" method needs the following lines, to make sure that > the "command" and the "output" are written at the very end. > > def run(self, command, prompt=1, verbose=1): > """Execute command within the shell as if it was typed in > directly. > >>> shell.run('print "this"') > >>> print "this" > this > >>> > """ > # Go to the very bottom of the text. > endpos = self.GetTextLength() > self.SetCurrentPos(endpos) > command = command.rstrip() > if prompt: self.prompt() > if verbose: self.write(command) > self.push(command) > > What do you think? > > _______________________________________________ > PyCrust-users mailing list > PyC...@li... > https://lists.sourceforge.net/lists/listinfo/pycrust-users |