public class PySystemState extends PyObject implements AutoCloseable, ClassDictInit, Closeable, Traverseproc
Modifier and Type | Class and Description |
---|---|
static class |
PySystemState.PySystemStateCloser |
PyObject.ConversionException
gcMonitorGlobal, TYPE
Constructor and Description |
---|
PySystemState() |
Modifier and Type | Method and Description |
---|---|
void |
__delattr__(String name)
A variant of the __delattr__ method which accepts a String
as the key.
|
PyObject |
__findattr_ex__(String name)
Attribute lookup hook.
|
void |
__rawdir__(PyDictionary accum) |
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 void |
classDictInit(PyObject dict) |
void |
cleanup() |
void |
close() |
static PySystemState |
doInitialize(Properties preProperties,
Properties postProperties,
String[] argv,
ClassLoader classLoader,
ExtensiblePyObjectAdapter adapter) |
static void |
exc_clear() |
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.
|
static Properties |
getBaseProperties() |
static String |
getBuiltin(String name) |
PyObject |
getBuiltins() |
ClassLoader |
getClassLoader() |
codecs.CodecState |
getCodecState() |
String |
getCurrentWorkingDir()
Return a string representing the current working directory.
|
static PyObject |
getDefaultBuiltins() |
PyString |
getdefaultencoding() |
File |
getFile(String path)
Resolve a path, returning a
File , taking the current working directory into account. |
PyObject |
getfilesystemencoding() |
ReentrantLock |
getImportLock() |
String |
getPath(String path)
Resolve a path.
|
static String |
getPathLazy(String path)
Resolve a path.
|
PyObject |
getPlatform() |
PyObject |
getprofile() |
int |
getrecursionlimit() |
ClassLoader |
getSyspathJavaLoader() |
PyObject |
gettrace() |
PyObject |
getWarnoptions() |
static void |
initialize() |
static void |
initialize(Properties preProperties,
Properties postProperties) |
static void |
initialize(Properties preProperties,
Properties postProperties,
String[] argv) |
static void |
initialize(Properties preProperties,
Properties postProperties,
String[] argv,
ClassLoader classLoader) |
static void |
initialize(Properties preProperties,
Properties postProperties,
String[] argv,
ClassLoader classLoader,
ExtensiblePyObjectAdapter adapter) |
static boolean |
isPackageCacheEnabled() |
boolean |
refersDirectlyTo(PyObject ob)
Optional operation.
|
void |
registerCloser(Callable<Void> resourceCloser) |
void |
setBuiltins(PyObject value) |
void |
setClassLoader(ClassLoader classLoader) |
void |
setCurrentWorkingDir(String path)
Change the current working directory to the specified path.
|
void |
setdefaultencoding(String encoding) |
void |
setPlatform(PyObject value) |
void |
setprofile(PyObject profilefunc) |
void |
setrecursionlimit(int recursionlimit) |
void |
settrace(PyObject tracefunc) |
void |
setWarnoptions(PyObject value) |
void |
shadow()
Deprecated.
|
String |
toString() |
int |
traverse(Visitproc visit,
Object arg)
Traverses all directly contained
PyObject s. |
boolean |
unregisterCloser(Callable<Void> resourceCloser) |
__abs__, __add__, __and__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __call__, __cmp__, __coerce__, __coerce_ex__, __complex__, __contains__, __delattr__, __delete__, __delitem__, __delitem__, __delslice__, __delslice__, __dir__, __div__, __divmod__, __ensure_finalizer__, __eq__, __findattr__, __findattr__, __finditem__, __finditem__, __finditem__, __float__, __floordiv__, __format__, __ge__, __get__, __getattr__, __getattr__, __getitem__, __getitem__, __getnewargs__, __getslice__, __getslice__, __gt__, __hash__, __hex__, __iadd__, __iand__, __idiv__, __idivmod__, __ifloordiv__, __ilshift__, __imod__, __imul__, __index__, __int__, __invert__, __ior__, __ipow__, __irshift__, __isub__, __iter__, __iternext__, __itruediv__, __ixor__, __le__, __len__, __long__, __lshift__, __lt__, __mod__, __mul__, __ne__, __neg__, __nonzero__, __not__, __oct__, __or__, __pos__, __pow__, __pow__, __radd__, __rand__, __rdiv__, __rdivmod__, __reduce__, __reduce_ex__, __reduce_ex__, __repr__, __rfloordiv__, __rlshift__, __rmod__, __rmul__, __ror__, __rpow__, __rrshift__, __rshift__, __rsub__, __rtruediv__, __rxor__, __set__, __setattr__, __setitem__, __setitem__, __setitem__, __setslice__, __setslice__, __str__, __sub__, __tojava__, __truediv__, __trunc__, __unicode__, __xor__, _add, _and, _callextra, _cmp, _div, _divmod, _doget, _doget, _doset, _eq, _floordiv, _ge, _gt, _iadd, _iand, _idiv, _idivmod, _ifloordiv, _ilshift, _imod, _imul, _in, _ior, _ipow, _irshift, _is, _isnot, _isub, _itruediv, _ixor, _jcall, _jcallexc, _jthrow, _le, _lshift, _lt, _mod, _mul, _ne, _notin, _or, _pow, _rshift, _sub, _truediv, _xor, asDouble, asIndex, asIndex, asInt, asInt, asIterable, asLong, asLong, asName, asName, asString, asString, asStringOrNull, asStringOrNull, bit_length, conjugate, delDict, delType, dispatch__init__, equals, fastGetClass, fastGetDict, getDict, getType, hashCode, implementsDescrDelete, implementsDescrGet, implementsDescrSet, invoke, invoke, invoke, invoke, invoke, invoke, isCallable, isDataDescr, isIndex, isInteger, isMappingType, isNumberType, isSequenceType, noAttributeError, object___subclasshook__, readonlyAttributeError, setDict, setType
public static final String PYTHON_CACHEDIR
public static final String PYTHON_CACHEDIR_SKIP
public static final String PYTHON_CONSOLE_ENCODING
public static final String PYTHON_IO_ENCODING
public static final String PYTHON_IO_ERRORS
public static final String JYTHON_JAR
public static final String JYTHON_DEV_JAR
public static final PyString version
public static final PyTuple subversion
public static final int hexversion
public static final PyTuple version_info
public static final int maxunicode
public static final int maxsize
public static final PyString float_repr_style
public static boolean py3kwarning
public static final Class flags
public static final PyTuple _mercurial
public static final PyObject copyright
public static PyTuple builtin_module_names
public static PackageManager packageManager
public static Properties registry
public static PyObject prefix
public static PyObject exec_prefix
public static final PyString byteorder
public static final int maxint
public static final int minint
public PyList argv
public PyObject modules
public PyList path
public PyList warnoptions
public PyObject builtins
public PyObject platform
public PyList meta_path
public PyList path_hooks
public PyObject path_importer_cache
public PyObject ps1
public PyObject ps2
public PyObject executable
public PyObject stdout
public PyObject stderr
public PyObject stdin
public PyObject __stdout__
public PyObject __stderr__
public PyObject __stdin__
public PyObject __displayhook__
public PyObject __excepthook__
public PyObject last_value
public PyObject last_type
public PyObject last_traceback
public PyObject __name__
public PyObject __dict__
public boolean _systemRestart
public boolean dont_write_bytecode
public static final PyObject float_info
public static final PyObject long_info
public static void classDictInit(PyObject dict)
@Deprecated public void shadow()
public static PyObject getDefaultBuiltins()
public PyObject getBuiltins()
public void setBuiltins(PyObject value)
public PyObject getWarnoptions()
public void setWarnoptions(PyObject value)
public PyObject getPlatform()
public void setPlatform(PyObject value)
public codecs.CodecState getCodecState()
public ReentrantLock getImportLock()
public ClassLoader getSyspathJavaLoader()
public PyObject __findattr_ex__(String name)
PyObject
PyObject.__getattr__(String)
or
PyObject.__findattr__(String)
. Both methods have a clear policy for
failed lookups.__findattr_ex__
in class PyObject
public void __setattr__(String name, PyObject value)
PyObject
__setattr__
in class PyObject
name
- the name whose value will be set -
must be an interned string .value
- the value to set this name toPyObject.__setattr__(PyString, PyObject)
public void __delattr__(String name)
PyObject
__delattr__(PyString name)
with the appropriate args.
The only reason to override this method is for performance.__delattr__
in class PyObject
name
- the name which will be removed -
must be an interned string .PyObject.__delattr__(PyString)
public void __rawdir__(PyDictionary accum)
public int getrecursionlimit()
public void setrecursionlimit(int recursionlimit)
public PyObject gettrace()
public void settrace(PyObject tracefunc)
public PyObject getprofile()
public void setprofile(PyObject profilefunc)
public PyString getdefaultencoding()
public void setdefaultencoding(String encoding)
public PyObject getfilesystemencoding()
public void setCurrentWorkingDir(String path)
path
- a path Stringpublic String getCurrentWorkingDir()
public String getPath(String path)
path
- a path Stringpublic static String getPathLazy(String path)
path
- a path Stringpublic File getFile(String path)
File
, taking the current working directory into account.path
- a path String
File
public void callExitFunc() throws PyIgnoreMethodTag
PyIgnoreMethodTag
public ClassLoader getClassLoader()
public void setClassLoader(ClassLoader classLoader)
public static Properties getBaseProperties()
public static void initialize()
public static void initialize(Properties preProperties, Properties postProperties)
public static void initialize(Properties preProperties, Properties postProperties, String[] argv)
public static void initialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader)
public static void initialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader, ExtensiblePyObjectAdapter adapter)
public static PySystemState doInitialize(Properties preProperties, Properties postProperties, String[] argv, ClassLoader classLoader, ExtensiblePyObjectAdapter adapter)
public static boolean isPackageCacheEnabled()
public static PyJavaPackage add_package(String n)
public static PyJavaPackage add_package(String n, String contents)
public static void add_classdir(String directoryPath)
Note. Classes found in directory and sub-directory are not made available to jython by
this call. It only makes the java package found in the directory available. This call is
mostly useful if jython is embedded in an application that deals with its own class loaders.
A servlet container is a very good example. Calling add_classdir("
public static void add_extdir(String directoryPath)
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.
directoryPath
- The name of a directory.add_classdir(java.lang.String)
public static void add_extdir(String directoryPath, boolean cache)
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.
directoryPath
- The name of a directory.cache
- Controls if the packages in the zip and jar file should be cached.add_classdir(java.lang.String)
public static void exit(PyObject status)
status
- the value to exit withPy.SystemExit
- always throws this exception. When caught at top level the program
will exit.public static void exit()
public static PyTuple exc_info()
public static void exc_clear()
public static PyFrame _getframe()
public static PyFrame _getframe(int depth)
public void cleanup()
public void close()
close
in interface Closeable
close
in interface AutoCloseable
public int traverse(Visitproc visit, Object arg)
Traverseproc
PyObject
s.
Like in CPython, arg
must be passed
unmodified to visit
as its second parameter.
If Visitproc.visit(PyObject, Object)
returns
nonzero, this return value
must be returned immediately by traverse.
Visitproc.visit(PyObject, Object)
must not be
called with a null
PyObject-argument.traverse
in interface Traverseproc
public boolean refersDirectlyTo(PyObject ob)
Traverseproc
Traverseproc.traverse(Visitproc, Object)
with
a visitproc that just watches out for ob
.
Must return false
if ob
is null
.refersDirectlyTo
in interface Traverseproc