circuitpython/CircuitPython_Library_Screenshot_Maker

blank line in a library list

jepler opened this issue · 2 comments

Strange. It seems like several of the "circuitplayground_circuitplayground_[something]_.py" images contain the same extra empty line.

My first inclination was that maybe it's related to the extra files present for this example (the wav and mp3 files). Perhaps it could be miscalculating how many lines it used for those and thus leaving more room than needed.

But poking around a few more I'm thinking maybe that is not the culprit. I found a few CLUE example scripts that have the same issue, and don't include any extra files in the root of the drive. i.e. https://adafruit.github.io/Adafruit_CircuitPython_Bundle/clue_clue_simpletest.py.png

It may require a bit of tinkering, adding some debugging prints and running the script manually on the examples that are affected by this to figure out the root cause.

Took a quick look into the CLUE and CircuitPlayground library examples. Both of them contain an advanced_examples directory. I'm thinking possibly these extra line is a result of the screenshot script mishandling the existence of that directory inside of examples. Likely one part of the logic is causing it to ignore the directory (not draw it's name and icon). But another part of the logic is not properly accounting for it being ignored when it's calculating the Y position that the libraries should start getting drawn.

With this theory in mind I also checked some of the examples for the bitmap_font library and they also contain the extra line: https://adafruit.github.io/Adafruit_CircuitPython_Bundle/bitmap-font_bitmap_font_label_forkawesome.py.png that one has a fonts directory inside of examples which actually raises a separate issue. The fonts in that directory are required for the examples to run so that directory and perhaps it's contents should get shown in the screenshot but they aren't currently.