Permalink
Browse files

Update generate.py

  • Loading branch information...
eriklax committed Apr 28, 2017
1 parent c724027 commit 79c4b084f045ea3f64bb311a877564c5e3038cd9
Showing with 2 additions and 2 deletions.
  1. +2 −2 generate.py
@@ -7,7 +7,7 @@
def fix_path(n):
return re.sub(r'[^a-z0-9]', r'', n)[0:16]

def get_config_file(filepath):
def get_config_line(filepath):
name = map(fix_path, filepath.replace('.hsl', '').split(os.path.sep))
code = base64.b64encode(open(filepath, 'r').read())
return 'file__examples' + '.'.join(name) + '="|text/x-hsl|' + code + '"'
@@ -21,4 +21,4 @@ def find_hsl_files(directory):
return f

for f in find_hsl_files('.'):
print(get_config_file(f))
print(get_config_line(f))

0 comments on commit 79c4b08

Please sign in to comment.