| 116 | } |
| 117 | |
| 118 | func (g *pyGen) genConstValue(c *Const) { |
| 119 | // constants go directly into wrapper as-is |
| 120 | val := c.val |
| 121 | switch val { |
| 122 | case "true": |
| 123 | val = "True" |
| 124 | case "false": |
| 125 | val = "False" |
| 126 | } |
| 127 | g.pywrap.Printf("%s = %s\n", c.GoName(), val) |
| 128 | if c.doc != "" { |
| 129 | lns := strings.Split(c.doc, "\n") |
| 130 | g.pywrap.Printf(`"""`) |
| 131 | g.pywrap.Printf("\n") |
| 132 | for _, l := range lns { |
| 133 | g.pywrap.Printf("%s\n", l) |
| 134 | } |
| 135 | g.pywrap.Printf(`"""`) |
| 136 | g.pywrap.Printf("\n") |
| 137 | } |
| 138 | } |
| 139 | |
| 140 | func (g *pyGen) genEnum(e *Enum) { |
| 141 | g.pywrap.Printf("class %s(Enum):\n", e.typ.Obj().Name()) |