Update pyproject.toml & keydelivery.py

- Update pykeydelivery dependency to version >= 0.9.1 in pyproject.toml
- Refactor the supported_carriers method in keydelivery.py to use self.api.list_carriers() instead of making an HTTPRequest to "https://app.kd100.com/console/utils/kdbm"
This commit is contained in:
Kumi 2023-08-31 09:01:04 +02:00
parent bcbd2989eb
commit f2ca2e0748
Signed by: kumi
GPG key ID: ECBCC9082395383F
2 changed files with 2 additions and 3 deletions

View file

@ -18,7 +18,7 @@ classifiers = [
"Operating System :: OS Independent",
]
dependencies = [
"pykeydelivery",
"pykeydelivery >= 0.9.1",
"postat",
"glsapi",
"fedextrack",

View file

@ -38,8 +38,7 @@ class KeyDelivery(BaseTracker):
def supported_carriers(self):
try:
request = HTTPRequest("https://app.kd100.com/console/utils/kdbm")
response = request.execute()
response = self.api.list_carriers()
carriers = [
(carrier["code"], 1, carrier["name"])
for carrier in response["data"]