@@ -98,10 +98,11 @@ def wrapper_func(self, args):
98
98
user_android_api = self .android_api ,
99
99
user_ndk_ver = self .ndk_version )
100
100
dist = self ._dist
101
+ dist_args , args = parse_dist_args (args )
101
102
if dist .needs_build :
102
103
info_notify ('No dist exists that meets your requirements, '
103
104
'so one will be built.' )
104
- args = build_dist_from_args (ctx , dist , args )
105
+ build_dist_from_args (ctx , dist , dist_args )
105
106
func (self , args )
106
107
return wrapper_func
107
108
@@ -120,20 +121,9 @@ def dist_from_args(ctx, dist_args):
120
121
require_perfect_match = dist_args .require_perfect_match )
121
122
122
123
123
- def build_dist_from_args (ctx , dist , args_list ):
124
+ def build_dist_from_args (ctx , dist , args ):
124
125
'''Parses out any bootstrap related arguments, and uses them to build
125
126
a dist.'''
126
- parser = argparse .ArgumentParser (
127
- description = 'Create a newAndroid project' )
128
- parser .add_argument (
129
- '--bootstrap' ,
130
- help = ('The name of the bootstrap type, \' pygame\' '
131
- 'or \' sdl2\' , or leave empty to let a '
132
- 'bootstrap be chosen automatically from your '
133
- 'requirements.' ),
134
- default = None )
135
- args , unknown = parser .parse_known_args (args_list )
136
-
137
127
bs = Bootstrap .get_bootstrap (args .bootstrap , ctx )
138
128
build_order , python_modules , bs \
139
129
= get_recipe_order_and_bootstrap (ctx , dist .recipes , bs )
@@ -156,8 +146,19 @@ def build_dist_from_args(ctx, dist, args_list):
156
146
info ('Dist can be found at (for now) {}'
157
147
.format (join (ctx .dist_dir , ctx .dist_name )))
158
148
159
- return unknown
160
149
150
+ def parse_dist_args (args_list ):
151
+ parser = argparse .ArgumentParser (
152
+ description = 'Create a newAndroid project' )
153
+ parser .add_argument (
154
+ '--bootstrap' ,
155
+ help = ('The name of the bootstrap type, \' pygame\' '
156
+ 'or \' sdl2\' , or leave empty to let a '
157
+ 'bootstrap be chosen automatically from your '
158
+ 'requirements.' ),
159
+ default = None )
160
+ args , unknown = parser .parse_known_args (args_list )
161
+ return args , unknown
161
162
162
163
163
164
def split_argument_list (l ):
0 commit comments