Skip to content

Commit d665a65

Browse files
committed
feat: add downloadProgress signal to Client
1 parent 10a45a1 commit d665a65

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ORStools/common/client.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class Client(QObject):
4848
"""Performs requests to the ORS API services."""
4949

5050
overQueryLimit = pyqtSignal(int)
51+
downloadProgress = pyqtSignal(int, int)
52+
5153

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

119121
blocking_request = QgsBlockingNetworkRequest()
120122

123+
blocking_request.downloadProgress.connect(
124+
lambda r, t: self.downloadProgress.emit(r, t)
125+
)
126+
121127
logger.log(f"url: {self.url}\nParameters: {json.dumps(post_json, indent=2)}", 0)
122128

123129
content = None

0 commit comments

Comments
 (0)