aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-09-06 18:30:54 +0300
committerFilipp Lepalaan <f@230.to>2013-09-06 18:30:54 +0300
commit3f2fc53c57606a110162eccc2409f5bcc1172af0 (patch)
tree81306cfe0b028f49c0852742626da38fd83797d6 /gsxws
parentd3fc9cb6dfc89ea118038a5868b99e459cab911b (diff)
downloadpy-gsxws-3f2fc53c57606a110162eccc2409f5bcc1172af0.tar.gz
py-gsxws-3f2fc53c57606a110162eccc2409f5bcc1172af0.tar.bz2
py-gsxws-3f2fc53c57606a110162eccc2409f5bcc1172af0.zip
Added more coverage details to Product
Diffstat (limited to 'gsxws')
-rw-r--r--gsxws/products.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/gsxws/products.py b/gsxws/products.py
index 654bef3..36aff3a 100644
--- a/gsxws/products.py
+++ b/gsxws/products.py
@@ -144,9 +144,35 @@ class Product(GsxObject):
import re
return ad.unlocked or (re.search("Unlock", ad.nextTetherPolicyDetails) is not None)
+ @property
+ def is_vintage(self):
+ title = self.warrantyDetails.productDescription
+ return title.startswith('~VIN,')
+
+ @property
def is_locked(self):
return not self.is_unlocked()
+ @property
+ def parts_covered(self):
+ return self.warrantyDetails.partCovered is True
+
+ @property
+ def labor_covered(self):
+ return self.warrantyDetails.laborCovered is True
+
+ @property
+ def parts_and_labor_covered(self):
+ return self.parts_covered and self.labor_covered
+
+ @property
+ def has_onsite(self):
+ from datetime import date
+ try:
+ return date.today() < self.warrantyDetails.onsiteEndDate
+ except Exception:
+ return False
+
if __name__ == '__main__':
import sys