diff options
author | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-10-09 19:06:07 +0300 |
---|---|---|
committer | Sergey Magidovich <mgsergio@mapswithme.com> | 2016-10-10 15:58:59 +0300 |
commit | 35a73ff37cfeefa07ae5ebcada89bc47a144d139 (patch) | |
tree | 40828a78eaaba85b9033fdf84a66540919131008 /tools | |
parent | 29cbd04e32d88363203951fa534f8d8479a3fb2e (diff) |
Code review.
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/python/opentable_restaurants.py | 14 | ||||
-rwxr-xr-x | tools/unix/generate_planet.sh | 16 |
2 files changed, 15 insertions, 15 deletions
diff --git a/tools/python/opentable_restaurants.py b/tools/python/opentable_restaurants.py index 4ed17b3b30..eec46c23c0 100755 --- a/tools/python/opentable_restaurants.py +++ b/tools/python/opentable_restaurants.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python2 +#! /usr/bin/env python2.7 # coding: utf-8 from __future__ import print_function @@ -28,7 +28,7 @@ class OpentableDownloader(object): self.opentable_filename = opentable_filename self.tsv_filename = tsv_filename - # TODO(mgsergio): Check if toke is atual in functions. + # TODO(mgsergio): Check if token is actual in functions. self._get_token() def download(self): @@ -101,19 +101,15 @@ if __name__ == '__main__': # TODO(mgsergio): Allow config instead. parser.add_argument('--client', required=True, help='Opentable client id') - parser.add_argument('--secrete', required=True, help="Opentable client's secrete") + parser.add_argument('--secret', required=True, help="Opentable client's secret") args = parser.parse_args(sys.argv[1:]) if args.download: print('Downloading') - loader = OpentableDownloader(args.client, args.secrete, args.opentable_data) + loader = OpentableDownloader(args.client, args.secret, args.opentable_data) loader.download() if args.tsv is not None: data = open(args.opentable_data) tsv = open(args.tsv, 'w') if args.tsv else sys.stdout - try: - make_tsv(data, tsv) - finally: - data.close() - tsv.close() + make_tsv(data, tsv) diff --git a/tools/unix/generate_planet.sh b/tools/unix/generate_planet.sh index 0d6749bb5a..efe6742fa4 100755 --- a/tools/unix/generate_planet.sh +++ b/tools/unix/generate_planet.sh @@ -252,16 +252,20 @@ if [ "$MODE" == "coast" ]; then # Download booking.com hotels. This takes around 3 hours, just like coastline processing. if [ ! -f "$BOOKING_FILE" -a -n "${BOOKING_USER-}" -a -n "${BOOKING_PASS-}" ]; then - log "STATUS" "Step B: Starting background hotels downloading" - $PYTHON $BOOKING_SCRIPT --user $BOOKING_USER --password $BOOKING_PASS --path "$INTDIR" --download --translate --output "$BOOKING_FILE" 2>"$LOG_PATH"/booking.log & - echo "Hotels have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG" + log "STATUS" "Step S1: Starting background hotels downloading" + ( + $PYTHON $BOOKING_SCRIPT --user $BOOKING_USER --password $BOOKING_PASS --path "$INTDIR" --download --translate --output "$BOOKING_FILE" 2>"$LOG_PATH"/booking.log & + echo "Hotels have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG" + ) & fi # Download opentable.com restaurants. This takes around 30 minutes. if [ ! -f "$OPENTABLE_FILE" -a -n "${OPENTABLE_USER-}" -a -n "${OPENTABLE_PASS-}" ]; then - log "STATUS" "Step C: Starting background restaurants downloading" - $PYTHON $OPENTABLE_SCRIPT --client $OPENTABLE_USER --secrete $OPENTABLE_PASS --opentable_data "$INTDIR"/opentable.json --download --tsv "$OPENTABLE_FILE" 2>"$LOG_PATH"/opentable.log & - echo "Hotels have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG" + log "STATUS" "Step S2: Starting background restaurants downloading" + ( + $PYTHON $OPENTABLE_SCRIPT --client $OPENTABLE_USER --secrete $OPENTABLE_PASS --opentable_data "$INTDIR"/opentable.json --download --tsv "$OPENTABLE_FILE" 2>"$LOG_PATH"/opentable.log & + echo "Restaurants have been downloaded. Please ensure this line is before Step 4." >> "$PLANET_LOG" + ) & fi [ ! -x "$OSMCTOOLS/osmupdate" ] && cc -x c "$OMIM_PATH/tools/osmctools/osmupdate.c" -o "$OSMCTOOLS/osmupdate" |