[Git][debian-gis-team/pyosmium][upstream] New upstream version 3.1.3

Bas Couwenberg gitlab at salsa.debian.org
Sat Feb 6 14:14:07 GMT 2021



Bas Couwenberg pushed to branch upstream at Debian GIS Project / pyosmium


Commits:
49bf56ae by Bas Couwenberg at 2021-02-06T15:03:35+01:00
New upstream version 3.1.3
- - - - -


4 changed files:

- CHANGELOG.md
- src/osmium/replication/server.py
- src/osmium/version.py
- tools/pyosmium-up-to-date


Changes:

=====================================
CHANGELOG.md
=====================================
@@ -4,6 +4,17 @@
 All notable changes to this project will be documented in this file.
 This project adheres to [Semantic Versioning](http://semver.org/).
 
+## [3.1.3] - 2021-02-05
+
+### Fixed
+
+- up-to-date: check if any updates are available before starting download
+- AttributeError when writing replication headers and network is unreachable
+
+### Changed
+
+- update to pybind11 2.6.2
+
 ## [3.1.2] - 2021-01-13
 
 ### Fixed
@@ -14,7 +25,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
 
 ### Added
 
-- support for lz4 compression (compled in when library is found)
+- support for lz4 compression (compiled in when library is found)
 
 ### Changed
 


=====================================
src/osmium/replication/server.py
=====================================
@@ -170,7 +170,8 @@ class ReplicationServer:
             h.set("osmosis_replication_base_url", self.baseurl)
             h.set("osmosis_replication_sequence_number", str(diffs.id))
             info = self.get_state_info(diffs.id)
-            h.set("osmosis_replication_timestamp", info.timestamp.strftime("%Y-%m-%dT%H:%M:%SZ"))
+            if info is not None:
+                h.set("osmosis_replication_timestamp", info.timestamp.strftime("%Y-%m-%dT%H:%M:%SZ"))
         if extra_headers is not None:
             for k, v in extra_headers.items():
                 h.set(k, v)


=====================================
src/osmium/version.py
=====================================
@@ -5,11 +5,11 @@ Version information.
 # the major version
 pyosmium_major = '3.1'
 # current release (Pip version)
-pyosmium_release = '3.1.2'
+pyosmium_release = '3.1.3'
 
 # libosmium version shipped with the Pip release
 libosmium_version = '2.16.0'
 # protozero version shipped with the Pip release
 protozero_version = '1.7.0'
 # pybind11 version shipped with the Pip release
-pybind11_version = '2.6.1'
+pybind11_version = '2.6.2'


=====================================
tools/pyosmium-up-to-date
=====================================
@@ -19,11 +19,11 @@ This program can update normal OSM data files as well as OSM history files.
 It detects automatically on what type of file it is called.
 
 The program returns 0, if updates have been successfully applied up to
-the newest data. It returns 1, if some updates have been applied but
-there is still data available on the server (either because the size
-limit has been reached or there was a network error which could not be
-resolved). Any other error results in a return code larger than 1. The
-output file is guaranteed to be unmodified in that case.
+the newest data or no new data was available. It returns 1, if some updates
+have been applied but there is still data available on the server (either
+because the size limit has been reached or there was a network error which
+could not be resolved). Any other error results in a return code larger than 1.
+The output file is guaranteed to be unmodified in that case.
 
 Some OSM data sources require a cookie to be sent with the HTTP requests. 
 Pyosmium-up-to-date does not fetch the cookie from these services for you.
@@ -33,6 +33,7 @@ cookies to the server and will save received cookies to the jar file.
 
 import re
 import sys
+import traceback
 import logging
 import socket
 
@@ -76,7 +77,14 @@ def update_from_custom_server(url, seq, ts, options):
         cookie_jar.load(options.cookie)
         opener = urlrequest.build_opener(urlrequest.HTTPCookieProcessor(cookie_jar))
         svr.open_url = opener.open
-    log.info("Using replication service at %s" % url)
+
+    log.info("Using replication service at %s", url)
+
+    current = svr.get_state_info()
+    if current is None:
+        log.error("Cannot download state information. Is the replication URL correct?")
+        return 3
+    log.debug("Server is at sequence %d (%s).", current.sequence, current.timestamp)
 
     if seq is None:
         log.info("Using timestamp %s as starting point." % ts)
@@ -86,6 +94,10 @@ def update_from_custom_server(url, seq, ts, options):
                       % (str(ts), url))
             return 3
     else:
+        if seq >= current.sequence:
+            log.info("File is already up to date.")
+            return 0
+
         log.debug("Using given sequence ID %d" % seq)
         startseq = seq + 1
         ts = svr.get_state_info(seq=startseq)
@@ -240,9 +252,13 @@ if __name__ == '__main__':
         log.error(str(e))
         exit(2)
 
-    if url is None:
-        ret = update_from_osm_server(ts, options)
-    else:
-        ret = update_from_custom_server(url, seq, ts, options)
+    try:
+        if url is None:
+            ret = update_from_osm_server(ts, options)
+        else:
+            ret = update_from_custom_server(url, seq, ts, options)
+    except:
+        traceback.print_exc()
+        exit(254)
 
     exit(ret)



View it on GitLab: https://salsa.debian.org/debian-gis-team/pyosmium/-/commit/49bf56ae6da8863b8ccbe69e416b15fe38ba2f07

-- 
View it on GitLab: https://salsa.debian.org/debian-gis-team/pyosmium/-/commit/49bf56ae6da8863b8ccbe69e416b15fe38ba2f07
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-grass-devel/attachments/20210206/40756aa2/attachment-0001.html>


More information about the Pkg-grass-devel mailing list