9
9
from __future__ import print_function
10
10
11
11
import sys
12
- from sys import stdout , stderr , platform
13
- from os .path import (join , dirname , realpath , exists , isdir , basename ,
14
- expanduser , splitext , split )
15
- from os import listdir , unlink , makedirs , environ , chdir , getcwd , uname
12
+ from sys import platform
13
+ from os .path import (join , dirname , realpath , exists , basename ,
14
+ expanduser , split )
15
+ from os import environ
16
16
import os
17
- import tarfile
18
- import io
19
- import json
20
17
import glob
21
18
import shutil
22
19
import re
26
23
from copy import deepcopy
27
24
from functools import wraps
28
25
from datetime import datetime
29
- from math import log10
30
26
31
27
import argparse
32
28
from appdirs import user_data_dir
39
35
CompiledComponentsPythonRecipe )
40
36
from pythonforandroid .logger import (logger , info , debug , warning , error ,
41
37
Out_Style , Out_Fore , Err_Style , Err_Fore ,
42
- info_notify , info_main , shprint )
43
- from pythonforandroid .util import (ensure_dir , current_directory , temp_directory ,
38
+ info_notify , info_main , shprint ,
39
+ Null_Fore , Null_Style )
40
+ from pythonforandroid .util import (ensure_dir , current_directory ,
44
41
which )
45
42
from pythonforandroid .bootstrap import Bootstrap
46
43
from pythonforandroid .distribution import Distribution , pretty_log_dists
68
65
Err_Style .RESET_ALL ]))
69
66
70
67
71
-
72
- # shprint(sh.ls, '-lah')
73
- # exit(1)
74
-
75
-
76
68
def add_boolean_option (parser , names , no_names = None ,
77
69
default = True , dest = None , description = None ):
78
70
group = parser .add_argument_group (description = description )
@@ -162,8 +154,6 @@ def _cache_execution(self, *args, **kwargs):
162
154
return _cache_execution
163
155
164
156
165
-
166
-
167
157
class Graph (object ):
168
158
# Taken from the old python-for-android/depsort
169
159
# Modified to include alternative dependencies
@@ -180,16 +170,16 @@ def remove_redundant_graphs(self):
180
170
181
171
# n.b. no need to test graph 0 as it will have been tested against
182
172
# all others by the time we get to it
183
- for i in range (len (graphs ) - 1 , 0 , - 1 ):
173
+ for i in range (len (graphs ) - 1 , 0 , - 1 ):
184
174
graph = graphs [i ]
185
175
186
- #test graph i against all graphs 0 to i-1
176
+ # test graph i against all graphs 0 to i-1
187
177
for j in range (0 , i ):
188
178
comparison_graph = graphs [j ]
189
-
179
+
190
180
if set (comparison_graph .keys ()) == set (graph .keys ()):
191
- #graph[i] == graph[j]
192
- #so remove graph[i] and continue on to testing graph[i-1]
181
+ # graph[i] == graph[j]
182
+ # so remove graph[i] and continue on to testing graph[i-1]
193
183
graphs .pop (i )
194
184
break
195
185
@@ -280,7 +270,8 @@ class Context(object):
280
270
root_dir = None # the filepath of toolchain.py
281
271
storage_dir = None # the root dir where builds and dists will be stored
282
272
283
- build_dir = None # in which bootstraps are copied for building and recipes are built
273
+ build_dir = None # in which bootstraps are copied for building
274
+ # and recipes are built
284
275
dist_dir = None # the Android project folder where everything ends up
285
276
libs_dir = None # where Android libs are cached after build but
286
277
# before being placed in dists
@@ -646,7 +637,8 @@ def prepare_build_environment(self, user_sdk_dir, user_ndk_dir,
646
637
executable ))
647
638
648
639
if not ok :
649
- error ('{}python-for-android cannot continue; aborting{}' .format (Err_Fore .RED , Err_Fore .RESET ))
640
+ error ('{}python-for-android cannot continue; aborting{}' .format (
641
+ Err_Fore .RED , Err_Fore .RESET ))
650
642
sys .exit (1 )
651
643
652
644
def __init__ (self ):
@@ -766,7 +758,7 @@ def build_recipes(build_order, python_modules, ctx):
766
758
.format (recipe .name ))
767
759
768
760
# 4) biglink everything
769
- # AND: Should make this optional
761
+ # AND: Should make this optional
770
762
info_main ('# Biglinking object files' )
771
763
biglink (ctx , arch )
772
764
@@ -1126,7 +1118,6 @@ def __init__(self):
1126
1118
help = ('The version of the Android NDK. This is optional, '
1127
1119
'we try to work it out automatically from the ndk_dir.' ))
1128
1120
1129
-
1130
1121
# AND: This option doesn't really fit in the other categories, the
1131
1122
# arg structure needs a rethink
1132
1123
parser .add_argument (
@@ -1171,7 +1162,6 @@ def __init__(self):
1171
1162
description = ('Whether the dist recipes must perfectly match '
1172
1163
'those requested' ))
1173
1164
1174
-
1175
1165
self ._read_configuration ()
1176
1166
1177
1167
args , unknown = parser .parse_known_args (sys .argv [1 :])
@@ -1283,7 +1273,6 @@ def clean_all(self, args):
1283
1273
parser = argparse .ArgumentParser (
1284
1274
description = "Clean the build cache, downloads and dists" )
1285
1275
parsed_args = parser .parse_args (args )
1286
- ctx = Context ()
1287
1276
self .clean_dists (args )
1288
1277
self .clean_builds (args )
1289
1278
self .clean_download_cache (args )
0 commit comments