From 9faf11d0dfc9c20dbc80525f050fc43868390549 Mon Sep 17 00:00:00 2001 From: "Kasper D. Fischer" Date: Sat, 16 Oct 2021 15:51:38 +0200 Subject: [PATCH] upgrade to python3 fixed some typos --- scripts/mkGeolocationTable.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/scripts/mkGeolocationTable.py b/scripts/mkGeolocationTable.py index 2703d87..7ab80c2 100755 --- a/scripts/mkGeolocationTable.py +++ b/scripts/mkGeolocationTable.py @@ -1,4 +1,4 @@ -#! /usr/bin/env python +#! /usr/bin/env python3 # -*- coding: utf-8 -*- ''' @@ -8,9 +8,9 @@ The output will will be a javascript structure to be included in the SeisObs map service. - The script should be updated regulary keep the total number of all + The script should be updated regularly keep the total number of all AJAX calls to the Nominatim service small, e. g. : - curl -s "https://ariadne.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js + curl -s "https://fdsnws.geophysik.ruhr-uni-bochum.de/fdsnws/event/1/query?minlat=50&maxlat=54&minlon=3&maxlon=10&minmag=1" | mkGeolocationTable.py > geolocationTable.js License Copyright 2020 Kasper D. Fischer @@ -135,18 +135,15 @@ def mkGeolocationTable(file=''): warnings.warn('Request {0} failed'.format(url)) ''' # dump json - print 'var geolocationTable = '+JSON.dumps(geolocationTable, sort_keys=True)+';' + print('var geolocationTable = {0};'.format(JSON.dumps(geolocationTable, sort_keys=True))) # __main__ if __name__ == "__main__": - def printline(line): - print line - # parse arguments import argparse versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','') parser = argparse.ArgumentParser( - description='Reverese geocoding lookup of events in xml format (stdin).', + description='Reverse geocoding lookup of events in xml format (stdin).', epilog=versionText) parser.add_argument('-v', '-V', '--version', action='version', version=versionText)