| Index: tools/protoc_wrapper/protoc_wrapper.py
|
| diff --git a/tools/protoc_wrapper/protoc_wrapper.py b/tools/protoc_wrapper/protoc_wrapper.py
|
| index 6a25de0ed5a367cfffea3fae8dc436dc355d1f49..50aee8b98061019ec361a7d2731ae05b2437efe0 100755
|
| --- a/tools/protoc_wrapper/protoc_wrapper.py
|
| +++ b/tools/protoc_wrapper/protoc_wrapper.py
|
| @@ -67,6 +67,17 @@ def WriteIncludes(headers, include):
|
| print(line, file=f)
|
|
|
|
|
| +def WritePythonInit(base_dir, protos):
|
| + def write_init_py(path):
|
| + if not path:
|
| + return
|
| + open(os.path.join(base_dir, path, '__init__.py'), 'a').close()
|
| + write_init_py(os.path.dirname(path))
|
| +
|
| + for proto in protos:
|
| + write_init_py(os.path.dirname(proto))
|
| +
|
| +
|
| def main(argv):
|
| parser = argparse.ArgumentParser()
|
| parser.add_argument("--protoc",
|
| @@ -136,6 +147,9 @@ def main(argv):
|
| if options.include:
|
| WriteIncludes(headers, options.include)
|
|
|
| + if options.py_out_dir:
|
| + WritePythonInit(options.py_out_dir, protos)
|
| +
|
|
|
| if __name__ == "__main__":
|
| try:
|
|
|