Created
November 20, 2015 14:39
-
-
Save izifortune/211cb1339b919e5dde7a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import glob | |
import os | |
data = {} | |
cnt = 1 | |
files = glob.glob("*.svg") | |
for f in files: | |
d = open(f, 'r') | |
content = d.readlines() | |
svg = [] | |
for el in content: | |
svg.append('//' + el) | |
tmp = "//" + f + "\n//\n" + "//Markup:" + "\n" + "//<core-icon icon-id=\"icons.glyphs." + \ | |
f.replace('.svg', '') + "\">\n//<!-- IGNORE -->\n//<div>\n" + \ | |
''.join(svg) + "//</div>\n//<!-- ENDIGNORE -->\n//</core-icon>" + "\n//\n//Style guide 5.1." + str(cnt) + "\n" | |
data[f] = tmp | |
cnt += 1 | |
with open("testing.less", "a") as f: | |
for i in data: | |
f.write(data[i] + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment