aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/core.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2014-12-17 00:11:28 +0200
committerFilipp Lepalaan <filipp@mac.com>2014-12-17 00:11:28 +0200
commitc1d744de2e3f59a18bd0943f29911ccafba7c1b5 (patch)
treeff0da09399406d28974b3730f0a30f72a40078b9 /gsxws/core.py
parent5defed13830d1e3f164b7c4894bd228fcfabd33f (diff)
downloadpy-gsxws-c1d744de2e3f59a18bd0943f29911ccafba7c1b5.tar.gz
py-gsxws-c1d744de2e3f59a18bd0943f29911ccafba7c1b5.tar.bz2
py-gsxws-c1d744de2e3f59a18bd0943f29911ccafba7c1b5.zip
CompTIA fixes0.5
Diffstat (limited to 'gsxws/core.py')
-rw-r--r--gsxws/core.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/gsxws/core.py b/gsxws/core.py
index e1e5a50..c2e26a4 100644
--- a/gsxws/core.py
+++ b/gsxws/core.py
@@ -226,8 +226,8 @@ class GsxCache(object):
def set(self, key, value):
d = {
- 'value': value,
- 'expires': self.now + self.expires
+ 'value' : value,
+ 'expires' : self.now + self.expires
}
self.shelf[key] = d
@@ -256,6 +256,7 @@ class GsxRequest(object):
ET.SubElement(self.env, "soapenv:Header")
self.body = ET.SubElement(self.env, "soapenv:Body")
+ self.xml_response = ''
for k, v in kwargs.items():
self.obj = v
@@ -309,11 +310,16 @@ class GsxRequest(object):
data = ET.tostring(self.env, "UTF-8")
res = self._send(method, data)
xml = res.read()
+ self.xml_response = xml
if res.status > 200:
raise GsxError(xml=xml, url=self._url)
logging.debug("Response: %s %s %s" % (res.status, res.reason, xml))
+
+ if raw:
+ return ET.fromstring(self.xml_response)
+
response = response or self._response
self.objects = objectify.parse(xml, response)
return self.objects