mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-30 18:56:27 +02:00
added feature in the py :)
This commit is contained in:
parent
f2a794d518
commit
07d950e970
1 changed files with 17 additions and 7 deletions
|
@ -1,6 +1,7 @@
|
||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import gzip
|
import gzip
|
||||||
|
import glob
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -62,10 +63,19 @@ def convert2Header(inFile, compress):
|
||||||
f.write("#endif /*__{}_{}_H__*/\n".format(define, define2))
|
f.write("#endif /*__{}_{}_H__*/\n".format(define, define2))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
convert2Header("index.html", True)
|
# delete all files in the 'h' dir, but ignore 'favicon_ico_gz.h'
|
||||||
convert2Header("setup.html", True)
|
dir = './html/h'
|
||||||
convert2Header("visualization.html", True)
|
for f in os.listdir(dir):
|
||||||
convert2Header("update.html", True)
|
if not f.startswith('favicon_ico_gz'):
|
||||||
convert2Header("serial.html", True)
|
os.remove(os.path.join(dir, f))
|
||||||
convert2Header("style.css", True)
|
|
||||||
convert2Header("api.js", True)
|
# grab all files with following extensions
|
||||||
|
os.chdir('./html')
|
||||||
|
types = ('*.html', '*.css', '*.js') # the tuple of file types
|
||||||
|
files_grabbed = []
|
||||||
|
for files in types:
|
||||||
|
files_grabbed.extend(glob.glob(files))
|
||||||
|
|
||||||
|
# go throw the array
|
||||||
|
for val in files_grabbed:
|
||||||
|
convert2Header(val, True)
|
Loading…
Add table
Reference in a new issue