aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2021-05-24 16:32:18 +0300
committerFilipp Lepalaan <filipp@mac.com>2021-05-24 16:32:18 +0300
commitf4f3f35f184966c59d7622170820d3389a02288f (patch)
tree6cb23e8a6084199e1d8b827129bf85243dcfdf8d
parent002e0b8a100869346e89bd052ce1c7edb402455a (diff)
downloadpy-gsxws-master.tar.gz
py-gsxws-master.tar.bz2
py-gsxws-master.zip
Fix is_mac (Python 3)HEADmaster
-rw-r--r--gsxws/products.py18
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()