404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.224.55.136: ~ $
import importlib
import logging

from ..backup_backends_lib import asyncable, BackendNonApplicableError


logger = logging.getLogger(__name__)


def _stub(*_, **__):
    pass


def backend(name, async_=False):
    logger.debug('Importing backend %s (async=%r)', name, async_)

    rel_name = '.' + name

    try:
        backup_backend = importlib.import_module(rel_name, __name__)
    except (ImportError, ValueError):
        raise ValueError('unsupported backup backend: ' + name)

    if not backup_backend.is_suitable():
        raise BackendNonApplicableError(
            "backup backend can't be used: " + name)

    for func in ('init', 'cleanup', 'info', 'pre_backups'):
        if not hasattr(backup_backend, func):
            setattr(backup_backend, func, _stub)

    for func in ('init', 'backups', 'cleanup', 'info', 'pre_backups'):
        func_obj = getattr(backup_backend, func)
        if hasattr(func_obj, 'async_'):
            # `asyncable` already applied
            continue
        func_obj_async = asyncable(func_obj)
        setattr(backup_backend, func, func_obj_async)

    if async_:
        for entry in dir(backup_backend):
            entry_obj = getattr(backup_backend, entry)
            if hasattr(entry_obj, 'async_'):
                entry_obj.async_ = True

    return backup_backend

Filemanager

Name Type Size Permission Actions
__pycache__ Folder 0755
clusterlogics Folder 0755
__init__.py File 1.29 KB 0644
acronis.py File 52.44 KB 0644
cpanel.py File 8.62 KB 0644
directadmin.py File 9.46 KB 0644
plesk.py File 13.14 KB 0644
r1soft.py File 11.36 KB 0644