Stash Software API  2.0.0
Classes | Variables
sStash.settingsLib Namespace Reference

[ MODULE ] - Stash settings module. More...

Classes

class  PlatformName
 [ ENUM CLASS ] - Platform names. More...
 
class  PrintColor
 [ ENUM CLASS ] - Print colors. More...
 

Functions

Project & Package Settings
def getProjectsPath (platformName, projectName=MASTER_PROJECT_NAME)
 Get absolute path of projects. More...
 
def getDevelopmentPackagesPath (projectName, developerName, developmentEnvName, platformName, create=False)
 Get development packages path. More...
 
def getStagePackagesPath (projectName, developerName, stageEnvName, platformName)
 Get stage packages path. More...
 
def getProjectPackagesPath (projectName, platformName)
 Get project packages path. More...
 
def getMasterProjectPackagesPath (platformName)
 Get master project packages path. More...
 
File Settings
def getLogFilePath (projectName, userName, platformName)
 Get absolute path of log file. More...
 
def getEnvResetScriptFilePath (projectName, developerName, developmentEnvName, stageEnvName, platformName)
 Get absolute path of a script which would reset the environment before Stash environment is initialized. More...
 
def getAppFilePath (projectName, developerName, developmentEnvName, stageEnvName, platformName, app)
 Get app file absolute path. More...
 
def getCallbackModulePath (projectName, developerName, developmentEnvName, stageEnvName, platformName)
 Get absolute path of Stash callback Python module. More...
 
def getPackageSettingsModulePath (projectName, developerName, developmentEnvName, stageEnvName, platformName)
 Get absolute path of Stash package settings Python module. More...
 
def getScriptFilePath (projectName, userName, developmentEnvName, stageEnvName, platformName)
 Get absolute path of script file . More...
 
Color Settings
def getTerminalHeaderDisplayColors (platformName)
 Get terminal header display colors. More...
 
def getTerminalDisplayColors (platformName)
 Get terminal display colors. More...
 

Variables

string IS_WINDOWS = 'Windows'
 [ bool ] - Whether the platform is Windows. More...
 
Environment Variables

Following attributes are not used by the executable but they are used by other Python packages.

string STASH_APP_NAME = 'STASH_APP_NAME'
 [ str ] - App name environment variable. More...
 
string STASH_APP_PATH = 'STASH_APP_PATH'
 [ str ] - App path environment variable. More...
 
string STASH_COMMAND = 'STASH_COMMAND'
 [ str ] - Stash command environment variable. More...
 
string STASH_DEVELOPER_NAME = 'STASH_DEVELOPER_NAME'
 [ str ] - Developer name environment variable. More...
 
string STASH_DEVELOPMENT_ENV_NAME = 'STASH_DEVELOPMENT_ENV_NAME'
 [ str ] - Development environment name environment variable. More...
 
string STASH_DEVELOPMENT_PACKAGES_PATH = 'STASH_DEVELOPMENT_PACKAGES_PATH'
 [ str ] - Development environment packages path environment variable. More...
 
string STASH_INITIALIZE_IN_PLACE = 'STASH_INITIALIZE_IN_PLACE'
 [ str ] - Stash initialize in place environment variable. More...
 
string STASH_MASTER_PROJECT_NAME = 'STASH_MASTER_PROJECT_NAME'
 [ str ] - Master project name environment variable. More...
 
string STASH_MASTER_PROJECT_PACKAGES_PATH = 'STASH_MASTER_PROJECT_PACKAGES_PATH'
 [ str ] - Master project packages path environment variable. More...
 
string STASH_MASTER_PROJECT_PATH = 'STASH_MASTER_PROJECT_PATH'
 [ str ] - Master project path environment variable. More...
 
string STASH_MASTER_PROJECT_ROOT_PATH = 'STASH_MASTER_PROJECT_ROOT_PATH'
 [ str ] - Master project root path environment variable. More...
 
string STASH_PROJECT_NAME = 'STASH_PROJECT_NAME'
 [ str ] - Project name environment variable. More...
 
string STASH_PROJECT_PACKAGES_PATH = 'STASH_PROJECT_PACKAGES_PATH'
 [ str ] - Project packages path environment variable. More...
 
string STASH_PROJECT_PATH = 'STASH_PROJECT_PATH'
 [ str ] - Project path environment variable. More...
 
string STASH_PROJECT_ROOT_PATH = 'STASH_PROJECT_ROOT_PATH'
 [ str ] - Project root path environment variable. More...
 
string STASH_PYTHON_EXECUTABLE_PATH = 'STASH_PYTHON_EXECUTABLE_PATH'
 [ str ] - Stash Python executable path environment variable. More...
 
