MECO™ API Reference
Classes | Functions | Variables
mMecoSettings.settingsLib Namespace Reference

[ MODULE ] - Settings module. More...

Classes

class  PlatformName
 [ ENUM CLASS ] - Platform names. More...
 

Functions

def getProjectsPath (platformName, projectName=MASTER_PROJECT_NAME)
 Get absolute path of projects. More...
 
def getProjectRootPath (platformName, projectName=MASTER_PROJECT_NAME)
 Get absolute path of given project. More...
 
def getReservedPackagesPath (developerName, platformName)
 Get reserved packages path. 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 getProjectInternalPackagesPath (projectName, platformName)
 Get project internal packages path. More...
 
def getProjectExternalPackagesPath (projectName, platformName)
 Get project external packages path. More...
 
def getMasterProjectInternalPackagesPath (platformName)
 Get master project internal packages path. More...
 
def getMasterProjectExternalPackagesPath (platformName)
 Get master project external packages path. More...
 
def getLogFilePath (projectName, userName, developmentEnvName, stageEnvName, platformName)
 Get absolute path of a log file. More...
 
def getAppFilePath (projectName, developerName, developmentEnvName, stageEnvName, platformName, app)
 Get absolute path of an app file. More...
 
def getScriptFilePath (projectName, userName, developmentEnvName, stageEnvName, platformName, appFile)
 Get absolute path of a script file. More...
 
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 current platform is Windows.
 
string MASTER_PROJECT_NAME = 'master'
 [ str ] - Name of the master project.
 
string RESERVED_ENV_NAME = 'main'
 [ str ] - Reserved env name.
 

Detailed Description

[ MODULE ] - Settings module.

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

All functions below are invoked by Meco and their arguments are provided automatically.

Warning
Return objects of each function must be implemented correctly for each platform, which Meco will run on.
Do not rename any of the functions or the arguments.

Function Documentation

◆ getProjectsPath()

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

Get absolute path of projects.

Absolute path of where the projects are kept.

Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
projectName[ str | mMecoSettings.settingsLib.MASTER_PROJECT_NAME | in ] - Project name, which the project path will be provided for.
Exceptions
N/A
Returns
str - Absolute path.

◆ getProjectRootPath()

def mMecoSettings.settingsLib.getProjectRootPath (   platformName,
  projectName = MASTER_PROJECT_NAME 
)

Get absolute path of given project.

Absolute path of where the projects are kept.

Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
projectName[ str | mMecoSettings.settingsLib.MASTER_PROJECT_NAME | in ] - Project name, which the project path will be provided for.
Exceptions
N/A
Returns
str - Absolute path.

◆ getReservedPackagesPath()

def mMecoSettings.settingsLib.getReservedPackagesPath (   developerName,
  platformName 
)

Get reserved packages path.

Return path is where the reserved packages are kept for given developer.

An example path would be like;

/projectsPath/MASTER_PROJECT_NAME/developers/DEVELOPER_NAME/reserved/main

Parameters
developerName[ str | None | in ] - Developer name.
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path.

◆ getDevelopmentPackagesPath()

def mMecoSettings.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

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 mMecoSettings.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

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.

◆ getProjectInternalPackagesPath()

def mMecoSettings.settingsLib.getProjectInternalPackagesPath (   projectName,
  platformName 
)

Get project internal packages path.

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

An example path would be like;

/projectsPath/PROJECT_NAME/internal

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.

◆ getProjectExternalPackagesPath()

def mMecoSettings.settingsLib.getProjectExternalPackagesPath (   projectName,
  platformName 
)

Get project external packages path.

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

An example path would be like;

/projectsPath/PROJECT_NAME/external

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.

◆ getMasterProjectInternalPackagesPath()

def mMecoSettings.settingsLib.getMasterProjectInternalPackagesPath (   platformName)

Get master project internal packages path.

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

An example path would be like;

/projectsPath/MASTER_PROJECT_NAME/internal

Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path.

◆ getMasterProjectExternalPackagesPath()

def mMecoSettings.settingsLib.getMasterProjectExternalPackagesPath (   platformName)

Get master project external packages path.

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

An example path would be like;

/projectsPath/MASTER_PROJECT_NAME/external

Parameters
platformName[ str | None | in ] - Platform name, one of the following; Linux, Darwin, Windows.
Exceptions
N/A
Returns
str - Absolute path.

◆ getLogFilePath()

def mMecoSettings.settingsLib.getLogFilePath (   projectName,
  userName,
  developmentEnvName,
  stageEnvName,
  platformName 
)

Get absolute path of a log file.

Log file would contain useful information for debugging purposes.

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

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

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 log file.

◆ getAppFilePath()

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

Get absolute path of an app file.

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/mMecoSettings/resources/apps/ENV_NAME.json

If stage environment is initialized;

/projectsPath/PROJECT_NAME/developers/DEVELOPER_NAME/stage/STAGE_ENV_NAME/mMecoSettings/resources/apps/ENV_NAME.json

If project environment is initialized;

/projectsPath/PROJECT_NAME/packages/mMecoSettings/0.0.0/mMecoSettings/resources/apps/ENV_NAME.json

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

/projectsPath/MASTER_PROJECT_NAME/packages/mMecoSettings/1.0.0/mMecoSettings/resources/apps/ENV_NAME.json

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

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
IOError- If no app file found for given app.
Returns
str - Absolute path of the app file.

◆ getScriptFilePath()

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

Get absolute path of a script file.

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

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

/projectsPath/PROJECT_NAME/users/USER_NAME/env/script/env_PROJECT_NAME_USER_NAME_DEVELOPMENT_ENV_NAME|STAGE_ENV_NAME.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.
appFile[ str | None | in ] - Absolute path of an app file if provided.
Exceptions
N/A
Returns
str - Absolute path of the environment script file.

◆ getTerminalHeaderDisplayColors()

def mMecoSettings.settingsLib.getTerminalHeaderDisplayColors (   platformName)

Get terminal header display colors.

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

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 mMecoSettings.settingsLib.getTerminalDisplayColors (   platformName)

Get terminal display colors.

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

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.