Skip to content

Commit f774389

Browse files
committed
Add --permission to SDL2 bootstraps
1 parent dfc8ab3 commit f774389

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

pythonforandroid/bootstraps/sdl2/build/build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def make_package(args):
248248

249249
default_icon = 'templates/kivy-icon.png'
250250
shutil.copy(args.icon or default_icon, 'res/drawable/icon.png')
251-
251+
252252
versioned_name = (args.name.replace(' ', '').replace('\'', '') +
253253
'-' + args.version)
254254

@@ -285,7 +285,7 @@ def make_package(args):
285285
fileh.write(re.sub(r'"private_version">[0-9\.]*<',
286286
'"private_version">{}<'.format(
287287
str(time.time())), lines))
288-
288+
289289

290290
def parse_args(args=None):
291291
import argparse
@@ -322,12 +322,17 @@ def parse_args(args=None):
322322
'"sensor"'))
323323
ap.add_argument('--icon', dest='icon',
324324
help='A png file to use as the icon for the application.')
325+
ap.add_argument('--permission', dest='permissions', action='append',
326+
help='The permissions to give this app.')
325327

326328
if args is None:
327329
args = sys.argv[1:]
328330
args = ap.parse_args(args)
329331
args.ignore_path = []
330332

333+
if args.permissions is None:
334+
args.permissions = []
335+
331336
make_package(args)
332337

333338
if __name__ == "__main__":

pythonforandroid/bootstraps/sdl2python3/build/build.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def make_package(args):
248248

249249
default_icon = 'templates/kivy-icon.png'
250250
shutil.copy(args.icon or default_icon, 'res/drawable/icon.png')
251-
251+
252252
versioned_name = (args.name.replace(' ', '').replace('\'', '') +
253253
'-' + args.version)
254254

@@ -285,7 +285,7 @@ def make_package(args):
285285
fileh.write(re.sub(r'"private_version">[0-9\.]*<',
286286
'"private_version">{}<'.format(
287287
str(time.time())), lines))
288-
288+
289289

290290
def parse_args(args=None):
291291
import argparse
@@ -322,12 +322,17 @@ def parse_args(args=None):
322322
'"sensor"'))
323323
ap.add_argument('--icon', dest='icon',
324324
help='A png file to use as the icon for the application.')
325+
ap.add_argument('--permission', dest='permissions', action='append',
326+
help='The permissions to give this app.')
325327

326328
if args is None:
327329
args = sys.argv[1:]
328330
args = ap.parse_args(args)
329331
args.ignore_path = []
330332

333+
if args.permissions is None:
334+
args.permissions = []
335+
331336
make_package(args)
332337

333338
if __name__ == "__main__":

0 commit comments

Comments
 (0)