forked from timotheus/ebaysdk-python
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommon.py
More file actions
31 lines (24 loc) · 861 Bytes
/
common.py
File metadata and controls
31 lines (24 loc) · 861 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# -*- coding: utf-8 -*-
'''
© 2012-2013 eBay Software Foundation
Authored by: Tim Keefer
Licensed under CDDL 1.0
'''
def dump(api, full=False):
print("\n")
if api.warnings():
print("Warnings" + api.warnings())
if api.response.content:
print("Call Success: %s in length" % len(api.response.content))
print("Response code: %s" % api.response_code())
print("Response DOM1: %s" % api.response_dom()) # deprecated
print("Response ETREE: %s" % api.response.dom())
if full:
print(api.response.content)
print(api.response.json())
print("Response Reply: %s" % api.response.reply)
else:
dictstr = "%s" % api.response.dict()
print("Response dictionary: %s..." % dictstr[:150])
replystr = "%s" % api.response.reply
print("Response Reply: %s" % replystr[:150])