org.jext.scripting.python
Class Run

java.lang.Object
  extended byorg.jext.scripting.python.Run

public final class Run
extends java.lang.Object


Constructor Summary
Run()
           
 
Method Summary
static org.python.core.PyObject eval(java.lang.String code, java.lang.String mapName, java.lang.Object[] map, JextFrame parent)
          Evaluates some Python code.
static void execute(java.lang.String code, JextFrame parent)
          Executes some Python code.
static org.python.util.PythonInterpreter getPythonInterpreter(JextFrame parent)
          Creates an interpreter.
static org.python.util.PythonInterpreter getPythonInterpreter(JextFrame parent, Console console)
          Creates an interpreter.
static void runScript(java.lang.String fileName, JextFrame parent)
          Runs a Jext script from a file.
static void setupPythonInterpreter(org.python.util.PythonInterpreter interp, JextFrame parent, Console console)
          This method does the local setup for PythonInterpreter: on each one you'll need to call it every time parent changes.
static void startupPythonInterpreter(org.python.util.PythonInterpreter interp)
          This method does the global setup for PythonInterpreter: on each one you'll need to call it only once.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Run

public Run()
Method Detail

startupPythonInterpreter

public static void startupPythonInterpreter(org.python.util.PythonInterpreter interp)
This method does the global setup for PythonInterpreter: on each one you'll need to call it only once.

Since:
Jext3.2pre4

setupPythonInterpreter

public static void setupPythonInterpreter(org.python.util.PythonInterpreter interp,
                                          JextFrame parent,
                                          Console console)
This method does the local setup for PythonInterpreter: on each one you'll need to call it every time parent changes. It setups the __jext__ script variable and the I/O streams.

Parameters:
interp - the PythonInterpreter to setup
parent - the value to give to the __jext__ var; if null, output will go to Jext's stdout and stderr(i.e. System.out and System.err)
console - if null, output will go to the log window of parent; else, it will go inside this console
Since:
Jext3.2pre4

getPythonInterpreter

public static org.python.util.PythonInterpreter getPythonInterpreter(JextFrame parent)
Creates an interpreter.

Parameters:
parent - The window which executes the script

getPythonInterpreter

public static org.python.util.PythonInterpreter getPythonInterpreter(JextFrame parent,
                                                                     Console console)
Creates an interpreter.

Parameters:
parent - The window which executes the script
console -

eval

public static org.python.core.PyObject eval(java.lang.String code,
                                            java.lang.String mapName,
                                            java.lang.Object[] map,
                                            JextFrame parent)
Evaluates some Python code.

Parameters:
code - The script code to be evaluated
map - A map of properties to add to interpreter
parent - The window which executes the script
Returns:
The result of the evaluation

execute

public static void execute(java.lang.String code,
                           JextFrame parent)
Executes some Python code.

Parameters:
code - The script code to be interpreted
parent - The window which executes the script

runScript

public static void runScript(java.lang.String fileName,
                             JextFrame parent)
Runs a Jext script from a file.

Parameters:
fileName - Path to the script
parent - The Jext window which have to execute the script


Copyright ? 2002 Romain Guy.