11 base, ext = splitext(basename(filename))
13 with open(filename,
"br")
as src:
16 cdata = post(
'https://cssminifier.com/raw',
17 data=dict(input=cdata)).text.encode(
'utf-8')
19 cdata = post(
'https://javascript-minifier.com/raw',
20 data=dict(input=cdata)).text.encode(
'utf-8')
22 cdata = post(
'https://html-minifier.com/raw',
23 data=dict(input=cdata)).text.encode(
'utf-8')
26 with open(
"cc/%s_%s.c" % (base, ext[1:]),
"w+")
as csource:
27 print(
"convert %s -> %s" % (src.name, csource.name))
28 csource.write(
"#include <inttypes.h>\n\n")
29 csource.write(
"const uint8_t %s_%s[] =\n" % (base, ext[1:]))
36 csource.write(
",\n\t")
39 csource.write(
"0x%02x" % b)