org.python.util

Class ReadlineConsole


public class ReadlineConsole
extends InteractiveConsole

Uses: Java Readline

Based on CPython-1.5.2's code module

Field Summary

String
filename

Fields inherited from class org.python.util.InteractiveConsole

filename

Fields inherited from class org.python.util.InteractiveInterpreter

buffer, filename

Constructor Summary

ReadlineConsole()
Create a new Interpreter with an empty dictionary
ReadlineConsole(PyObject locals)
Create a new interpreter with the given dictionary to use as its namespace
ReadlineConsole(PyObject locals, String filename)

Method Summary

static String
_raw_input(args[] , kws[] )
Central point of dispatch to Readline library for all clients, whether the console itself or others like cmd.Cmd interpreters.
String
raw_input(PyObject prompt)
Write a prompt and read a line.

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, runsource, showexception, write

Methods inherited from class org.python.util.PythonInterpreter

cleanup, eval, exec, exec, execfile, execfile, execfile, get, get, getLocals, initialize, set, set, setErr, setErr, setErr, setLocals, setOut, setOut, setOut

Field Details

filename

public String filename

Constructor Details

ReadlineConsole

public ReadlineConsole()
Create a new Interpreter with an empty dictionary

ReadlineConsole

public ReadlineConsole(PyObject locals)
Create a new interpreter with the given dictionary to use as its namespace
Parameters:

ReadlineConsole

public ReadlineConsole(PyObject locals,
                       String filename)

Method Details

_raw_input

public static String _raw_input(args[] ,
                                kws[] )
Central point of dispatch to Readline library for all clients, whether the console itself or others like cmd.Cmd interpreters. Both of these uses come through here.
Parameters:
Returns:
the user input

raw_input

public String raw_input(PyObject prompt)
Write a prompt and read a line. The returned line does not include the trailing newline. When the user enters the EOF key sequence, EOFError is raised. This subclass implements the functionality using JavaReadline.
Overrides:
raw_input in interface InteractiveConsole

Jython homepage