MCPcopy Index your code
hub / github.com/kivy/python-for-android / __init__

Method __init__

pythonforandroid/toolchain.py:198–721  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

196class ToolchainCL:
197
198 def __init__(self):
199
200 argv = sys.argv
201 self.warn_on_carriage_return_args(argv)
202 # Buildozer used to pass these arguments in a now-invalid order
203 # If that happens, apply this fix
204 # This fix will be removed once a fixed buildozer is released
205 if (len(argv) > 2
206 and argv[1].startswith('--color')
207 and argv[2].startswith('--storage-dir')):
208 argv.append(argv.pop(1)) # the --color arg
209 argv.append(argv.pop(1)) # the --storage-dir arg
210
211 parser = NoAbbrevParser(
212 description='A packaging tool for turning Python scripts and apps '
213 'into Android APKs')
214
215 generic_parser = argparse.ArgumentParser(
216 add_help=False,
217 description='Generic arguments applied to all commands')
218 argparse.ArgumentParser(
219 add_help=False, description='Arguments for dist building')
220
221 generic_parser.add_argument(
222 '--debug', dest='debug', action='store_true', default=False,
223 help='Display debug output and all build info')
224 generic_parser.add_argument(
225 '--color', dest='color', choices=['always', 'never', 'auto'],
226 help='Enable or disable color output (default enabled on tty)')
227 generic_parser.add_argument(
228 '--sdk-dir', '--sdk_dir', dest='sdk_dir', default='',
229 help='The filepath where the Android SDK is installed')
230 generic_parser.add_argument(
231 '--ndk-dir', '--ndk_dir', dest='ndk_dir', default='',
232 help='The filepath where the Android NDK is installed')
233 generic_parser.add_argument(
234 '--android-api',
235 '--android_api',
236 dest='android_api',
237 default=0,
238 type=int,
239 help=('The Android API level to build against defaults to {} if '
240 'not specified.').format(RECOMMENDED_TARGET_API))
241 generic_parser.add_argument(
242 '--ndk-version', '--ndk_version', dest='ndk_version', default=None,
243 help=('DEPRECATED: the NDK version is now found automatically or '
244 'not at all.'))
245 generic_parser.add_argument(
246 '--ndk-api', type=int, default=None,
247 help=('The Android API level to compile against. This should be your '
248 '*minimal supported* API, not normally the same as your --android-api. '
249 'Defaults to min(ANDROID_API, {}) if not specified.').format(RECOMMENDED_NDK_API))
250 generic_parser.add_argument(
251 '--symlink-bootstrap-files', '--ssymlink_bootstrap_files',
252 action='store_true',
253 dest='symlink_bootstrap_files',
254 default=False,
255 help=('If True, symlinks the bootstrap files '

Callers

nothing calls this directly

Calls 13

_read_configurationMethod · 0.95
setup_colorFunction · 0.90
ContextClass · 0.90
project_has_setup_pyFunction · 0.90
get_dep_names_of_packageFunction · 0.90
NoAbbrevParserClass · 0.85
add_boolean_optionFunction · 0.85
split_argument_listFunction · 0.85
formatMethod · 0.80
list_recipesMethod · 0.80

Tested by

no test coverage detected