Stash Software API  2.0.0
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
sStashApp.stashAppLib.StashAppFile Class Reference

[ CLASS ] - Operate on Stash App files. More...

Inheritance diagram for sStashApp.stashAppLib.StashAppFile:
sFileSystem.jsonFileLib.JSONFile sFileSystem.fileLib.File

Public Member Functions

def __init__ (self, absFile=None)
 Constructor. More...
 
def create (self, fileName, developer='', description='', darwinExecutable='', linuxExecutable='', windowsExecutable='', settingsName='', folderName='', version='', ignorePackages=[], developerName=None, overwrite=False)
 Constructor. More...
 
def isValid (self)
 Determine whether this app file is valid. More...
 
def setFile (self, absFile)
 Set JSON file. More...
 
def asStr (self)
 Get string representation. More...
 
def write (self)
 Write the content into the file. More...
 
def read (self)
 Read the content of the file and store it in content member. More...
 
Properties
def setDeveloper (self, developer)
 Set developer. More...
 
def developer (self)
 Developer. More...
 
def setDescription (self, description)
 Set description. More...
 
def description (self)
 Description. More...
 
def setDarwinExecutable (self, darwinExecutable)
 Set Darwin executable. More...
 
def darwinExecutable (self)
 Darwin executable. More...
 
def setLinuxExecutable (self, linuxExecutable)
 Set Linux executable. More...
 
def linuxExecutable (self)
 Linux executable. More...
 
def setWindowsExecutable (self, windowsExecutable)
 Set Windows executable. More...
 
def windowsExecutable (self)
 Windows executable. More...
 
def setSettingsName (self, settingsName)
 Set settings name. More...
 
def settingsName (self)
 Settings name. More...
 
def setFolderName (self, folderName)
 Set folder name. More...
 
def folderName (self)
 Folder name. More...
 
def setVersion (self, version)
 Set version. More...
 
def version (self)
 Version. More...
 
def setIgnorePackages (self, ignorePackages)
 Set ignore packages. More...
 
def ignorePackages (self)
 Ignore packages. More...
 
- Public Member Functions inherited from sFileSystem.jsonFileLib.JSONFile
def __init__ (self, absFile=None)
 Constructor. More...
 
def asStr (self)
 Get string representation. More...
 
def setFile (self, absFile)
 Set JSON file. More...
 
def write (self, indent=None)
 Write the content into the file. More...
 
def read (self)
 Read the content of the file and store it in content member. More...
 
def setContent (self, content)
 Set JSON content. More...
 
- Public Member Functions inherited from sFileSystem.fileLib.File
def __init__ (self, absFile=None)
 Constructor. More...
 
def __str__ (self)
 String representation. More...
 
def asStr (self)
 Get string representation. More...
 
def asDict (self)
 Get file information as dict instance. More...
 
def setFile (self, absFile)
 Set file. More...
 
def update (self)
 Update information of the file in case it has been altered. More...
 
def exists (self)
 Check whether the file exists. More...
 
def rename (self, newName)
 Rename the file. More...
 
def copy (self, destinationFile, overwrite=False)
 Copy the file. More...
 
def copyToPath (self, destinationPath, overwrite=False)
 Copy the file to given path. More...
 
def remove (self, raiseException=False)
 Remove the file. More...
 
def write (self, line, append=True)
 Write given line into the file. More...
 
def writeLines (self, lines, append=True)
 Write given lines into the file. More...
 
def read (self)
 Read content of the file. More...
 
def readLines (self)
 Read lines. More...
 
def lineCount (self)
 Get line count of the file. More...
 
def create (cls, absFile, overwrite=False, binary=False)
 Create a file and return a sFileSystem.fileLib.File instance for it. More...
 
def file (self)
 Absolute path of the file. More...
 
def directory (self)
 Directory where the file is located in. More...
 
def fileName (self)
 Name of the file with it's extension. More...
 
def baseName (self)
 Name of the file without extension, base name. More...
 
def extension (self)
 File's extension. More...
 
def size (self)
 File size in bytes. More...
 
def sizeStr (self)
 File size as human readable string. More...
 
def content (self)
 Content of the file. More...
 

Static Public Member Functions

