diff options
author | Filipp Lepalaan <f@0x00.co> | 2013-01-10 11:20:13 +0200 |
---|---|---|
committer | Filipp Lepalaan <f@0x00.co> | 2013-01-10 11:20:13 +0200 |
commit | b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd (patch) | |
tree | 968b7984c0328faaaefe746aee7cee6ea571baf9 /gsx.py | |
parent | f1f5728949f9eabbb77e487d60f41d77d59285c6 (diff) | |
download | py-gsxws-b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd.tar.gz py-gsxws-b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd.tar.bz2 py-gsxws-b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd.zip |
Added CompTIA
Diffstat (limited to 'gsx.py')
-rwxr-xr-x | gsx.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -1,6 +1,8 @@ #coding=utf-8 import re +import os +import json import base64 from suds.client import Client from datetime import date, time @@ -111,6 +113,24 @@ class GsxObject(object): return data +class CompTia: + """ + Stores and accesses CompTIA codes. + This should really be fetched from GSX, but suds gives this error: + suds.TypeNotFound: Type not found: 'comptiaDescription' + when calling CompTIACodes()... + """ + def __init__(self): + df = open(os.path.join(os.path.dirname(__file__), 'comptia.json')) + self.data = json.load(df) + + def symptoms(self, component=None): + symptoms = self.data['symptoms'] + return symptoms[component] if component else symptoms + + def modifiers(self): + return self.data['modifiers'] + class Lookup(GsxObject): def parts(self): """ |