|
1.1
|
(patrick 03-Aug-20) |
1 |
: import os
|
|
|
|
2 |
: import sys
|
|
|
|
3 |
:
|
|
|
|
4 |
: pkgRelDir = sys.argv[1]
|
|
|
|
5 |
: pkgFiles = sys.argv[2:]
|
|
|
|
6 |
:
|
|
|
|
7 |
: getFileName = lambda f: os.path.splitext(os.path.basename(f))[0]
|
|
|
|
8 |
: importNames = ', '.join('"{}"'.format(getFileName(f)) for f in pkgFiles)
|
|
|
|
9 |
:
|
|
|
|
10 |
: script = """__all__ = [{import_names}]
|
|
|
|
11 |
: for x in __all__:
|
|
|
|
12 |
: __import__('lldb.{pkg_name}.' + x)
|
|
|
|
13 |
: """.format(import_names=importNames, pkg_name=pkgRelDir.replace("/", "."))
|
|
|
|
14 |
:
|
|
|
|
15 |
: pkgIniFile = os.path.normpath(os.path.join(pkgRelDir, "__init__.py"))
|
|
|
|
16 |
: with open(pkgIniFile, "w") as f:
|
|
|
|
17 |
: f.write(script)
|