Fix enum values.

This commit is contained in:
Sergey Vartanov 2021-10-20 23:49:34 +03:00
parent 15ab5e7d62
commit a5910786e2
13 changed files with 31 additions and 35 deletions

3
.gitignore vendored
View file

@ -24,3 +24,6 @@ precommit.py
.idea
temp
venv
compare.html
taginfo

View file

@ -6,6 +6,7 @@
<w>betula</w>
<w>carto</w>
<w>changeset</w>
<w>cladr</w>
<w>dasharray</w>
<w>defs</w>
<w>dharmachakra</w>

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.7 MiB

After

Width:  |  Height:  |  Size: 7.7 MiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 315 KiB

After

Width:  |  Height:  |  Size: 319 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 347 KiB

After

Width:  |  Height:  |  Size: 348 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 199 KiB

After

Width:  |  Height:  |  Size: 199 KiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 1.6 MiB

After

Width:  |  Height:  |  Size: 1.6 MiB

Before After
Before After

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 206 KiB

After

Width:  |  Height:  |  Size: 207 KiB

Before After
Before After

View file

@ -241,7 +241,7 @@ class Constructor:
if not line.tags:
return
building_mode: str = self.configuration.building_mode
building_mode: BuildingMode = self.configuration.building_mode
if "building" in line.tags or (
building_mode == BuildingMode.ISOMETRIC
and "building:part" in line.tags

View file

@ -10,45 +10,37 @@ __email__ = "me@enzet.ru"
class DrawingMode(Enum):
"""
Map drawing mode.
"""
"""Map drawing mode."""
NORMAL: str = "normal"
AUTHOR: str = "author"
TIME: str = "time"
NORMAL = "normal"
AUTHOR = "author"
TIME = "time"
class LabelMode(Enum):
"""
Label drawing mode.
"""
"""Label drawing mode."""
NO: str = "no"
MAIN: str = "main"
ALL: str = "all"
NO = "no"
MAIN = "main"
ALL = "all"
class BuildingMode(Enum):
"""
Building drawing mode.
"""
"""Building drawing mode."""
NO: str = "no"
FLAT: str = "flat"
ISOMETRIC: str = "isometric"
ISOMETRIC_NO_PARTS: str = "isometric-no-parts"
NO = "no"
FLAT = "flat"
ISOMETRIC = "isometric"
ISOMETRIC_NO_PARTS = "isometric-no-parts"
@dataclass
class MapConfiguration:
"""
Map drawing configuration.
"""
"""Map drawing configuration."""
drawing_mode: str = DrawingMode.NORMAL
building_mode: str = BuildingMode.FLAT
label_mode: str = LabelMode.MAIN
drawing_mode: DrawingMode = DrawingMode.NORMAL
building_mode: BuildingMode = BuildingMode.FLAT
label_mode: LabelMode = LabelMode.MAIN
zoom_level: float = 18.0
overlap: int = 12
level: str = "overground"

View file

@ -163,7 +163,7 @@ class Point(Tagged):
self,
svg: svgwrite.Drawing,
occupied: Optional[Occupied] = None,
label_mode: str = LabelMode.MAIN,
label_mode: LabelMode = LabelMode.MAIN,
) -> None:
"""Draw all labels."""
labels: list[Label]

View file

@ -635,7 +635,7 @@ class Scheme:
texts.append(Label(f"{tags['height']} m"))
processed.add("height")
for tag in tags:
if self.is_writable(tag) and tag not in processed:
if self.is_writable(tag, tags[tag]) and tag not in processed:
texts.append(Label(tags[tag]))
return texts