Issue #13: add --country argument.

This commit is contained in:
Sergey Vartanov 2021-09-12 06:43:45 +03:00
parent 34d7ae0dbc
commit 8aadb79f62
3 changed files with 7 additions and 1 deletions

View file

@ -69,6 +69,7 @@ class MapConfiguration:
options.level,
options.seed,
options.show_tooltips,
options.country,
)
def is_wireframe(self) -> bool:

View file

@ -97,7 +97,6 @@ def match_location(restrictions: dict[str, str], country: str) -> bool:
if (
"include" in restrictions
and restrictions["include"] != "world"
and country != "world"
and country not in restrictions["include"]
):
return False

View file

@ -120,6 +120,12 @@ def add_map_arguments(parser: argparse.ArgumentParser) -> None:
action=argparse.BooleanOptionalAction,
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: