8000 Merge pull request #966 from KeyWeeUsr/multi_permissions · loaf/python-for-android@f6433d0 · GitHub
[go: up one dir, main page]

Skip to content

Commit f6433d0

Browse files
authored
Merge pull request kivy#966 from KeyWeeUsr/multi_permissions
Switch --permission to accept >=1 parameters
2 parents 7314a95 + 8847a14 commit f6433d0

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

pythonforandroid/bootstraps/pygame/build/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ def parse_args(args=None):
415415
'Usually one of "landscape", "portrait" or '
416416
'"sensor"'))
417417
ap.add_argument('--permission', dest='permissions', action='append',
418-
help='The permissions to give this app.')
418+
help='The permissions to give this app.', nargs='+')
419419
ap.add_argument('--ignore-path', dest='ignore_path', action='append',
420420
help='Ignore path when building the app')
421421
ap.add_argument('--icon', dest='icon',
@@ -488,6 +488,9 @@ def parse_args(args=None):
488488

489489
if args.permissions is None:
490490
args.permissions = []
491+
elif args.permissions:
492+
if isinstance(args.permissions[0], list):
493+
args.permissions = [p for perm in args.permissions for p in perm]
491494

492495
if args.ignore_path is None:
493496
args.ignore_path = []

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def parse_args(args=None):
417417
ap.add_argument('--icon', dest='icon',
418418
help='A png file to use as the icon for the application.')
419419
ap.add_argument('--permission', dest='permissions', action='append',
420-
help='The permissions to give this app.')
420+
help='The permissions to give this app.', nargs='+')
421421
ap.add_argument('--meta-data', dest='meta_data', action='append',
422422
help='Custom key=value to add in application metadata')
423423
ap.add_argument('--presplash', dest='presplash',
@@ -488,6 +488,9 @@ def parse_args(args=None):
488488

489489
if args.permissions is None:
490490
args.permissions = []
491+
elif args.permissions:
492+
if isinstance(args.permissions[0], list):
493+
args.permissions = [p for perm in args.permissions for p in perm]
491494

492495
if args.meta_data is None:
493496
args.meta_data = []

pythonforandroid/bootstraps/webview/build/build.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def parse_args(args=None):
404404
ap.add_argument('--icon', dest='icon',
405405
help='A png file to use as the icon for the application.')
406406
ap.add_argument('--permission', dest='permissions', action='append',
407-
help='The permissions to give this app.')
407+
help='The permissions to give this app.', nargs='+')
408408
ap.add_argument('--meta-data', dest='meta_data', action='append',
409409
help='Custom key=value to add in application metadata')
410410
ap.add_argument('--presplash', dest='presplash',
@@ -465,6 +465,9 @@ def parse_args(args=None):
465465

466466
if args.permissions is None:
467467
args.permissions = []
468+
elif args.permissions:
469+
if isinstance(args.permissions[0], list):
470+
args.permissions = [p for perm in args.permissions for p in perm]
468471

469472
if args.meta_data is None:
470473
args.meta_data = []

0 commit comments

Comments
 (0)
0