| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
import os |
| 21 |
|
| 22 |
|
| 23 |
def get_subdirs(ctx): |
| 24 |
""" |
| 25 |
Get the compatibility module subirectories. |
| 26 |
|
| 27 |
The compat modules are found dynamically so that this script does |
| 28 |
not have to be modified if more modules are added. |
| 29 |
|
| 30 |
:param ctx: the waf context |
| 31 |
:type ctx: waflib.Context.Context |
| 32 |
:returns: list of str -- the subdirectories |
| 33 |
""" |
| 34 |
subdirs = [] |
| 35 |
for entry in ctx.path.listdir(): |
| 36 |
path = os.path.join(ctx.path.abspath(), entry) |
| 37 |
if os.path.isdir(path) and not entry.startswith('.'): |
| 38 |
subdirs.append(entry) |
| 39 |
return subdirs |
| 40 |
|
| 41 |
|
| 42 |
def recurse_into_subdirs(ctx): |
| 43 |
""" |
| 44 |
Recurse into compatibility module subdirectories. |
| 45 |
|
| 46 |
:param ctx: the waf context |
| 47 |
:type ctx: waflib.Context.Context |
| 48 |
""" |
| 49 |
for x in get_subdirs(ctx): |
| 50 |
ctx.recurse(x) |
| 51 |
|
| 52 |
|
| 53 |
def options(opt): |
| 54 |
recurse_into_subdirs(opt) |
| 55 |
|
| 56 |
|
| 57 |
def configure(conf): |
| 58 |
recurse_into_subdirs(conf) |
| 59 |
|
| 60 |
|
| 61 |
def build(bld): |
| 62 |
recurse_into_subdirs(bld) |