Skip to content

Commit

Permalink
Fixed problems that prevented generation of the stencil collection on…
Browse files Browse the repository at this point in the history
… Windows.

Less `str` more `as_posix()`.
Closes #2
  • Loading branch information
nathanielw committed Jun 5, 2015
1 parent 47d2800 commit 3138f60
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions generate-xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 3138f60

Please sign in to comment.