(result)
| 34 | |
| 35 | |
| 36 | def 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 | |
| 56 | def _get_estado_info(db, sigla): |
no outgoing calls
no test coverage detected