|
22 | 22 | ANDROID = 'android'
|
23 | 23 | ANT = 'ant'
|
24 | 24 |
|
25 |
| -#if ANDROIDSDK is on path, use android from this path |
| 25 | +# if ANDROIDSDK is on path, use android from this path |
26 | 26 | ANDROIDSDK = os.environ.get('ANDROIDSDK')
|
27 | 27 | if ANDROIDSDK:
|
28 | 28 | ANDROID = os.path.join(ANDROIDSDK, 'tools', ANDROID)
|
@@ -85,11 +85,13 @@ def compile_dir(dfn):
|
85 | 85 | def is_whitelist(name):
|
86 | 86 | return match_filename(WHITELIST_PATTERNS, name)
|
87 | 87 |
|
| 88 | + |
88 | 89 | def is_blacklist(name):
|
89 | 90 | if is_whitelist(name):
|
90 | 91 | return False
|
91 | 92 | return match_filename(BLACKLIST_PATTERNS, name)
|
92 | 93 |
|
| 94 | + |
93 | 95 | def match_filename(pattern_list, name):
|
94 | 96 | for pattern in pattern_list:
|
95 | 97 | if pattern.startswith('^'):
|
@@ -131,11 +133,11 @@ def select(fn):
|
131 | 133 | fn = realpath(fn)
|
132 | 134 | assert(fn.startswith(d))
|
133 | 135 | fn = fn[len(d):]
|
134 |
| - if fn.startswith('/site-packages/') or \ |
135 |
| - fn.startswith('/config/') or \ |
136 |
| - fn.startswith('/lib-dynload/') or \ |
137 |
| - fn.startswith('/libpymodules.so'): |
138 |
| - return False |
| 136 | + if (fn.startswith('/site-packages/') or |
| 137 | + fn.startswith('/config/') or |
| 138 | + fn.startswith('/lib-dynload/') or |
| 139 | + fn.startswith('/libpymodules.so')): |
| 140 | + return False |
139 | 141 | return fn
|
140 | 142 |
|
141 | 143 | # get a list of all python file
|
@@ -300,7 +302,7 @@ def make_package(args):
|
300 | 302 | # Update the project to a recent version.
|
301 | 303 | try:
|
302 | 304 | subprocess.call([ANDROID, 'update', 'project', '-p', '.', '-t',
|
303 |
| - 'android-{}'.format(android_api)]) |
| 305 | + 'android-{}'.format(android_api)]) |
304 | 306 | except (OSError, IOError):
|
305 | 307 | print 'An error occured while calling', ANDROID, 'update'
|
306 | 308 | print 'Your PATH must include android tools.'
|
@@ -395,7 +397,8 @@ def make_package(args):
|
395 | 397 | help='The name of the project\'s launcher icon.')
|
396 | 398 | ap.add_argument('--orientation', dest='orientation', default='landscape',
|
397 | 399 | help=('The orientation that the game will display in. '
|
398 |
| - 'Usually one of "landscape", "portrait" or "sensor"')) |
| 400 | + 'Usually one of "landscape", "portrait" or ' |
| 401 | + '"sensor"')) |
399 | 402 | ap.add_argument('--permission', dest='permissions', action='append',
|
400 | 403 | help='The permissions to give this app.')
|
401 | 404 | ap.add_argument('--ignore-path', dest='ignore_path', action='append',
|
@@ -439,18 +442,19 @@ def make_package(args):
|
439 | 442 | ap.add_argument('--minsdk', dest='min_sdk_version', default='8',
|
440 | 443 | help='Minimum Android SDK version to use. Default to 8')
|
441 | 444 | ap.add_argument('--window', dest='window', action='store_true',
|
442 |
| - help='Indicate if the application will be windowed') |
| 445 | + help='Indicate if the application will be windowed') |
443 | 446 | ap.add_argument('--wakelock', dest='wakelock', action='store_true',
|
444 |
| - help='Indicate if the application needs the device to stay on') |
| 447 | + help=('Indicate if the application needs the device ' |
| 448 | + 'to stay on')) |
445 | 449 | ap.add_argument('command', nargs='*',
|
446 | 450 | help=('The command to pass to ant (debug, release, '
|
447 | 451 | 'installd, installr)'))
|
448 | 452 | ap.add_argument('--add-jar', dest='add_jar', action='append',
|
449 | 453 | help=('Add a Java .jar to the libs, so you can access its '
|
450 |
| - 'classes with pyjnius. You can specify this argument ' |
451 |
| - 'more than once to include multiple jars')) |
| 454 | + 'classes with pyjnius. You can specify this ' |
| 455 | + 'argument more than once to include multiple jars')) |
452 | 456 | ap.add_argument('--meta-data', dest='meta_data', action='append',
|
453 |
| - help='Custom key=value to add in application metadata') |
| 457 | + help='Custom key=value to add in application metadata') |
454 | 458 |
|
455 | 459 | args = ap.parse_args()
|
456 | 460 |
|
|
0 commit comments