|
2 | 2 |
|
3 | 3 |
|
4 | 4 | def check_all(*callables):
|
5 |
| - def check(**kwargs): |
6 |
| - return all(c(**kwargs) for c in callables) |
7 |
| - return check |
| 5 | + def check(**kwargs): |
| 6 | + return all(c(**kwargs) for c in callables) |
| 7 | + return check |
8 | 8 |
|
9 | 9 |
|
10 | 10 | def check_any(*callables):
|
11 |
| - def check(**kwargs): |
12 |
| - return any(c(**kwargs) for c in callables) |
13 |
| - return check |
| 11 | + def check(**kwargs): |
| 12 | + return any(c(**kwargs) for c in callables) |
| 13 | + return check |
14 | 14 |
|
15 | 15 |
|
16 | 16 | def is_platform(platform):
|
17 |
| - def is_x(**kwargs): |
18 |
| - return uname()[0] == platform |
19 |
| - return is_x |
| 17 | + def is_x(**kwargs): |
| 18 | + return uname()[0] == platform |
| 19 | + return is_x |
20 | 20 |
|
21 | 21 | is_linux = is_platform('Linux')
|
22 | 22 | is_darwin = is_platform('Darwin')
|
23 | 23 |
|
24 | 24 |
|
25 | 25 | def is_arch(xarch):
|
26 |
| - def is_x(arch, **kwargs): |
27 |
| - return arch.arch == xarch |
28 |
| - return is_x |
| 26 | + def is_x(arch, **kwargs): |
| 27 | + return arch.arch == xarch |
| 28 | + return is_x |
29 | 29 |
|
30 | 30 |
|
31 | 31 | def is_api_gt(apiver):
|
32 |
| - def is_x(recipe, **kwargs): |
33 |
| - return recipe.ctx.android_api > apiver |
34 |
| - return is_x |
| 32 | + def is_x(recipe, **kwargs): |
| 33 | + return recipe.ctx.android_api > apiver |
| 34 | + return is_x |
35 | 35 |
|
36 | 36 |
|
37 | 37 | def is_api_gte(apiver):
|
38 |
| - def is_x(recipe, **kwargs): |
39 |
| - return recipe.ctx.android_api >= apiver |
40 |
| - return is_x |
| 38 | + def is_x(recipe, **kwargs): |
| 39 | + return recipe.ctx.android_api >= apiver |
| 40 | + return is_x |
41 | 41 |
|
42 | 42 |
|
43 | 43 | def is_api_lt(apiver):
|
44 |
| - def is_x(recipe, **kwargs): |
45 |
| - return recipe.ctx.android_api < apiver |
46 |
| - return is_x |
| 44 | + def is_x(recipe, **kwargs): |
| 45 | + return recipe.ctx.android_api < apiver |
| 46 | + return is_x |
47 | 47 |
|
48 | 48 |
|
49 | 49 | def is_api_lte(apiver):
|
50 |
| - def is_x(recipe, **kwargs): |
51 |
| - return recipe.ctx.android_api <= apiver |
52 |
| - return is_x |
| 50 | + def is_x(recipe, **kwargs): |
| 51 | + return recipe.ctx.android_api <= apiver |
| 52 | + return is_x |
53 | 53 |
|
54 | 54 |
|
55 | 55 | def is_api(apiver):
|
56 |
| - def is_x(recipe, **kwargs): |
57 |
| - return recipe.ctx.android_api == apiver |
58 |
| - return is_x |
| 56 | + def is_x(recipe, **kwargs): |
| 57 | + return recipe.ctx.android_api == apiver |
| 58 | + return is_x |
59 | 59 |
|
60 | 60 |
|
61 | 61 | def will_build(recipe_name):
|
62 |
| - def will(recipe, **kwargs): |
63 |
| - return recipe_name in recipe.ctx.recipe_build_order |
64 |
| - return will |
| 62 | + def will(recipe, **kwargs): |
| 63 | + return recipe_name in recipe.ctx.recipe_build_order |
| 64 | + return will |
65 | 65 |
|
0 commit comments