MCPcopy Index your code
hub / github.com/PostmonAPI/postmon / format_result

Function format_result

PostmonServer.py:36–53  ·  view source on GitHub ↗
(result)

Source from the content-addressed store, hash-verified

34
35
36def format_result(result):
37 # checa se foi solicitada resposta em JSONP
38 js_func_name = bottle.request.query.get(jsonp_query_key)
39
40 #checa se foi solicitado xml
41 format = bottle.request.query.get('format')
42 if format == 'xml':
43 response.content_type = 'application/xml'
44 return xmltodict.unparse({'result': result})
45
46 if js_func_name:
47 # se a resposta vai ser JSONP, o content type deve ser js e seu
48 # conteudo deve ser JSON
49 response.content_type = 'application/javascript'
50 result = json.dumps(result)
51
52 result = '%s(%s);' % (js_func_name, result)
53 return result
54
55
56def _get_estado_info(db, sigla):

Callers 4

verifica_cepFunction · 0.85
ufFunction · 0.85
cidadeFunction · 0.85
track_packFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected