File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -64,19 +64,24 @@ def track_pack(provider, track):
6464 try :
6565 encomenda = Correios .encomenda (track )
6666
67+ resposta = dict ()
6768 result = []
6869
6970 for status in encomenda .status :
70- resposta = dict ()
71+ historico = dict ()
7172
72- resposta ['data' ] = status .data
73- resposta ['local' ] = status .local
74- resposta ['situacao' ] = status .situacao
75- resposta ['detalhes' ] = status .detalhes
73+ historico ['data' ] = status .data
74+ historico ['local' ] = status .local
75+ historico ['situacao' ] = status .situacao
76+ historico ['detalhes' ] = status .detalhes
7677
77- result .append (resposta )
78+ result .append (historico )
7879
79- return json .dumps (result )
80+ resposta ['servico' ] = provider
81+ resposta ['codigo' ] = track
82+ resposta ['historico' ] = result
83+
84+ return json .dumps (resposta )
8085
8186 except AttributeError :
8287 response .status = '404 O pacote %s informado nao pode ser localizado' % track
You can’t perform that action at this time.
0 commit comments