mirror of
https://github.com/lumapu/ahoy.git
synced 2025-04-28 17:56:21 +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 os
|
||||
import gzip
|
||||
import glob
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
|
@ -62,10 +63,19 @@ def convert2Header(inFile, compress):
|
|||
f.write("#endif /*__{}_{}_H__*/\n".format(define, define2))
|
||||
f.close()
|
||||
|
||||
convert2Header("index.html", True)
|
||||
convert2Header("setup.html", True)
|
||||
convert2Header("visualization.html", True)
|
||||
convert2Header("update.html", True)
|
||||
convert2Header("serial.html", True)
|
||||
convert2Header("style.css", True)
|
||||
convert2Header("api.js", True)
|
||||
# delete all files in the 'h' dir, but ignore 'favicon_ico_gz.h'
|
||||
dir = './html/h'
|
||||
for f in os.listdir(dir):
|
||||
if not f.startswith('favicon_ico_gz'):
|
||||
os.remove(os.path.join(dir, f))
|
||||
|
||||
# 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