# Path: easy_karabiner/fucking_string.py
# def ensure_utf8(s):
#     # convert from any object to `unicode`
#     if not isinstance(s, basestring):
#         s = unicode(s)
# 
#     if isinstance(s, unicode):
#         s = s.encode('utf-8')
#     return unicode(s, encoding='utf-8')


from .fucking_string import ensure_utf8

class ConfigWarning(Exception):
    pass


class InvalidDefinition(ConfigWarning):
    pass


class InvalidKeymapException(ConfigWarning):
    pass


class UndefinedFilterException(ConfigWarning):
    pass


class UndefinedKeyException(ConfigWarning):
    pass


class ExceptionRegister(object):
    """This class is used to record the occurrence of any exceptions,
    so we can provide a user friendly error message.
    """
    error_table = {}
    raw_maps_table = {}

    @classmethod
    def put(cls, k, raw_map):

# Path: easy_karabiner/fucking_string.py
# def ensure_utf8(s):
#     # convert from any object to `unicode`
#     if not isinstance(s, basestring):
#         s = unicode(s)
# 
#     if isinstance(s, unicode):
#         s = s.encode('utf-8')
#     return unicode(s, encoding='utf-8')


# Path: easy_karabiner/exception.py
from .fucking_string import ensure_utf8


class ConfigWarning(Exception):
    pass


class InvalidDefinition(ConfigWarning):
    pass


class InvalidKeymapException(ConfigWarning):
    pass


class UndefinedFilterException(ConfigWarning):
    pass


class UndefinedKeyException(ConfigWarning):
    pass


class ExceptionRegister(object):
    """This class is used to record the occurrence of any exceptions,
    so we can provide a user friendly error message.
    """
    error_table = {}
    raw_maps_table = {}

    @classmethod
    def put(cls, k, raw_map):

        k = ensure_utf8(k)