File tree 4 files changed +14
-0
lines changed
supervisor/shared/web_workflow 4 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
.. module :: hashlib
7
7
:synopsis: hashing algorithms
8
+ :noindex:
8
9
9
10
|see_cpython_module | :mod: `cpython:hashlib `.
10
11
Original file line number Diff line number Diff line change @@ -26,3 +26,7 @@ pyelftools
26
26
27
27
# for stubs and annotations
28
28
adafruit-circuitpython-typing
29
+
30
+ # for web workflow minify
31
+ minify_html
32
+ jsmin
Original file line number Diff line number Diff line change 26
26
27
27
#include "supervisor/shared/web_workflow/websocket.h"
28
28
29
+ // TODO: Remove ESP specific stuff. For now, it is useful as we refine the server.
30
+ #include "esp_log.h"
31
+
29
32
typedef struct {
30
33
socketpool_socket_obj_t socket ;
31
34
uint8_t opcode ;
Original file line number Diff line number Diff line change 4
4
5
5
import argparse
6
6
import gzip
7
+ import minify_html
8
+ import jsmin
7
9
import mimetypes
8
10
import pathlib
9
11
24
26
variable = path .name .replace ("." , "_" )
25
27
uncompressed = f .read ()
26
28
ulen = len (uncompressed )
29
+ if f .name .endswith (".html" ):
30
+ uncompressed = minify_html .minify (uncompressed .decode ("utf-8" )).encode ("utf-8" )
31
+ elif f .name .endswith (".js" ):
32
+ uncompressed = jsmin .jsmin (uncompressed .decode ("utf-8" )).encode ("utf-8" )
27
33
compressed = gzip .compress (uncompressed )
28
34
clen = len (compressed )
29
35
compressed = ", " .join ([hex (x ) for x in compressed ])
You can’t perform that action at this time.
0 commit comments