string STASH_PYTHON_VERSION = 'STASH_PYTHON_VERSION'
 [ str ] - Stash Python version environment variable. More...
 
string STASH_STAGE_ENV_NAME = 'STASH_STAGE_ENV_NAME'
 [ str ] - Stage environment name environment variable. More...
 
string STASH_STAGE_PACKAGES_PATH = 'STASH_STAGE_PACKAGES_PATH'
 [ str ] - Stage environment packages path environment variable. More...
 
string STASH_USE_DEFAULT_PYTHON_INTERPRETER = 'STASH_USE_DEFAULT_PYTHON_INTERPRETER'
 [ str ] - Stash use default Python interpreter environment variable. More...
 
string STASH_USE_PROJECT_APPS_ONLY = 'STASH_USE_PROJECT_APPS_ONLY'
 [ str ] - Stash use project apps only environment variable. More...
 
string STASH_VERSION = 'STASH_VERSION'
 [ str ] - Stash version environment variable. More...
 
Static Settings
string MASTER_PROJECT_NAME = 'master'
 [ str ] - Name of the master project. More...
 

Detailed Description

[ MODULE ] - Stash settings module.

This is the settings module where you can change the implementation of the settings functions in order to customize Stash settings. Please check the relevant function for detailed description below.

All functions below are invoked by Stash so all the arguments required provided automatically.

Warning
Return objects of each function must be implemented correctly for each platform, which Stash will be run on.
Do not raise any exceptions anywhere in this module as they will be ignored.
Do not rename any of the functions or the arguments.

Function Documentation

◆ getProjectsPath()

def sStash.settingsLib.getProjectsPath (   platformName,
  projectName = MASTER_PROJECT_NAME 
)

Get absolute path of projects.

Absolute path of where the projects are kept.

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
projectName[ str | sStash.settingsLib.MASTER_PROJECT_NAME | in ] - Project name the project path is requested for.
Exceptions
N/A
Returns
str - Absolute path.

◆ getDevelopmentPackagesPath()

def sStash.settingsLib.getDevelopmentPackagesPath (   projectName,
  developerName,
  developmentEnvName,
  platformName,
  create = False 
)

Get development packages path.

Return path is where the development packages are kept for given project, developer and development environment.

An example path would be like;

/projectsPath/PROJECT_NAME/developers/DEVELOPER_NAME/development/DEVELOPMENT_ENV_NAME

Warning
An empty string must be returned from the function is no path is meant to be provided.
The function will try to create the path if it doesn't exist. If it fails it does so silently.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
create[ bool | None | in ] - Create the development packages path if it doesn't exist.
Exceptions
N/A
Returns
str - Absolute path.

◆ getStagePackagesPath()

def sStash.settingsLib.getStagePackagesPath (   projectName,
  developerName,
  stageEnvName,
  platformName 
)

Get stage packages path.

Return path is where the stage packages are kept for given project, developer and stage environment.

An example path would be like;

/projectsPath/PROJECT_NAME/developers/DEVELOPER_NAME/stage/STAGE_ENV_NAME

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path.

◆ getProjectPackagesPath()

def sStash.settingsLib.getProjectPackagesPath (   projectName,
  platformName 
)

Get project packages path.

Return path is where the production packages are kept for given project.

An example path would be like;

/projectsPath/PROJECT_NAME/packages

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path.

◆ getMasterProjectPackagesPath()

def sStash.settingsLib.getMasterProjectPackagesPath (   platformName)

Get master project packages path.

Return path is where the production packages are kept for master project.

An example path would be like;

/projectsPath/MASTER_PROJECT_NAME/packages

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path.

◆ getLogFilePath()

def sStash.settingsLib.getLogFilePath (   projectName,
  userName,
  platformName 
)

Get absolute path of log file.

Log file would contain useful information for debugging purposes.

The following example path is also the one Stash uses by default.

/projectsPath/PROJECT_NAME/users/USER_NAME/env/log/stashLog.txt

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
userName[ str | None | in ] - User name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path of the log file.

◆ getEnvResetScriptFilePath()

def sStash.settingsLib.getEnvResetScriptFilePath (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName 
)

Get absolute path of a script which would reset the environment before Stash environment is initialized.

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path of a script file.

◆ getAppFilePath()

def sStash.settingsLib.getAppFilePath (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName,
  app 
)

Get app file absolute path.

Function returns the absolute file path of requested app, so information regarding the app can be obtained.

Location of the app file may vary. Example paths;

If development environment is initialized;

/projectsPath/PROJECT_NAME/developers/DEVELOPER_NAME/development/DEVELOPMENT_ENV_NAME/sStashApp/resources/files/app/APP_NAME.sapp

