Merge pull request #1071 from lerela/1070_fix_python3_raw_input
Support for both input and raw_input in iOS target to avoid NameError with Python 3
This commit is contained in:
commit
504efcc243
1 changed files with 9 additions and 3 deletions
|
@ -7,11 +7,12 @@ if sys.platform != 'darwin':
|
||||||
raise NotImplementedError('Windows platform not yet working for Android')
|
raise NotImplementedError('Windows platform not yet working for Android')
|
||||||
|
|
||||||
import plistlib
|
import plistlib
|
||||||
from buildozer import BuildozerCommandException
|
from buildozer import BuildozerCommandException, IS_PY3
|
||||||
from buildozer.target import Target, no_config
|
from buildozer.target import Target, no_config
|
||||||
from os.path import join, basename, expanduser, realpath
|
from os.path import join, basename, expanduser, realpath
|
||||||
from getpass import getpass
|
from getpass import getpass
|
||||||
|
|
||||||
|
|
||||||
PHP_TEMPLATE = '''
|
PHP_TEMPLATE = '''
|
||||||
<?php
|
<?php
|
||||||
// credits goes to http://jeffreysambells.com/2010/06/22/ios-wireless-app-distribution
|
// credits goes to http://jeffreysambells.com/2010/06/22/ios-wireless-app-distribution
|
||||||
|
@ -395,7 +396,12 @@ class TargetIos(Target):
|
||||||
|
|
||||||
save = None
|
save = None
|
||||||
while save is None:
|
while save is None:
|
||||||
q = raw_input('Do you want to save the password (Y/n): ')
|
if IS_PY3:
|
||||||
|
input_func = input
|
||||||
|
else:
|
||||||
|
input_func = raw_input
|
||||||
|
|
||||||
|
q = input_func('Do you want to save the password (Y/n): ')
|
||||||
if q in ('', 'Y'):
|
if q in ('', 'Y'):
|
||||||
save = True
|
save = True
|
||||||
elif q == 'n':
|
elif q == 'n':
|
||||||
|
@ -405,7 +411,7 @@ class TargetIos(Target):
|
||||||
|
|
||||||
if save:
|
if save:
|
||||||
with open(password_file, 'wb') as fd:
|
with open(password_file, 'wb') as fd:
|
||||||
fd.write(password)
|
fd.write(password.encode())
|
||||||
|
|
||||||
def get_target(buildozer):
|
def get_target(buildozer):
|
||||||
return TargetIos(buildozer)
|
return TargetIos(buildozer)
|
||||||
|
|
Loading…
Add table
Reference in a new issue