From 3138f60bc69e68a5a36fa767383e5d1b7af774fb Mon Sep 17 00:00:00 2001 From: Nathaniel Watson Date: Fri, 5 Jun 2015 23:41:43 +1200 Subject: [PATCH] Fixed problems that prevented generation of the stencil collection on Windows. Less `str` more `as_posix()`. Closes #2 --- generate-xml.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/generate-xml.py b/generate-xml.py index f417893..cb6ae33 100644 --- a/generate-xml.py +++ b/generate-xml.py @@ -22,14 +22,14 @@ for f in sprite_files: element = etree.SubElement(files_element, 'file') - element.text = str(f) + element.text = f.as_posix() element.set('id', f.stem) - match = name_re.search(str(f)) + match = name_re.search(f.as_posix()) element.set('name', (match.group(1) + ' - ' + match.group(2).replace('_', ' ')).title()) icon_name = f.stem + '.png' - element.set('icon', str(os.path.join(str(icons_out.relative_to(out)), icon_name))) + element.set('icon', icons_out.relative_to(out).joinpath(icon_name).as_posix()) # Pencil uses Unix-style paths for icons with open(os.path.join(str(icons_out), icon_name),'wb+') as icon_out: thumb = cairosvg.svg2png(file_obj=str(f), write_to=icon_out)