limit to platform in install

This commit is contained in:
j 2016-01-31 19:02:29 +05:30
parent fe9e2c65bc
commit 2c61fcc111

14
install
View file

@ -14,6 +14,18 @@ def makedirs(dirname):
if not os.path.exists(dirname):
os.makedirs(dirname)
def get_platform():
name = sys.platform
if name.startswith('darwin'):
name = 'darwin64'
elif name.startswith('linux'):
import platform
if platform.architecture()[0] == '64bit':
name = 'linux64'
else:
name = 'linux32'
return name
class Install(Thread):
base_url = 'http://downloads.openmedialibrary.com/'
@ -98,7 +110,9 @@ class Install(Thread):
release = self.get_release()
self.status['release'] = release
print("Installing Open Media Library:")
platform = get_platform()
for module in sorted(release['modules']):
if release['modules'][module].get('platform', platform) == platform:
self.status['installing'] = module
self.status['progress'] = 0
self.status['size'] = 0