# Path: wxpy/compatible/utils.py
# def force_encoded_string_output(func):
# 
#     if sys.version_info.major < 3:
# 
#         def _func(*args, **kwargs):
#             return func(*args, **kwargs).encode(sys.stdout.encoding or 'utf-8')
# 
#         return _func
# 
#     else:
#         return func
# 
# Path: wxpy/utils/misc.py
# def ensure_list(x, except_false=True):
#     """
#     若传入的对象不为列表，则转化为列表
# 
#     :param x: 输入对象
#     :param except_false: None, False 等例外，会直接返回原值
#     :return: 列表，或 None, False 等
#     :rtype: list
#     """
# 
#     if isinstance(x, (list, tuple)) or (not x and except_false):
#         return x
#     return [x]


import logging
import weakref
from wxpy.compatible.utils import force_encoded_string_output
from wxpy.utils import ensure_list
# coding: utf-8
from __future__ import unicode_literals



logger = logging.getLogger(__name__)


class MessageConfig(object):
    """
    单个消息注册配置
    """

    def __init__(
            self, bot, func,
            chats, msg_types, except_self,
            run_async, enabled
    ):
        self.bot = weakref.proxy(bot)
        self.func = func

        self.chats = ensure_list(chats)

# Path: wxpy/compatible/utils.py
# def force_encoded_string_output(func):
# 
#     if sys.version_info.major < 3:
# 
#         def _func(*args, **kwargs):
#             return func(*args, **kwargs).encode(sys.stdout.encoding or 'utf-8')
# 
#         return _func
# 
#     else:
#         return func
# 
# Path: wxpy/utils/misc.py
# def ensure_list(x, except_false=True):
#     """
#     若传入的对象不为列表，则转化为列表
# 
#     :param x: 输入对象
#     :param except_false: None, False 等例外，会直接返回原值
#     :return: 列表，或 None, False 等
#     :rtype: list
#     """
# 
#     if isinstance(x, (list, tuple)) or (not x and except_false):
#         return x
#     return [x]


# Path: wxpy/api/messages/message_config.py
import logging
import weakref
from wxpy.compatible.utils import force_encoded_string_output
from wxpy.utils import ensure_list

# coding: utf-8
from __future__ import unicode_literals



logger = logging.getLogger(__name__)


class MessageConfig(object):
    """
    单个消息注册配置
    """

    def __init__(
            self, bot, func,
            chats, msg_types, except_self,
            run_async, enabled
    ):
        self.bot = weakref.proxy(bot)
        self.func = func

        self.chats = ensure_list(chats)

        self.msg_types = ensure_list(msg_types)