From a01a92491adaf3bd063d55125701e81d01b58534 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 10 Jun 2013 20:47:30 +0300 Subject: Added parts argument to Product.warranty() --- gsxws/products.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gsxws/products.py b/gsxws/products.py index 3042109..252d97e 100644 --- a/gsxws/products.py +++ b/gsxws/products.py @@ -39,7 +39,7 @@ class Product(GsxObject): self.configCode = result.configCode return result - def warranty(self): + def warranty(self, parts=None): """ The Warranty Status API retrieves the same warranty details displayed on the GSX Coverage screen. @@ -51,7 +51,17 @@ class Product(GsxObject): u'Out Of Warranty (No Coverage)' >>> Product('DGKFL06JDHJP').warranty().estimatedPurchaseDate datetime.date(2011, 6, 2) + >>> Product('WQ8094DW0P1').warranty([(u'661-5070', u'Z26',)]) # doctest: +ELLIPSIS + {'warrantyStatus': 'Out Of Warranty (No Coverage)',... """ + try: + self.partNumbers = [] + for k, v in parts: + part = GsxObject(partNumber=k, comptiaCode=v) + self.partNumbers.append(part) + except Exception: + pass + self._submit("unitDetail", "WarrantyStatus", "warrantyDetailInfo") self.warrantyDetails = self._req.objects return self.warrantyDetails -- cgit v1.2.3 From 9e13cf13b75d5deddc3800c82cfa5cbbbb214099 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 10 Jun 2013 20:59:25 +0300 Subject: Version bump --- setup.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 0b28ea6..0c491ab 100644 --- a/setup.py +++ b/setup.py @@ -2,9 +2,9 @@ from setuptools import setup, find_packages setup( name="gsxws", - version="0.3", + version="0.4", description="Apple GSX integration.", - install_requires = ['suds'], + install_requires=['yaml'], classifiers=[ "Environment :: Web Environment", "Intended Audience :: Developers", @@ -15,8 +15,8 @@ setup( ], keywords="gsx, python", author="Filipp Lepalaan", - author_email="filipp@mcare.fi", + author_email="filipp@fps.ee", url="https://github.com/filipp/py-gsxws", license="BSD", - packages = find_packages(), + packages=find_packages(), ) -- cgit v1.2.3 From afdfa3695ab7266d6b49eb7f5d616bedd22d96f2 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Mon, 10 Jun 2013 21:02:51 +0300 Subject: Fix yaml package name --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 0c491ab..1ca66e1 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ setup( name="gsxws", version="0.4", description="Apple GSX integration.", - install_requires=['yaml'], + install_requires=['PyYAML'], classifiers=[ "Environment :: Web Environment", "Intended Audience :: Developers", -- cgit v1.2.3