MCPcopy Create free account
hub / github.com/comaps/comaps / parse_options

Function parse_options

tools/python/maps_generator/__main__.py:23–109  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21logger = logging.getLogger("maps_generator")
22
23def parse_options():
24 parser = ArgumentParser(
25 description="A tool to generate map files in Organic Maps' .mwm format.",
26 epilog="See maps_generator/README.md for setup instructions and usage examples.",
27 formatter_class=RawDescriptionHelpFormatter,
28 parents=[settings.parser],
29 )
30 parser.add_argument(
31 "-c",
32 "--continue",
33 default="",
34 nargs="?",
35 type=str,
36 help="Continue the last build or the one specified in CONTINUE from the "
37 "last stopped stage.",
38 )
39 parser.add_argument(
40 "-s",
41 "--suffix",
42 default="",
43 type=str,
44 help="Suffix of the name of a build directory.",
45 )
46 parser.add_argument(
47 "--countries",
48 type=str,
49 default="",
50 help="List of countries/regions, separated by a comma or a semicolon, or a path to "
51 "a file with a newline-separated list of regions, for which maps "
52 "should be built. Filenames in data/borders/ (without the .poly extension) "
53 "represent all valid region names. "
54 "A * wildcard is accepted, e.g. --countries=\"UK*\" will match "
55 "UK_England_East Midlands, UK_England_East of England_Essex, etc.",
56 )
57 parser.add_argument(
58 "--without_countries",
59 type=str,
60 default="",
61 help="List of countries/regions to exclude from generation. "
62 "Has a priority over --countries and uses the same syntax.",
63 )
64 parser.add_argument(
65 "--skip",
66 type=str,
67 default="",
68 help=f"List of stages, separated by a comma or a semicolon, "
69 f"for which building will be skipped. Available skip stages: "
70 f"{', '.join([s.replace('stage_', '') for s in stages.stages.get_visible_stages_names()])}.",
71 )
72 parser.add_argument(
73 "--from_stage",
74 type=str,
75 default="",
76 help=f"Stage from which maps will be rebuild. Available stages: "
77 f"{', '.join([s.replace('stage_', '') for s in stages.stages.get_visible_stages_names()])}.",
78 )
79 parser.add_argument(
80 "--coasts",

Callers 1

mainFunction · 0.85

Calls 3

joinMethod · 0.45
parse_argsMethod · 0.45

Tested by

no test coverage detected