Skip to content

Commit

Permalink
{pyactr} Remove hard-coded redaction of GUI warning
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaloney committed Jan 23, 2024
1 parent 6a07eeb commit 13e92a4
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions framework/pyactr/pyactr.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ package pyactr
import (
_ "embed"
"fmt"
"regexp"
"strings"

"golang.org/x/exp/maps"
Expand Down Expand Up @@ -147,7 +146,6 @@ func (p *PyACTR) Run(initialBuffers framework.InitialBuffers) (result *framework

// run it!
output, err := executil.ExecCommand(Info.ExecutableName, runFile)
output = removeWarning(output)
if err != nil {
err = &executil.ErrExecuteCommand{Output: output}
return
Expand Down Expand Up @@ -725,14 +723,3 @@ func (p PyACTR) outputStatement(production *actr.Production, s *actr.Statement)
p.Writeln(" ~goal>")
}
}

// removeWarning will remove the long warning whenever pyactr is run without tkinter.
func removeWarning(text string) string {
r := regexp.MustCompile(`(?s).+warnings.warn\("Simulation GUI is set to False."\)(.+)`)
matches := r.FindAllStringSubmatch(text, -1)
if len(matches) == 1 {
text = strings.TrimSpace(matches[0][1])
}

return text
}

0 comments on commit 13e92a4

Please sign in to comment.