Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make it work on Windows #27

Merged
merged 5 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ Retrieve the latest replication diff from the OSM API:

```python
>>> from osmdiff import OSMChange
>>> o = OSMChange()
>>> o.frequency = "minute" # the default
>>> o = OSMChange(frequency="minute") # minute is the default frequency
>>> o.get_state() # retrieve current sequence ID
>>> o.sequence_number
2704451
Expand Down Expand Up @@ -104,4 +103,4 @@ I welcome your contributions in code, documentation and suggestions for enhancem

[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)

If you find `osmdiff` useful, or you use it in commercial software, please consider sponsoring this project.
If you find `osmdiff` useful, or you use it in commercial software, please consider sponsoring this project.
4 changes: 2 additions & 2 deletions src/osmdiff/augmenteddiff.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
from posixpath import join as urljoin
from xml.etree import cElementTree

import dateutil.parser
Expand Down Expand Up @@ -49,7 +49,7 @@ def __init__(

def get_state(self):
"""Get the current state from the OSM API"""
state_url = os.path.join(self.base_url, "augmented_diff_status")
state_url = urljoin(self.base_url, "augmented_diff_status")
if self.debug:
print("getting state from", state_url)
response = requests.get(state_url, timeout=5)
Expand Down
6 changes: 3 additions & 3 deletions src/osmdiff/osmchange.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os
from posixpath import join as urljoin
from gzip import GzipFile
from xml.etree import ElementTree

Expand Down Expand Up @@ -32,7 +32,7 @@ def __init__(

def get_state(self):
"""Get the current state from the OSM API"""
state_url = os.path.join(self.base_url, self._frequency, "state.txt")
state_url = urljoin(self.base_url, self._frequency, "state.txt")
response = requests.get(state_url, timeout=5)
if response.status_code != 200:
return False
Expand All @@ -45,7 +45,7 @@ def get_state(self):

def _build_sequence_url(self):
seqno = str(self._sequence_number).zfill(9)
url = os.path.join(
url = urljoin(
self.base_url,
self._frequency,
seqno[:3],
Expand Down