Stash Software API  2.0.0
Public Member Functions | List of all members
sStash.stashLib.Stash Class Reference

[ CLASS ] - Class to operate on environments. More...

Inheritance diagram for sStash.stashLib.Stash:

Public Member Functions

def __init__ (self, request=None)
 Constructor. More...
 
def getCommandWithFlags (self)
 Get executable along with the flags and values which can be executed. More...
 
def execute (self, commands=None)
 Initialize Stash environment and run provided commands if any. More...
 
def outAppExec (self)
 Get application executable for the current platform. More...
 
Properties
def request (self)
 Request instance used by the class. More...
 
def powerShellExecutablePath (self)
 PowerShell executable path. More...
 
def setPowerShellExecutablePath (self, path)
 Set PowerShell executable path. More...
 
def hasError (self)
 Whether errors occurred in execution. More...
 
def error (self)
 Error. More...
 
def stdOut (self)
 STD out. More...
 
def stdErr (self)
 STD error. More...
 
Packages Related Methods
def outPackages (self)
 Get all packages. More...
 
def outDevelopmentPackages (self)
 Get development packages. More...
 
def outStagePackages (self)
 Get stage packages. More...
 
def outProjectPackages (self)
 Get project packages. More...
 
def outMasterPackages (self)
 Get master project packages. More...
 
Environment Related Methods
def outEnv (self, value)
 Get environment. More...
 
Debug Related Methods
def outData (self, value)
 Get data. More...
 

Static Public Member Functions

Licensing Related Methods
def outMAC ()
 Get MAC address for licensing. More...
 
def outVersion ()
 Get version. More...
 

Detailed Description

[ CLASS ] - Class to operate on environments.

Constructor & Destructor Documentation

◆ __init__()

def sStash.stashLib.Stash.__init__ (   self,
  request = None 
)

Constructor.

Parameters
request[ sStash.stashLib.Request | None | in ] - Request instance.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ request()

def sStash.stashLib.Stash.request (   self)

Request instance used by the class.

Exceptions
N/A
Returns
sStash.stashLib.Request - Request class instance.

◆ powerShellExecutablePath()

def sStash.stashLib.Stash.powerShellExecutablePath (   self)

PowerShell executable path.

Exceptions
N/A
Returns
str - Path.

◆ setPowerShellExecutablePath()

def sStash.stashLib.Stash.setPowerShellExecutablePath (   self,
  path 
)

Set PowerShell executable path.

Parameters
path[ str | None | in ] - PowerShell executable path.
Exceptions
IOError- If provided PowerShell executable path doesn't exist.
Returns
None - None.

◆ hasError()

def sStash.stashLib.Stash.hasError (   self)

Whether errors occurred in execution.

Exceptions
N/A
Returns
bool - Result.

◆ error()

def sStash.stashLib.Stash.error (   self)

Error.

Exceptions
N/A
Returns
sStash.stashLib.Error - Error class instance.
None - If there is no error.

◆ stdOut()

def sStash.stashLib.Stash.stdOut (   self)

STD out.

Exceptions
N/A
Returns
str - STD out.

◆ stdErr()

def sStash.stashLib.Stash.stdErr (   self)

STD error.

Exceptions
N/A
Returns
str - STD error.

◆ getCommandWithFlags()

def sStash.stashLib.Stash.getCommandWithFlags (   self)

Get executable along with the flags and values which can be executed.

Exceptions
N/A
Returns
None - None.

◆ execute()

def sStash.stashLib.Stash.execute (   self,
  commands = None 
)

Initialize Stash environment and run provided commands if any.

You can use return values namely stdout and stderr to see the result.

You can invoke sStash.stashLib.Stash.hasError method to check whether errors occurred during execution. You can also invoke sStash.stashLib.Stash.error method to get sStash.stashLib.Error class instance, which represents the error. Please note, sStash.stashLib.Error class designed to provide information on errors only generated by Stash. If an error occurred outside of Stash, information about it can be directly obtained from stderr, which is the second return value of this method since sStash.stashLib.Stash.error method will return None in such case.

Warning
Method raises IOError on Windows OS if PowerShell executable path doesn't exist. You can set the PowerShell executable path by using sStash.stashLib.Stash.powerShellExecutablePath method before invoking this method.
Parameters
commands[ str, unicode, list, tuple | None | in ] - Commands to be executed.
Exceptions
IOError- On Windows OS if PowerShell executable path doesn't exist.
Returns
tuple - stdout and stderr strings.

◆ outAppExec()

def sStash.stashLib.Stash.outAppExec (   self)

Get application executable for the current platform.

app argument must be provided in Request.set method. Alternatively you can use Request.setByStr method and provide app argument to set the development environment name.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

Exceptions
N/A
Returns
tuple - stdout and stderr strings.

◆ outPackages()

def sStash.stashLib.Stash.outPackages (   self)

Get all packages.

Method lists all packages of all environments, namely development (if set), stage (if set), project and master project environments.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

Exceptions
N/A
Returns
dict - Keys (str) are the names of the environments, values (list) are the absolute paths of the packages.
None - If no packages found.
None - If an error occurred.

◆ outDevelopmentPackages()

def sStash.stashLib.Stash.outDevelopmentPackages (   self)

Get development packages.

development argument must be provided in Request.set method. Alternatively you can use Request.setByStr method and provide development argument to set the development environment name.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

See also
Stash.outStagePackages for getting stage packages.
Exceptions
N/A
Returns
list of str - Absolute path of the packages.
None - If no packages found.
None - If an error occurred.

◆ outStagePackages()

def sStash.stashLib.Stash.outStagePackages (   self)

Get stage packages.

stage argument must be provided in Request.set method. Alternatively you can use Request.setByStr method and provide stage argument to set the stage environment name.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

See also
Stash.outDevelopmentPackages for getting development project packages.
Exceptions
N/A
Returns
list of str - Absolute path of the packages.
None - If no packages found.
None - If an error occurred.

◆ outProjectPackages()

def sStash.stashLib.Stash.outProjectPackages (   self)

Get project packages.

project argument must be provided in Request.set method. Alternatively you can use Request.setByStr method and provide project argument to set the stage environment name.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

See also
Stash.outMasterPackages for getting master project packages.
Exceptions
N/A
Returns
list of str - Absolute path of the packages.
None - If no packages found.
None - If an error occurred.

◆ outMasterPackages()

def sStash.stashLib.Stash.outMasterPackages (   self)

Get master project packages.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

See also
Stash.outProjectPackages for getting project packages.
Exceptions
N/A
Returns
list of str - Absolute path of the packages.
None - If no packages found.
None - If an error occurred.

◆ outEnv()

def sStash.stashLib.Stash.outEnv (   self,
  value 
)

Get environment.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

Accepted values are:

Value Result Return Data Types
1 Entries dict
2 Entries as they would be in env script str
Parameters
value[ int | None | in ] - Any value from the table above.
Exceptions
N/A
Returns
list of str - Result.
dict - Result.
None - If an error occurred.

◆ outData()

def sStash.stashLib.Stash.outData (   self,
  value 
)

Get data.

You can use Stash.hasError method to check whether an error occurred during execution of this method. Use Stash.error method to get the error information.

Accepted values are:

Value Result Return Data Types
1 All below str
2 Request str
3 Settings str
4 App dict
5 Solver str
6 Builder str
Parameters
value[ int | None | in ] - Any value from the table above.
Exceptions
N/A
Returns
str - Result.
dict - Result.
None - If an error occurred.

◆ outMAC()

def sStash.stashLib.Stash.outMAC ( )
static

Get MAC address for licensing.

Exceptions
N/A
Returns
str - MAC address.

◆ outVersion()

def sStash.stashLib.Stash.outVersion ( )
static

Get version.

Exceptions
N/A
Returns
str - Version.

The documentation for this class was generated from the following file: