Skip to content

Commit

Permalink
Generate gzip for frontend/mdi
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob committed May 21, 2016
1 parent de5533e commit e4b697b
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/mdi_version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
"""DO NOT MODIFY. Auto-generated by update_mdi script."""
VERSION = "1baebe8155deb447230866d7ae854bd9"
VERSION = "9ee3d4466a65bef35c2c8974e91b37c0"
Binary file not shown.
2 changes: 1 addition & 1 deletion homeassistant/components/frontend/www_static/mdi.html

Large diffs are not rendered by default.

Binary file not shown.
1 change: 1 addition & 0 deletions script/build_frontend
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ npm run frontend_prod
cp bower_components/webcomponentsjs/webcomponents-lite.min.js ..
cp build/frontend.html ..
cp build/service_worker.js ..
gzip build/frontend.html -c -k -9 > ../frontend.html.gz

# Generate the MD5 hash of the new frontend
cd ../..
Expand Down
6 changes: 6 additions & 0 deletions script/update_mdi.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3
"""Download the latest Polymer v1 iconset for materialdesignicons.com."""
import hashlib
import gzip
import os
import re
import requests
Expand All @@ -16,6 +17,7 @@
OUTPUT_BASE = os.path.join('homeassistant', 'components', 'frontend')
VERSION_OUTPUT = os.path.join(OUTPUT_BASE, 'mdi_version.py')
ICONSET_OUTPUT = os.path.join(OUTPUT_BASE, 'www_static', 'mdi.html')
ICONSET_OUTPUT_GZ = os.path.join(OUTPUT_BASE, 'www_static', 'mdi.html.gz')


def get_local_version():
Expand Down Expand Up @@ -58,6 +60,10 @@ def write_component(version, source):
print('Writing icons to', ICONSET_OUTPUT)
outp.write(source)

with gzip.open(ICONSET_OUTPUT_GZ, 'wb') as outp:
print('Writing icons gz to', ICONSET_OUTPUT_GZ)
outp.write(source.encode('utf-8'))

with open(VERSION_OUTPUT, 'w') as outp:
print('Generating version file', VERSION_OUTPUT)
outp.write(
Expand Down

0 comments on commit e4b697b

Please sign in to comment.