MCPcopy Index your code
hub / github.com/go-python/gopy / GenPyBind

Function GenPyBind

bind/gen.go:445–463  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

443// python-side classes
444// mode = gen, build, pkg, exe
445func 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
465type pyGen struct {
466 gofile *printer

Callers 1

genPkgFunction · 0.92

Calls 2

genPackageMapMethod · 0.95
genMethod · 0.95

Tested by

no test coverage detected