raise BuildException("Expected to find buildozer-compatible spec at {0}"
.format(spec))
defaults = {'orientation': 'landscape', 'icon': '',
- 'permissions': '', 'android.api': "19" }
+ 'permissions': '', 'android.api': "19"}
bconfig = ConfigParser(defaults, allow_no_value=True)
bconfig.read(spec)
loc_ndk = common.env['ANDROID_NDK']
loc_sdk = common.env['ANDROID_SDK']
if loc_ndk == '$ANDROID_NDK':
- loc_ndk = loc_sdk+'/ndk-bundle'
+ loc_ndk = loc_sdk + '/ndk-bundle'
bc_ndk = None
bc_sdk = None
try:
- bc_ndk = bconfig.get('app','android.sdk_path')
- except:
+ bc_ndk = bconfig.get('app', 'android.sdk_path')
+ except Exception:
pass
try:
- bc_sdk = bconfig.get('app','android.ndk_path')
- except:
+ bc_sdk = bconfig.get('app', 'android.ndk_path')
+ except Exception:
pass
if bc_sdk is None:
- bconfig.set('app','android.sdk_path',loc_sdk)
+ bconfig.set('app', 'android.sdk_path', loc_sdk)
if bc_ndk is None:
- bconfig.set('app','android.ndk_path',loc_ndk)
+ bconfig.set('app', 'android.ndk_path', loc_ndk)
- fspec = open(spec,'w')
+ fspec = open(spec, 'w')
bconfig.write(fspec)
fspec.close()
p = None
# execute buildozer
- cmd = ['buildozer','android','release']
+ cmd = ['buildozer', 'android', 'release']
try:
p = FDroidPopen(cmd, cwd=root_dir)
- except:
+ except Exception:
pass
# buidozer not installed ? clone repo and run
- if (p is None or p.returncode!=0):
- cmd = ['git','clone','https://github.com/kivy/buildozer.git']
+ if (p is None or p.returncode != 0):
+ cmd = ['git', 'clone', 'https://github.com/kivy/buildozer.git']
p = subprocess.Popen(cmd, cwd=root_dir, shell=False)
p.wait()
if p.returncode != 0:
raise BuildException("Distribute build failed")
- cmd = ['python','buildozer/buildozer/scripts/client.py','android','release']
+ cmd = ['python', 'buildozer/buildozer/scripts/client.py', 'android', 'release']
p = FDroidPopen(cmd, cwd=root_dir)
# expected to fail.