diff --git a/tools/python/booking/__main__.py b/tools/python/booking/__main__.py index 8537fb90dc..f79ab49e81 100644 --- a/tools/python/booking/__main__.py +++ b/tools/python/booking/__main__.py @@ -6,9 +6,9 @@ import sys from tqdm import tqdm -from .api.booking_api import LIMIT_REQUESTS_PER_MINUTE -from .download_hotels import download -from .download_test_data import download_test_data +from booking.api.booking_api import LIMIT_REQUESTS_PER_MINUTE +from booking.download_hotels import download +from booking.download_test_data import download_test_data def process_options(): diff --git a/tools/python/booking/download_hotels.py b/tools/python/booking/download_hotels.py index 245858bc0a..1148d987b7 100755 --- a/tools/python/booking/download_hotels.py +++ b/tools/python/booking/download_hotels.py @@ -1,7 +1,8 @@ import logging import statistics from collections import defaultdict -from concurrent.futures import ThreadPoolExecutor, as_completed +from concurrent.futures import ThreadPoolExecutor +from concurrent.futures import as_completed from functools import partial from multiprocessing.pool import ThreadPool @@ -9,8 +10,9 @@ import math from eviltransform import gcj2wgs_exact from tqdm import tqdm -from .api.booking_api import BookingApi, BookingListApi -from .api.exceptions import GettingMinPriceError +from booking.api.booking_api import BookingApi +from booking.api.booking_api import BookingListApi +from booking.api.exceptions import GettingMinPriceError SUPPORTED_LANGUAGES = ("en", "ru", "ar", "cs", "da", "nl", "fi", "fr", "de", "hu", "id", "it", "ja", "ko", "pl", "pt", "ro", "es", diff --git a/tools/python/booking/download_test_data.py b/tools/python/booking/download_test_data.py index f8de356306..d8fc7a022c 100755 --- a/tools/python/booking/download_test_data.py +++ b/tools/python/booking/download_test_data.py @@ -1,12 +1,10 @@ import logging -import statistics from functools import partial from multiprocessing.pool import ThreadPool -import math from tqdm import tqdm -from .api.booking_api import BookingApi, BookingListApi +from booking.api.booking_api import BookingApi, BookingListApi SUPPORTED_LANGUAGES = ("en", "ru") diff --git a/tools/python/descriptions/__main__.py b/tools/python/descriptions/__main__.py index c34d14eb07..17e8973659 100644 --- a/tools/python/descriptions/__main__.py +++ b/tools/python/descriptions/__main__.py @@ -5,9 +5,10 @@ import os import wikipediaapi -from .descriptions_downloader import (log, check_and_get_checker, - download_from_wikipedia_tags, - download_from_wikidata_tags) +from descriptions.descriptions_downloader import check_and_get_checker +from descriptions.descriptions_downloader import download_from_wikidata_tags +from descriptions.descriptions_downloader import download_from_wikipedia_tags +from descriptions.descriptions_downloader import log def parse_args(): diff --git a/tools/python/descriptions/descriptions_downloader.py b/tools/python/descriptions/descriptions_downloader.py index 91c9214fa6..8284227690 100644 --- a/tools/python/descriptions/descriptions_downloader.py +++ b/tools/python/descriptions/descriptions_downloader.py @@ -15,7 +15,8 @@ import wikipediaapi from bs4 import BeautifulSoup from wikidata.client import Client -from .exceptions import GettingError, ParseError +from descriptions.exceptions import GettingError +from descriptions.exceptions import ParseError """ This script downloads Wikipedia pages for different languages. diff --git a/tools/python/maps_generator/__init__.py b/tools/python/maps_generator/__init__.py index 103e180770..36264c942c 100644 --- a/tools/python/maps_generator/__init__.py +++ b/tools/python/maps_generator/__init__.py @@ -1,6 +1,6 @@ import os -from .generator import settings +from maps_generator.generator import settings CONFIG_PATH = os.path.join( os.path.dirname(os.path.join(os.path.realpath(__file__))), diff --git a/tools/python/maps_generator/__main__.py b/tools/python/maps_generator/__main__.py index 1432ea82ab..10d6be4f43 100644 --- a/tools/python/maps_generator/__main__.py +++ b/tools/python/maps_generator/__main__.py @@ -3,20 +3,20 @@ import os from argparse import ArgumentParser from argparse import RawDescriptionHelpFormatter -from .generator import settings -from .generator import stages -from .generator import stages_declaration as sd -from .generator.env import Env -from .generator.env import PathProvider -from .generator.env import WORLDS_NAMES -from .generator.env import find_last_build_dir -from .generator.env import get_all_countries_list -from .generator.exceptions import ContinueError -from .generator.exceptions import SkipError -from .generator.exceptions import ValidationError -from .maps_generator import generate_coasts -from .maps_generator import generate_maps -from .utils.algo import unique +from maps_generator.generator import settings +from maps_generator.generator import stages +from maps_generator.generator import stages_declaration as sd +from maps_generator.generator.env import Env +from maps_generator.generator.env import PathProvider +from maps_generator.generator.env import WORLDS_NAMES +from maps_generator.generator.env import find_last_build_dir +from maps_generator.generator.env import get_all_countries_list +from maps_generator.generator.exceptions import ContinueError +from maps_generator.generator.exceptions import SkipError +from maps_generator.generator.exceptions import ValidationError +from maps_generator.maps_generator import generate_coasts +from maps_generator.maps_generator import generate_maps +from maps_generator.utils.algo import unique logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/diff_stats.py b/tools/python/maps_generator/diff_stats.py index 53f174777a..31490d9809 100644 --- a/tools/python/maps_generator/diff_stats.py +++ b/tools/python/maps_generator/diff_stats.py @@ -1,7 +1,7 @@ import argparse -from .generator.statistics import diff -from .generator.statistics import read_types +from maps_generator.generator.statistics import diff +from maps_generator.generator.statistics import read_types def get_args(): diff --git a/tools/python/maps_generator/generator/coastline.py b/tools/python/maps_generator/generator/coastline.py index f24ae39b41..5dc327ef65 100644 --- a/tools/python/maps_generator/generator/coastline.py +++ b/tools/python/maps_generator/generator/coastline.py @@ -4,10 +4,10 @@ This file contains api for osmfilter and generator_tool to generate coastline. import os import subprocess -from . import settings -from .env import Env -from .gen_tool import run_gen_tool -from .osmtools import osmfilter +from maps_generator.generator import settings +from maps_generator.generator.env import Env +from maps_generator.generator.gen_tool import run_gen_tool +from maps_generator.generator.osmtools import osmfilter def filter_coastline( diff --git a/tools/python/maps_generator/generator/env.py b/tools/python/maps_generator/generator/env.py index 0c520dc8dc..568f404036 100644 --- a/tools/python/maps_generator/generator/env.py +++ b/tools/python/maps_generator/generator/env.py @@ -16,13 +16,13 @@ from typing import Set from typing import Type from typing import Union -from . import settings -from .osmtools import build_osmtools -from .stages import Stage -from .status import Status -from ..utils.file import find_executable -from ..utils.file import is_executable -from ..utils.file import symlink_force +from maps_generator.generator import settings +from maps_generator.generator.osmtools import build_osmtools +from maps_generator.generator.stages import Stage +from maps_generator.generator.status import Status +from maps_generator.utils.file import find_executable +from maps_generator.utils.file import is_executable +from maps_generator.utils.file import symlink_force logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/generator/gen_tool.py b/tools/python/maps_generator/generator/gen_tool.py index b35bfab546..ee41cd55d0 100644 --- a/tools/python/maps_generator/generator/gen_tool.py +++ b/tools/python/maps_generator/generator/gen_tool.py @@ -3,10 +3,9 @@ import logging import os import subprocess -from . import settings -from .exceptions import OptionNotFound -from .exceptions import ValidationError -from .exceptions import wait_and_raise_if_fail +from maps_generator.generator.exceptions import OptionNotFound +from maps_generator.generator.exceptions import ValidationError +from maps_generator.generator.exceptions import wait_and_raise_if_fail logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/generator/generation.py b/tools/python/maps_generator/generator/generation.py index b8d314e00a..aa164b532e 100644 --- a/tools/python/maps_generator/generator/generation.py +++ b/tools/python/maps_generator/generator/generation.py @@ -7,13 +7,12 @@ from typing import Union import filelock -from . import settings -from .env import Env -from .exceptions import ContinueError -from .stages import Stage -from .stages import get_stage_name -from .stages import stages -from .status import Status +from maps_generator.generator.env import Env +from maps_generator.generator.exceptions import ContinueError +from maps_generator.generator.stages import Stage +from maps_generator.generator.stages import get_stage_name +from maps_generator.generator.stages import stages +from maps_generator.generator.status import Status class Generation: diff --git a/tools/python/maps_generator/generator/osmtools.py b/tools/python/maps_generator/generator/osmtools.py index 2e9709ca8c..0132077fc0 100644 --- a/tools/python/maps_generator/generator/osmtools.py +++ b/tools/python/maps_generator/generator/osmtools.py @@ -1,9 +1,9 @@ import os import subprocess -from . import settings -from .exceptions import BadExitStatusError -from .exceptions import wait_and_raise_if_fail +from maps_generator.generator import settings +from maps_generator.generator.exceptions import BadExitStatusError +from maps_generator.generator.exceptions import wait_and_raise_if_fail def build_osmtools(path, output=subprocess.DEVNULL, error=subprocess.DEVNULL): diff --git a/tools/python/maps_generator/generator/settings.py b/tools/python/maps_generator/generator/settings.py index ddbe37d44a..2d96477804 100644 --- a/tools/python/maps_generator/generator/settings.py +++ b/tools/python/maps_generator/generator/settings.py @@ -8,8 +8,8 @@ from pathlib import Path from typing import Any from typing import AnyStr -from ..utils.md5 import md5 -from ..utils.system import total_virtual_memory +from maps_generator.utils.md5 import md5 +from maps_generator.utils.system import total_virtual_memory parser = argparse.ArgumentParser(add_help=False) opt_config = "--config" diff --git a/tools/python/maps_generator/generator/stages.py b/tools/python/maps_generator/generator/stages.py index f773a358c4..8b9b162b1c 100644 --- a/tools/python/maps_generator/generator/stages.py +++ b/tools/python/maps_generator/generator/stages.py @@ -21,9 +21,9 @@ from typing import Optional from typing import Type from typing import Union -from .status import Status -from ..utils.log import DummyObject -from ..utils.log import create_file_logger +from maps_generator.generator.status import Status +from maps_generator.utils.log import DummyObject +from maps_generator.utils.log import create_file_logger logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/generator/stages_declaration.py b/tools/python/maps_generator/generator/stages_declaration.py index 50943e904e..41b704d8f2 100644 --- a/tools/python/maps_generator/generator/stages_declaration.py +++ b/tools/python/maps_generator/generator/stages_declaration.py @@ -20,32 +20,32 @@ from typing import Type from descriptions.descriptions_downloader import check_and_get_checker from descriptions.descriptions_downloader import download_from_wikidata_tags from descriptions.descriptions_downloader import download_from_wikipedia_tags +from maps_generator.generator import coastline +from maps_generator.generator import settings +from maps_generator.generator import steps +from maps_generator.generator.env import Env +from maps_generator.generator.env import PathProvider +from maps_generator.generator.env import WORLDS_NAMES +from maps_generator.generator.env import WORLD_COASTS_NAME +from maps_generator.generator.env import WORLD_NAME +from maps_generator.generator.exceptions import BadExitStatusError +from maps_generator.generator.gen_tool import run_gen_tool +from maps_generator.generator.stages import Stage +from maps_generator.generator.stages import build_lock +from maps_generator.generator.stages import country_stage +from maps_generator.generator.stages import helper_stage_for +from maps_generator.generator.stages import mwm_stage +from maps_generator.generator.stages import outer_stage +from maps_generator.generator.stages import planet_lock +from maps_generator.generator.stages import production_only +from maps_generator.generator.stages import stages +from maps_generator.generator.statistics import get_stages_info +from maps_generator.generator.statistics import make_stats +from maps_generator.utils.file import download_files +from maps_generator.utils.file import is_verified from post_generation.hierarchy_to_countries import hierarchy_to_countries from post_generation.inject_promo_ids import inject_promo_ids from post_generation.localads_mwm_to_csv import create_csv -from . import coastline -from . import settings -from . import steps -from .env import Env -from .env import PathProvider -from .env import WORLDS_NAMES -from .env import WORLD_COASTS_NAME -from .env import WORLD_NAME -from .exceptions import BadExitStatusError -from .gen_tool import run_gen_tool -from .stages import Stage -from .stages import build_lock -from .stages import country_stage -from .stages import helper_stage_for -from .stages import mwm_stage -from .stages import outer_stage -from .stages import planet_lock -from .stages import production_only -from .stages import stages -from .statistics import get_stages_info -from .statistics import make_stats -from ..utils.file import download_files -from ..utils.file import is_verified logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/generator/statistics.py b/tools/python/maps_generator/generator/statistics.py index dcb3efac4a..2a32769345 100644 --- a/tools/python/maps_generator/generator/statistics.py +++ b/tools/python/maps_generator/generator/statistics.py @@ -8,8 +8,8 @@ from typing import AnyStr from typing import Dict from typing import List -from .env import WORLDS_NAMES -from .exceptions import ParseError +from maps_generator.generator.env import WORLDS_NAMES +from maps_generator.generator.exceptions import ParseError logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/generator/steps.py b/tools/python/maps_generator/generator/steps.py index 0c9bb9634b..12dce586a9 100644 --- a/tools/python/maps_generator/generator/steps.py +++ b/tools/python/maps_generator/generator/steps.py @@ -8,20 +8,20 @@ import shutil import subprocess from typing import AnyStr -from . import settings -from .env import Env -from .env import PathProvider -from .env import WORLDS_NAMES -from .env import WORLD_NAME -from .env import get_all_countries_list -from .gen_tool import run_gen_tool -from .osmtools import osmconvert -from .osmtools import osmupdate -from ..utils.file import download_file -from ..utils.file import is_verified -from ..utils.file import symlink_force -from ..utils.md5 import md5 -from ..utils.md5 import write_md5sum +from maps_generator.generator import settings +from maps_generator.generator.env import Env +from maps_generator.generator.env import PathProvider +from maps_generator.generator.env import WORLDS_NAMES +from maps_generator.generator.env import WORLD_NAME +from maps_generator.generator.env import get_all_countries_list +from maps_generator.generator.gen_tool import run_gen_tool +from maps_generator.generator.osmtools import osmconvert +from maps_generator.generator.osmtools import osmupdate +from maps_generator.utils.file import download_file +from maps_generator.utils.file import is_verified +from maps_generator.utils.file import symlink_force +from maps_generator.utils.md5 import md5 +from maps_generator.utils.md5 import write_md5sum logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/maps_generator.py b/tools/python/maps_generator/maps_generator.py index 8fabff82e0..a3e4a820f3 100644 --- a/tools/python/maps_generator/maps_generator.py +++ b/tools/python/maps_generator/maps_generator.py @@ -2,9 +2,9 @@ import logging from typing import AnyStr from typing import Optional -from .generator import stages_declaration as sd -from .generator.env import Env -from .generator.generation import Generation +from maps_generator.generator import stages_declaration as sd +from maps_generator.generator.env import Env +from maps_generator.generator.generation import Generation logger = logging.getLogger("maps_generator") diff --git a/tools/python/maps_generator/utils/file.py b/tools/python/maps_generator/utils/file.py index dcce455474..fe599116e5 100644 --- a/tools/python/maps_generator/utils/file.py +++ b/tools/python/maps_generator/utils/file.py @@ -9,8 +9,8 @@ from typing import AnyStr from typing import Dict from typing import Optional -from .md5 import check_md5 -from .md5 import md5 +from maps_generator.utils.md5 import check_md5 +from maps_generator.utils.md5 import md5 logger = logging.getLogger("maps_generator") diff --git a/tools/python/post_generation/__main__.py b/tools/python/post_generation/__main__.py index 833417deb8..d3048a5936 100644 --- a/tools/python/post_generation/__main__.py +++ b/tools/python/post_generation/__main__.py @@ -3,9 +3,9 @@ import json import os import sys -from .hierarchy_to_countries import hierarchy_to_countries as hierarchy_to_countries_ -from .inject_promo_ids import inject_promo_ids -from .localads_mwm_to_csv import create_csv +from post_generation.hierarchy_to_countries import hierarchy_to_countries as hierarchy_to_countries_ +from post_generation.inject_promo_ids import inject_promo_ids +from post_generation.localads_mwm_to_csv import create_csv class PostGeneration: diff --git a/tools/python/post_generation/localads_mwm_to_csv.py b/tools/python/post_generation/localads_mwm_to_csv.py index 828098aa15..6b6b655ecf 100755 --- a/tools/python/post_generation/localads_mwm_to_csv.py +++ b/tools/python/post_generation/localads_mwm_to_csv.py @@ -3,7 +3,9 @@ import ctypes import logging import os import sys -from multiprocessing import Pool, Queue, Process +from multiprocessing import Pool +from multiprocessing import Process +from multiprocessing import Queue from zlib import adler32 from mwm import MetadataField