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

[ CLASS ] - Class to operate on Stash projects. More...

Inheritance diagram for sStash.projectLib.Project:

Public Member Functions

def __init__ (self, name=None)
 Constructor. More...
 
def setProject (self, name)
 Set project. More...
 
def getLocalPath (self, relativePath)
 Get absolute path of given relativePath. More...
 
def getLocalHelpFile (self, folder)
 Get absolute path of the requested local help file. More...
 
def createDevelopmentEnvironment (self, name, developerName=getuser())
 Create development environment. More...
 
def createStageEnvironment (self, name, developmentEnvName, developerName=getuser(), verbose=False)
 Create stage environment. More...
 
def listPackages (self, onlyInSysPath=False)
 List packages. More...
 
Properties
def name (self)
 Property. More...
 
def projectRoot (self)
 Property. More...
 

Static Public Member Functions

def create (name)
 Create a project. More...
 
def list ()
 List projects. More...
 

Detailed Description

[ CLASS ] - Class to operate on Stash projects.

Constructor & Destructor Documentation

◆ __init__()

def sStash.projectLib.Project.__init__ (   self,
  name = None 
)

Constructor.

This method calls setPackage method regardless absolutePath argument is provided or not.

Parameters
name[ str | None | in ] - Name of the project to be set.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ name()

def sStash.projectLib.Project.name (   self)

Property.

Exceptions
N/A
Returns
str - Project name.

◆ projectRoot()

def sStash.projectLib.Project.projectRoot (   self)

Property.

Exceptions
N/A
Returns
str - Project root.

◆ setProject()

def sStash.projectLib.Project.setProject (   self,
  name 
)

Set project.

Parameters
name[ str | None | in ] - Name of the project to be set.
Exceptions
N/A
Returns
bool - Returns False if project doesn't exist, True otherwise.

◆ getLocalPath()

def sStash.projectLib.Project.getLocalPath (   self,
  relativePath 
)

Get absolute path of given relativePath.

Method doesn't check whether the returned path exists.

Parameters
relativePath[ str | None | in ] - Structure from Structure from sStash.projectLib.ProjectFolder (i.e. sStash.projectLib.ProjectFolder.kDocDeveloperPythonAPIReference).
Exceptions
N/A
Returns
str - Absolute path of the requested folder.
None - If no package has been set.

◆ getLocalHelpFile()

def sStash.projectLib.Project.getLocalHelpFile (   self,
  folder 
)

Get absolute path of the requested local help file.

Parameters
folder[ str | None | in ] - Structure from sStash.projectLib.ProjectFolder (i.e. sStash.projectLib.ProjectFolder.kDocDeveloperPythonAPIReference).
Exceptions
N/A
Returns
str - Absolute path of the help file.
None - If help file doesn't exist.
None - If no project has been set.

◆ createDevelopmentEnvironment()

def sStash.projectLib.Project.createDevelopmentEnvironment (   self,
  name,
  developerName = getuser() 
)

Create development environment.

Parameters
name[ str | None | in ] - Name of the development environment.
developerName[ str | getuser() | in ] - Name of the developer.
Exceptions
IOError- If development environment already exists.
Returns
str - Absolute path of the development environment.

◆ createStageEnvironment()

def sStash.projectLib.Project.createStageEnvironment (   self,
  name,
  developmentEnvName,
  developerName = getuser(),
  verbose = False 
)

Create stage environment.

Parameters
name[ str | None | in ] - Name of the stage environment.
developmentEnvName[ str | None | in ] - Name of the development environment where packages will be copied from.
developerName[ str | getuser() | in ] - Name of the developer who owns the development and stage environment.
verbose[ bool | False | in ] - Displayed created package names.
Exceptions
IOError- If development environment doesn't exist.
IOError- If stage environment already exists.
IOError- If no package found in development environment.
Returns
str - Absolute path of the stage environment.

◆ listPackages()

def sStash.projectLib.Project.listPackages (   self,
  onlyInSysPath = False 
)

List packages.

Parameters
onlyInSysPath[ bool | None | in ] - Whether to list only packages in sys.path.
Exceptions
IOError- If packages path of the project doesn't exist.
Returns
list of str - Absolute path of the root of the packages.

◆ create()

def sStash.projectLib.Project.create (   name)
static

Create a project.

Parameters
name[ str | None | in ] - Name of the project, which will be created.
Exceptions
IOError- If project already exists.
Returns
sStash.projectLib.Project - Instance of sStash.projectLib.Project, which represents the created project.

◆ list()

def sStash.projectLib.Project.list ( )
static

List projects.

Exceptions
IOError- If projects path doesn't exist.
Returns
list of str - Name of the projects.

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