SPPAS 4.22

https://sppas.org/

Module sppas.config

Class sppasPostInstall

Description

Check directories and create if not existing.

Public functions

sppas_directories

Create the required directories in the SPPAS package.

Raises

sppasPermissionError

View Source
@staticmethod
def sppas_directories():
    """Create the required directories in the SPPAS package.

        :raise: sppasPermissionError

        """
    logging.info('Check directories and create if not existing:')
    sppas_parent_dir = os.path.dirname(paths.basedir)
    try:
        os.mkdir(os.path.join(sppas_parent_dir, 'sppas_test'))
        shutil.rmtree(os.path.join(sppas_parent_dir, 'sppas_test'))
        logging.info(' - Write access to SPPAS package directory is granted.')
    except OSError as e:
        logging.critical('Write access denied to {:s}. SPPAS package should be installed elsewhere.'.format(sppas_parent_dir))
        logging.error(str(e))
    if os.path.exists(paths.logs) is False:
        os.mkdir(paths.logs)
        logging.info(' - The directory {:s} to store logs is created.'.format(paths.logs))
    else:
        logging.info(' - The folder for logs is OK.')
    if os.path.exists(paths.wkps) is False:
        os.mkdir(paths.wkps)
        logging.info('The directory {:s} to store workspaces is created.'.format(paths.wkps))
    else:
        logging.info(' - The folder for the workspaces is OK.')
    if os.path.exists(paths.trash) is False:
        os.mkdir(paths.trash)
        logging.info('The Trash directory {:s} is created.'.format(paths.trash))
    else:
        logging.info(' - The trash is OK.')

sppas_dependencies

Enable or disable features depending on dependencies.

View Source
@staticmethod
def sppas_dependencies():
    """Enable or disable features depending on dependencies."""
    pass