Skip to content

Commit

Permalink
Replace SVG CSS file with <style> block in SVG
Browse files Browse the repository at this point in the history
  • Loading branch information
meshy committed Jun 6, 2022
1 parent d38b959 commit 72f0946
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 15 deletions.
3 changes: 0 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ update:
/usr/local/bin/s3cmd put wheel.svg s3://wheelpackages/wheel.svg --cf-invalidate \
--add-header='Cache-Control: max-age=30' \
--add-header='Date: `date -u +"%a, %d %b %Y %H:%M:%S GMT"`'
/usr/local/bin/s3cmd put wheel.css s3://wheelpackages/wheel.css --cf-invalidate \
--add-header='Cache-Control: max-age=30' \
--add-header='Date: `date -u +"%a, %d %b %Y %H:%M:%S GMT"`'
8 changes: 7 additions & 1 deletion svg_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
import xml.etree.ElementTree as et

HEADERS = b'''<?xml version=\"1.0\" standalone=\"no\"?>
<?xml-stylesheet href="wheel.css" type="text/css"?>
<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"
\"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">
'''

STYLES = """
.success { stroke: #4CAE4C; stroke-width: 1; fill: #5CB85C; }
.default { stroke: #cccccc; stroke-width: 1; fill: #ffffff; }
"""

PATH_TEMPLATE = '''
M {start_outer_x},{start_outer_y}
A{outer_radius},{outer_radius} 0 0 1 {end_outer_x},{end_outer_y}
Expand Down Expand Up @@ -129,6 +133,8 @@ def generate_svg_wheel(packages, total):
version='1.1',
xmlns='http://www.w3.org/2000/svg',
)
style = et.SubElement(wheel, "style", attrib={"type": "text/css"})
style.text = STYLES

add_annular_sectors(wheel, packages, total)

Expand Down
11 changes: 0 additions & 11 deletions wheel.css

This file was deleted.

0 comments on commit 72f0946

Please sign in to comment.