コード例 #1
0
ファイル: __init__.py プロジェクト: inkhey/mmc
def activate():
    """
    Run some tests to ensure the module is ready to operate.
    """
    config = MscConfig()
    config.init("msc")
    logger = logging.getLogger()
    if config.disable:
        logger.warning("Plugin msc: disabled by configuration.")
        return False

    if not os.path.isdir(config.qactionspath):
        logger.error("Quick Actions config is invalid: %s is not a directory. Please check msc.ini." % config.qactionspath)
        return False

    if not MscDatabase().activate(config):
        return False

    if config.check_db_enable:
        scheduleCheckStatus(config.check_db_interval)

    # Add convergence reschedule task in the task manager
    TaskManager().addTask("msc.convergence_reschedule",
                          (convergence_reschedule,),
                          cron_expression=config.convergence_reschedule)
    return True
コード例 #2
0
def activate():
    """
    Run some tests to ensure the module is ready to operate.
    """
    config = MscConfig()
    config.init("msc")
    logger = logging.getLogger()
    if config.disable:
        logger.warning("Plugin msc: disabled by configuration.")
        return False

    if not os.path.isdir(config.qactionspath):
        logger.error(
            "Quick Actions config is invalid: %s is not a directory. Please check msc.ini."
            % config.qactionspath)
        return False

    if not MscDatabase().activate(config):
        return False

    if config.check_db_enable:
        scheduleCheckStatus(config.check_db_interval)

    # Add convergence reschedule task in the task manager
    TaskManager().addTask("msc.convergence_reschedule",
                          (convergence_reschedule, ),
                          cron_expression=config.convergence_reschedule)
    return True
コード例 #3
0
ファイル: __init__.py プロジェクト: tekmans/mmc
def activate_2():
    conf = MscConfig()
    conf.init('msc')
    dldir = conf.download_directory_path
    # Clean all lock or error status file in the download directory pool
    if os.path.exists(dldir):
        logging.getLogger().info('Cleaning lock file in %s' % dldir)
        for root, dirs, files in os.walk(dldir):
            for name in files:
                if name.endswith(MscDownloadedFiles.LOCKEXT) or name.endswith(MscDownloadedFiles.ERROREXT):
                    os.remove(os.path.join(root, name))
    return True
コード例 #4
0
ファイル: __init__.py プロジェクト: resonancellc/mmc-1
def activate_2():
    conf = MscConfig()
    conf.init('msc')
    dldir = conf.download_directory_path
    # Clean all lock or error status file in the download directory pool
    if os.path.exists(dldir):
        logging.getLogger().info('Cleaning lock file in %s' % dldir)
        for root, dirs, files in os.walk(dldir):
            for name in files:
                if name.endswith(MscDownloadedFiles.LOCKEXT) or name.endswith(MscDownloadedFiles.ERROREXT):
                    os.remove(os.path.join(root, name))
    return True
コード例 #5
0
ファイル: __init__.py プロジェクト: tekmans/mmc
def activate():
    """
    Run some tests to ensure the module is ready to operate.
    """
    config = MscConfig()
    config.init("msc")
    logger = logging.getLogger()
    if config.disable:
        logger.warning("Plugin msc: disabled by configuration.")
        return False

    if not os.path.isdir(config.qactionspath):
        logger.error("Quick Actions config is invalid: %s is not a directory. Please check msc.ini." % config.qactionspath)
        return False

    if not MscDatabase().activate(config):
        return False

    return True