From 4b276ca92be677e00b5a0f2e10562194af9b30fb Mon Sep 17 00:00:00 2001 From: Lucas Cardoso Date: Tue, 14 Mar 2017 11:36:03 -0300 Subject: [PATCH 1/4] Adicionando pasta da idei no gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index d57811a..a04cdb9 100644 --- a/.gitignore +++ b/.gitignore @@ -89,3 +89,5 @@ ENV/ .ropeproject example/teste.py + +.idea/* From cf0d93013effa38456c9c1758e74906687f5e44d Mon Sep 17 00:00:00 2001 From: Lucas Cardoso Date: Tue, 14 Mar 2017 11:36:38 -0300 Subject: [PATCH 2/4] Adicionando requirements --- requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..0442a2b --- /dev/null +++ b/requirements.txt @@ -0,0 +1,5 @@ +appdirs==1.4.3 +future==0.16.0 +packaging==16.8 +pyparsing==2.2.0 +requests==2.13.0 From 93e0a33c445aeb9e57510fed8e20847574d584bd Mon Sep 17 00:00:00 2001 From: Lucas Cardoso Date: Tue, 14 Mar 2017 11:38:35 -0300 Subject: [PATCH 3/4] Adicionando suporte a python3 na exception do base.py --- cieloApi3/request/base.py | 3 ++- setup.py | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/cieloApi3/request/base.py b/cieloApi3/request/base.py index f94c0fa..3b8cd4d 100644 --- a/cieloApi3/request/base.py +++ b/cieloApi3/request/base.py @@ -1,5 +1,6 @@ import uuid, json +from future.utils import raise_with_traceback from requests import Request, Session class Base(object): @@ -51,6 +52,6 @@ def send_request(self, method, uri, data=None, params=None): data_send = json.loads(body or 'null') - raise Exception, '\r\n%s\r\nMethod: %s\r\nUri: %s\r\nData: %s' % (''.join(errors), method, response.url, json.dumps(data_send, indent=2)) + raise_with_traceback(Exception('\r\n%s\r\nMethod: %s\r\nUri: %s\r\nData: %s' % (''.join(errors), method, response.url, json.dumps(data_send, indent=2)))) return answers diff --git a/setup.py b/setup.py index e7a6b47..759f6c6 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ url='https://github.com/thiago-Malaca/API-3.0-Python', keywords='api3.0 cielo python sdk ecommerce', packages=find_packages(), - install_requires=['requests'], + install_requires=['requests', 'future'], license='MIT', classifiers=( # 'Development Status :: 5 - Production/Stable', @@ -37,6 +37,8 @@ # 'Programming Language :: Python :: 2.5', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.4', + 'Programming Language :: Python :: 3.5', ) ) From 9f5919b1a02ede20152ce5b2d65b647f4b601520 Mon Sep 17 00:00:00 2001 From: Lucas Cardoso Date: Thu, 16 Mar 2017 14:40:38 -0300 Subject: [PATCH 4/4] =?UTF-8?q?Verifica=C3=A7=C3=A3o=20da=20instancia=20ad?= =?UTF-8?q?aptada=20para=20py3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cieloApi3/objectJSON.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cieloApi3/objectJSON.py b/cieloApi3/objectJSON.py index 49bcc04..dc657c5 100644 --- a/cieloApi3/objectJSON.py +++ b/cieloApi3/objectJSON.py @@ -1,5 +1,7 @@ import json +from future.utils import integer_types + class ObjectJSON(object): @@ -58,7 +60,8 @@ def remove_none_dict(obj): retorno = {} for chave in obj: valor = obj[chave] - if valor or isinstance(valor, (int, long, float, complex)): + types = integer_types + (float, complex) + if valor or isinstance(valor, types): retorno[chave] = remove_none(valor) return retorno