30 lines
759 B
Python
30 lines
759 B
Python
from gen_c import hydrolink_gen_c
|
|
from gen_python import hydrolink_gen_python
|
|
import hydroparse
|
|
|
|
import pathlib
|
|
import os
|
|
|
|
|
|
def generate_c():
|
|
this_file_dir = os.path.dirname(os.path.realpath(__file__))
|
|
xml_path = os.path.join(this_file_dir, "hydrolink_def.xml")
|
|
m = hydroparse.HydroXml(xml_path)
|
|
|
|
path = pathlib.Path(this_file_dir)
|
|
path = path / "generated" / "c" / "include" / "hydrolink"
|
|
path.mkdir(parents=True, exist_ok=True)
|
|
hydrolink_gen_c.generate([m], str(path))
|
|
|
|
path = pathlib.Path(this_file_dir)
|
|
path = path / "generated" / "python" / "hydrolink"
|
|
path.mkdir(parents=True, exist_ok=True)
|
|
hydrolink_gen_python.generate([m], str(path))
|
|
|
|
|
|
def main():
|
|
generate_c()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|