[IMP] send an already pushed document. handle exceptions differently for the client or internal call

This commit is contained in:
Guewen Baconnier @ Camptocamp
2012-11-23 14:29:32 +01:00
parent b88f5c556a
commit b4c2fbc7fa
3 changed files with 125 additions and 45 deletions

View File

@@ -155,10 +155,15 @@ class Pingen(object):
:param int/str color: type of print, 0 = B/W, 1 = Color
:return: id of the post on pingen.com
"""
data = {
'speed': speed,
'color': color,
}
response = self._send(
requests.post,
'document/send',
params={'id': document_id})
params={'id': document_id},
data={'data': json.dumps(data)})
return response.json['id']