jenkins.plugins.shiningpanda.interpreters
Class Python

java.lang.Object
  extended by jenkins.plugins.shiningpanda.interpreters.Python
Direct Known Subclasses:
CPython, Executable, IronPython, Jython, PyPy, Virtualenv

public abstract class Python
extends Object


Constructor Summary
protected Python(hudson.FilePath home)
          Constructor using fields
 
Method Summary
static Python fromHome(hudson.FilePath home)
          Create a PYTHON interpreter from its home folder.
 Map<String,String> getEnvironment()
          Get the environment for this interpreter with the home variable defined.
abstract  Map<String,String> getEnvironment(boolean includeHomeKey)
          Get the environment for this interpreter.
abstract  hudson.FilePath getExecutable()
          Get the PYTHON executable.
 hudson.FilePath getHome()
          Get the home folder.
 CPython isCPython()
          Is this a CPython implementation?
 Executable isExecutable()
          Is this an executable implementation?
 IronPython isIronPython()
          Is this a IronPython implementation?
 Jython isJython()
          Is this a JYTHON implementation?
 PyPy isPyPy()
          Is this a PyPy implementation?
protected  boolean isUnix()
          Is this PYTHON on UNIX?
 boolean isValid()
          Check if this is a valid interpreter.
 Virtualenv isVirtualenv()
          Is this a VIRTUALENV?
protected  boolean isWindows()
          Is this PYTHON on Windows?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Python

protected Python(hudson.FilePath home)
          throws IOException,
                 InterruptedException
Constructor using fields

Parameters:
home - The home folder
Throws:
InterruptedException
IOException
Method Detail

getHome

public hudson.FilePath getHome()
Get the home folder.

Returns:
The home folder

isCPython

public CPython isCPython()
Is this a CPython implementation?

Returns:
true if this is a CPython implementation, else false

isPyPy

public PyPy isPyPy()
Is this a PyPy implementation?

Returns:
true if this is a PyPy implementation, else false

isJython

public Jython isJython()
Is this a JYTHON implementation?

Returns:
true if this is a JYTHON implementation, else false

isIronPython

public IronPython isIronPython()
Is this a IronPython implementation?

Returns:
true if this is a IronPython implementation, else false

isVirtualenv

public Virtualenv isVirtualenv()
Is this a VIRTUALENV?

Returns:
true if this is a VIRTUALENV, else false

isExecutable

public Executable isExecutable()
Is this an executable implementation?

Returns:
true if this is an executable implementation, else false

isValid

public boolean isValid()
                throws IOException,
                       InterruptedException
Check if this is a valid interpreter.

Returns:
true if this is a valid interpreter
Throws:
IOException
InterruptedException

isWindows

protected boolean isWindows()
                     throws IOException,
                            InterruptedException
Is this PYTHON on Windows?

Returns:
true if on Windows, else false
Throws:
IOException
InterruptedException

isUnix

protected boolean isUnix()
                  throws IOException,
                         InterruptedException
Is this PYTHON on UNIX?

Returns:
true if on UNIX, else false
Throws:
IOException
InterruptedException

getExecutable

public abstract hudson.FilePath getExecutable()
                                       throws IOException,
                                              InterruptedException
Get the PYTHON executable.

Returns:
The executable file if exists, else null
Throws:
IOException
InterruptedException

getEnvironment

public abstract Map<String,String> getEnvironment(boolean includeHomeKey)
                                           throws IOException,
                                                  InterruptedException
Get the environment for this interpreter.

Parameters:
includeHomeKey - If true, add home variable such as PYTHONHOME
Returns:
The environment
Throws:
IOException
InterruptedException

getEnvironment

public Map<String,String> getEnvironment()
                                  throws IOException,
                                         InterruptedException
Get the environment for this interpreter with the home variable defined.

Returns:
The environment
Throws:
IOException
InterruptedException

fromHome

public static Python fromHome(hudson.FilePath home)
                       throws IOException,
                              InterruptedException
Create a PYTHON interpreter from its home folder.

Parameters:
home - The home folder
Returns:
The interpreter if exists, else null
Throws:
IOException
InterruptedException


Copyright © 2004-2012. All Rights Reserved.