Skip to content
Prev Previous commit
Next Next commit
feat: add downloadProgress signal to Client
  • Loading branch information
merydian committed Oct 21, 2025
commit 803b28d5615c9918e2f2c3984fcf9c29bbdf58a3
6 changes: 6 additions & 0 deletions ORStools/common/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ class Client(QObject):
"""Performs requests to the ORS API services."""

overQueryLimit = pyqtSignal(int)
downloadProgress = pyqtSignal(int, int)


def __init__(self, provider: Optional[dict] = None, agent: Optional[str] = None) -> None:
"""
Expand Down Expand Up @@ -118,6 +120,10 @@ def fetch_with_retry(

blocking_request = QgsBlockingNetworkRequest()

blocking_request.downloadProgress.connect(
lambda r, t: self.downloadProgress.emit(r, t)
)

logger.log(f"url: {self.url}\nParameters: {json.dumps(post_json, indent=2)}", 0)

content = None
Expand Down