예제 #1
0
파일: msgprocess.py 프로젝트: jwu26/OngMani
    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!")
예제 #2
0
    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!")
예제 #3
0
파일: msgparser.py 프로젝트: jwu26/OngMani
 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))
예제 #4
0
 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))
예제 #5
0
파일: ongmani.py 프로젝트: jwu26/OngMani
 def three(self, req, args):
     dbg.info("req is %s", req)
     return 'three'
예제 #6
0
파일: ongmani.py 프로젝트: jwu26/OngMani
 def two(self, req):
     dbg.info("req is %s", req)
     return 'two'
예제 #7
0
 def three(self, req, args):
     dbg.info("req is %s", req)
     return 'three'
예제 #8
0
 def two(self, req):
     dbg.info("req is %s", req)
     return 'two'