org.python.core

Class PySystemState

public class PySystemState extends PyObject

The "sys" module.
Field Summary
PyListargv
The arguments passed to this program on the command line.
static PyObjectbuiltins
static String[]builtin_module_names
static Stringbyteorder
static Filecachedir
static Stringcopyright
The copyright notice for this release.
PyObjectexecutable
static Stringexec_prefix
static inthexversion
static StringJYTHON_JAR
PyObjectlast_traceback
PyObjectlast_type
PyObjectlast_value
static intmaxint
static intmaxunicode
PyListmeta_path
static intminint
PyObjectmodules
static PackageManagerpackageManager
PyListpath
PyListpath_hooks
PyObjectpath_importer_cache
static Stringplatform
static Stringprefix
TraceFunctionprofilefunc
PyObjectps1
PyObjectps2
static Propertiesregistry
PyObjectstderr
PyObjectstdin
PyObjectstdout
TraceFunctiontracefunc
static Stringversion
The current version of Jython.
static PyTupleversion_info
static PyListwarnoptions
PyObject__dict__
PyObject__displayhook__
PyObject__excepthook__
PyObject__stderr__
PyObject__stdin__
PyObject__stdout__
Constructor Summary
PySystemState()
Method Summary
static voidadd_classdir(String directoryPath)
Add a classpath directory to the list of places that are searched for java packages.
static voidadd_extdir(String directoryPath)
Add a .jar & .zip directory to the list of places that are searched for java .jar and .zip files.
static voidadd_extdir(String directoryPath, boolean cache)
Add a .jar & .zip directory to the list of places that are searched for java .jar and .zip files.
static PyJavaPackageadd_package(String n)
static PyJavaPackageadd_package(String n, String contents)
voidcallExitFunc()
static PyTupleexc_info()
static voidexit(PyObject status)
Exit a Python program with the given status.
static voidexit()
Exit a Python program with the status 0.
static PropertiesgetBaseProperties()
ClassLoadergetClassLoader()
Stringgetdefaultencoding()
intgetrecursionlimit()
static voidinitialize()
static voidinitialize(Properties preProperties, Properties postProperties, String[] argv)
static voidinitialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader)
static voidinitialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader, ExtensiblePyObjectAdapter adapter)
StringsafeRepr()
voidsetClassLoader(ClassLoader classLoader)
voidsetdefaultencoding(String encoding)
voidsetprofile(PyObject profilefunc)
voidsetrecursionlimit(int recursionlimit)
voidsettrace(PyObject tracefunc)
StringtoString()
static PyFrame_getframe()
static PyFrame_getframe(int depth)
void__delattr__(String name)
PyObject__findattr__(String name)
void__rawdir__(PyDictionary accum)
void__setattr__(String name, PyObject value)

Field Detail

argv

public PyList argv
The arguments passed to this program on the command line.

builtins

public static PyObject builtins

builtin_module_names

public static String[] builtin_module_names

byteorder

public static String byteorder

cachedir

public static File cachedir

copyright

public static String copyright
The copyright notice for this release.

executable

public PyObject executable

exec_prefix

public static String exec_prefix

hexversion

public static int hexversion

JYTHON_JAR

public static final String JYTHON_JAR

last_traceback

public PyObject last_traceback

last_type

public PyObject last_type

last_value

public PyObject last_value

maxint

public static int maxint

maxunicode

public static int maxunicode

meta_path

public PyList meta_path

minint

public static int minint

modules

public PyObject modules

packageManager

public static PackageManager packageManager

path

public PyList path

path_hooks

public PyList path_hooks

path_importer_cache

public PyObject path_importer_cache

platform

public static String platform

prefix

public static String prefix

profilefunc

public TraceFunction profilefunc

ps1

public PyObject ps1

ps2

public PyObject ps2

registry

public static Properties registry

stderr

public PyObject stderr

stdin

public PyObject stdin

stdout

public PyObject stdout

tracefunc

public TraceFunction tracefunc

version

public static String version
The current version of Jython.

Usually updated by hand.
Replaced by ant when doing a snapshot build.

This also applies for the PY_* integer values below

version_info

public static PyTuple version_info

warnoptions

public static PyList warnoptions

__dict__

public PyObject __dict__

__displayhook__

public PyObject __displayhook__

__excepthook__

public PyObject __excepthook__

__stderr__

public PyObject __stderr__

__stdin__

public PyObject __stdin__

__stdout__

public PyObject __stdout__

Constructor Detail

PySystemState

public PySystemState()

Method Detail

add_classdir

public static void add_classdir(String directoryPath)
Add a classpath directory to the list of places that are searched for java packages.

Note. Classes found in directory and subdirectory are not made available to jython by this call. It only makes the java package found in the directory available. This call is mostly usefull if jython is embedded in an application that deals with its own classloaders. A servlet container is a very good example. Calling add_classdir("/WEB-INF/classes") makes the java packages in WEB-INF classes available to jython import. However the actual classloading is completely handled by the servlet container's context classloader.

add_extdir

public static void add_extdir(String directoryPath)
Add a .jar & .zip directory to the list of places that are searched for java .jar and .zip files. The .jar and .zip files found will not be cached.

Note. Classes in .jar and .zip files found in the directory are not made available to jython by this call. See the note for add_classdir(dir) for more details.

Parameters: directoryPath The name of a directory.

See Also: PySystemState

add_extdir

public static void add_extdir(String directoryPath, boolean cache)
Add a .jar & .zip directory to the list of places that are searched for java .jar and .zip files.

Note. Classes in .jar and .zip files found in the directory are not made available to jython by this call. See the note for add_classdir(dir) for more details.

Parameters: directoryPath The name of a directory. cache Controls if the packages in the zip and jar file should be cached.

See Also: PySystemState

add_package

public static PyJavaPackage add_package(String n)

add_package

public static PyJavaPackage add_package(String n, String contents)

callExitFunc

public void callExitFunc()

exc_info

public static PyTuple exc_info()

exit

public static void exit(PyObject status)
Exit a Python program with the given status.

Parameters: status the value to exit with

Throws: Py.SystemExit always throws this exception. When caught at top level the program will exit.

exit

public static void exit()
Exit a Python program with the status 0.

getBaseProperties

public static Properties getBaseProperties()

getClassLoader

public ClassLoader getClassLoader()

getdefaultencoding

public String getdefaultencoding()

getrecursionlimit

public int getrecursionlimit()

initialize

public static void initialize()

initialize

public static void initialize(Properties preProperties, Properties postProperties, String[] argv)

initialize

public static void initialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader)

initialize

public static void initialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader, ExtensiblePyObjectAdapter adapter)

safeRepr

public String safeRepr()

setClassLoader

public void setClassLoader(ClassLoader classLoader)

setdefaultencoding

public void setdefaultencoding(String encoding)

setprofile

public void setprofile(PyObject profilefunc)

setrecursionlimit

public void setrecursionlimit(int recursionlimit)

settrace

public void settrace(PyObject tracefunc)

toString

public String toString()

_getframe

public static PyFrame _getframe()

_getframe

public static PyFrame _getframe(int depth)

__delattr__

public void __delattr__(String name)

__findattr__

public PyObject __findattr__(String name)

__rawdir__

public void __rawdir__(PyDictionary accum)

__setattr__

public void __setattr__(String name, PyObject value)
Jython homepage