mirror of
https://github.com/enzet/map-machine.git
synced 2025-08-06 10:09:52 +02:00
Issue #24: change icon directory.
Individual icons are now generated in `icon_set/ids` and `icon_set/names` directories.
This commit is contained in:
parent
762d9637c3
commit
f80672b7c1
1 changed files with 9 additions and 4 deletions
|
@ -100,15 +100,20 @@ class IconCollection:
|
||||||
|
|
||||||
return cls(icons)
|
return cls(icons)
|
||||||
|
|
||||||
def draw_icons(self, output_directory: Path):
|
def draw_icons(self, output_directory: Path, by_name: bool = False):
|
||||||
"""
|
"""
|
||||||
:param output_directory: path to the directory to store individual SVG
|
:param output_directory: path to the directory to store individual SVG
|
||||||
files for icons
|
files for icons
|
||||||
"""
|
"""
|
||||||
|
if by_name:
|
||||||
|
def get_file_name(x):
|
||||||
|
return f"Röntgen {' + '.join(x.get_names())}.svg"
|
||||||
|
else:
|
||||||
|
def get_file_name(x):
|
||||||
|
return f"{'___'.join(x.get_shape_ids())}.svg"
|
||||||
|
|
||||||
for icon in self.icons:
|
for icon in self.icons:
|
||||||
icon.draw_to_file(
|
icon.draw_to_file(output_directory / get_file_name(icon))
|
||||||
output_directory / f"{'___'.join(icon.get_shape_ids())}.svg"
|
|
||||||
)
|
|
||||||
|
|
||||||
def draw_grid(
|
def draw_grid(
|
||||||
self,
|
self,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue