Skip to content

Commit ab5e7a8

Browse files
committed
version bump to 0.8.5
1 parent 7e7bdcf commit ab5e7a8

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

usps/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.8.4"
1+
__version__ = "0.8.5"

usps/__main__.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ def ordinal(day: int) -> str:
5353
else:
5454
con.print("\t[red]No estimated delivery time yet.[/]")
5555

56-
con.print(*[f"\t[yellow]{line}[/]" for line in textwrap.wrap(package.last_status, 102)], "", sep = "\n")
56+
con.print(
57+
*[f"\t[yellow]{line}[/]" for line in textwrap.wrap(package.last_status, 102)] if package.last_status is not None else [],
58+
"",
59+
sep = "\n"
60+
)
5761

5862
# Print out steps
5963
location_max = len(max(package.steps, key = lambda _package: len(_package.location)).location)

usps/tracking/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Step:
1717
@dataclass
1818
class Package:
1919
expected: list[datetime] | None
20-
last_status: str
20+
last_status: str | None
2121
state: str
2222
steps: list[Step]
2323

usps/tracking/ups.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def track_package(cls, tracking_number: str) -> Package:
8686

8787
# Handle estimated delivery date
8888
estimated_delivery = None
89-
if data["packageStatusTime"]:
89+
if data["scheduledDeliveryDateDetail"]:
9090
delivery = data["scheduledDeliveryDateDetail"]
9191
month, year = UPS_CMS_MAPPINGS[delivery["monthCMSKey"]], datetime.now().year
9292
estimated_delivery = [
@@ -101,6 +101,9 @@ def track_package(cls, tracking_number: str) -> Package:
101101
case "010":
102102
status_name = "Your package is in transit to the destination."
103103

104+
case "011":
105+
status_name = None
106+
104107
case "021":
105108
status_name = "Your package is out for delivery."
106109

0 commit comments

Comments
 (0)