diff options
author | Filipp Lepalaan <filipp@mac.com> | 2014-12-17 00:11:28 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2014-12-17 00:11:28 +0200 |
commit | c1d744de2e3f59a18bd0943f29911ccafba7c1b5 (patch) | |
tree | ff0da09399406d28974b3730f0a30f72a40078b9 /gsxws/comptia.py | |
parent | 5defed13830d1e3f164b7c4894bd228fcfabd33f (diff) | |
download | py-gsxws-c1d744de2e3f59a18bd0943f29911ccafba7c1b5.tar.gz py-gsxws-c1d744de2e3f59a18bd0943f29911ccafba7c1b5.tar.bz2 py-gsxws-c1d744de2e3f59a18bd0943f29911ccafba7c1b5.zip |
CompTIA fixes0.5
Diffstat (limited to 'gsxws/comptia.py')
-rw-r--r-- | gsxws/comptia.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/gsxws/comptia.py b/gsxws/comptia.py index bdbc7d4..61164f8 100644 --- a/gsxws/comptia.py +++ b/gsxws/comptia.py @@ -11,6 +11,7 @@ MODIFIERS = ( ("E", "Environmental"), ("F", "Configuration: Peripheral"), ("G", "Damaged"), + ("H", "Apple Review"), ) GROUPS = ( @@ -28,6 +29,7 @@ GROUPS = ( ('B', "iPhone"), ('E', "iPod"), ('F', "iPad"), + ('G', "Beats Products"), ) @@ -57,23 +59,21 @@ class CompTIA(GsxObject): >>> CompTIA().fetch() # doctest: +ELLIPSIS {u'A': {'989': u'Remote Inoperable', ... """ - self._submit("ComptiaCodeLookupRequest", "ComptiaCodeLookup", "comptiaInfo", True) + if self._cache.get('comptia'): + return self._cache.get('comptia') - if self._cache.get(): - return self._cache.get() - - root = self._req.objects + doc = self._submit("ComptiaCodeLookupRequest", "ComptiaCodeLookup", "comptiaInfo", raw=True) + root = doc.find('.//comptiaInfo') for el in root.findall(".//comptiaGroup"): group = {} comp_id = unicode(el[0].text) - for ci in el.findall("comptiaCodeInfo"): group[ci[0].text] = unicode(ci[1].text) self._comptia[comp_id] = group - self._cache.set(self._comptia) + self._cache.set('comptia', self._comptia) return self._comptia def symptoms(self, component=None): |