Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Byko-Ianko <bykoianko@gmail.com>2016-11-14 18:05:25 +0300
committerGitHub <noreply@github.com>2016-11-14 18:05:25 +0300
commit8b6112eb1078dfbf900f4b1d437efe542497f6aa (patch)
tree3af5756ef74f2a5d5c22e2fa75ee2c99a8749943 /tools/python
parent42c4a8e6be0ae8882e5fa0dca983e42ba8fb38f5 (diff)
parent0c8eec1616b20c23ea8d087fb94a69297590279e (diff)
Merge pull request #4716 from Zverik/small_fixes
[build] Some build and style fixes
Diffstat (limited to 'tools/python')
-rwxr-xr-xtools/python/booking_hotels.py8
-rw-r--r--tools/python/mwm/mwm.py2
2 files changed, 8 insertions, 2 deletions
diff --git a/tools/python/booking_hotels.py b/tools/python/booking_hotels.py
index d64c1f9e8c..8b315d7e3e 100755
--- a/tools/python/booking_hotels.py
+++ b/tools/python/booking_hotels.py
@@ -89,7 +89,8 @@ def download(user, password, path):
# Check for error.
if hotels is None:
- exit(1)
+ logging.critical('No hotels downloaded for country {0}'.format(country['name']))
+ break
for h in hotels:
allhotels[h['hotel_id']] = h
@@ -98,6 +99,9 @@ def download(user, password, path):
if len(hotels) < maxrows:
break
+ if not hotels:
+ continue
+
# Now the same for hotel translations
offset = 0
while True:
@@ -116,6 +120,8 @@ def download(user, password, path):
if len(hotels) < maxrows:
break
+ if not hotels:
+ raise Exception('Failed to load any hotels')
logging.info('Num of hotels: {0}, translations: {1}'.format(len(allhotels), offset))
filename = os.path.join(path,
'{0} - {1}.pkl'.format(country['area'].encode('utf8'), country['name'].encode('utf8')))
diff --git a/tools/python/mwm/mwm.py b/tools/python/mwm/mwm.py
index 65929831bd..bb8f3d8100 100644
--- a/tools/python/mwm/mwm.py
+++ b/tools/python/mwm/mwm.py
@@ -258,7 +258,7 @@ class MWM:
if type_id < len(self.type_mapping):
types.append(self.type_mapping[type_id])
else:
- types.append(str(type_id))
+ types.append(str(type_id + 1)) # So the numbers match with mapcss-mapping.csv
header['types'] = types
if has_name:
header['name'] = self.read_multilang()