# Path: mbot/utils/packages.py
# def install_package(package, upgrade=True,
#                     target=None):
#     """Install a package on PyPi. Accepts pip compatible package strings.
#     Return boolean if install successful.
#     """
#     # Not using 'import pip; pip.main([])' because it breaks the logger
#     with INSTALL_LOCK:
#         if check_package_exists(package, target):
#             return True
# 
#         _LOGGER.info('Attempting install of %s', package)
#         args = [sys.executable, '-m', 'pip', 'install', '--quiet', package]
#         if upgrade:
#             args.append('--upgrade')
#         if target:
#             args += ['--target', os.path.abspath(target)]
# 
#         try:
#             return subprocess.call(args) == 0
#         except subprocess.SubprocessError:
#             _LOGGER.exception('Unable to install pacakge %s', package)
#             return False


import logging
import os
import anyconfig
import appdirs
from mbot.utils.packages import install_package
            from raven import Client
                from cryptography.fernet import Fernet
                from cryptography.fernet import Fernet
        return _b

    @property
    def storage(self):
        return self.conf['storage']

    @property
    def core(self):
        return self.conf['core']

    @property
    def logging(self):
        return self.conf['logging']

    def get_log_level(self):
        return getattr(logging,
                       self.logging['level'],
                       logging.DEBUG)

    @property
    def DEBUG(self):
        return self.get_log_level() == logging.DEBUG

    def init_logging(self):
        """Init logging"""

        if not self.is_ready():
            return

        if 'sentry_dsn' in self.logging:

# Path: mbot/utils/packages.py
# def install_package(package, upgrade=True,
#                     target=None):
#     """Install a package on PyPi. Accepts pip compatible package strings.
#     Return boolean if install successful.
#     """
#     # Not using 'import pip; pip.main([])' because it breaks the logger
#     with INSTALL_LOCK:
#         if check_package_exists(package, target):
#             return True
# 
#         _LOGGER.info('Attempting install of %s', package)
#         args = [sys.executable, '-m', 'pip', 'install', '--quiet', package]
#         if upgrade:
#             args.append('--upgrade')
#         if target:
#             args += ['--target', os.path.abspath(target)]
# 
#         try:
#             return subprocess.call(args) == 0
#         except subprocess.SubprocessError:
#             _LOGGER.exception('Unable to install pacakge %s', package)
#             return False


# Path: mbot/config.py
import logging
import os
import anyconfig
import appdirs
from mbot.utils.packages import install_package
            from raven import Client
                from cryptography.fernet import Fernet
                from cryptography.fernet import Fernet

        return _b

    @property
    def storage(self):
        return self.conf['storage']

    @property
    def core(self):
        return self.conf['core']

    @property
    def logging(self):
        return self.conf['logging']

    def get_log_level(self):
        return getattr(logging,
                       self.logging['level'],
                       logging.DEBUG)

    @property
    def DEBUG(self):
        return self.get_log_level() == logging.DEBUG

    def init_logging(self):
        """Init logging"""

        if not self.is_ready():
            return

        if 'sentry_dsn' in self.logging:

            install_package("raven")