def list (development=True, stage=True, project=True, masterProject=True, keyword=None)
 Read the content of the file and store it in content member. More...
 
- Static Public Member Functions inherited from sFileSystem.fileLib.File
def fileExists (absFile)
 Check whether the given file exists. More...
 
def getFileSizeStr (size, precision=2)
 Get given byte size in human readable string. More...
 
def replaceExtension (absFile, newExtension)
 Replace given files extension with given extension. More...
 

Static Public Attributes

string EXTENSION = 'sapp'
 [ str ] - Stash App file extension. More...
 
string PACKAGE_NAME = 'sStashApp'
 [ str ] - Name of the app package. More...
 

Detailed Description

[ CLASS ] - Operate on Stash App files.

Constructor & Destructor Documentation

◆ __init__()

def sStashApp.stashAppLib.StashAppFile.__init__ (   self,
  absFile = None 
)

Constructor.

Parameters
absFile[ str | None | in ] - Absolute path of a Stash App file.
Exceptions
N/A
Returns
None - None.

Member Function Documentation

◆ setDeveloper()

def sStashApp.stashAppLib.StashAppFile.setDeveloper (   self,
  developer 
)

Set developer.

Parameters
developer[ str | None | in ] - Developer's email address.
Exceptions
N/A
Returns
None - None.

◆ developer()

def sStashApp.stashAppLib.StashAppFile.developer (   self)

Developer.

Exceptions
N/A
Returns
str - Developer.

◆ setDescription()

def sStashApp.stashAppLib.StashAppFile.setDescription (   self,
  description 
)

Set description.

Parameters
description[ str | None | in ] - Description.
Exceptions
N/A
Returns
None - None.

◆ description()

def sStashApp.stashAppLib.StashAppFile.description (   self)

Description.

Exceptions
N/A
Returns
str - Description.

◆ setDarwinExecutable()

def sStashApp.stashAppLib.StashAppFile.setDarwinExecutable (   self,
  darwinExecutable 
)

Set Darwin executable.

Parameters
darwinExecutable[ str | None | in ] - Mac OS executable.
Exceptions
N/A
Returns
None - None.

◆ darwinExecutable()

def sStashApp.stashAppLib.StashAppFile.darwinExecutable (   self)

Darwin executable.

Exceptions
N/A
Returns
str - Darwin executable.

◆ setLinuxExecutable()

def sStashApp.stashAppLib.StashAppFile.setLinuxExecutable (   self,
  linuxExecutable 
)

Set Linux executable.

Parameters
linuxExecutable[ str | None | in ] - Linux OS executable.
Exceptions
N/A
Returns
None - None.

◆ linuxExecutable()

def sStashApp.stashAppLib.StashAppFile.linuxExecutable (   self)

Linux executable.

Exceptions
N/A
Returns
str - Linux executable.

◆ setWindowsExecutable()

def sStashApp.stashAppLib.StashAppFile.setWindowsExecutable (   self,
  windowsExecutable 
)

Set Windows executable.

Parameters
windowsExecutable[ str | None | in ] - Windows OS executable.
Exceptions
N/A
Returns
None - None.

◆ windowsExecutable()

def sStashApp.stashAppLib.StashAppFile.windowsExecutable (   self)

Windows executable.

Exceptions
N/A
Returns
str - Windows executable.

◆ setSettingsName()

def sStashApp.stashAppLib.StashAppFile.setSettingsName (   self,
  settingsName 
)

Set settings name.

Parameters
settingsName[ str | None | in ] - Settings name.
Exceptions
N/A
Returns
None - None.

◆ settingsName()

def sStashApp.stashAppLib.StashAppFile.settingsName (   self)

Settings name.

Exceptions
N/A
Returns
str - Settings name.

◆ setFolderName()

def sStashApp.stashAppLib.StashAppFile.setFolderName (   self,
  folderName 
)

Set folder name.

Parameters
folderName[ str | None | in ] - Folder name.
Exceptions
N/A
Returns
None - None.

◆ folderName()

def sStashApp.stashAppLib.StashAppFile.folderName (   self)

Folder name.

Exceptions
N/A
Returns
str - Folder name.

◆ setVersion()

