Skip to content
This repository was archived by the owner on Jul 8, 2025. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*pyc
*#
.#*
27 changes: 24 additions & 3 deletions documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,16 @@ class Job(BackendDocument):
#TODO accountId, bundleId, storeCountry, appType{AppStoreApp,CydiaApp}, executionStrategy{DefaultExecution,OpenCloseExecution,RandomExecution,SmartExecution}
'worker': Worker,
'device': Device,
'date_added': float
'date_added': float,
'error_message': unicode,
'compatible_devices': int
}
required_fields = ['type', 'state', 'jobInfo']
default_values = {
'date_added': time.time,
'state': STATE.UNDEFINED
'state': STATE.UNDEFINED,
# 100 for ipad, 10 for iPhone and 1 for iPod
'compatible_devices': 0b111
}
indexes = [{
'fields':['type', 'state'],
Expand Down Expand Up @@ -223,7 +227,24 @@ def can_run_on_device(self, device):
if country == acc.storeCountry:
return True
return False
return True
if 'minimumOSVersion' in self.jobInfo:
minimumOSVersion = int(self.jobInfo['minimumOSVersion'])
productVersion = int(''.join(device['deviceInfo']['ProductVersion'].split('.')))
if productVersion < minimumOSVersion:
return False

deviceClass = device['deviceInfo']['DeviceClass']
if deviceClass == 'iPad':
deviceClassValue = 0b100
elif deviceClass == 'iPhone':
deviceClassValue = 0b10
else:
deviceClassValue = 0b1

if not self.compatible_devices & deviceClassValue:
return False
else:
return True


# A app is a concrete app (user account, version, bundleID) under test
Expand Down