aboutsummaryrefslogtreecommitdiffstats
path: root/gsx.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@0x00.co>2013-01-10 11:20:13 +0200
committerFilipp Lepalaan <f@0x00.co>2013-01-10 11:20:13 +0200
commitb2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd (patch)
tree968b7984c0328faaaefe746aee7cee6ea571baf9 /gsx.py
parentf1f5728949f9eabbb77e487d60f41d77d59285c6 (diff)
downloadpy-gsxws-b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd.tar.gz
py-gsxws-b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd.tar.bz2
py-gsxws-b2f78ab6053b51fa8ecf1e94e5eff58da7a7d1dd.zip
Added CompTIA
Diffstat (limited to 'gsx.py')
-rwxr-xr-xgsx.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/gsx.py b/gsx.py
index 5adc33c..36b3185 100755
--- a/gsx.py
+++ b/gsx.py
@@ -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):
"""