-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add option to check and warn or bail out on flowtext #53
Conversation
print("SVG input document uses {} flow text elements, which won't render on browsers!".format(cnt_flowText_el)) | ||
if options.error_on_flowtext: | ||
sys.exit(1) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now it does not really matter (as it seems we don't touch flowRoot
s, even if they are empty) but in general I guess "compatibility checks" should be done somewhere at the end of scourString()
as we most likely want to check Scours output for compatibility, not the input?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general, I agree.
In this case, why do all the hard work processing/cleansing the SVG, when we bail out anyway.
Why don't you include your tests in Also unittests should be minimal examples. Your SVG test files include a lot of unnecessary Inkscape cruft that has nothing to do with the actual test making it harder to find the cause of an issue if something breaks in future. |
No. The should be as close to real world as possible. And that (foten) means, the input file comes from Inkscape (saved as Inkscape SVG). Because designers just press save.
That's a good point. I will fix that, though it'll require some refactoring .. scour doesn't use exceptions at all! And the unit test don't spawn the scour executable, but call directly into the Python module, so we can't test for exit code 1. |
Well, I guess these are two different philosophies, both having advantages and disadvantages.
Yes, I see the need for a solution here, too, to check things like using file streams as input arguments. As you wrote we mainly test functionality in |
@Ede123 alright. unit tests added. I have only added minimal code .. no big refactoring. Too much work. Whitespace/PEP8 is also annoying and we should clean that up some time .. |
FWIW, the whitespace commit in above only fixes trailing spaces .. the file contains tabs (probably even a mixture of spaces and tabs). Many Python projects use this rule: indent == 4 spaces (no tabs). But PEP8 has more to say about whitespace .. |
This fixes #49 in a pragmatic way