GenPyBind generates a .go file, build.py file to enable pybindgen to create python bindings, and wrapper .py file(s) that are loaded as the interface to the package with shadow python-side classes mode = gen, build, pkg, exe
(mode BuildMode, libext, extragccargs string, lang int, dynamicLink bool, cfg *BindCfg)
| 443 | // python-side classes |
| 444 | // mode = gen, build, pkg, exe |
| 445 | func GenPyBind(mode BuildMode, libext, extragccargs string, lang int, dynamicLink bool, cfg *BindCfg) error { |
| 446 | gen := &pyGen{ |
| 447 | mode: mode, |
| 448 | pypkgname: cfg.Name, |
| 449 | cfg: cfg, |
| 450 | libext: libext, |
| 451 | extraGccArgs: extragccargs, |
| 452 | lang: lang, |
| 453 | dynamicLink: dynamicLink, |
| 454 | } |
| 455 | gen.genPackageMap() |
| 456 | thePyGen = gen |
| 457 | err := gen.gen() |
| 458 | thePyGen = nil |
| 459 | if err != nil { |
| 460 | return err |
| 461 | } |
| 462 | return err |
| 463 | } |
| 464 | |
| 465 | type pyGen struct { |
| 466 | gofile *printer |
no test coverage detected