diff --git a/TC1/http_server/test.py b/TC1/http_server/test.py index ba89c78..0b7ccab 100644 --- a/TC1/http_server/test.py +++ b/TC1/http_server/test.py @@ -11,11 +11,7 @@ try: except: io = __import__("StringIO").StringIO -def gen(s, fn): - dat = io() - with gzip.GzipFile(fileobj=dat, mode="w") as f: - f.write(s) - dat = dat.getvalue() +def gen(dat, fn): try: s = ','.join(["0x%02x" % c for c in dat]) except: @@ -26,15 +22,25 @@ def gen(s, fn): fn = re.sub(r"[^\w]", "_", fn) print("const unsigned char %s[0x%x] = {\n%s};" % (fn, len(dat), s)) +def gz_gen(s, fn): + dat = io() + with gzip.GzipFile(fileobj=dat, mode="w") as f: + f.write(s) + dat = dat.getvalue() + gen(dat, fn) + def pack(path, name): s = b'' for fn in glob.glob(path): s += ("/*%s*/\n" % fn).encode('utf-8') s += open(fn, 'rb').read() - gen(s, name) + gz_gen(s, name) pack('web/*.js', 'js_pack') pack('web/*.css', 'css_pack') for fn in glob.glob('web/*.html'): - gen(open(fn, 'rb').read(), fn) + gz_gen(open(fn, 'rb').read(), fn) + +for fn in glob.glob('web/*.woff2'): + gen(open(fn, 'rb').read(), fn) \ No newline at end of file diff --git a/TC1/http_server/web/fontello-codes.css b/TC1/http_server/web/fontello-codes.css new file mode 100644 index 0000000..05050f0 --- /dev/null +++ b/TC1/http_server/web/fontello-codes.css @@ -0,0 +1,14 @@ + +.icon-add:before { content: '\e800'; } /* '' */ +.icon-arrow_drop_down:before { content: '\e801'; } /* '' */ +.icon-access_alarm:before { content: '\e802'; } /* '' */ +.icon-event:before { content: '\e803'; } /* '' */ +.icon-help:before { content: '\e804'; } /* '' */ +.icon-home:before { content: '\e805'; } /* '' */ +.icon-info:before { content: '\e806'; } /* '' */ +.icon-keyboard_arrow_down:before { content: '\e807'; } /* '' */ +.icon-cloud_download:before { content: '\e808'; } /* '' */ +.icon-more_vert:before { content: '\e809'; } /* '' */ +.icon-notes:before { content: '\e80a'; } /* '' */ +.icon-search:before { content: '\e80b'; } /* '' */ +.icon-settings:before { content: '\e80c'; } /* '' */ \ No newline at end of file diff --git a/TC1/http_server/web/icons.woff2 b/TC1/http_server/web/icons.woff2 new file mode 100644 index 0000000..0ea8e18 Binary files /dev/null and b/TC1/http_server/web/icons.woff2 differ