upgrade to python3
fixed some typos
This commit is contained in:
parent
844f77e8e8
commit
9faf11d0df
@ -1,4 +1,4 @@
|
|||||||
#! /usr/bin/env python
|
#! /usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
'''
|
'''
|
||||||
@ -8,9 +8,9 @@
|
|||||||
The output will will be a javascript structure to be included in the
|
The output will will be a javascript structure to be included in the
|
||||||
SeisObs map service.
|
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. :
|
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
|
License
|
||||||
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
Copyright 2020 Kasper D. Fischer <kasper.fischer@rub.de>
|
||||||
@ -135,18 +135,15 @@ def mkGeolocationTable(file=''):
|
|||||||
warnings.warn('Request {0} failed'.format(url))
|
warnings.warn('Request {0} failed'.format(url))
|
||||||
'''
|
'''
|
||||||
# dump json
|
# dump json
|
||||||
print 'var geolocationTable = '+JSON.dumps(geolocationTable, sort_keys=True)+';'
|
print('var geolocationTable = {0};'.format(JSON.dumps(geolocationTable, sort_keys=True)))
|
||||||
|
|
||||||
# __main__
|
# __main__
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
def printline(line):
|
|
||||||
print line
|
|
||||||
|
|
||||||
# parse arguments
|
# parse arguments
|
||||||
import argparse
|
import argparse
|
||||||
versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','')
|
versionText = '$Revision$ ($Date$, $Author$)'.replace('$', '').replace(':','')
|
||||||
parser = argparse.ArgumentParser(
|
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)
|
epilog=versionText)
|
||||||
parser.add_argument('-v', '-V', '--version', action='version',
|
parser.add_argument('-v', '-V', '--version', action='version',
|
||||||
version=versionText)
|
version=versionText)
|
||||||
|
Loading…
Reference in New Issue
Block a user