MCPcopy Create free account
hub / github.com/fogleman/primitive / run

Function run

scripts/html.py:4–23  ·  view source on GitHub ↗
(in_folder, out_folder)

Source from the content-addressed store, hash-verified

2import sys
3
4def run(in_folder, out_folder):
5 seen = set()
6 for name in os.listdir(out_folder):
7 if not name.endswith('.png'):
8 continue
9 seen.add(name.split('.')[0])
10 for name in os.listdir(in_folder):
11 if not name.endswith('.jpg'):
12 continue
13 name = name[:-4]
14 if name not in seen:
15 continue
16 for m in [1, 3, 5]:
17 print '<tr>'
18 path = '%s.jpg' % name
19 print '<td><img src="%s"></td>' % os.path.join(in_folder, path)
20 for n in [50, 100, 200]:
21 path = '%s.%d.128.4.%d.png' % (name, n, m)
22 print '<td><img src="%s"></td>' % os.path.join(out_folder, path)
23 print '</tr>'
24
25def main():
26 args = sys.argv[1:]

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected