You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected Behavior: When using a Textarea widget all lines of a multi-line input is accessible from the parsed argparse.Namespace object.
Actual Behavior: When using a Textarea widget only the first line of a multi-line input is accessible from the parsed argparse.Namespace object.
Example Code:
The below code yields a gooey GUI with a Textarea input with "hello" as the first line and "there" as the second line of default input. Clicking Start however, results in a error as the second assert fails.
fromgooeyimportGooeyParser, Gooeydefget_parser() ->GooeyParser:
parser=GooeyParser()
parser.add_argument(
"--text-area",
default="hello\nthere",
dest="text_area",
widget="Textarea",
)
returnparser@Gooeydefmain():
args=get_parser().parse_args()
assertargs.text_area=="hello"# this passes (actual | not expected)assertargs.text_area=="hello\nthere"# this fails (expected)if__name__=="__main__":
main()
Other:
Only multi-line text (delimited by newline \n characters) suffers this issue. Text that is long enough to be wrapped to the next line (but is not actually delimited by a newline \n) is still accessible from the parsed argparse.Namespace object.
The text was updated successfully, but these errors were encountered:
I had the same issue with the same system specs. I looked into it, and turns out it's caused by the way Windows' cmd parses the command fed by Gooey, which doesn't handle very well newline characters (or any escape characters, for that regard).
An easy fix to this is passing requires_shell=False to Gooey's decorator. This will treat newline characters as they should.
OS: Windows 10
Python Version: Python 3.6.3
Gooey Version: 1.0.3
Expected Behavior: When using a
Textarea
widget all lines of a multi-line input is accessible from the parsedargparse.Namespace
object.Actual Behavior: When using a
Textarea
widget only the first line of a multi-line input is accessible from the parsedargparse.Namespace
object.Example Code:
The below code yields a gooey GUI with a
Textarea
input with"hello"
as the first line and"there"
as the second line of default input. Clicking Start however, results in a error as the second assert fails.Other:
Only multi-line text (delimited by newline
\n
characters) suffers this issue. Text that is long enough to be wrapped to the next line (but is not actually delimited by a newline\n
) is still accessible from the parsedargparse.Namespace
object.The text was updated successfully, but these errors were encountered: