Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WSFEv1: Agrego los cambios de FCE al branch py3k #65

Closed
wants to merge 16 commits into from

Conversation

NicolasSandoval
Copy link
Contributor

#62 Hola Mariano hice los cambios de Factura de crédito electrónica

@@ -13,7 +13,7 @@
"Módulo de Intefase para archivos de texto (exportación version 1)"

__author__ = "Mariano Reingart ([email protected])"
__copyright__ = "Copyright (C) 2011 Mariano Reingart"
__copyright__ = "Copyright (C) 2019 Mariano Reingart"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No sería bueno pone run xyz - 2019?
xyz = desde que año.

:-)

recex1.py Outdated
@@ -465,6 +465,17 @@ def depurar_xml(client):
print(ws.ErrMsg)
sys.exit(0)

if '/monctz' in sys.argv:
i = sys.argv.index("/monctz")
if i+1<len(sys.argv):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

que tal:

Suggested change
if i+1<len(sys.argv):
if i+1 < len(sys.argv):

Copy link
Owner

@reingart reingart Jun 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De hecho, habría que correr pyflakes o similar antes de pushear los commits, asi saltan todas estas cuestiones de estilo de PEP8
Ver tambien autopep8 y/o black para corregir el código automágicamente.
Más adelante, estas herramientas se deberían correr automáticamente en el proceso de Integración Continua, tanto para revisar el código y/o corregirlo automáticamente (travis o lo que se decida instalar)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gracias por las sugerencias .
Agrego los métodos a tener en cuenta.

@@ -11,26 +11,27 @@
# for more details.

"""M�dulo para obtener CAE/CAEA, c�digo de autorizaci�n electr�nico webservice
WSFEv1 de AFIP (Factura Electr�nica Nacional - Proyecto Version 1 - 2.10)
WSFEv1 de AFIP (Factura Electr�nica Nacional - Proyecto Version 1 - 2.13)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Habría alguna chance que a la versión la saque de algun solo lugar? por ejemplo un version.py?

Así de esa manera no hay que estar modificando los archivos

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, esa versión es de AFIP; a veces viene en el WSDL del webservice, pero en general hay que revisar la especificación técnica de cada endpoint: http://www.afip.gov.ar/ws

wsfev1.py Outdated
# agregar la factura creada internamente para solicitud m�ltiple:
if "--multiple" in sys.argv:
wsfev1.AgregarFacturaX()

import time
# import time
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Que tal eliminar el comentario?

@NicolasSandoval
Copy link
Contributor Author

Hola @eamanu , gracias por las sugerencias.

wsbfev1.py Outdated

import datetime
import decimal
import os
import sys
from .utils import inicializar_y_capturar_excepciones, BaseWS, get_install_dir
from utils import inicializar_y_capturar_excepciones, BaseWS, get_install_dir
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cuidado: en Python3 todos los imports deberían ser absolutos (posiblemente se debería agregar pyafipws. como prefijo para evitar ambiguedades)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hola @reingart , gracias lo tengo en cuenta.

wsbfev1.py Outdated
@@ -456,7 +489,7 @@ def p_assert_eq(a, b):
# Setear token y sing de autorizaci�n (pasos previos)

# obteniendo el TA para pruebas
from .wsaa import WSAA
from wsaa import WSAA
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem: usar import absoluto o relativo al paquete

recex1.py Outdated
@@ -465,6 +465,17 @@ def depurar_xml(client):
print(ws.ErrMsg)
sys.exit(0)

if '/monctz' in sys.argv:
i = sys.argv.index("/monctz")
if i+1<len(sys.argv):
Copy link
Owner

@reingart reingart Jun 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

De hecho, habría que correr pyflakes o similar antes de pushear los commits, asi saltan todas estas cuestiones de estilo de PEP8
Ver tambien autopep8 y/o black para corregir el código automágicamente.
Más adelante, estas herramientas se deberían correr automáticamente en el proceso de Integración Continua, tanto para revisar el código y/o corregirlo automáticamente (travis o lo que se decida instalar)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants