(s *Struct)
| 10 | ) |
| 11 | |
| 12 | func (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 |
| 23 | class %[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 | |
| 38 | func (g *pyGen) genStructInit(s *Struct) { |
| 39 | pkgname := g.cfg.Name |
no test coverage detected