Package gda.jython

Class GDAInteractiveConsole

java.lang.Object
org.python.util.PythonInterpreter
org.python.util.InteractiveInterpreter
org.python.util.InteractiveConsole
gda.jython.GDAInteractiveConsole

public class GDAInteractiveConsole extends org.python.util.InteractiveConsole
Class that overrides InteractiveConsole to allow customisation
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    class 
    Class to act as sys.stdin in Jython.
  • Field Summary

    Fields inherited from class org.python.util.InteractiveConsole

    CONSOLE_FILENAME, filename

    Fields inherited from class org.python.util.InteractiveInterpreter

    buffer

    Fields inherited from class org.python.util.PythonInterpreter

    cflags, systemState, threadLocals
  • Constructor Summary

    Constructors
    Constructor
    Description
    GDAInteractiveConsole(org.python.core.PyObject locals, org.python.core.PySystemState pySystemState)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    org.python.core.PyObject
     
    raw_input(org.python.core.PyObject prompt)
    Read a line of user input.
    boolean
    runsource(String command)
    Run the given command in the Jython interpreter after running it through the translator.
    void
    setIn(InputStream inStream)
     
    void
    showexception(org.python.core.PyException arg0)
    Show syntax error messages in the Terminal This is to work around an apparent bug in jython.

    Methods inherited from class org.python.util.InteractiveConsole

    getDefaultBanner, interact, interact, push, raw_input

    Methods inherited from class org.python.util.InteractiveInterpreter

    interrupt, resetbuffer, runcode, runsource, runsource, write

    Methods inherited from class org.python.util.PythonInterpreter

    cleanup, compile, compile, compile, compile, eval, exec, exec, execfile, execfile, execfile, get, get, getLocals, getSystemState, initialize, set, set, setErr, setErr, setErr, setIn, setIn, setLocals, setOut, setOut, setOut, setSystemState, threadLocalStateInterpreter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • GDAInteractiveConsole

      public GDAInteractiveConsole(org.python.core.PyObject locals, org.python.core.PySystemState pySystemState)
  • Method Details

    • showexception

      public void showexception(org.python.core.PyException arg0)
      Show syntax error messages in the Terminal This is to work around an apparent bug in jython. showexception will print to the terminal for ordinary stuff, just not PySyntaxErrors. log as error as it is an exception Only show cause as a single line on teh Jython console
      Overrides:
      showexception in class org.python.util.InteractiveInterpreter
    • eval

      public org.python.core.PyObject eval(String s)
      Overrides:
      eval in class org.python.util.PythonInterpreter
    • setIn

      public void setIn(InputStream inStream)
      Overrides:
      setIn in class org.python.util.PythonInterpreter
    • runsource

      public boolean runsource(String command)
      Run the given command in the Jython interpreter after running it through the translator.

      Overrides:
      runsource in class org.python.util.InteractiveInterpreter
      See Also:
    • raw_input

      public String raw_input(org.python.core.PyObject prompt)
      Read a line of user input.

      Overrides the default raw_input to allow different InputStreams to be specified when running a command

      Overrides:
      raw_input in class org.python.util.InteractiveConsole