# Path: apiritif/utils.py
# VERSION = "1.1.3"
# def get_trace(error):
# def graceful():
# def headers_as_text(headers_dict):
# def shorten(string, upto, end_with="..."):
# def assert_regexp(regex, text, match=False, msg=None):
# def assert_not_regexp(regex, text, match=False, msg=None):
# class NormalShutdown(BaseException):


import os
import sys
from abc import ABCMeta, abstractmethod
from importlib import import_module
from pathlib import Path
from pkgutil import iter_modules
from apiritif.utils import log


PLUGINS_PATH = 'PLUGINS_PATH'


def import_plugins():
    path = os.environ.get(PLUGINS_PATH, None)
    if not path:
        log.debug('Plugins PATH not found, continue without plugins')
        return

    # add plugins path to PYTHONPATH
    sys.path.append(path)

    package = Path(path).resolve().name

# Path: apiritif/utils.py
# VERSION = "1.1.3"
# def get_trace(error):
# def graceful():
# def headers_as_text(headers_dict):
# def shorten(string, upto, end_with="..."):
# def assert_regexp(regex, text, match=False, msg=None):
# def assert_not_regexp(regex, text, match=False, msg=None):
# class NormalShutdown(BaseException):


# Path: apiritif/action_plugins.py
import os
import sys
from abc import ABCMeta, abstractmethod
from importlib import import_module
from pathlib import Path
from pkgutil import iter_modules
from apiritif.utils import log



PLUGINS_PATH = 'PLUGINS_PATH'


def import_plugins():
    path = os.environ.get(PLUGINS_PATH, None)
    if not path:
        log.debug('Plugins PATH not found, continue without plugins')
        return

    # add plugins path to PYTHONPATH
    sys.path.append(path)

    package = Path(path).resolve().name

    log.info(f'Plugins package {package}')