schriftgestalt / GlyphsSDK

Scripting SDK for Glyphs
Apache License 2.0
89 stars 37 forks source link

remote scripting cosmetical fix #93

Closed RafalBuchner closed 1 week ago

RafalBuchner commented 2 weeks ago

This will help in making output more readable

schriftgestalt commented 2 weeks ago

How does it change the output? For me, the output of the script looks as expected?

RafalBuchner commented 1 week ago

hey, sorry for delayed response If you change code in your testExternal.py on this line, to use multiple print statements one after another, for example code = "print(Layer)\nprint('a')\nprint('b')" and you run it, you will recieve output with multiplied breaklines. Like this:

image

The Reason is that GSStdOut.setWrite_ method recieves strings that always ends with \n escape sequence. Further, method is using python's print, which by default appends same escape sequence to the end of printed string. This way we end up with very long terminal output.

RafalBuchner commented 1 week ago

this pull request also includes this https://github.com/schriftgestalt/GlyphsSDK/pull/93/commits/c1ae2321adbdeb86f3ced71fd6d1f61b1f2865ab fix that will help throw proper errors while using runScript