Ejemplo n.º 1
0
    def formatBizQueryParaMap(self, paraMap, urlencode):
        """格式化参数,签名过程需要使用"""
        slist = sorted(paraMap)
        buff = []
        for k in slist:
            v = quote(paraMap[k]) if urlencode else paraMap[k]
            buff.append("{0}={1}".format(k, smart_str(v)))

        return "&".join(buff)
Ejemplo n.º 2
0
    def formatBizQueryParaMap(self, paraMap, urlencode):
        """格式化参数,签名过程需要使用"""
        slist = sorted(paraMap)
        buff = []
        for k in slist:
            v = quote(paraMap[k]) if urlencode else paraMap[k]
            buff.append("{0}={1}".format(k, smart_str(v)))

        return "&".join(buff)
Ejemplo n.º 3
0
 def arrayToXml(self, arr):
     """array转xml"""
     xml = ["<xml>"]
     for k, v in arr.iteritems():
         if v.isdigit():
             xml.append("<{0}>{1}</{0}>".format(k, v))
         else:
             xml.append("<{0}><![CDATA[{1}]]></{0}>".format(k, smart_str(v)))
     xml.append("</xml>")
     return "".join(xml)
Ejemplo n.º 4
0
 def arrayToXml(self, arr):
     """array转xml"""
     xml = ["<xml>"]
     for k, v in arr.iteritems():
         if v.isdigit():
             xml.append("<{0}>{1}</{0}>".format(k, v))
         else:
             xml.append("<{0}><![CDATA[{1}]]></{0}>".format(
                 k, smart_str(v)))
     xml.append("</xml>")
     return "".join(xml)