diff options
Diffstat (limited to 'runner/python')
| -rw-r--r-- | runner/python/file.go (renamed from runner/python/filetarget.go) | 12 | ||||
| -rw-r--r-- | runner/python/indexer.go | 4 | ||||
| -rw-r--r-- | runner/python/proj.go (renamed from runner/python/projtarget.go) | 20 | ||||
| -rw-r--r-- | runner/python/runner.go | 4 |
4 files changed, 20 insertions, 20 deletions
diff --git a/runner/python/filetarget.go b/runner/python/file.go index 6793f4b..f8b6c2e 100644 --- a/runner/python/filetarget.go +++ b/runner/python/file.go @@ -7,20 +7,20 @@ import ( "pik/runner" ) -type FileTarget struct { +type File struct { runner.BaseTarget File string } type HydratedFileTarget struct { - runner.BaseHydration[*FileTarget] + runner.BaseHydration[*File] } func (h *HydratedFileTarget) Icon() string { return "\uE606" } -func (p *FileTarget) Create(s *model.Source) *exec.Cmd { +func (p *File) Create(s *model.Source) *exec.Cmd { var cmd []string if Python.Uv != "" { cmd = []string{Python.Uv, "run", "--", p.File} @@ -36,15 +36,15 @@ func (p *FileTarget) Create(s *model.Source) *exec.Cmd { return exec.Command(cmd[0], cmd[1:]...) } -func (p *FileTarget) Sub() []string { +func (p *File) Sub() []string { return nil } -func (p *FileTarget) Label() string { +func (p *File) Label() string { return p.Full } -func (p *FileTarget) Hydrate(src *model.Source) (model.HydratedTarget, error) { +func (p *File) Hydrate(src *model.Source) (model.HydratedTarget, error) { return &HydratedFileTarget{ BaseHydration: runner.Hydrated(p), }, nil diff --git a/runner/python/indexer.go b/runner/python/indexer.go index d0dd4e3..3a61f7e 100644 --- a/runner/python/indexer.go +++ b/runner/python/indexer.go @@ -8,7 +8,7 @@ import ( "pik/model" ) -type Pyproj struct { +type pyproj struct { Project struct { Scripts map[string]string } @@ -29,7 +29,7 @@ func (p python) Index(path string, f fs.FS, runners []model.Runner) ([]model.Tar return nil, err } - pp := &Pyproj{} + pp := &pyproj{} err = toml.Unmarshal(content, pp) if err != nil { diff --git a/runner/python/projtarget.go b/runner/python/proj.go index c7422b4..9a711bd 100644 --- a/runner/python/projtarget.go +++ b/runner/python/proj.go @@ -7,24 +7,24 @@ import ( "pik/runner" ) -type ProjTarget struct { +type Project struct { runner.BaseTarget Cmd string } -type HydratedProjTarget struct { - runner.BaseHydration[*ProjTarget] +type Hydrated struct { + runner.BaseHydration[*Project] } -func (h *HydratedProjTarget) Icon() string { +func (h *Hydrated) Icon() string { return "\uE606" } -func (h *HydratedProjTarget) Description() string { +func (h *Hydrated) Description() string { return h.BaseTarget.Cmd } -func (p *ProjTarget) Create(s *model.Source) *exec.Cmd { +func (p *Project) Create(s *model.Source) *exec.Cmd { var cmd []string if Python.Uv != "" { cmd = []string{Python.Uv, "run", "--", p.Cmd} @@ -34,16 +34,16 @@ func (p *ProjTarget) Create(s *model.Source) *exec.Cmd { return exec.Command(cmd[0], cmd[1:]...) } -func (p *ProjTarget) Sub() []string { +func (p *Project) Sub() []string { return nil } -func (p *ProjTarget) Label() string { +func (p *Project) Label() string { return p.Cmd } -func (p *ProjTarget) Hydrate(src *model.Source) (model.HydratedTarget, error) { - return &HydratedProjTarget{ +func (p *Project) Hydrate(src *model.Source) (model.HydratedTarget, error) { + return &Hydrated{ BaseHydration: runner.Hydrated(p), }, nil } diff --git a/runner/python/runner.go b/runner/python/runner.go index b06d8ab..2293336 100644 --- a/runner/python/runner.go +++ b/runner/python/runner.go @@ -57,7 +57,7 @@ func (p python) PyFor(src *model.Source) []string { } func (p python) CreateProjTarget(name string, cmd string) model.Target { - return &ProjTarget{ + return &Project{ BaseTarget: runner.BaseTarget{ Identity: identity.New(name), }, @@ -67,7 +67,7 @@ func (p python) CreateProjTarget(name string, cmd string) model.Target { func (p python) CreateTarget(fs fs.FS, source string, file string, entry fs.DirEntry) (model.Target, error) { _, filename := filepath.Split(file) - return &FileTarget{ + return &File{ BaseTarget: runner.BaseTarget{ Identity: identity.New(filename), MyTags: model.TagsFromFilename(filename), |
