diff options
author | Filipp Lepalaan <filipp@mac.com> | 2021-05-24 16:32:18 +0300 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2021-05-24 16:32:18 +0300 |
commit | f4f3f35f184966c59d7622170820d3389a02288f (patch) | |
tree | 6cb23e8a6084199e1d8b827129bf85243dcfdf8d /gsxws/products.py | |
parent | 002e0b8a100869346e89bd052ce1c7edb402455a (diff) | |
download | py-gsxws-f4f3f35f184966c59d7622170820d3389a02288f.tar.gz py-gsxws-f4f3f35f184966c59d7622170820d3389a02288f.tar.bz2 py-gsxws-f4f3f35f184966c59d7622170820d3389a02288f.zip |
Diffstat (limited to 'gsxws/products.py')
-rw-r--r-- | gsxws/products.py | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/gsxws/products.py b/gsxws/products.py index dfc4194..98b092b 100644 --- a/gsxws/products.py +++ b/gsxws/products.py @@ -7,10 +7,10 @@ import re import os import json -from .utils import fetch_url -from .lookups import Lookup -from .diagnostics import Diagnostics -from .core import GsxObject, GsxError, validate +from gsxws.utils import fetch_url +from gsxws.lookups import Lookup +from gsxws.diagnostics import Diagnostics +from gsxws.core import GsxObject, GsxError, validate def models(): @@ -211,7 +211,13 @@ class Product(object): @property def is_mac(self): - return re.match(r'^i?Mac', self.description) + """ + >>> product = Product('DGKFL06JDHJP') + >>> product.description = "MacBook Pro" + >>> product.is_mac + True + """ + return (re.match(r'^i?Mac', self.description) != None) @property def is_iphone(self): @@ -263,7 +269,7 @@ if __name__ == '__main__': import sys import doctest import logging - from .core import connect + from gsxws.core import connect logging.basicConfig(level=logging.DEBUG) connect(*sys.argv[1:]) doctest.testmod() |