wechat_sdk/base.py
def _transcoding_dict(cls, data):
        """
        编码转换 for dict
        :param data: 需要转换的 dict 数据
        :return: 转换好的 dict
        """
        if not isinstance(data, dict):
            raise ValueError('Parameter data must be dict object.')

        result = {}
        for k, v in data.items():
            k = cls._transcoding(k)
            if isinstance(v, dict):
                v = cls._transcoding_dict(v)
            elif isinstance(v, list):
                v = cls._transcoding_list(v)
            else:
                v = cls._transcoding(v)
            result.update({k: v})
        return result
def _transcoding_dict(cls, data):
        """
        编码转换 for dict
        :param data: 需要转换的 dict 数据
        :return: 转换好的 dict
        """
        if not isinstance(data, dict):
            raise ValueError('Parameter data must be dict object.')

        result = {}
        for k, v in data.items():
            k = cls._transcoding(k)
            if isinstance(v, dict):
                v = cls._transcoding_dict(v)
            elif isinstance(v, list):
                v = cls._transcoding_list(v)
            else:
                v = cls._transcoding(v)
            result.update({k: v})
        return result
def _transcoding_dict ( cls , data ) : if not isinstance ( data , dict ) : raise ValueError ( 'Parameter data must be dict object.' ) result = { } for k , v in data . items ( ) : k = cls . _transcoding ( k ) if isinstance ( v , dict ) : v = cls . _transcoding_dict ( v ) elif isinstance ( v , list ) : v = cls . _transcoding_list ( v ) else : v = cls . _transcoding ( v ) result . update ( { k : v } ) return result
编码转换 for dict
        :param data: 需要转换的 dict 数据
        :return: 转换好的 dict
编码转换 for dict : param data : 需要转换的 dict 数据 : return : 转换好的 dict