refactor: change bmap binding generator name, layout for future refactor
This commit is contained in:
10
Assets/CodeGen/BMapBinder/ExpFctsExtractor/.gitignore
vendored
Normal file
10
Assets/CodeGen/BMapBinder/ExpFctsExtractor/.gitignore
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
# Python-generated files
|
||||
__pycache__/
|
||||
*.py[oc]
|
||||
build/
|
||||
dist/
|
||||
wheels/
|
||||
*.egg-info
|
||||
|
||||
# Virtual environments
|
||||
.venv
|
||||
@@ -0,0 +1 @@
|
||||
3.11
|
||||
3
Assets/CodeGen/BMapBinder/ExpFctsExtractor/README.md
Normal file
3
Assets/CodeGen/BMapBinder/ExpFctsExtractor/README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# ExpFcts Extractor
|
||||
|
||||
See upper level [README.md](../README.md) for informations.
|
||||
24
Assets/CodeGen/BMapBinder/ExpFctsExtractor/main.py
Normal file
24
Assets/CodeGen/BMapBinder/ExpFctsExtractor/main.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import os, re
|
||||
|
||||
def main():
|
||||
self_path: str = os.path.dirname(__file__)
|
||||
src_file: str = os.path.join(self_path, '../../BMap/BMExports.hpp')
|
||||
dst_file: str = os.path.join(self_path, 'dest/BMExports.hpp')
|
||||
|
||||
with open(src_file, 'r', encoding='utf-8') as fsrc:
|
||||
# read full text
|
||||
fulltext: str = fsrc.read()
|
||||
# do findall and write into file
|
||||
with open(dst_file, 'w', encoding='utf-8') as fdst:
|
||||
# We should not only match BMAP_EXPORT,
|
||||
# because it may match the defination of BMAP_EXPORT.
|
||||
# So we add a bool at head because all BMap functions return bool.
|
||||
for item in re.findall('^BMAP_EXPORT[ \\t]+bool[ \\t]+[^;]+;', fulltext, re.MULTILINE):
|
||||
fdst.write(item)
|
||||
fdst.write('\n')
|
||||
|
||||
print('DONE')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
@@ -0,0 +1,7 @@
|
||||
[project]
|
||||
name = "exp-fcts-extractor"
|
||||
version = "0.1.0"
|
||||
description = "Add your description here"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.11"
|
||||
dependencies = []
|
||||
8
Assets/CodeGen/BMapBinder/ExpFctsExtractor/uv.lock
generated
Normal file
8
Assets/CodeGen/BMapBinder/ExpFctsExtractor/uv.lock
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
version = 1
|
||||
revision = 2
|
||||
requires-python = ">=3.11"
|
||||
|
||||
[[package]]
|
||||
name = "exp-fcts-extractor"
|
||||
version = "0.1.0"
|
||||
source = { virtual = "." }
|
||||
Reference in New Issue
Block a user