Skip to content

Commit 6ca777b

Browse files
committed
adding support CSV file type in screenshots
1 parent dc90e59 commit 6ca777b

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

create_requirement_images.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
import click
1616
from PIL import Image, ImageDraw, ImageFont
17+
from get_imports import SHOWN_FILETYPES
1718

1819
from get_imports import (
1920
get_libs_for_project,
@@ -36,8 +37,6 @@
3637
TEXT_COLOR = "#B0B0B0"
3738
HIDDEN_TEXT_COLOR = "#808080"
3839

39-
SHOWN_FILETYPES = ["py", "mpy", "bmp", "pcf", "bdf", "wav", "mp3", "mid", "json", "txt"]
40-
4140
f = open("latest_bundle_data.json", "r")
4241
bundle_data = json.load(f)
4342
f.close()
@@ -73,6 +72,7 @@ def asset_path(asset_name):
7372
"mid": file_music_icon,
7473
"pcf": file_font_icon,
7574
"bdf": file_font_icon,
75+
"csv": file_empty_icon,
7676
"json": file_icon,
7777
"license": file_empty_icon,
7878
}
@@ -203,6 +203,9 @@ def make_header(position, project_files):
203203
if isinstance(cur_file, str):
204204
if "." in cur_file[-5:]:
205205
cur_extension = cur_file.split(".")[-1]
206+
if cur_extension == "csv":
207+
print("Found CSV:")
208+
print(cur_file)
206209
if cur_extension in SHOWN_FILETYPES:
207210
project_files_to_draw.append(cur_file)
208211
# tuple for directory

get_imports.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,27 @@
1212
import findimports
1313
import requests
1414

15+
1516
BUNDLE_DATA = "latest_bundle_data.json"
1617
BUNDLE_TAG = "latest_bundle_tag.json"
1718

1819
LEARN_GUIDE_REPO = os.environ.get(
1920
"LEARN_GUIDE_REPO", "../Adafruit_Learning_System_Guides/"
2021
)
2122

22-
SHOWN_FILETYPES = ["py", "mpy", "bmp", "pcf", "bdf", "wav", "mp3", "mid", "json", "txt"]
23+
SHOWN_FILETYPES = [
24+
"py",
25+
"mpy",
26+
"bmp",
27+
"pcf",
28+
"bdf",
29+
"wav",
30+
"mp3",
31+
"mid",
32+
"json",
33+
"txt",
34+
"csv",
35+
]
2336
SHOWN_FILETYPES_EXAMPLE = [s for s in SHOWN_FILETYPES if s != "py"]
2437

2538

0 commit comments

Comments
 (0)