If stage environment is initialized;

/projectsPath/PROJECT_NAME/developers/DEVELOPER_NAME/stage/STAGE_ENV_NAME/sStashApp/resources/files/app/APP_NAME.sapp

If project environment is initialized;

/projectsPath/PROJECT_NAME/packages/sStashApp/0.0.0/sStashApp/resources/files/app/APP_NAME.sapp

If no project environment is initialized meaning that only master project is initialized;

/projectsPath/MASTER_PROJECT_NAME/packages/sStashApp/0.0.0/sStashApp/resources/files/app/APP_NAME.sapp

App file will be searched for in the paths provided above with the given order.

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
app[ str | None | in ] - App.
Exceptions
N/A
Returns
str - Absolute path of the app file.

◆ getCallbackModulePath()

def sStash.settingsLib.getCallbackModulePath (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName 
)

Get absolute path of Stash callback Python module.

The following example path is also the one Stash uses by default.

/projectsPath/MASTER_PROJECT_NAME/packages/sStash/VERSION/python/sStash/callbackLib.py

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path of the callback Python module file.

◆ getPackageSettingsModulePath()

def sStash.settingsLib.getPackageSettingsModulePath (   projectName,
  developerName,
  developmentEnvName,
  stageEnvName,
  platformName 
)

Get absolute path of Stash package settings Python module.

The following example path is also the one Stash uses by default.

/projectsPath/MASTER_PROJECT_NAME/packages/sStash/VERSION/python/sStash/packageSettingsLib.py

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
developerName[ str | None | in ] - Developer name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path of the package settings Python module file.

◆ getScriptFilePath()

def sStash.settingsLib.getScriptFilePath (   projectName,
  userName,
  developmentEnvName,
  stageEnvName,
  platformName 
)

Get absolute path of script file .

Script file will be written out by Stash and will contain the environment, so it can be sourced to set the environment.

The following example path is also the one Stash uses by default.

/projectsPath/PROJECT_NAME/users/USER_NAME/env/script/env.EXTENSION

Warning
An empty string must be returned from the function is no path is meant to be provided.
Parameters
projectName[ str | None | in ] - Project name.
userName[ str | None | in ] - User name.
developmentEnvName[ str | None | in ] - Development environment name.
stageEnvName[ str | None | in ] - Stage environment name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path of the environment script file.

◆ getTerminalHeaderDisplayColors()

def sStash.settingsLib.getTerminalHeaderDisplayColors (   platformName)

Get terminal header display colors.

You can customize the terminal header display colors by changing the return value of this function.

Warning
Please keep s formatting as it is since this formatting style is used by Stash in C++ instead of Python.
Index Description
0. Color of the dashes in headers
1. Color of the text in headers
Warning
Only following colors are available on Windows OS.
  • Black
  • DarkBlue
  • DarkGreen
  • DarkCyan
  • DarkRed
  • DarkMagenta
  • DarkYellow
  • Gray
  • DarkGray
  • Blue
  • Green
  • Cyan
  • Red
  • Magenta
  • Yellow
  • White
Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
list of str - Values that represents colors.

◆ getTerminalDisplayColors()

def sStash.settingsLib.getTerminalDisplayColors (   platformName)

Get terminal display colors.

You can customize the terminal display colors by changing the return value of this function.

Warning
Please keep s formatting on Linux OS and Mac OS as it is since this formatting style is used by Stash in C++ instead of Python.
Index Description
0. Color of the development environment
1. Color of the stage environment
2. Color of the project environment
3. Color of the master project environment
4. Color of the before environment
5. Color of the after environment
6. Color of info
Warning
Only following colors are available on Windows OS.
  • Black
  • DarkBlue
  • DarkGreen
  • DarkCyan
  • DarkRed
  • DarkMagenta
  • DarkYellow
  • Gray
  • DarkGray
  • Blue
  • Green
  • Cyan
  • Red
  • Magenta
  • Yellow
  • White
Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
list of str - Values that represents colors.

Variable Documentation

◆ IS_WINDOWS

string sStash.settingsLib.IS_WINDOWS = 'Windows'

[ bool ] - Whether the platform is Windows.

◆ STASH_APP_NAME

string sStash.settingsLib.STASH_APP_NAME = 'STASH_APP_NAME'

[ str ] - App name environment variable.

◆ STASH_APP_PATH

string sStash.settingsLib.STASH_APP_PATH = 'STASH_APP_PATH'

[ str ] - App path environment variable.

◆ STASH_COMMAND

string sStash.settingsLib.STASH_COMMAND = 'STASH_COMMAND'

[ str ] - Stash command environment variable.

