org.python.core
Class PySystemState

java.lang.Object
  extended byorg.python.core.PyObject
      extended byorg.python.core.PySystemState
All Implemented Interfaces:
Serializable

public class PySystemState
extends PyObject

The "sys" module.

See Also:
Serialized Form

Field Summary
 PyObject __dict__
           
 PyObject __displayhook__
           
 PyObject __excepthook__
           
 PyObject __stderr__
           
 PyObject __stdin__
           
 PyObject __stdout__
           
static boolean appletMode
           
 PyList argv
          The arguments passed to this program on the command line.
static String[] builtin_module_names
           
 PyObject builtins
           
static File cachedir
           
static String copyright
          The copyright notice for this release.
static String exec_prefix
           
 PyObject executable
           
static int hexversion
           
 PyObject last_traceback
           
 PyObject last_type
           
 PyObject last_value
           
static int maxint
           
static int minint
           
 PyObject modules
           
static PackageManager packageManager
           
 PyList path
           
static String platform
           
static String prefix
           
 TraceFunction profilefunc
           
 PyObject ps1
           
 PyObject ps2
           
static Properties registry
           
 PyObject stderr
           
 PyObject stdin
           
 PyObject stdout
           
 TraceFunction tracefunc
           
static String version
          The current version of JPython.
static PyTuple version_info
           
static PyList warnoptions
           
 
Fields inherited from class org.python.core.PyObject
__class__
 
Constructor Summary
PySystemState()
           
 
Method Summary
 void __delattr__(String name)
          A variant of the __delattr__ method which accepts a String as the key.
 PyObject __findattr__(String name)
          A variant of the __findattr__ method which accepts a Java String as the name.
 void __setattr__(String name, PyObject value)
          A variant of the __setattr__ method which accepts a String as the key.
static PyFrame _getframe()
           
static PyFrame _getframe(int depth)
           
static void add_classdir(String directoryPath)
          Add a classpath directory to the list of places that are searched for java packages.
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.
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.
static PyJavaPackage add_package(String n)
           
static PyJavaPackage add_package(String n, String contents)
           
 void callExitFunc()
           
static PyTuple exc_info()
           
static void exit()
          Exit a Python program with the status 0.
static void exit(PyObject status)
          Exit a Python program with the given status.
 ClassLoader getClassLoader()
           
 String getdefaultencoding()
           
static void initialize()
           
static void initialize(Properties preProperties, Properties postProperties, String[] argv)
           
static void initialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader)
           
static void initializeApplet()
           
 String safeRepr()
           
 void setClassLoader(ClassLoader classLoader)
           
 void setdefaultencoding(String encoding)
           
 void setprofile(PyObject profilefunc)
           
 void settrace(PyObject tracefunc)
           
 String toString()
           
 
Methods inherited from class org.python.core.PyObject
__abs__, __add__, __and__, __anye__, __bde__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delitem__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __eq__, __findattr__, __finditem__, __finditem__, __finditem__, __float__, __ge__, __getattr__, __getattr__, __getitem__, __getitem__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ilshift__, __imod__, __imul__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __ixor__, __lde__, __le__, __len__, __like__, __long__, __lshift__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rcontained__, __rcontains__, __rde__, __rdiv__, __rdivmod__, __repr__, __rexact__, __rlshift__, __rmod__, __rmul__, __ror__, __roverlaps__, __rpow__, __rrshift__, __rshift__, __rsub__, __rxor__, __setattr__, __setitem__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __str2__, __sub__, __tojava__, __xor__, _add, _and, _anye, _bde, _callextra, _cmp, _div, _divmod, _dodel, _doget, _doget, _doset, _eq, _ge, _gt, _in, _is, _isnot, _jcall, _jcallexc, _jthrow, _lde, _le, _like, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rcontained, _rcontains, _rde, _rexact, _roverlaps, _rshift, _sub, _xor, equals, hashCode, invoke, invoke, invoke, invoke, invoke, isCallable, isMappingType, isNumberType, isSequenceType
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

version

public static String version
The current version of JPython.


hexversion

public static int hexversion

version_info

public static PyTuple version_info

copyright

public static String copyright
The copyright notice for this release.


argv

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


modules

public PyObject modules

path

public PyList path

builtins

public PyObject builtins

platform

public static String platform

ps1

public PyObject ps1

ps2

public PyObject ps2

maxint

public static int maxint

minint

public static int minint

executable

public PyObject executable

warnoptions

public static PyList warnoptions

stdout

public PyObject stdout

stderr

public PyObject stderr

stdin

public PyObject stdin

__stdout__

public PyObject __stdout__

__stderr__

public PyObject __stderr__

__stdin__

public PyObject __stdin__

__displayhook__

public PyObject __displayhook__

__excepthook__

public PyObject __excepthook__

last_value

public PyObject last_value

last_type

public PyObject last_type

last_traceback

public PyObject last_traceback

__dict__

public PyObject __dict__

registry

public static Properties registry

prefix

public static String prefix

exec_prefix

public static String exec_prefix

appletMode

public static boolean appletMode

packageManager

public static PackageManager packageManager

cachedir

public static File cachedir

builtin_module_names

public static String[] builtin_module_names

tracefunc

public TraceFunction tracefunc

profilefunc

public TraceFunction profilefunc
Constructor Detail

PySystemState

public PySystemState()
Method Detail

exit

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

Parameters:
status - the value to exit with
Throws:
PySystemExit - 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.


getClassLoader

public ClassLoader getClassLoader()

setClassLoader

public void setClassLoader(ClassLoader classLoader)

exc_info

public static PyTuple exc_info()

_getframe

public static PyFrame _getframe()

_getframe

public static PyFrame _getframe(int depth)

__findattr__

public PyObject __findattr__(String name)
Description copied from class: PyObject
A variant of the __findattr__ method which accepts a Java String as the name. By default, this method will call __findattr__(PyString name) with the appropriate args. The only reason to override this method is for performance. Warning: name must be an interned string!!!!!!!!

Overrides:
__findattr__ in class PyObject
Parameters:
name - the name to lookup in this namespace must be an interned string .
Returns:
the value corresponding to name or null if name is not found
See Also:
PyObject.__findattr__(PyString)

__setattr__

public void __setattr__(String name,
                        PyObject value)
Description copied from class: PyObject
A variant of the __setattr__ method which accepts a String as the key. This String must be interned.

Overrides:
__setattr__ in class PyObject
Parameters:
name - the name whose value will be set - must be an interned string .
value - the value to set this name to
See Also:
PyObject.__setattr__(PyString, PyObject)

__delattr__

public void __delattr__(String name)
Description copied from class: PyObject
A variant of the __delattr__ method which accepts a String as the key. This String must be interned. By default, this will call __delattr__(PyString name) with the appropriate args. The only reason to override this method is for performance.

Overrides:
__delattr__ in class PyObject
Parameters:
name - the name which will be removed - must be an interned string .
See Also:
PyObject.__delattr__(PyString)

safeRepr

public String safeRepr()
                throws PyIgnoreMethodTag
Overrides:
safeRepr in class PyObject
Throws:
PyIgnoreMethodTag

toString

public String toString()

initializeApplet

public static void initializeApplet()

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)

add_package

public static PyJavaPackage add_package(String n)

add_package

public static PyJavaPackage add_package(String n,
                                        String contents)

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 make the java package found ion 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:
add_classdir(java.lang.String)

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:
add_classdir(java.lang.String)

settrace

public void settrace(PyObject tracefunc)

setprofile

public void setprofile(PyObject profilefunc)

getdefaultencoding

public String getdefaultencoding()

setdefaultencoding

public void setdefaultencoding(String encoding)

callExitFunc

public void callExitFunc()
                  throws PyIgnoreMethodTag
Throws:
PyIgnoreMethodTag