forked from organicmaps/organicmaps-tmp
[python][generator] Added check_maps.py
This commit is contained in:
parent
ee59e38832
commit
fff7e43da9
1 changed files with 53 additions and 0 deletions
53
tools/python/maps_generator/check_maps.py
Normal file
53
tools/python/maps_generator/check_maps.py
Normal file
|
@ -0,0 +1,53 @@
|
|||
import argparse
|
||||
import sys
|
||||
|
||||
from maps_generator.checks.default_check_set import CheckType
|
||||
from maps_generator.checks.default_check_set import get_mwm_check_sets_and_filters
|
||||
from maps_generator.checks.default_check_set import run_checks_and_print_results
|
||||
|
||||
|
||||
def get_args():
|
||||
parser = argparse.ArgumentParser(
|
||||
description="This script checks maps generation and prints results."
|
||||
)
|
||||
parser.add_argument(
|
||||
"--old", type=str, required=True, help="Path to old mwm directory.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--new", type=str, required=True, help="Path to new mwm directory.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--categories", type=str, required=True, help="Path to categories file.",
|
||||
)
|
||||
|
||||
parser.add_argument(
|
||||
"--level",
|
||||
type=str,
|
||||
required=False,
|
||||
choices=("low", "medium", "hard", "strict"),
|
||||
default="hard",
|
||||
help="Messages level.",
|
||||
)
|
||||
parser.add_argument(
|
||||
"--output",
|
||||
type=str,
|
||||
required=False,
|
||||
default="",
|
||||
help="Path to output file. stdout by default.",
|
||||
)
|
||||
return parser.parse_args()
|
||||
|
||||
|
||||
def main():
|
||||
args = get_args()
|
||||
|
||||
s = get_mwm_check_sets_and_filters(args.old, args.new, args.categories)
|
||||
run_checks_and_print_results(
|
||||
s,
|
||||
CheckType[args.level],
|
||||
file=open(args.output, "w") if args.output else sys.stdout,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
Loading…
Add table
Reference in a new issue