MECO™ API Reference
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
mMecoSettings.appLib.AppFile Class Reference

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

Inheritance diagram for mMecoSettings.appLib.AppFile:
mFileSystem.jsonFileLib.JSONFile mFileSystem.fileLib.File

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.
 

Detailed Description

[ CLASS ] - Operate on Meco App files.

Constructor & Destructor Documentation

◆ __init__()

def mMecoSettings.appLib.AppFile.__init__ (   self,
  absFile = None 
)

Constructor.

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

Reimplemented from mFileSystem.jsonFileLib.JSONFile.

Member Function Documentation

◆ setDeveloper()

def mMecoSettings.appLib.AppFile.setDeveloper (   self,
  developer 
)

Set developer.

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

◆ developer()

def mMecoSettings.appLib.AppFile.developer (   self)

Developer.

Exceptions
N/A
Returns
str - Developer.

◆ setDescription()

def mMecoSettings.appLib.AppFile.setDescription (   self,
  description 
)

Set description.

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

◆ description()

def mMecoSettings.appLib.AppFile.description (   self)

Description.

Exceptions
N/A
Returns
str - Description.

◆ setDarwinExecutable()

def mMecoSettings.appLib.AppFile.setDarwinExecutable (   self,
  darwinExecutable 
)

Set Darwin executable.

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

◆ darwinExecutable()

def mMecoSettings.appLib.AppFile.darwinExecutable (   self)

Darwin executable.

Exceptions
N/A
Returns
str - Darwin executable.

◆ setLinuxExecutable()

def mMecoSettings.appLib.AppFile.setLinuxExecutable (   self,
  linuxExecutable 
)

Set Linux executable.

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

◆ linuxExecutable()

def mMecoSettings.appLib.AppFile.linuxExecutable (   self)

Linux executable.

Exceptions
N/A
Returns
str - Linux executable.

◆ setWindowsExecutable()

def mMecoSettings.appLib.AppFile.setWindowsExecutable (   self,
  windowsExecutable 
)

Set Windows executable.

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

◆ windowsExecutable()

def mMecoSettings.appLib.AppFile.windowsExecutable (   self)

Windows executable.

Exceptions
N/A
Returns
str - Windows executable.

◆ setGlobalEnvClassName()

def mMecoSettings.appLib.AppFile.setGlobalEnvClassName (   self,
  globalEnvClassName 
)

Set global env class name.

Parameters
globalEnvClassName[ str | None | in ] - Global env class name.
Exceptions
N/A
Returns
None - None.

◆ globalEnvClassName()

def mMecoSettings.appLib.AppFile.globalEnvClassName (   self)

Global env class name.

Exceptions
N/A
Returns
str - Global env class name.

◆ setApplication()

def mMecoSettings.appLib.AppFile.setApplication (   self,
  application 
)

Set application.

Parameters
application[ str | None | in ] - Application.
Exceptions
N/A
Returns
None - None.

◆ application()

def mMecoSettings.appLib.AppFile.application (   self)

Application.

Exceptions
N/A
Returns
str - Application.

◆ setFolderName()

def mMecoSettings.appLib.AppFile.setFolderName (   self,
  folderName 
)

Set folder name.

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

◆ folderName()

def mMecoSettings.appLib.AppFile.folderName (   self)

Folder name.

Exceptions
N/A
Returns
str - Folder name.

◆ setVersion()

def mMecoSettings.appLib.AppFile.setVersion (   self,
  version 
)

Set version.

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

◆ version()

def mMecoSettings.appLib.AppFile.version (   self)

Version.

Exceptions
N/A
Returns
str - Version.

◆ setPackages()

def mMecoSettings.appLib.AppFile.setPackages (   self,
  packages 
)

Set packages.

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

◆ packages()

def mMecoSettings.appLib.AppFile.packages (   self)

Packages.

Exceptions
N/A
Returns
list of str - Packages.

◆ create()

def mMecoSettings.appLib.AppFile.create (   self,
  fileName,
  developer = '',
  description = '',
  darwinExecutable = '',
  linuxExecutable = '',
  windowsExecutable = '',
  globalEnvClassName = '',
  application = '',
  folderName = '',
  version = '',
  packages = [],
  overwrite = False 
)

Constructor.

Parameters
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.
Exceptions
N/A
Returns
bool - Result.

◆ isValid()

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
Exceptions
N/A
Returns
None - None.

◆ setFile()

def mMecoSettings.appLib.AppFile.setFile (   self,
  path 
)

Set JSON file.

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

Reimplemented from mFileSystem.jsonFileLib.JSONFile.

◆ asStr()

def mMecoSettings.appLib.AppFile.asStr (   self)

Get string representation.

Exceptions
N/A
Returns
str - File info

Reimplemented from mFileSystem.fileLib.File.

◆ write()

def mMecoSettings.appLib.AppFile.write (   self)

Write the content into the file.

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

◆ read()

def mMecoSettings.appLib.AppFile.read (   self)

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

Exceptions
N/A
Returns
variant - Content.

Reimplemented from mFileSystem.jsonFileLib.JSONFile.

◆ list()

def mMecoSettings.appLib.AppFile.list (   keyword = None)
static

List Meco app files available in the initialized environment.

Parameters
keyword[ str | None | in ] - Keyword to filter the app files.
Exceptions
N/A
Returns
list of mMecoSettings.appLib.AppFile - App files.
None - If no app file found.

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