def sStashApp.stashAppLib.StashAppFile.setVersion (   self,
  version 
)

Set version.

Parameters
version[ str | None | in ] - Version.
Exceptions
N/A
Returns
None - None.

◆ version()

def sStashApp.stashAppLib.StashAppFile.version (   self)

Version.

Exceptions
N/A
Returns
str - Version.

◆ setIgnorePackages()

def sStashApp.stashAppLib.StashAppFile.setIgnorePackages (   self,
  ignorePackages 
)

Set ignore packages.

Parameters
ignorePackages[ list of str | None | in ] - Ignore packages.
Exceptions
N/A
Returns
None - None.

◆ ignorePackages()

def sStashApp.stashAppLib.StashAppFile.ignorePackages (   self)

Ignore packages.

Exceptions
N/A
Returns
list of str - Ignore packages.

◆ create()

def sStashApp.stashAppLib.StashAppFile.create (   self,
  fileName,
  developer = '',
  description = '',
  darwinExecutable = '',
  linuxExecutable = '',
  windowsExecutable = '',
  settingsName = '',
  folderName = '',
  version = '',
  ignorePackages = [],
  developerName = None,
  overwrite = False 
)

Constructor.

Parameters
fileName[ str | None | in ] - Name of the Stash App file, which will be created.
developer[ str | None | in ] - Email address of the developer.
description[ str | None | in ] - Description about the app.
darwinExecutable[ str | None | in ] - Mac OS executable.
linuxExecutable[ str | None | in ] - Linux executable.
windowsExecutable[ str | None | in ] - Windows executable.
settingsName[ str | None | in ] - Settings name of the app.
folderName[ str | None | in ] - Folder name of the app.
version[ str | None | in ] - Version of the app.
ignorePackages[ str | [] | in ] - Packages to be ignored by this app.
developerName[ str | None | in ] - Developer's user name which this app file will be created for.
overwrite[ bool | False | in ] - Whether to overwrite existing app file.
Exceptions
N/A
Returns
bool - Result.

◆ isValid()

def sStashApp.stashAppLib.StashAppFile.isValid (   self)

Determine whether this app file is valid.

For an app file to be valid it must have values for the following keys.

  • description
  • settingsName
  • version

and at least one of the following:

  • darwinExecutable
  • linuxExecutable
  • windowsExecutable
Exceptions
N/A
Returns
None - None.

◆ setFile()

def sStashApp.stashAppLib.StashAppFile.setFile (   self,
  absFile 
)

Set JSON file.

Parameters
absFile[ str | None | in ] - Absolute path of the file.
Exceptions
N/A
Returns
bool - Result, returns False is the file doesn't exist.

◆ asStr()

def sStashApp.stashAppLib.StashAppFile.asStr (   self)

Get string representation.

Exceptions
N/A
Returns
str - File info

◆ write()

def sStashApp.stashAppLib.StashAppFile.write (   self)

Write the content into the file.

Exceptions
ValueError- If content is not an instance of dict.
Returns
bool - Result.

◆ read()

def sStashApp.stashAppLib.StashAppFile.read (   self)

Read the content of the file and store it in content member.

Exceptions
N/A
Returns
variant - Content.

◆ list()

def sStashApp.stashAppLib.StashAppFile.list (   development = True,
  stage = True,
  project = True,
  masterProject = True,
  keyword = None 
)
static

Read the content of the file and store it in content member.

Parameters
development[ bool | True | in ] - Whether to list Stash App files in development environment.
stage[ bool | True | in ] - Whether to list Stash App files in stage environment.
project[ bool | True | in ] - Whether to list Stash App files in project environment.
masterProject[ bool | True | in ] - Whether to list Stash App files in master project environment.
keyword[ str | None | in ] - Keyword.
Exceptions
N/A
Returns
dict - Dict instance with the following keys; development, stage, project, masterProject.

Member Data Documentation

◆ EXTENSION

string sStashApp.stashAppLib.StashAppFile.EXTENSION = 'sapp'
static

[ str ] - Stash App file extension.

◆ PACKAGE_NAME

string sStashApp.stashAppLib.StashAppFile.PACKAGE_NAME = 'sStashApp'
static

[ str ] - Name of the app package.


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