aboutsummaryrefslogtreecommitdiffstats
path: root/products.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-05-10 10:53:18 +0300
committerFilipp Lepalaan <f@230.to>2013-05-10 10:53:18 +0300
commit452005bbb83059913d4c8b7648d9e368936e53da (patch)
tree76154292190e86576959500299d922fd18938e1e /products.py
parent2680b7d1925b4317715dcc89b2af4aec1646d8cb (diff)
downloadpy-gsxws-452005bbb83059913d4c8b7648d9e368936e53da.tar.gz
py-gsxws-452005bbb83059913d4c8b7648d9e368936e53da.tar.bz2
py-gsxws-452005bbb83059913d4c8b7648d9e368936e53da.zip
Some refactoring
Diffstat (limited to 'products.py')
-rw-r--r--products.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/products.py b/products.py
index b0aa911..dc878f8 100644
--- a/products.py
+++ b/products.py
@@ -1,15 +1,16 @@
import sys
+import suds
from gsxws import connect, GsxError
from repairs import GsxObject
from lookups import Lookup
+
class GsxRequest(object):
def submit(self, method, data, attr=None):
- """Submits the SOAP envelope
- """
+ "Submits the SOAP envelope"
from gsxws import CLIENT, SESSION
f = getattr(CLIENT.service, method)
-
+
try:
result = f(data)
return getattr(result, attr) if attr else result
@@ -18,14 +19,14 @@ class GsxRequest(object):
class Product(GsxObject, GsxRequest):
- """Something serviceable that Apple makes
- """
+ "Something serviceable that Apple makes"
serialNumber = ""
alternateDeviceId = ""
configDescription = ""
def model(self):
- """Returns the model description of this Product
+ """
+ Returns the model description of this Product
>>> Product(serialNumber='DGKFL06JDHJP').model().configDescription
iMac (27-inch, Mid 2011)
@@ -39,7 +40,8 @@ class Product(GsxObject, GsxRequest):
return result
def warranty(self):
- """The Warranty Status API retrieves the same warranty details
+ """
+ The Warranty Status API retrieves the same warranty details
displayed on the GSX Coverage screen.
If part information is provided, the part warranty information is returned.
If you do not provide the optional part information in the