Package org.python.modules._io
Class _jyio
- java.lang.Object
-
- org.python.modules._io._jyio
-
- All Implemented Interfaces:
ClassDictInit
public class _jyio extends java.lang.Object implements ClassDictInit
The Python _io module implemented in Java.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
__doc__
static java.lang.String
__doc__open
static PyInteger
DEFAULT_BUFFER_SIZE
Default buffer size for export.static PyType
UnsupportedOperation
A Python class for theUnsupportedOperation
exception.
-
Constructor Summary
Constructors Constructor Description _jyio()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
classDictInit(PyObject dict)
This method is called when the module is loaded, to populate the namespace (dictionary) of the module.static PyObject
open(PyObject[] args, java.lang.String[] kwds)
Open file and return a stream.static PyException
UnsupportedOperation(java.lang.String message)
A function that returns aPyException
, which is a Java exception suitable for throwing, and that will be raised as anUnsupportedOperation
Python exception.
-
-
-
Field Detail
-
UnsupportedOperation
public static PyType UnsupportedOperation
A Python class for theUnsupportedOperation
exception.
-
DEFAULT_BUFFER_SIZE
public static final PyInteger DEFAULT_BUFFER_SIZE
Default buffer size for export.
-
__doc__
public static final java.lang.String __doc__
- See Also:
- Constant Field Values
-
__doc__open
public static final java.lang.String __doc__open
- See Also:
- Constant Field Values
-
-
Method Detail
-
classDictInit
public static void classDictInit(PyObject dict)
This method is called when the module is loaded, to populate the namespace (dictionary) of the module. The dictionary has been initialised at this point reflectively from the methods of this class and this method nulls those entries that ought not to be exposed.- Parameters:
dict
- namespace of the module
-
UnsupportedOperation
public static PyException UnsupportedOperation(java.lang.String message)
A function that returns aPyException
, which is a Java exception suitable for throwing, and that will be raised as anUnsupportedOperation
Python exception.- Parameters:
message
- text message parameter to the Python exception- Returns:
- nascent
UnsupportedOperation
Python exception
-
open
public static PyObject open(PyObject[] args, java.lang.String[] kwds)
Open file and return a stream. Raise IOError upon failure. This is a port to Java of the CPython _io.open (Modules/_io/_iomodule.c) following the same logic, but expressed with the benefits of Java syntax.- Parameters:
args
- array of arguments from Python call via Jython frameworkkwds
- array of keywords from Python call via Jython framework- Returns:
- the stream object
-
-