fixed multiple devices via API correctly
diff --git a/appurify/client.py b/appurify/client.py index c6db13a..ba9c384 100644 --- a/appurify/client.py +++ b/appurify/client.py
@@ -73,8 +73,10 @@ device_id_list.append( device["device_type_id"]) if response_device_list.status_code == 200: - if int(self.device_type_id) not in device_id_list : - raise AppurifyClientError("Current device list does not include device type: %s" % self.device_type_id, exit_code=constants.EXIT_CODE_DEVICE_NOT_FOUND) + listOfDevices = self.device_type_id.split(',') + for d in listOfDevices: + if int(d) not in device_id_list : + raise AppurifyClientError("Current device list does not include device type: %s" % d, exit_code=constants.EXIT_CODE_DEVICE_NOT_FOUND) def checkAppCompatibility(self, app_src): response_device_list = devices_list(self.access_token) @@ -82,15 +84,17 @@ reservingDevice = -1 for device in data_device_list["response"]: - if int(self.device_type_id) == device["device_type_id"]: - reservingDevice = device + paramListDevices = self.device_type_id.split(',') + for d in paramListDevices : + if int(d) == device["device_type_id"]: + reservingDevice = device - #verify app type works with OS type of device - if int(response_device_list.status_code) == 200 and reservingDevice != -1: - devicePlatform = reservingDevice["os_name"].lower() - appType = app_src[-3:] - if (appType == "ipa" and devicePlatform == "android") or (appType == "apk" and devicePlatform == "ios"): - raise AppurifyClientError("Must install .ipa on iOS device or .apk on android device. Mismatch: %s installing onto an %s device." % (appType, devicePlatform), exit_code=constants.EXIT_CODE_APP_INCOMPATIBLE) + #verify app type works with OS type of device + if reservingDevice != -1 and int(response_device_list.status_code) == 200: + devicePlatform = reservingDevice["os_name"].lower() + appType = app_src[-3:] + if (appType == "ipa" and devicePlatform == "android") or (appType == "apk" and devicePlatform == "ios"): + raise AppurifyClientError("Must install .ipa on iOS device or .apk on android device. Mismatch: %s installing onto an %s device: %s" % (appType, devicePlatform, d), exit_code=constants.EXIT_CODE_APP_INCOMPATIBLE)
diff --git a/appurify/constants.py b/appurify/constants.py index 87183f2..d9ed1dd 100644 --- a/appurify/constants.py +++ b/appurify/constants.py
@@ -11,7 +11,7 @@ # Current development version # Increment this during development as and when desired # setup.py will use this version to generate new releases -VERSION = (0, 4, 4) +VERSION = (0, 4, 5) __version__ = '.'.join(map(str, VERSION[0:3])) + ''.join(VERSION[3:]) # Last tagged stable version
diff --git a/dist/appurify-0.4.5.tar.gz b/dist/appurify-0.4.5.tar.gz new file mode 100644 index 0000000..d6f83c4 --- /dev/null +++ b/dist/appurify-0.4.5.tar.gz Binary files differ