Package EasyExtend :: Module eeconsole :: Class ConsoleBase
[hide private]
[frames] | no frames]

Class ConsoleBase



object --+
         |
        ConsoleBase
Known Subclasses:
EEConsole

Instance Methods [hide private]
 
write(self, data)
 
input(self, prompt)
Wraps raw_input.
 
reset(self)
 
at_exit(self)
 
try_parse(self)
 
compile_cst(self)
 
interact(self)
Interactive loop.
 
runcode(self, code)
Execute a code object.
 
showtraceback(self)
(Copied from code.py)

Inherited from object: __delattr__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

input(self, prompt)

 
Wraps raw_input. Override this method in subclasses to customize input behaviour.
Parameters:
  • prompt - prompt to be printed at input.

interact(self)

 

Interactive loop.
This implementation uses two flags for determining if more user input has to be expected.
- more: true if command is incomplete. Otherwise false.
- guess_more: true if command is incomplete or complete but still expects an empty line
  to be passed for statement-termination.
The guess_more flag is introduced instead of hypothetical line break trailers and maybe_compile
cruft of the stdlibs implementation ( codeop.py ).

runcode(self, code)

 

Execute a code object.

When an exception occurs, self.showtraceback() is called to display a traceback. All exceptions are caught except SystemExit, which is reraised.

A note about KeyboardInterrupt: this exception may occur elsewhere in this code, and may not always be caught. The caller should be prepared to deal with it.

(copied from code.py)