◆ STASH_DEVELOPER_NAME

string sStash.settingsLib.STASH_DEVELOPER_NAME = 'STASH_DEVELOPER_NAME'

[ str ] - Developer name environment variable.

◆ STASH_DEVELOPMENT_ENV_NAME

string sStash.settingsLib.STASH_DEVELOPMENT_ENV_NAME = 'STASH_DEVELOPMENT_ENV_NAME'

[ str ] - Development environment name environment variable.

◆ STASH_DEVELOPMENT_PACKAGES_PATH

string sStash.settingsLib.STASH_DEVELOPMENT_PACKAGES_PATH = 'STASH_DEVELOPMENT_PACKAGES_PATH'

[ str ] - Development environment packages path environment variable.

◆ STASH_INITIALIZE_IN_PLACE

string sStash.settingsLib.STASH_INITIALIZE_IN_PLACE = 'STASH_INITIALIZE_IN_PLACE'

[ str ] - Stash initialize in place environment variable.

◆ STASH_MASTER_PROJECT_NAME

string sStash.settingsLib.STASH_MASTER_PROJECT_NAME = 'STASH_MASTER_PROJECT_NAME'

[ str ] - Master project name environment variable.

◆ STASH_MASTER_PROJECT_PACKAGES_PATH

string sStash.settingsLib.STASH_MASTER_PROJECT_PACKAGES_PATH = 'STASH_MASTER_PROJECT_PACKAGES_PATH'

[ str ] - Master project packages path environment variable.

◆ STASH_MASTER_PROJECT_PATH

string sStash.settingsLib.STASH_MASTER_PROJECT_PATH = 'STASH_MASTER_PROJECT_PATH'

[ str ] - Master project path environment variable.

◆ STASH_MASTER_PROJECT_ROOT_PATH

string sStash.settingsLib.STASH_MASTER_PROJECT_ROOT_PATH = 'STASH_MASTER_PROJECT_ROOT_PATH'

[ str ] - Master project root path environment variable.

◆ STASH_PROJECT_NAME

string sStash.settingsLib.STASH_PROJECT_NAME = 'STASH_PROJECT_NAME'

[ str ] - Project name environment variable.

◆ STASH_PROJECT_PACKAGES_PATH

string sStash.settingsLib.STASH_PROJECT_PACKAGES_PATH = 'STASH_PROJECT_PACKAGES_PATH'

[ str ] - Project packages path environment variable.

◆ STASH_PROJECT_PATH

string sStash.settingsLib.STASH_PROJECT_PATH = 'STASH_PROJECT_PATH'

[ str ] - Project path environment variable.

◆ STASH_PROJECT_ROOT_PATH

string sStash.settingsLib.STASH_PROJECT_ROOT_PATH = 'STASH_PROJECT_ROOT_PATH'

[ str ] - Project root path environment variable.

◆ STASH_PYTHON_EXECUTABLE_PATH

string sStash.settingsLib.STASH_PYTHON_EXECUTABLE_PATH = 'STASH_PYTHON_EXECUTABLE_PATH'

[ str ] - Stash Python executable path environment variable.

◆ STASH_PYTHON_VERSION

string sStash.settingsLib.STASH_PYTHON_VERSION = 'STASH_PYTHON_VERSION'

[ str ] - Stash Python version environment variable.

◆ STASH_STAGE_ENV_NAME

string sStash.settingsLib.STASH_STAGE_ENV_NAME = 'STASH_STAGE_ENV_NAME'

[ str ] - Stage environment name environment variable.

◆ STASH_STAGE_PACKAGES_PATH

string sStash.settingsLib.STASH_STAGE_PACKAGES_PATH = 'STASH_STAGE_PACKAGES_PATH'

[ str ] - Stage environment packages path environment variable.

◆ STASH_USE_DEFAULT_PYTHON_INTERPRETER

string sStash.settingsLib.STASH_USE_DEFAULT_PYTHON_INTERPRETER = 'STASH_USE_DEFAULT_PYTHON_INTERPRETER'

[ str ] - Stash use default Python interpreter environment variable.

◆ STASH_USE_PROJECT_APPS_ONLY

string sStash.settingsLib.STASH_USE_PROJECT_APPS_ONLY = 'STASH_USE_PROJECT_APPS_ONLY'

[ str ] - Stash use project apps only environment variable.

◆ STASH_VERSION

string sStash.settingsLib.STASH_VERSION = 'STASH_VERSION'

[ str ] - Stash version environment variable.

◆ MASTER_PROJECT_NAME

string sStash.settingsLib.MASTER_PROJECT_NAME = 'master'

[ str ] - Name of the master project.