Top Description Fields Constructors Methods
org.python.modules._io

public Class _jyio

extends Object
implements ClassDictInit
Class Inheritance
All Implemented Interfaces
org.python.core.ClassDictInit
Imports
org.python.core.ArgParser, .ClassDictInit, .Py, .PyException, .PyInteger, .PyObject, .PyString, .PyStringMap, .PyType, .imp, org.python.core.io.IOBase

The Python _io module implemented in Java.

Field Summary

Modifier and TypeField and Description
public static final String
public static final String
private static final int
_DEFAULT_BUFFER_SIZE

Default buffer size obtained from IOBase#DEFAULT_BUFFER_SIZE.

public static final PyInteger
DEFAULT_BUFFER_SIZE

Default buffer size for export.

private static final String[]
public static PyType
UnsupportedOperation

A Python class for the UnsupportedOperation exception.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static void
classDictInit(PyObject
namespace of the module
dict
)

This method is called when the module is loaded, to populate the namespace (dictionary) of the module.

private static PyType

Returns:

the constructed exception type
makeException
(PyObject
module dictionary
dict
,
String
name of the exception
excname
,
PyObject...
one or more bases (superclasses)
bases
)

Convenience method for constructing a type object of a Python exception, named as given, and added to the namespace of the "_io" module.

public static PyObject

Returns:

the stream object
open
(PyObject[]
array of arguments from Python call via Jython framework
args
,
String[]
array of keywords from Python call via Jython framework
kwds
)

Open file and return a stream.

public static PyException

Returns:

nascent UnsupportedOperation Python exception
UnsupportedOperation
(String
text message parameter to the Python exception
message
)

A function that returns a PyException, which is a Java exception suitable for throwing, and that will be raised as an UnsupportedOperation Python exception.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

__doc__back to summary
public static final String __doc__
__doc__openback to summary
public static final String __doc__open
_DEFAULT_BUFFER_SIZEback to summary
private static final int _DEFAULT_BUFFER_SIZE

Default buffer size obtained from IOBase#DEFAULT_BUFFER_SIZE.

DEFAULT_BUFFER_SIZEback to summary
public static final PyInteger DEFAULT_BUFFER_SIZE

Default buffer size for export.

openKwdsback to summary
private static final String[] openKwds
UnsupportedOperationback to summary
public static PyType UnsupportedOperation

A Python class for the UnsupportedOperation exception.

Constructor Detail

_jyioback to summary
public _jyio()

Method Detail

classDictInitback to summary
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:PyObject

namespace of the module

makeExceptionback to summary
private static PyType makeException(PyObject dict, String excname, PyObject... bases)

Convenience method for constructing a type object of a Python exception, named as given, and added to the namespace of the "_io" module.

Parameters
dict:PyObject

module dictionary

excname:String

name of the exception

bases:PyObject[]

one or more bases (superclasses)

Returns:PyType

the constructed exception type

openback to summary
public static PyObject open(PyObject[] args, 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:PyObject[]

array of arguments from Python call via Jython framework

kwds:String[]

array of keywords from Python call via Jython framework

Returns:PyObject

the stream object

UnsupportedOperationback to summary
public static PyException UnsupportedOperation(String message)

A function that returns a PyException, which is a Java exception suitable for throwing, and that will be raised as an UnsupportedOperation Python exception.

Parameters
message:String

text message parameter to the Python exception

Returns:PyException

nascent UnsupportedOperation Python exception