def __init__(self, req, args): dbg.debug("in") dbg.debug("exit") self.method = req.method.lower() self.params = req.environ["wsgiorg.routing_args"][1] self.params_1 = req.params.copy() self.params_sig = req.params.get("signature", "0") self.params_ts = req.params.get("timestamp", "0") self.params_nonce = req.params.get("nonce", "0") # params_echostr =req.params.get('echostr') self.params_echostr = req.params.get("echostr", "helloW!") # local: content_type = req.headers["Content-Type"] content_length = req.headers["Content-Length"] dbg.info("content_type: <%s> Len<%s>, args.id: %s", content_type, content_length, args["id"]) if content_type == "text/plain": return params_echostr if args["id"] != "upload": dbg.error("Not Support Command by Qi'e") return params_echostr else: dbg.debug("Upload Support") self.host = req.headers["Host"] if content_type != "text/xml": dbg.error("Only support xml format! <%s>", content_type) return else: dbg.debug("Xml is appreicated!")
def __init__(self, req, args): dbg.debug("in") dbg.debug("exit") self.method = req.method.lower() self.params=req.environ['wsgiorg.routing_args'][1] self.params_1=req.params.copy() self.params_sig=req.params.get('signature', '0') self.params_ts =req.params.get('timestamp', '0') self.params_nonce =req.params.get('nonce', '0') #params_echostr =req.params.get('echostr') self.params_echostr =req.params.get('echostr', 'helloW!') #local: content_type = req.headers['Content-Type'] content_length = req.headers['Content-Length'] dbg.info("content_type: <%s> Len<%s>, args.id: %s",content_type, content_length ,args['id']) if content_type == 'text/plain': return params_echostr if args['id'] != 'upload': dbg.error("Not Support Command by Qi'e") return params_echostr else: dbg.debug("Upload Support") self.host = req.headers['Host'] if content_type != 'text/xml': dbg.error("Only support xml format! <%s>", content_type) return else: dbg.debug("Xml is appreicated!")
def print_node(node): '''Print Dom''' dbg.info("==============================================") if node.attrib: dbg.debug("node.attrib:%s" % node.attrib) if node.attrib.has_key("MsgId") > 0 : dbg.debug("node.attrib['MsgId']:%s" % node.attrib['MsgId']) dbg.debug("<%s>:<%s>" % (node.tag, node.text))
def print_node(node): '''Print Dom''' dbg.info("==============================================") if node.attrib: dbg.debug("node.attrib:%s" % node.attrib) if node.attrib.has_key("MsgId") > 0: dbg.debug("node.attrib['MsgId']:%s" % node.attrib['MsgId']) dbg.debug("<%s>:<%s>" % (node.tag, node.text))
def three(self, req, args): dbg.info("req is %s", req) return 'three'
def two(self, req): dbg.info("req is %s", req) return 'two'