Browse Source

change the way to get the keys on **kwargs, fix the keyError when disabling NFEs range

pull/143/head
marinaGD 8 years ago
parent
commit
ab0c0d3991
  1. 5
      pytrustnfe/Servidores.py
  2. 5
      pytrustnfe/nfe/__init__.py
  3. 4
      pytrustnfe/utils.py

5
pytrustnfe/Servidores.py

@ -71,6 +71,8 @@ SIGLA_ESTADO = {
def localizar_url(servico, estado, mod='55', ambiente=2):
import ipdb
ipdb.set_trace()
sigla = SIGLA_ESTADO[estado]
ws = ESTADO_WS[sigla]
@ -422,7 +424,6 @@ UFGO = {
}
}
UFMT = {
NFE_AMBIENTE_PRODUCAO: {
'servidor': 'nfe.sefaz.mt.gov.br',
@ -548,7 +549,6 @@ UFPE = {
}
}
UFRS = {
NFE_MODELO: {
NFE_AMBIENTE_PRODUCAO: {
@ -653,7 +653,6 @@ UFSP = {
}
}
ESTADO_WS = {
'AC': SVRS,
'AL': SVRS,

5
pytrustnfe/nfe/__init__.py

@ -182,8 +182,9 @@ def _render(certificado, method, sign, **kwargs):
def _send(certificado, method, **kwargs):
xml_send = kwargs["xml"]
url = localizar_url(method, kwargs['estado'], kwargs['modelo'],
kwargs['ambiente'])
url = localizar_url(method, kwargs.get('estado'),
kwargs.get('modelo', '55'),
kwargs.get('ambiente'))
cabecalho = _build_header(method, **kwargs)
send_raw = False

4
pytrustnfe/utils.py

@ -101,7 +101,9 @@ def gerar_nfeproc(envio, recibo):
def gerar_nfeproc_cancel(nfe_proc, cancelamento):
docEnvio = ET.fromstring(nfe_proc)
docCancel = ET.fromstring(cancelamento.encode())
import ipdb
ipdb.set_trace()
docCancel = ET.fromstring(cancelamento)
ev_cancelamento = _find_node(docCancel, "retEvento")
if ev_cancelamento is None:

Loading…
Cancel
Save