aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws/products.py
diff options
context:
space:
mode:
authorFilipp Lepalaan <f@230.to>2013-07-19 10:56:31 +0300
committerFilipp Lepalaan <f@230.to>2013-07-19 10:56:31 +0300
commitce8ada78e4b285f51ae83ad78990b16582588a36 (patch)
tree00bdd3126aaf3a7ad5b65e4653ea93f1bafee5d2 /gsxws/products.py
parent151b3893395bae90f5795b50e27812d30403b91e (diff)
downloadpy-gsxws-ce8ada78e4b285f51ae83ad78990b16582588a36.tar.gz
py-gsxws-ce8ada78e4b285f51ae83ad78990b16582588a36.tar.bz2
py-gsxws-ce8ada78e4b285f51ae83ad78990b16582588a36.zip
Added Product.is_unlocked()
Diffstat (limited to 'gsxws/products.py')
-rw-r--r--gsxws/products.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/gsxws/products.py b/gsxws/products.py
index 8905b2b..654bef3 100644
--- a/gsxws/products.py
+++ b/gsxws/products.py
@@ -137,6 +137,16 @@ class Product(GsxObject):
self.serialNumber = ad.serialNumber
return ad
+ def is_unlocked(self, ad=None):
+ """
+ Returns true if this iOS device is unlocked
+ """
+ import re
+ return ad.unlocked or (re.search("Unlock", ad.nextTetherPolicyDetails) is not None)
+
+ def is_locked(self):
+ return not self.is_unlocked()
+
if __name__ == '__main__':
import sys