MECO™ API Reference
|
[ CLASS ] - Operate on Meco App files. More...
Public Member Functions | |
def | __init__ (self, absFile=None) |
Constructor. More... | |
def | create (self, fileName, developer='', description='', darwinExecutable='', linuxExecutable='', windowsExecutable='', globalEnvClassName='', application='', folderName='', version='', packages=[], overwrite=False) |
Constructor. More... | |
def | isValid (self) |
Determine whether this app file is valid. More... | |
def | setFile (self, path) |
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 | setGlobalEnvClassName (self, globalEnvClassName) |
Set global env class name. More... | |
def | globalEnvClassName (self) |
Global env class name. More... | |
def | setApplication (self, application) |
Set application. More... | |
def | application (self) |
Application. 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 | setPackages (self, packages) |
Set packages. More... | |
def | packages (self) |
Packages. More... | |
Public Member Functions inherited from mFileSystem.jsonFileLib.JSONFile | |
def | setContent (self, content) |
Set JSON content. More... | |
def | write (self, indent=None) |
Write the content into the file. More... | |
Public Member Functions inherited from mFileSystem.fileLib.File | |
def | __str__ (self) |
String representation. More... | |
def | asDict (self) |
Get file information as dict instance. 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 | remove (self) |
Remove the file. More... | |
def | create (cls, path, overwrite=False, binary=False) |
Create a file and return a mFileSystem.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... | |
def | copy (self, destinationFile, overwrite=False) |
Copy the file. More... | |
def | copyToPath (self, destinationPath, overwrite=False) |
Copy the file to given path. 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 | readLines (self) |
Read lines. More... | |
def | lineCount (self) |
Get line count of the file. More... | |
Static Public Member Functions | |
def | list (keyword=None) |
List Meco app files available in the initialized environment. More... | |
Static Public Member Functions inherited from mFileSystem.fileLib.File | |
def | fileExists (path) |
Check whether the given file exists. More... | |
def | getFileSizeAsStr (size, precision=2) |
Get given byte size in human readable string. More... | |
def | replaceExtension (path, newExtension) |
Replace given files extension with given extension. More... | |
Static Public Attributes | |
string | EXTENSION = 'json' |
[ str ] - Meco App file extension. | |
string | PACKAGE_NAME = 'mMecoSettings' |
[ str ] - Name of the app package. | |
[ CLASS ] - Operate on Meco App files.
def mMecoSettings.appLib.AppFile.__init__ | ( | self, | |
absFile = None |
|||
) |
Constructor.
absFile | [ str | None | in ] - Absolute path of a Meco App file. |
N/A |
Reimplemented from mFileSystem.jsonFileLib.JSONFile.
def mMecoSettings.appLib.AppFile.setDeveloper | ( | self, | |
developer | |||
) |
Set developer.
developer | [ str | None | in ] - Developer's email address. |
N/A |
def mMecoSettings.appLib.AppFile.developer | ( | self | ) |
Developer.
N/A |
def mMecoSettings.appLib.AppFile.setDescription | ( | self, | |
description | |||
) |
Set description.
description | [ str | None | in ] - Description. |
N/A |
def mMecoSettings.appLib.AppFile.description | ( | self | ) |
Description.
N/A |
def mMecoSettings.appLib.AppFile.setDarwinExecutable | ( | self, | |
darwinExecutable | |||
) |
Set Darwin executable.
darwinExecutable | [ str | None | in ] - Mac OS executable. |
N/A |
def mMecoSettings.appLib.AppFile.darwinExecutable | ( | self | ) |
Darwin executable.
N/A |
def mMecoSettings.appLib.AppFile.setLinuxExecutable | ( | self, | |
linuxExecutable | |||
) |
Set Linux executable.
linuxExecutable | [ str | None | in ] - Linux OS executable. |
N/A |
def mMecoSettings.appLib.AppFile.linuxExecutable | ( | self | ) |
Linux executable.
N/A |
def mMecoSettings.appLib.AppFile.setWindowsExecutable | ( | self, | |
windowsExecutable | |||
) |
Set Windows executable.
windowsExecutable | [ str | None | in ] - Windows OS executable. |
N/A |
def mMecoSettings.appLib.AppFile.windowsExecutable | ( | self | ) |
Windows executable.
N/A |
def mMecoSettings.appLib.AppFile.setGlobalEnvClassName | ( | self, | |
globalEnvClassName | |||
) |
Set global env class name.
globalEnvClassName | [ str | None | in ] - Global env class name. |
N/A |
def mMecoSettings.appLib.AppFile.globalEnvClassName | ( | self | ) |
Global env class name.
N/A |
def mMecoSettings.appLib.AppFile.setApplication | ( | self, | |
application | |||
) |
Set application.
application | [ str | None | in ] - Application. |
N/A |
def mMecoSettings.appLib.AppFile.application | ( | self | ) |
Application.
N/A |
def mMecoSettings.appLib.AppFile.setFolderName | ( | self, | |
folderName | |||
) |
Set folder name.
folderName | [ str | None | in ] - Folder name. |
N/A |
def mMecoSettings.appLib.AppFile.folderName | ( | self | ) |
Folder name.
N/A |
def mMecoSettings.appLib.AppFile.setVersion | ( | self, | |
version | |||
) |
Set version.
version | [ str | None | in ] - Version. |
N/A |
def mMecoSettings.appLib.AppFile.version | ( | self | ) |
Version.
N/A |
def mMecoSettings.appLib.AppFile.setPackages | ( | self, | |
packages | |||
) |
Set packages.
packages | [ list of str | None | in ] - Packages. |
N/A |
def mMecoSettings.appLib.AppFile.packages | ( | self | ) |
Packages.
N/A |
def mMecoSettings.appLib.AppFile.create | ( | self, | |
fileName, | |||
developer = '' , |
|||
description = '' , |
|||
darwinExecutable = '' , |
|||
linuxExecutable = '' , |
|||
windowsExecutable = '' , |
|||
globalEnvClassName = '' , |
|||
application = '' , |
|||
folderName = '' , |
|||
version = '' , |
|||
packages = [] , |
|||
overwrite = False |
|||
) |
Constructor.
fileName | [ str | None | in ] - Name of the Meco 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. |
globalEnvClassName | [ str | None | in ] - Global env class name. |
application | [ str | None | in ] - Application. |
folderName | [ str | None | in ] - Folder name of the app. |
version | [ str | None | in ] - Version of the app. |
packages | [ str | [] | in ] - Packages. |
overwrite | [ bool | False | in ] - Whether to overwrite existing app file. |
N/A |
def mMecoSettings.appLib.AppFile.isValid | ( | self | ) |
Determine whether this app file is valid.
For an app file to be valid it must have values for the following keys.
developer
description
N/A |
def mMecoSettings.appLib.AppFile.setFile | ( | self, | |
path | |||
) |
Set JSON file.
path | [ str | None | in ] - Absolute path of the file. |
N/A |
Reimplemented from mFileSystem.jsonFileLib.JSONFile.
def mMecoSettings.appLib.AppFile.asStr | ( | self | ) |
Get string representation.
N/A |
Reimplemented from mFileSystem.fileLib.File.
def mMecoSettings.appLib.AppFile.write | ( | self | ) |
Write the content into the file.
ValueError | - If content is not an instance of dict. |
def mMecoSettings.appLib.AppFile.read | ( | self | ) |
Read the content of the file and store it in content member.
N/A |
Reimplemented from mFileSystem.jsonFileLib.JSONFile.
|
static |
List Meco app files available in the initialized environment.
keyword | [ str | None | in ] - Keyword to filter the app files. |
N/A |