Skip to content

Commit d2435d6

Browse files
committed
Restructured dist_info.json creation
1 parent a80fc6f commit d2435d6

File tree

3 files changed

+15
-34
lines changed

3 files changed

+15
-34
lines changed

pythonforandroid/bootstrap.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,15 +107,7 @@ def prepare_dist_dir(self, name):
107107

108108
def run_distribute(self):
109109
# TODO: Move this to Distribution.save_info
110-
with current_directory(self.dist_dir):
111-
info('Saving distribution info')
112-
with open('dist_info.json', 'w') as fileh:
113-
json.dump({'dist_name': self.ctx.dist_name,
114-
'bootstrap': self.ctx.bootstrap.name,
115-
'archs': [arch.arch for arch in self.ctx.archs],
116-
'ndk_api': self.ctx.ndk_api,
117-
'recipes': self.ctx.recipe_build_order + self.ctx.python_modules},
118-
fileh)
110+
self.distribution.save_info(self.dist_dir)
119111

120112
@classmethod
121113
def list_bootstraps(cls):

pythonforandroid/bootstraps/sdl2/__init__.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,13 @@ def run_distribute(self):
6363

6464
site_packages_dir = self.ctx.python_recipe.create_python_bundle(
6565
join(self.dist_dir, python_bundle_dir), arch)
66-
# TODO: Also set site_packages_dir again so fry_eggs can work
6766

6867
if 'sqlite3' not in self.ctx.recipe_build_order:
6968
with open('blacklist.txt', 'a') as fileh:
7069
fileh.write('\nsqlite3/*\nlib-dynload/_sqlite3.so\n')
7170

7271
self.strip_libraries(arch)
73-
self.fry_eggs(site_packages_dir) # TODO uncomment this and make it work with python3
72+
self.fry_eggs(site_packages_dir)
7473
super(SDL2GradleBootstrap, self).run_distribute()
7574

7675

pythonforandroid/distribution.py

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -182,29 +182,19 @@ def get_distributions(cls, ctx, extra_dist_dirs=[]):
182182
dists.append(dist)
183183
return dists
184184

185-
# def save_info(self):
186-
# '''
187-
# Save information about the distribution in its dist_dir.
188-
# '''
189-
# with current_directory(self.dist_dir):
190-
# info('Saving distribution info')
191-
# with open('dist_info.json', 'w') as fileh:
192-
# json.dump({'dist_name': self.name,
193-
# 'archs': [arch.arch for arch in self.ctx.archs],
194-
# 'ndk_api': self.ctx.ndk_api,
195-
# 'recipes': self.ctx.recipe_build_order},
196-
# fileh)
197-
198-
# def load_info(self):
199-
# '''Load information about the dist from the info file that p4a
200-
# automatically creates.'''
201-
# with current_directory(self.dist_dir):
202-
# filen = 'dist_info.json'
203-
# if not exists(filen):
204-
# return None
205-
# with open('dist_info.json', 'r') as fileh:
206-
# dist_info = json.load(fileh)
207-
# return dist_info
185+
def save_info(self, dirn):
186+
'''
187+
Save information about the distribution in its dist_dir.
188+
'''
189+
with current_directory(dirn):
190+
info('Saving distribution info')
191+
with open('dist_info.json', 'w') as fileh:
192+
json.dump({'dist_name': self.ctx.dist_name,
193+
'bootstrap': self.ctx.bootstrap.name,
194+
'archs': [arch.arch for arch in self.ctx.archs],
195+
'ndk_api': self.ctx.ndk_api,
196+
'recipes': self.ctx.recipe_build_order + self.ctx.python_modules},
197+
fileh)
208198

209199

210200
def pretty_log_dists(dists, log_func=info):

0 commit comments

Comments
 (0)