Stash Software API
2.0.0
|
[ CLASS ] - Operate on Stash App files. More...
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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
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... | |
[ CLASS ] - Operate on Stash App files.
def sStashApp.stashAppLib.StashAppFile.__init__ | ( | self, | |
absFile = None |
|||
) |
Constructor.
absFile | [ str | None | in ] - Absolute path of a Stash App file. |
N/A |
def sStashApp.stashAppLib.StashAppFile.setDeveloper | ( | self, | |
developer | |||
) |
Set developer.
developer | [ str | None | in ] - Developer's email address. |
N/A |
def sStashApp.stashAppLib.StashAppFile.developer | ( | self | ) |
Developer.
N/A |
def sStashApp.stashAppLib.StashAppFile.setDescription | ( | self, | |
description | |||
) |
Set description.
description | [ str | None | in ] - Description. |
N/A |
def sStashApp.stashAppLib.StashAppFile.description | ( | self | ) |
Description.
N/A |
def sStashApp.stashAppLib.StashAppFile.setDarwinExecutable | ( | self, | |
darwinExecutable | |||
) |
Set Darwin executable.
darwinExecutable | [ str | None | in ] - Mac OS executable. |
N/A |
def sStashApp.stashAppLib.StashAppFile.darwinExecutable | ( | self | ) |
Darwin executable.
N/A |
def sStashApp.stashAppLib.StashAppFile.setLinuxExecutable | ( | self, | |
linuxExecutable | |||
) |
Set Linux executable.
linuxExecutable | [ str | None | in ] - Linux OS executable. |
N/A |
def sStashApp.stashAppLib.StashAppFile.linuxExecutable | ( | self | ) |
Linux executable.
N/A |
def sStashApp.stashAppLib.StashAppFile.setWindowsExecutable | ( | self, | |
windowsExecutable | |||
) |
Set Windows executable.
windowsExecutable | [ str | None | in ] - Windows OS executable. |
N/A |
def sStashApp.stashAppLib.StashAppFile.windowsExecutable | ( | self | ) |
Windows executable.
N/A |
def sStashApp.stashAppLib.StashAppFile.setSettingsName | ( | self, | |
settingsName | |||
) |
Set settings name.
settingsName | [ str | None | in ] - Settings name. |
N/A |
def sStashApp.stashAppLib.StashAppFile.settingsName | ( | self | ) |
Settings name.
N/A |
def sStashApp.stashAppLib.StashAppFile.setFolderName | ( | self, | |
folderName | |||
) |
Set folder name.
folderName | [ str | None | in ] - Folder name. |
N/A |
def sStashApp.stashAppLib.StashAppFile.folderName | ( | self | ) |
Folder name.
N/A |
def sStashApp.stashAppLib.StashAppFile.setVersion | ( | self, | |
version | |||
) |
Set version.
version | [ str | None | in ] - Version. |
N/A |
def sStashApp.stashAppLib.StashAppFile.version | ( | self | ) |
Version.
N/A |
def sStashApp.stashAppLib.StashAppFile.setIgnorePackages | ( | self, | |
ignorePackages | |||
) |
Set ignore packages.
ignorePackages | [ list of str | None | in ] - Ignore packages. |
N/A |
def sStashApp.stashAppLib.StashAppFile.ignorePackages | ( | self | ) |
Ignore packages.
N/A |
def sStashApp.stashAppLib.StashAppFile.create | ( | self, | |
fileName, | |||
developer = '' , |
|||
description = '' , |
|||
darwinExecutable = '' , |
|||
linuxExecutable = '' , |
|||
windowsExecutable = '' , |
|||
settingsName = '' , |
|||
folderName = '' , |
|||
version = '' , |
|||
ignorePackages = [] , |
|||
developerName = None , |
|||
overwrite = False |
|||
) |
Constructor.
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. |
N/A |
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
N/A |
def sStashApp.stashAppLib.StashAppFile.setFile | ( | self, | |
absFile | |||
) |
Set JSON file.
absFile | [ str | None | in ] - Absolute path of the file. |
N/A |
def sStashApp.stashAppLib.StashAppFile.asStr | ( | self | ) |
Get string representation.
N/A |
def sStashApp.stashAppLib.StashAppFile.write | ( | self | ) |
Write the content into the file.
ValueError | - If content is not an instance of dict. |
def sStashApp.stashAppLib.StashAppFile.read | ( | self | ) |
Read the content of the file and store it in content member.
N/A |
|
static |
Read the content of the file and store it in content member.
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. |
N/A |
|
static |
[ str ] - Stash App file extension.
|
static |
[ str ] - Name of the app package.