mirror of
https://github.com/enzet/map-machine.git
synced 2025-05-01 11:17:48 +02:00
Issue #13: add --country argument.
This commit is contained in:
parent
34d7ae0dbc
commit
8aadb79f62
3 changed files with 7 additions and 1 deletions
|
@ -69,6 +69,7 @@ class MapConfiguration:
|
||||||
options.level,
|
options.level,
|
||||||
options.seed,
|
options.seed,
|
||||||
options.show_tooltips,
|
options.show_tooltips,
|
||||||
|
options.country,
|
||||||
)
|
)
|
||||||
|
|
||||||
def is_wireframe(self) -> bool:
|
def is_wireframe(self) -> bool:
|
||||||
|
|
|
@ -97,7 +97,6 @@ def match_location(restrictions: dict[str, str], country: str) -> bool:
|
||||||
if (
|
if (
|
||||||
"include" in restrictions
|
"include" in restrictions
|
||||||
and restrictions["include"] != "world"
|
and restrictions["include"] != "world"
|
||||||
and country != "world"
|
|
||||||
and country not in restrictions["include"]
|
and country not in restrictions["include"]
|
||||||
):
|
):
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -120,6 +120,12 @@ def add_map_arguments(parser: argparse.ArgumentParser) -> None:
|
||||||
action=argparse.BooleanOptionalAction,
|
action=argparse.BooleanOptionalAction,
|
||||||
default=False,
|
default=False,
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--country",
|
||||||
|
help="two-letter code (ISO 3166-1 alpha-2) of country, that should be "
|
||||||
|
"used for location restrictions",
|
||||||
|
default="world",
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def add_tile_arguments(parser: argparse.ArgumentParser) -> None:
|
def add_tile_arguments(parser: argparse.ArgumentParser) -> None:
|
||||||
|
|
Loading…
Add table
Reference in a new issue