diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-06-07 16:16:15 +0300 |
---|---|---|
committer | Maksim Andrianov <maksimandrianov1@gmail.com> | 2019-06-11 15:25:19 +0300 |
commit | 7817da0d7fa4a78cce595d7897900b9ce75fa2eb (patch) | |
tree | 50ff8e6b15735d4987202f983def9c7f240896f5 /tools | |
parent | be760427c86a6202dee140bb6ca5f09b07fff736 (diff) |
[generator][promo] The type sponsored-promo_catalog is added into cities.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/python/ResponseProvider.py | 2 | ||||
-rw-r--r-- | tools/python/jsons.py | 4 | ||||
-rw-r--r-- | tools/python/maps_generator/README.md | 1 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/env.py | 4 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/gen_tool.py | 1 | ||||
-rw-r--r-- | tools/python/maps_generator/generator/settings.py | 2 | ||||
-rw-r--r-- | tools/python/maps_generator/maps_generator.py | 12 | ||||
-rw-r--r-- | tools/python/maps_generator/var/etc/map_generator.ini.default | 1 |
8 files changed, 19 insertions, 8 deletions
diff --git a/tools/python/ResponseProvider.py b/tools/python/ResponseProvider.py index 61551b5b1c..ee094439cf 100644 --- a/tools/python/ResponseProvider.py +++ b/tools/python/ResponseProvider.py @@ -147,7 +147,7 @@ class ResponseProvider: "/partners/taxi_info": self.partners_yandex_taxi_info, "/partners/get-offers-in-bbox/": self.partners_rent_nearby, "/partners/CalculateByCoords": self.partners_calculate_by_coords, - "/gallery/city/TestId/": self.promo_gallery_city, + "/gallery/v1/city/TestId/": self.promo_gallery_city, }[url]() except: return self.test_404() diff --git a/tools/python/jsons.py b/tools/python/jsons.py index be08c3eb0e..29083b1ab5 100644 --- a/tools/python/jsons.py +++ b/tools/python/jsons.py @@ -543,14 +543,14 @@ PROMO_GALLERY_CITY = """ "access": "public", "lux_category": { "name": null, - "color": "666666" + "color": "000000" }, "tier": null } ], "errors": [], "meta": { - "more": "search?city=666" + "more": "search?city=888" } } """ diff --git a/tools/python/maps_generator/README.md b/tools/python/maps_generator/README.md index e934506097..a4b78b0a9a 100644 --- a/tools/python/maps_generator/README.md +++ b/tools/python/maps_generator/README.md @@ -75,6 +75,7 @@ OSM_TOOLS_PATH: ~/osmctools # Urls for production maps generation. # UGC_URL: # HOTELS_URL: +# PROMO_CATALOG_CITIES: # POPULARITY_URL: # FOOD_URL: # FOOD_TRANSLATIONS_URL: diff --git a/tools/python/maps_generator/generator/env.py b/tools/python/maps_generator/generator/env.py index 0710579267..1a1fdc2414 100644 --- a/tools/python/maps_generator/generator/env.py +++ b/tools/python/maps_generator/generator/env.py @@ -196,6 +196,10 @@ class Env: return os.path.join(self.intermediate_path, "hotels.csv") @property + def promo_catalog_cities_path(self): + return os.path.join(self.intermediate_path, "promo_catalog_cities.json") + + @property def popularity_path(self): return os.path.join(self.intermediate_path, "popular_places.csv") diff --git a/tools/python/maps_generator/generator/gen_tool.py b/tools/python/maps_generator/generator/gen_tool.py index becf2a62fc..440f10dd43 100644 --- a/tools/python/maps_generator/generator/gen_tool.py +++ b/tools/python/maps_generator/generator/gen_tool.py @@ -42,6 +42,7 @@ class GenTool: "version": bool, "planet_version": int, "booking_data": str, + "promo_catalog_cities": str, "brands_data": str, "brands_translations_data": str, "cities_boundaries_data": str, diff --git a/tools/python/maps_generator/generator/settings.py b/tools/python/maps_generator/generator/settings.py index 8df50f2a38..eb387b961d 100644 --- a/tools/python/maps_generator/generator/settings.py +++ b/tools/python/maps_generator/generator/settings.py @@ -45,6 +45,7 @@ PLANET_MD5_URL = PLANET_URL + ".md5" PLANET_COASTS_URL = "" UGC_URL = "" HOTELS_URL = "" +PROMO_CATALOG_CITIES_URL = "" POPULARITY_URL= "" SUBWAY_URL = "" FOOD_URL = "" @@ -116,6 +117,7 @@ PLANET_MD5_URL = _get_opt_path(config, "External", "PLANET_MD5_URL", PLANET_MD5_ PLANET_COASTS_URL = _get_opt_path(config, "External", "PLANET_COASTS_URL", PLANET_COASTS_URL) UGC_URL = _get_opt_path(config, "External", "UGC_URL", UGC_URL) HOTELS_URL = _get_opt_path(config, "External", "HOTELS_URL", HOTELS_URL) +PROMO_CATALOG_CITIES_URL = _get_opt_path(config, "External", "PROMO_CATALOG_CITIES_URL", PROMO_CATALOG_CITIES_URL) POPULARITY_URL = _get_opt_path(config, "External", "POPULARITY_URL", POPULARITY_URL) SUBWAY_URL = _get_opt(config, "External", "SUBWAY_URL", SUBWAY_URL) FOOD_URL = _get_opt(config, "External", "FOOD_URL", FOOD_URL) diff --git a/tools/python/maps_generator/maps_generator.py b/tools/python/maps_generator/maps_generator.py index 15fde3c696..981e776449 100644 --- a/tools/python/maps_generator/maps_generator.py +++ b/tools/python/maps_generator/maps_generator.py @@ -1,12 +1,12 @@ +import datetime +import json import logging +import multiprocessing import os import shutil +from collections import defaultdict from functools import partial from multiprocessing.pool import ThreadPool -from collections import defaultdict -import multiprocessing -import json -import datetime from descriptions.descriptions_downloader import (check_and_get_checker, download_from_wikipedia_tags, @@ -61,9 +61,10 @@ def stage_download_production_external(env, **kwargs): download_external({ settings.UGC_URL: env.ugc_path, settings.HOTELS_URL: env.hotels_path, + settings.PROMO_CATALOG_CITIES_URL: env.promo_catalog_cities_path, settings.POPULARITY_URL: env.popularity_path, settings.FOOD_URL: env.food_paths, - settings.FOOD_TRANSLATIONS_URL: env.food_translations_path + settings.FOOD_TRANSLATIONS_URL: env.food_translations_path, }) @@ -79,6 +80,7 @@ def stage_features(env): extra["idToWikidata"] = env.id_to_wikidata_path if env.is_accepted_stage(stage_download_production_external.__name__): extra["booking_data"] = env.hotels_path + extra["promo_catalog_cities"] = env.promo_catalog_cities_path extra["popular_places_data"] = env.popularity_path extra["brands_data"] = env.food_paths extra["brands_translations_data"] = env.food_translations_path diff --git a/tools/python/maps_generator/var/etc/map_generator.ini.default b/tools/python/maps_generator/var/etc/map_generator.ini.default index 593781d5a0..d2c5a00439 100644 --- a/tools/python/maps_generator/var/etc/map_generator.ini.default +++ b/tools/python/maps_generator/var/etc/map_generator.ini.default @@ -29,6 +29,7 @@ OSM_TOOLS_PATH: ~/osmctools # PLANET_COASTS_URL: # UGC_URL: # HOTELS_URL: +# PROMO_CATALOG_CITIES_URL: # POPULARITY_URL: # SUBWAY_URL: # FOOD_URL: |