Skip to content

Commit

Permalink
{pyactr} Remove hard-coded redaction of GUI warning (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
asmaloney authored Feb 26, 2024
1 parent 546f32c commit d9fafc8
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 @@ -728,14 +726,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 d9fafc8

Please sign in to comment.