Skip to content

Commit 5690688

Browse files
authored
Merge pull request #1 from jepler/jepler-patch-1
Various improvements, including getting the bundle json automatically
2 parents 05cd77d + 0a51e2d commit 5690688

File tree

558 files changed

+110
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

558 files changed

+110
-10
lines changed

.gitignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1+
__pycache__
12
.idea/*
23

3-
python_generator/out.png
4-

python_generator/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
latest_bundle_data.json
2+
latest_bundle_tag.json
3+
generated_images

python_generator/create_requirement_images.py

100644100755
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
1+
#!/usr/bin/env python3
2+
3+
from multiprocessing import Pool
4+
import json
5+
import os
16
import traceback
27

38
from PIL import Image, ImageDraw, ImageFont
4-
import json
59

610
from get_imports import get_libs_for_project, get_files_for_project, get_learn_guide_cp_projects
711

12+
os.makedirs("generated_images", exist_ok=True)
13+
814
OUT_WIDTH = 800
915
PADDING = 20
1016

@@ -49,6 +55,8 @@
4955
"json": file_icon
5056
}
5157

58+
for img in FILE_TYPE_ICON_MAP.values():
59+
img.load()
5260

5361
def generate_requirement_image(learn_guide_project):
5462
def make_line(requirement_name, position=(0, 0), icon=None, hidden=False, triangle_icon=None):
@@ -224,8 +232,7 @@ def make_libraries(libraries, position):
224232
traceback.print_exc()
225233
print("SyntaxError finding imports for {}".format(learn_guide_project))
226234

227-
#print(get_learn_guide_cp_projects())
228-
229-
for cp_project in get_learn_guide_cp_projects():
230-
print("making screenshot for: {}".format(cp_project))
231-
generate_requirement_image(cp_project)
235+
if __name__ == '__main__':
236+
with Pool() as p:
237+
for _ in p.imap(generate_requirement_image, get_learn_guide_cp_projects()):
238+
pass
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)