mirror of
https://github.com/Montecri/GNSSTimeServer.git
synced 2026-03-20 23:37:00 +01:00
ESP32 port
ESP32 port and new functionalities.
This commit is contained in:
committed by
GitHub
parent
badfc9dcf4
commit
e4a34345bb
25
src/indextprocessor.py
Normal file
25
src/indextprocessor.py
Normal file
@@ -0,0 +1,25 @@
|
||||
import gzip
|
||||
import os
|
||||
|
||||
if __name__ == '__main__':
|
||||
with open('src/index.html', 'rb') as orig_file:
|
||||
with gzip.open("src/index.h.gz", 'wb') as zipped_file:
|
||||
zipped_file.writelines(orig_file)
|
||||
|
||||
file_size = os.path.getsize('src/index.h.gz')
|
||||
|
||||
with open('src/index.h.gz', 'rb') as file_t:
|
||||
block = file_t.read()
|
||||
st = ""
|
||||
for ch in block:
|
||||
st += '0x%02X' % ch + ", "
|
||||
st = st[:-2]
|
||||
|
||||
with open('src/index_bytearray.h', 'wt') as text_file:
|
||||
text_file.write('#define index_gz_len ' + str(file_size) + '\nconst uint8_t index_gz[] PROGMEM = {\n')
|
||||
|
||||
with open('src/index_bytearray.h', 'at') as text_file:
|
||||
text_file.write(st)
|
||||
|
||||
with open('src/index_bytearray.h', 'at') as text_file:
|
||||
text_file.write('\n};\n')
|
||||
Reference in New Issue
Block a user