Open GoogleCodeExporter opened 9 years ago
OK, tried adding readline() to CountingStream (see attached patch). Now I just
get
told that it is an empty pipeline (see debug trace below).
What I want is for this to be added to the history and to be given a blank text
box
to type my next command in.
It seems a PipelineParseException is caught in hotwire_ui/shell.py in
Hotwire.__do_parse() (line 1118) and it simply returns false and exits.
Two possible ways around it - where the exception is caught (line 1119) there
could
be a little bit of logic to say if the exception is EmptyPipeline then check if
there
is some non-whitespace, and if there is add it to the history and clear the
input
before returning. Maybe EmptyPipelineException could inherit from
PipelineParseException for this purpose.
Alternatively there could be some way to communicate to the __execute() method
that
calls __do_parse() that there is some history, and it could communicate that to
the
execute_pipeline() method which does the adding to history and clearing input
anyway.
I think the first method would probably be cleaner, but will defer to Colin as
to
what would fit in best to his code, though I might try coding the first method
at
some point.
21:21:46 [140684159440608] hotwire.Command DEBUG parsing '#ls'
21:21:46 [140684159440608] hotwire.Command DEBUG tokenize: None
21:21:46 [140684159440608] hotwire.ui.Shell DEBUG parse failed, current
syntax=<hotwire.command.HotwirePipeLanguage object at 0x10909d0>
Traceback (most recent call last):
File "/home/mish/dev/hw/comment/hotwire_ui/shell.py", line 1118, in __do_parse
resolve=resolve)
File "/home/mish/dev/hw/comment/hotwire/command.py", line 1189, in parse
return Pipeline.parse(text, context=self.__context, resolver=(resolve and
self.__resolver or None), **kwargs)
File "/home/mish/dev/hw/comment/hotwire/command.py", line 1012, in parse
return Pipeline.create(context, resolver, accept_partial=accept_partial, *tokens)
File "/home/mish/dev/hw/comment/hotwire/command.py", line 991, in create
raise PipelineParseException(_("Empty pipeline"))
PipelineParseException: Empty pipeline
Original comment by dmi...@gmail.com
on 14 Jul 2008 at 8:40
Attachments:
Original issue reported on code.google.com by
dmi...@gmail.com
on 14 Jul 2008 at 8:19