def KV17cvlinfo(environ, start_response): contents = environ["wsgi.input"].read() content_type = environ.get("CONTENT_TYPE") if content_type is not None and "zip" in content_type: # should be: application/x-gzip contents = zlib.decompress(contents) try: xml = ET.fromstring(contents) except Exception, e: yield reply(KV17_SE % (time.strftime(ISO_TIME), e), start_response) return
def KV17cvlinfo(environ, start_response): contents = environ['wsgi.input'].read() content_type = environ.get('CONTENT_TYPE') if content_type is not None and 'zip' in content_type: # should be: application/x-gzip contents = zlib.decompress(contents) try: xml = ET.fromstring(contents) except Exception, e: yield reply(KV17_SE % (time.strftime(ISO_TIME), e), start_response) return
def KV15messages(environ, start_response): contents = environ['wsgi.input'].read() content_type = environ.get('CONTENT_TYPE') if content_type is not None and 'zip' in content_type: # should be: application/x-gzip contents = zlib.decompress(contents) try: xml = ET.fromstring(contents) except Exception,e: yield reply(KV15_SE % (time.strftime(ISO_TIME), e), start_response) return
if content_type is not None and "zip" in content_type: # should be: application/x-gzip contents = zlib.decompress(contents) try: xml = ET.fromstring(contents) except Exception, e: yield reply(KV17_SE % (time.strftime(ISO_TIME), e), start_response) return if xml.tag == "{http://bison.connekt.nl/tmi8/kv17/msg}VV_TM_PUSH": posinfo = xml.findall("{http://bison.connekt.nl/tmi8/kv17/msg}KV17cvlinfo") if posinfo is not None: for dossier in posinfo: fetchfrommessage(dossier) yield reply(KV17_OK % (time.strftime(ISO_TIME)), start_response) return elif root.tag == "{http://bison.connekt.nl/tmi8/kv17/msg}VV_TM_RES": yield reply( KV17_PE % (time.strftime(ISO_TIME), "What are you thinking? We are the receiver, we don't do responses!"), start_response, ) return else: yield reply( KV17_NA % (time.strftime(ISO_TIME), "Unknown root tag, did you specify the schema?"), start_response ) return
contents = zlib.decompress(contents) try: xml = ET.fromstring(contents) except Exception, e: yield reply(KV17_SE % (time.strftime(ISO_TIME), e), start_response) return if xml.tag == '{http://bison.connekt.nl/tmi8/kv17/msg}VV_TM_PUSH': posinfo = xml.findall( '{http://bison.connekt.nl/tmi8/kv17/msg}KV17cvlinfo') if posinfo is not None: for dossier in posinfo: fetchfrommessage(dossier) yield reply(KV17_OK % (time.strftime(ISO_TIME)), start_response) return elif root.tag == '{http://bison.connekt.nl/tmi8/kv17/msg}VV_TM_RES': yield reply( KV17_PE % (time.strftime(ISO_TIME), "What are you thinking? We are the receiver, we don't do responses!" ), start_response) return else: yield reply( KV17_NA % (time.strftime(ISO_TIME), "Unknown root tag, did you specify the schema?"), start_response)