diff options
author | Ilya Zverev <zverik@textual.ru> | 2016-11-11 19:20:27 +0300 |
---|---|---|
committer | Ilya Zverev <zverik@textual.ru> | 2016-11-14 17:42:45 +0300 |
commit | 9fd4c120648e6e902b924d5da0d8de42cbe27084 (patch) | |
tree | 3f2cf16218137cca8033a0022b9e56bb5bec6452 /tools/python | |
parent | 77206c4859e4dd0d06b954f2ae9e24dce0fbc795 (diff) |
[build] Small fixes to build process and styles
Diffstat (limited to 'tools/python')
-rwxr-xr-x | tools/python/booking_hotels.py | 8 | ||||
-rw-r--r-- | tools/python/mwm/mwm.py | 2 |
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() |