Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some maybe useful commits #1

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
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