X-Git-Url: https://git.openstreetmap.org./chef.git/blobdiff_plain/c249fadcc5ce27698d1f11fe5ec4a1c299786b3c..90b601cad3220365064a9936413ace6a06a25f4b:/cookbooks/planet/files/default/history_cgi/HEADER.cgi
diff --git a/cookbooks/planet/files/default/history_cgi/HEADER.cgi b/cookbooks/planet/files/default/history_cgi/HEADER.cgi
index 51ac84581..4b64cfc6e 100755
--- a/cookbooks/planet/files/default/history_cgi/HEADER.cgi
+++ b/cookbooks/planet/files/default/history_cgi/HEADER.cgi
@@ -1,4 +1,4 @@
-#!/usr/bin/env python
+#!/usr/bin/python3
from time import time
from os import stat, environ
@@ -10,7 +10,7 @@ def nice_size(file):
MB = 1024. * KB
GB = 1024. * MB
TB = 1024. * GB
-
+
if size < KB:
size, suffix = size, ''
elif size < MB:
@@ -21,7 +21,7 @@ def nice_size(file):
size, suffix = size/GB, 'GB'
else:
size, suffix = size/TB, 'TB'
-
+
if size < 10:
return '%.1f %s' % (round(size,1), suffix)
else:
@@ -44,30 +44,31 @@ def nice_time(time):
return '%d months' % (time / 2592000.)
def file_info(file, name):
+ torrent_file = file + '.torrent'
size = nice_size(file)
hash = search(r'\w{32}', open(file+'.md5', 'r').read()).group(0)
date = nice_time(time() - stat(file).st_mtime)
- return '%(name)s
%(size)s, created %(date)s ago.
md5: %(hash)s.' % locals()
+ return '%(name)s (torrent)
%(size)s, created %(date)s ago.
md5: %(hash)s.' % locals()
planet_link = file_info('history-latest.osm.bz2', 'Latest Full History Planet XML File')
planet_pbf_link = file_info('../../pbf/full-history/history-latest.osm.pbf', 'Latest Full History Planet PBF File')
-print """
+print("""
The files found here are complete copies of the OpenStreetMap.org -database, including editing history. These are published under an -Open Data Commons Open Database License 1.0 licensed. For more +database, including editing history. These are published under an +Open Data Commons Open Database License 1.0 licensed. For more information, see the project wiki.
@@ -94,13 +95,13 @@ information, see t- You are granted permission to use OpenStreetMap data by - the OpenStreetMap License, which also describes + You are granted permission to use OpenStreetMap data by + the OpenStreetMap License, which also describes your obligations.
You can process the file - or extracts with a variety of tools, although some tools for processing OSM data will + or extracts with a variety of tools, although some tools for processing OSM data will only work on 'current' planets and will not process a 'history' planet available here.
The complete history planet is extremely large, so you may prefer to use one of the available extracts - (individual countries or states) from third parties. + (individual countries or states) from third parties.
@@ -117,4 +118,4 @@ information, see tIf you find data within OpenStreetMap that you believe is an infringement of someone else's copyright, then please make contact with the OpenStreetMap Data Working Group.
-""" % locals() +""" % locals())