ArithmeticError
public static PyObject ArithmeticError
AssertionError
public static PyObject AssertionError
AttributeError
public static PyObject AttributeError
COMMENT
public static final int COMMENT
DEBUG
public static final int DEBUG
DeprecationWarning
public static PyObject DeprecationWarning
ERROR
public static final int ERROR
Ellipsis
public static PyObject Ellipsis
The singleton Ellipsis Python object - written as ... when indexing
EmptyObjects
public static PyObject[] EmptyObjects
A zero-length array of PyObject's to pass to functions that
expect zero-arguments *
EmptyString
public static PyString EmptyString
A zero-length Python string *
EmptyTuple
public static PyTuple EmptyTuple
A tuple with zero elements *
EnvironmentError
public static PyObject EnvironmentError
Exception
public static PyObject Exception
FloatingPointError
public static PyObject FloatingPointError
ImportError
public static PyObject ImportError
IndentationError
public static PyObject IndentationError
IndexError
public static PyObject IndexError
JavaError
public static PyObject JavaError
KeyboardInterrupt
public static PyObject KeyboardInterrupt
LookupError
public static PyObject LookupError
MESSAGE
public static final int MESSAGE
MemoryError
public static PyObject MemoryError
NameError
public static PyObject NameError
Newline
public static PyString Newline
A Python string containing '\n' *
NoConversion
public static Object NoConversion
A unique object to indicate no conversion is possible
in __tojava__ methods *
NoKeywords
public static String[] NoKeywords
A zero-length array of Strings to pass to functions that
don't have any keyword arguments *
None
public static PyObject None
The singleton None Python object *
NotImplemented
public static PyObject NotImplemented
The singleton NotImplemented Python object. Used in rich comparison
NotImplementedError
public static PyObject NotImplementedError
One
public static PyInteger One
The Python integer 1 - also used as true *
OverflowError
public static PyObject OverflowError
OverflowWarning
public static PyObject OverflowWarning
ReferenceError
public static PyObject ReferenceError
RuntimeError
public static PyObject RuntimeError
RuntimeWarning
public static PyObject RuntimeWarning
Space
public static PyString Space
A Python string containing ' ' *
StandardError
public static PyObject StandardError
StopIteration
public static PyObject StopIteration
SyntaxError
public static PyObject SyntaxError
SyntaxWarning
public static PyObject SyntaxWarning
SystemError
public static PyObject SystemError
SystemExit
public static PyObject SystemExit
TypeError
public static PyObject TypeError
UnboundLocalError
public static PyObject UnboundLocalError
UnicodeError
public static PyObject UnicodeError
UserWarning
public static PyObject UserWarning
ValueError
public static PyObject ValueError
WARNING
public static final int WARNING
Zero
public static PyInteger Zero
The Python integer 0 - also used as false *
ZeroDivisionError
public static PyObject ZeroDivisionError
AssertionError
public static PyException AssertionError(String message)
AttributeError
public static PyException AttributeError(String message)
DeprecationWarning
public static void DeprecationWarning(String message)
EOFError
public static PyException EOFError(String message)
FloatingPointError
public static PyException FloatingPointError(String message)
IOError
public static PyException IOError(String message)
IOError
public static PyException IOError(java.io.IOException ioe)
ImportError
public static PyException ImportError(String message)
IndexError
public static PyException IndexError(String message)
JavaError
public static PyException JavaError(Throwable t)
KeyError
public static PyException KeyError(String message)
MemoryError
public static PyException MemoryError(String message)
NameError
public static PyException NameError(String message)
OverflowError
public static PyException OverflowError(String message)
OverflowWarning
public static void OverflowWarning(String message)
ReferenceError
public static PyException ReferenceError(String message)
RuntimeError
public static PyException RuntimeError(String message)
RuntimeWarning
public static void RuntimeWarning(String message)
StopIteration
public static PyException StopIteration(String message)
SyntaxError
public static PyException SyntaxError(String message)
SyntaxWarning
public static void SyntaxWarning(String message)
SystemError
public static PyException SystemError(String message)
TypeError
public static PyException TypeError(String message)
UnboundLocalError
public static PyException UnboundLocalError(String message)
UnicodeError
public static PyException UnicodeError(String message)
UserWarning
public static void UserWarning(String message)
ValueError
public static PyException ValueError(String message)
Warning
public static void Warning(String message)
ZeroDivisionError
public static PyException ZeroDivisionError(String message)
addTraceback
public static void addTraceback(Throwable t,
PyFrame frame)
assert_
public static void assert_(PyObject test)
compile
public static PyCode compile(InputStream istream,
String filename,
String type)
compile
public static PyCode compile(org.python.parser.ast.modType node,
String filename)
compile
public static PyCode compile(org.python.parser.ast.modType node,
String name,
String filename)
compile
public static PyCode compile(org.python.parser.ast.modType node,
String name,
String filename,
boolean linenumbers,
boolean printResults)
compile_command_flags
public static PyObject compile_command_flags(String string,
String filename,
String kind,
CompilerFlags cflags,
boolean stdprompt)
compile_flags
public static PyCode compile_flags(InputStream istream,
String filename,
String type,
CompilerFlags cflags)
compile_flags
public static PyCode compile_flags(String data,
String filename,
String type,
CompilerFlags cflags)
compile_flags
public static PyCode compile_flags(org.python.parser.ast.modType node,
String name,
String filename,
boolean linenumbers,
boolean printResults,
CompilerFlags cflags)
findClass
public static Class findClass(String name)
findClassEx
public static Class findClassEx(String name,
String reason)
getAdapter
public static org.python.core.adapter.ExtensiblePyObjectAdapter getAdapter()
- the ExtensiblePyObjectAdapter used by java2py.
getCompilerFlags
public static CompilerFlags getCompilerFlags(int flags,
boolean dont_inherit)
getFrame
public static PyFrame getFrame()
getName
public static String getName()
getThreadState
public static final ThreadState getThreadState()
idstr
public static String idstr(PyObject o)
initProxy
public static void initProxy(PyProxy proxy,
String module,
String pyclass,
Object[] args,
String[] packages,
String[] props,
String frozenPackage,
String[] modules)
initProxy
public static void initProxy(PyProxy proxy,
String module,
String pyclass,
Object[] args,
String[] packages,
String[] props,
boolean frozen)
initPython
public static boolean initPython()
initRunnable
public static void initRunnable(String module,
PyObject dict)
java2py
public static PyObject java2py(Object o)
Uses the PyObjectAdapter passed to PySystemState.initialize
to turn o into a PyObject.
- default PyObjectAdapter type
java_obj_id
public static long java_obj_id(Object o)
makeCharacter
public static final PyString makeCharacter(Character o)
maybeWrite
public static void maybeWrite(String type,
String msg,
int level)
memory_error
public static void memory_error(OutOfMemoryError t)
newBoolean
public static PyInteger newBoolean(boolean t)
newCode
public static PyCode newCode(int argcount,
varnames[] ,
String filename,
String name,
boolean args,
boolean keywords,
PyFunctionTable funcs,
int func_id)
newCode
public static PyCode newCode(int argcount,
varnames[] ,
String filename,
String name,
boolean args,
boolean keywords,
PyFunctionTable funcs,
int func_id,
String[] cellvars,
String[] freevars,
int npurecell,
int moreflags)
newCode
public static PyCode newCode(int argcount,
varnames[] ,
String filename,
String name,
int firstlineno,
boolean args,
boolean keywords,
PyFunctionTable funcs,
int func_id)
newCode
public static PyCode newCode(int argcount,
varnames[] ,
String filename,
String name,
int firstlineno,
boolean args,
boolean keywords,
PyFunctionTable funcs,
int func_id,
String[] cellvars,
String[] freevars,
int npurecell,
int moreflags)
newFloat
public static PyFloat newFloat(double v)
newFloat
public static PyFloat newFloat(float v)
newImaginary
public static PyComplex newImaginary(double v)
newInteger
public static final PyInteger newInteger(int i)
newInteger
public static PyObject newInteger(long i)
newJavaCode
public static PyCode newJavaCode(Class cls,
String name)
newJavaFunc
public static PyObject newJavaFunc(Class cls,
String name)
newLong
public static PyLong newLong(String s)
newLong
public static PyLong newLong(int i)
newLong
public static PyLong newLong(java.math.BigInteger i)
newString
public static PyString newString(String s)
newString
public static PyString newString(char c)
newUnicode
public static PyUnicode newUnicode(String s)
newUnicode
public static PyUnicode newUnicode(char c)
print
public static void print(PyObject o)
printComma
public static void printComma(PyObject o)
printException
public static void printException(Throwable t)
printException
public static void printException(Throwable t,
PyFrame f)
printException
public static void printException(Throwable t,
PyFrame f,
PyObject file)
printResult
public static void printResult(PyObject ret)
println
public static void println()
println
public static void println(PyObject o)
printlnv
public static void printlnv(PyObject file)
py2boolean
public static boolean py2boolean(PyObject o)
py2byte
public static byte py2byte(PyObject o)
py2char
public static char py2char(PyObject o)
py2char
public static char py2char(PyObject o,
String msg)
py2double
public static double py2double(PyObject o)
py2float
public static float py2float(PyObject o)
py2int
public static int py2int(PyObject o)
py2int
public static int py2int(PyObject o,
String msg)
py2long
public static long py2long(PyObject o)
py2short
public static short py2short(PyObject o)
py2void
public static void py2void(PyObject o)
relFindClass
public static Class relFindClass(Class home,
String name)
runMain
public static void runMain(Class mainClass,
String[] args,
String[] packages,
String[] props,
String frozenPackage,
String[] modules)
throws Exception
runMain
public static void runMain(PyRunnable main,
String[] args)
throws Exception
Initializes a default PythonInterpreter and runs the code from
PyRunnable.getMain()
as __main__
Called by the code generated in
Module.addMain()
safeRepr
public static String safeRepr(PyObject o)
saveClassFile
public static void saveClassFile(String name,
ByteArrayOutputStream bytestream)
setFrame
public static void setFrame(PyFrame f)
tojava
public static Object tojava(PyObject o,
Class c)
Convert a given PyObject
to an instance of a Java class.
Identical to o.__tojava__(c)
except that it will
raise a TypeError
if the conversion fails.
o
- the PyObject
to convert.c
- the class to convert it to.
tojava
public static Object tojava(PyObject o,
String s)
warning
public static void warning(PyObject category,
String message)
warning
public static void warning(PyObject category,
String message,
String filename,
int lineno,
String module,
PyObject registry)
writeComment
public static void writeComment(String type,
String msg)
writeDebug
public static void writeDebug(String type,
String msg)
writeError
public static void writeError(String type,
String msg)
writeMessage
public static void writeMessage(String type,
String msg)
writeWarning
public static void writeWarning(String type,
String msg)