add given path to python imports -- these packages were referenced
(ipath string, extra bool)
| 86 | |
| 87 | // add given path to python imports -- these packages were referenced |
| 88 | func (p *Package) AddPyImport(ipath string, extra bool) { |
| 89 | mypath := p.pkg.Path() |
| 90 | if mypath == "go" { |
| 91 | return |
| 92 | } |
| 93 | if ipath == mypath { |
| 94 | return |
| 95 | } |
| 96 | if p.pyimports == nil { |
| 97 | p.pyimports = make(map[string]string) |
| 98 | } |
| 99 | if _, has := p.pyimports[ipath]; has { |
| 100 | return |
| 101 | } |
| 102 | nm := filepath.Base(ipath) |
| 103 | p.pyimports[ipath] = nm |
| 104 | // if extra { |
| 105 | // fmt.Printf("%v added py import: %v = %v\n", mypath, ipath, nm) |
| 106 | // } |
| 107 | } |
| 108 | |
| 109 | // getDoc returns the doc string associated with types.Object |
| 110 | // parent is the name of the containing scope ("" for global scope) |
no outgoing calls
no test coverage detected