lfgr 00266a009b Fixed typo | %!s(int64=3) %!d(string=hai) anos | |
---|---|---|
.. | ||
cyskeleton | %!s(int64=3) %!d(string=hai) anos | |
README.md | %!s(int64=3) %!d(string=hai) anos | |
config_default.json | %!s(int64=3) %!d(string=hai) anos | |
generate.bat | %!s(int64=3) %!d(string=hai) anos | |
generate.sh | %!s(int64=3) %!d(string=hai) anos | |
preprocess.bat | %!s(int64=3) %!d(string=hai) anos | |
preprocess.sh | %!s(int64=3) %!d(string=hai) anos | |
skeleton_bts.json | %!s(int64=3) %!d(string=hai) anos |
Generates a skeleton of the CvPythonExtensions
module from information obtained by the CySkeleton-extract mod.
First, extract python data from BtS or your mod (see ../extract/README.md
). Alternatively, you can use the file skeleton_bts.json
in this directory.
The skeleton produced by CySkeleton-extract is very simple, containing only basic types and docstrings for each function or member. However, the docstrings in BtS are fairly uniform and can thus be used to extract function signatures. This is what script cyskeleton.preprocess
does (among other things). Depending on your operating system, type one of the following in your terminal console window, after switching to this directory (generate
):
# Windows
.\preprocess.bat --config config_default.json -v3 skeleton_bts.json skeleton_bts_proc.json
# Linux
./preprocess.sh --config config_default.json -v3 skeleton_bts.json skeleton_bts_proc.json
--config config_default.json
is optional, but recommended. It tells the script to override certain signatures that are missing or wrong in the DLL, and also to override certain types. You can supply your own config file (perhaps an edited config_default.json
), if you want.
-v3
is similarly optional. The number (0-3) controls how much extra information (e.g., failures to parse certain signatures) is printed.
The last two arguments are the input and output files. If you have previously run CySkeleton-extract on your own mod, you should obviously replace the input file, and probably should also rename the output file.
To generate the CvPythonExtensions.py
file, simply run, e.g.,
# Windows
.\generate.bat skeleton_bts_proc.json out/bts/CvPythonExtensions.py
# Linux
./generate.sh skeleton_bts_proc.json out/bts/CvPythonExtensions.py
This produces a file CyPythonExtensions.py
in the out/bts
directory, which you can then add to your IDE (In PyCharm, for example, you can add out/bts
as a project root and then designate it as a source folder.