# Path: elodie/compatability.py
# def _bytes(string):
#     if constants.python_version == 3:
#         return bytes(string, 'utf8')
#     else:
#         return bytes(string)
# 
# Path: elodie/config.py
# def load_config_for_plugin(name):
#     # Plugins store data using Plugin%PluginName% format.
#     key = 'Plugin{}'.format(name)
#     config = load_config()
# 
#     if key in config:
#         return config[key]
# 
#     return {}
# 
# def load_plugin_config():
#     config = load_config()
# 
#     # If plugins are defined in the config we return them as a list
#     # Else we return an empty list
#     if 'Plugins' in config and 'plugins' in config['Plugins']:
#         return config['Plugins']['plugins'].split(',')
# 
#     return []
# 
# Path: elodie/constants.py

# 
# Path: elodie/log.py
# def all(message):
# def info(message):
# def info_json(payload):
# def progress(message='.', new_line=False):
# def warn(message):
# def warn_json(payload):
# def error(message):
# def error_json(payload):
# def _print_debug(string):
# def _print(s):


from builtins import object
from json import dumps, loads
from importlib import import_module
from os.path import dirname, dirname, isdir, isfile
from os import mkdir
from sys import exc_info
from traceback import format_exc
from elodie.compatability import _bytes
from elodie.config import load_config_for_plugin, load_plugin_config
from elodie.constants import application_directory
from elodie import log
import io
        return db

    def delete(self, key):
        with io.open(self.db_file, 'r') as f:
            db = loads(f.read())

        # delete key without throwing an exception
        db.pop(key, None)
        new_content = dumps(db, ensure_ascii=False).encode('utf8')
        with io.open(self.db_file, 'wb') as f:
            f.write(new_content)


class Plugins(object):
    """Plugin object which manages all interaction with plugins.
       Exposes methods to load plugins and execute their methods.
    """

    def __init__(self):
        self.plugins = []
        self.classes = {}
        self.loaded = False

    def load(self):
        """Load plugins from config file.
        """
        # If plugins have been loaded then return
        if self.loaded == True:
            return


# Path: elodie/compatability.py
# def _bytes(string):
#     if constants.python_version == 3:
#         return bytes(string, 'utf8')
#     else:
#         return bytes(string)
# 
# Path: elodie/config.py
# def load_config_for_plugin(name):
#     # Plugins store data using Plugin%PluginName% format.
#     key = 'Plugin{}'.format(name)
#     config = load_config()
# 
#     if key in config:
#         return config[key]
# 
#     return {}
# 
# def load_plugin_config():
#     config = load_config()
# 
#     # If plugins are defined in the config we return them as a list
#     # Else we return an empty list
#     if 'Plugins' in config and 'plugins' in config['Plugins']:
#         return config['Plugins']['plugins'].split(',')
# 
#     return []
# 
# Path: elodie/constants.py

# 
# Path: elodie/log.py
# def all(message):
# def info(message):
# def info_json(payload):
# def progress(message='.', new_line=False):
# def warn(message):
# def warn_json(payload):
# def error(message):
# def error_json(payload):
# def _print_debug(string):
# def _print(s):


# Path: elodie/plugins/plugins.py
from builtins import object
from json import dumps, loads
from importlib import import_module
from os.path import dirname, dirname, isdir, isfile
from os import mkdir
from sys import exc_info
from traceback import format_exc
from elodie.compatability import _bytes
from elodie.config import load_config_for_plugin, load_plugin_config
from elodie.constants import application_directory
from elodie import log
import io

        return db

    def delete(self, key):
        with io.open(self.db_file, 'r') as f:
            db = loads(f.read())

        # delete key without throwing an exception
        db.pop(key, None)
        new_content = dumps(db, ensure_ascii=False).encode('utf8')
        with io.open(self.db_file, 'wb') as f:
            f.write(new_content)


class Plugins(object):
    """Plugin object which manages all interaction with plugins.
       Exposes methods to load plugins and execute their methods.
    """

    def __init__(self):
        self.plugins = []
        self.classes = {}
        self.loaded = False

    def load(self):
        """Load plugins from config file.
        """
        # If plugins have been loaded then return
        if self.loaded == True:
            return


        plugin_list = load_plugin_config()