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

Method genStruct

bind/gen_struct.go:12–36  ·  view source on GitHub ↗
(s *Struct)

Source from the content-addressed store, hash-verified

10)
11
12func (g *pyGen) genStruct(s *Struct) {
13 strNm := s.obj.Name()
14
15 base := "go.GoClass"
16 emb := s.FirstEmbed()
17 if emb != nil {
18 base = emb.pyPkgId(s.sym.gopkg)
19 }
20
21 g.pywrap.Printf(`
22# Python type for struct %[3]s
23class %[1]s(%[4]s):
24 ""%[2]q""
25`,
26 strNm,
27 s.Doc(),
28 s.GoName(),
29 base,
30 )
31 g.pywrap.Indent()
32 g.genStructInit(s)
33 g.genStructMembers(s)
34 g.genStructMethods(s)
35 g.pywrap.Outdent()
36}
37
38func (g *pyGen) genStructInit(s *Struct) {
39 pkgname := g.cfg.Name

Callers 1

genAllMethod · 0.95

Calls 11

genStructInitMethod · 0.95
genStructMembersMethod · 0.95
genStructMethodsMethod · 0.95
FirstEmbedMethod · 0.80
pyPkgIdMethod · 0.80
PrintfMethod · 0.80
IndentMethod · 0.80
OutdentMethod · 0.80
DocMethod · 0.65
GoNameMethod · 0.65
NameMethod · 0.45

Tested by

no test coverage detected