Skip to content

Commit

Permalink
Completo limpieza modulos antiguos
Browse files Browse the repository at this point in the history
  • Loading branch information
reingart committed Oct 5, 2016
1 parent 2fa1e3b commit c5f33de
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 45 deletions.
37 changes: 0 additions & 37 deletions php.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyrece.py
Expand Up @@ -27,7 +27,7 @@
import traceback
from ConfigParser import SafeConfigParser
import wsaa, wsfe, wsfev1, wsfexv1
from php import SimpleXMLElement, SoapClient, SoapFault, date
from utils import SimpleXMLElement, SoapClient, SoapFault, date
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
from email.mime.multipart import MIMEMultipart
Expand Down
2 changes: 1 addition & 1 deletion rece1.py
Expand Up @@ -26,7 +26,7 @@

# revisar la instalación de pyafip.ws:
import wsfev1
from php import SimpleXMLElement, SoapClient, SoapFault, date
from utils import SimpleXMLElement, SoapClient, SoapFault, date
from utils import leer, escribir, leer_dbf, guardar_dbf, N, A, I, abrir_conf


Expand Down
2 changes: 1 addition & 1 deletion recem.py
Expand Up @@ -25,7 +25,7 @@

# revisar la instalación de pyafip.ws:
import wsmtx
from php import SimpleXMLElement, SoapClient, SoapFault, date
from utils import SimpleXMLElement, SoapClient, SoapFault, date
from utils import leer, escribir, leer_dbf, guardar_dbf, N, A, I, abrir_conf


Expand Down
2 changes: 1 addition & 1 deletion recex1.py
Expand Up @@ -25,7 +25,7 @@

# revisar la instalación de pyafip.ws:
import wsfexv1
from php import SimpleXMLElement, SoapClient, SoapFault, date
from utils import SimpleXMLElement, SoapClient, SoapFault, date
from utils import leer, escribir, leer_dbf, guardar_dbf, N, A, I, abrir_conf


Expand Down
15 changes: 15 additions & 0 deletions utils.py
Expand Up @@ -16,13 +16,15 @@
__copyright__ = "Copyright (C) 2013 Mariano Reingart"
__license__ = "GPL 3.0"

import datetime
import functools
import inspect
import locale
import socket
import sys
import os
import stat
import time
import traceback
import warnings
from cStringIO import StringIO
Expand Down Expand Up @@ -840,6 +842,19 @@ def norm(x, encoding="latin1"):
return unicodedata.normalize('NFKD', x).encode('ASCII', 'ignore')


def date(fmt=None,timestamp=None):
"Manejo de fechas (simil PHP)"
if fmt=='U': # return timestamp
t = datetime.datetime.now()
return int(time.mktime(t.timetuple()))
if fmt=='c': # return isoformat
d = datetime.datetime.fromtimestamp(timestamp)
return d.isoformat()
if fmt=='Ymd':
d = datetime.datetime.now()
return d.strftime("%Y%m%d")


def get_install_dir():
if not hasattr(sys, "frozen"):
basepath = __file__
Expand Down
2 changes: 1 addition & 1 deletion wdigdepfiel.py
Expand Up @@ -31,7 +31,7 @@
"""

import os, sys, time
from php import date, SimpleXMLElement, SoapClient, SoapFault
from utils import date, SimpleXMLElement, SoapClient, SoapFault

WSDDFURL = "https://testdia.afip.gov.ar/Dia/Ws/wDigDepFiel/wDigDepFiel.asmx"
SOAP_ACTION = 'ar.gov.afip.dia.serviciosWeb.wDigDepFiel/'
Expand Down
3 changes: 1 addition & 2 deletions wsaa.py
Expand Up @@ -23,10 +23,9 @@

import hashlib, datetime, email, os, sys, time, traceback, warnings
import unicodedata
from php import date
from pysimplesoap.client import SimpleXMLElement
from utils import inicializar_y_capturar_excepciones, BaseWS, get_install_dir, \
exception_info, safe_console
exception_info, safe_console, date
try:
from M2Crypto import BIO, Rand, SMIME, SSL
except ImportError:
Expand Down
2 changes: 1 addition & 1 deletion wsctgv3.py
Expand Up @@ -68,7 +68,7 @@
"""

import os, sys, time, base64
from php import date
from utils import date
import traceback
from pysimplesoap.client import SoapFault
import utils
Expand Down

0 comments on commit c5f33de

Please sign in to comment.