Skip to content

Commit

Permalink
use: Dict
Browse files Browse the repository at this point in the history
  • Loading branch information
nanato12 committed May 28, 2024
1 parent 0538b82 commit 5a7d23d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions notify/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from io import BufferedReader, BytesIO
from typing import Any, Union
from typing import Any, Dict, Union

import requests
from pydantic import BaseModel, StrictStr
Expand All @@ -20,7 +20,7 @@ def model_post_init(self, __context: Any) -> None:
raise Exception("Invalid access token")

@property
def headers(self) -> dict[str, str]:
def headers(self) -> Dict[str, str]:
return {
"Authorization": f"Bearer {self.token}",
}
Expand Down Expand Up @@ -51,15 +51,15 @@ def send_image(
def send_text(self, text: str) -> Response:
return self.send({"message": (None, text)})

def send(self, files: dict[str, Any]) -> Response:
def send(self, files: Dict[str, Any]) -> Response:
return requests.post(
f"{self.host}/api/notify",
headers=self.headers,
files=files,
)

def get_status(self) -> Status:
j: dict[str, Any] = requests.get(
j: Dict[str, Any] = requests.get(
f"{self.host}/api/status", headers=self.headers
).json()
j["target_type"] = j.pop("targetType")
Expand Down

0 comments on commit 5a7d23d

Please sign in to comment.