Add Logging Statements and Avoid Crash#6
Add Logging Statements and Avoid Crash#6ben-e-whitney wants to merge 2 commits intonarimiran:masterfrom ben-e-whitney:dev
Conversation
|
Thank you for your contribution! I've started by looking at your second commit. You are right saying that currently the script has an ugly crash when there is an empty table (either empty file or too large skip).
I think I found another, simpler, way. I'm gonna push it soon, take a look when it is here.
Logging idea seems interesting, I'll think about it. See if you would maybe like to add logging also in places where there is currently printing to console (and maybe in other places too), and make another pull request. |
The first commit adds a pair of logging statements to
format_alignment. I thought it was worth alerting the user if an invalid column type was passed in.The second commit avoids a crash if the script is passed an empty file (or if
skipis large enough to skip all of the rows in a file). Compare the output ofbefore and after the commit. One possible solution (the route I took) is to initialize
num_columnsto zero and then modifyformat_alignmentto avoid an empty return value (which would cause a TeX error) whenlengthis zero. If you'd like to handle it in another way you can skip this commit.