sist2/scripts/serve_static.py
2019-10-25 20:25:01 -04:00

18 lines
416 B
Python

files = [
"web/css/bundle.css",
"web/js/bundle.js",
"web/img/bg-bars.png",
"web/img/sprite-skin-flat.png",
"web/search.html",
]
def clean(filepath):
return filepath.split("/")[-1].replace(".", "_").replace("-", "_")
for file in files:
with open(file, "rb") as f:
data = f.read()
print("char %s[%d] = {%s};" % (clean(file), len(data), ",".join(str(int(b)) for b in data)))