module filehelper.jython_helper
¶
Short summary¶
module pyenbc.filehelper.jython_helper
Hadoop uses a java implementation of Python: Jython. This provides provides helper around that.
Functions¶
function |
truncated documentation |
---|---|
download the standalone jython if it does not exists, we should version |
|
return the java path |
|
returns the java path :raises FileNotFoundError: if java is not found |
|
This function assumes a file |
|
Checks if :epkg:`java` is installed. |
|
runs a jython script and returns the standard output and error |
Documentation¶
Hadoop uses a java implementation of Python: Jython. This provides provides helper around that.
- pyenbc.filehelper.jython_helper.download_java_standalone(version='2.7.1-rc2')¶
download the standalone jython if it does not exists, we should version
JYTHON_VERSION
by default in order to fit the cluster’s version- Parameters:
version –
JYTHON_VERSION
or …- Returns:
path to it
- pyenbc.filehelper.jython_helper.get_java_cmd()¶
return the java path
- Returns:
java cmd
- pyenbc.filehelper.jython_helper.get_java_path()¶
returns the java path
- Raises:
FileNotFoundError – if java is not found
- pyenbc.filehelper.jython_helper.get_jython_jar()¶
This function assumes a file
jython-standalone-x.x.x.jar
is present in this directory, the function returns the file.- Returns:
absolute path
- pyenbc.filehelper.jython_helper.is_java_installed(fLOG=<function noLOG>)¶
Checks if :epkg:`java` is installed.
- Returns:
boolean
- pyenbc.filehelper.jython_helper.run_jython(pyfile, argv=None, jython_path=None, sin=None, timeout=None, fLOG=<function noLOG>)¶
runs a jython script and returns the standard output and error
- Parameters:
pyfile – jython file
argv – arguments to sned to the command line
jython_path – path to jython standalone
sin – data to send to the standard input
timeout – timeout
fLOG – logging function
- Returns:
out, err
If jython_path is None, the function looks into this directory.