python-ntfy 0.4.8__tar.gz → 0.5.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/PKG-INFO +1 -1
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/pyproject.toml +3 -3
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/python_ntfy/_ntfy.py +15 -6
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/LICENSE +0 -0
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/README.md +0 -0
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/python_ntfy/__init__.py +0 -0
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/python_ntfy/_get_functions.py +0 -0
- {python_ntfy-0.4.8 → python_ntfy-0.5.1}/python_ntfy/_send_functions.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "python-ntfy"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.1"
|
|
4
4
|
description = "An ntfy library aiming for feature completeness"
|
|
5
5
|
authors = ["Matthew Cane <matthew.cane0@gmail.com>"]
|
|
6
6
|
readme = "README.md"
|
|
@@ -24,9 +24,9 @@ mkdocstrings = {extras = ["python"], version = ">=0.26.2,<0.30.0"}
|
|
|
24
24
|
mypy = "^1.12.0"
|
|
25
25
|
pytest = ">=7.4.1,<9.0.0"
|
|
26
26
|
python-dotenv = "^1.0.0"
|
|
27
|
-
pytest-asyncio = ">=0.21.1,<
|
|
27
|
+
pytest-asyncio = ">=0.21.1,<1.1.0"
|
|
28
28
|
pytest-codecov = ">=0.5.1,<0.8.0"
|
|
29
|
-
ruff = ">=0.7,<0.
|
|
29
|
+
ruff = ">=0.7,<0.13"
|
|
30
30
|
mkdocs-material = "^9.5.41"
|
|
31
31
|
mkdocstrings-python = "^1.12.1"
|
|
32
32
|
types-pygments = "^2.18.0.20240506"
|
|
@@ -68,20 +68,27 @@ class NtfyClient(GetFunctionsMixin, SendFunctionsMixin):
|
|
|
68
68
|
|
|
69
69
|
# If the user has set the user and password, use that
|
|
70
70
|
# If the user has set the token, use that
|
|
71
|
-
# Otherwise, use
|
|
71
|
+
# Otherwise, use None
|
|
72
|
+
|
|
73
|
+
self._auth: tuple[str, str] | None = None
|
|
72
74
|
if (user := os.environ.get("NTFY_USER")) and (
|
|
73
75
|
password := os.environ.get("NTFY_PASSWORD")
|
|
74
76
|
):
|
|
75
77
|
self._auth = (user, password)
|
|
76
78
|
elif token := os.environ.get("NTFY_TOKEN"):
|
|
77
79
|
self._auth = ("", token)
|
|
78
|
-
else:
|
|
79
|
-
self._auth = ("", "")
|
|
80
80
|
|
|
81
|
-
def __set_url(
|
|
81
|
+
def __set_url(
|
|
82
|
+
self,
|
|
83
|
+
server,
|
|
84
|
+
topic,
|
|
85
|
+
) -> None:
|
|
82
86
|
self.url = server.strip("/") + "/" + topic
|
|
83
87
|
|
|
84
|
-
def set_topic(
|
|
88
|
+
def set_topic(
|
|
89
|
+
self,
|
|
90
|
+
topic: str,
|
|
91
|
+
) -> None:
|
|
85
92
|
"""Set a new topic for the client.
|
|
86
93
|
|
|
87
94
|
Args:
|
|
@@ -93,7 +100,9 @@ class NtfyClient(GetFunctionsMixin, SendFunctionsMixin):
|
|
|
93
100
|
self._topic = topic
|
|
94
101
|
self.__set_url(self._server, self._topic)
|
|
95
102
|
|
|
96
|
-
def get_topic(
|
|
103
|
+
def get_topic(
|
|
104
|
+
self,
|
|
105
|
+
) -> str:
|
|
97
106
|
"""Get the current topic.
|
|
98
107
|
|
|
99
108
|
Returns:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|