Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -89,3 +89,5 @@ ENV/
.ropeproject

example/teste.py

.idea/*
5 changes: 4 additions & 1 deletion cieloApi3/objectJSON.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

import json
from future.utils import integer_types


class ObjectJSON(object):

Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion cieloApi3/request/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import uuid, json

from future.utils import raise_with_traceback
from requests import Request, Session

class Base(object):
Expand Down Expand Up @@ -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
5 changes: 5 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
appdirs==1.4.3
future==0.16.0
packaging==16.8
pyparsing==2.2.0
requests==2.13.0
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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',
)
)

Expand Down