python-ntfy 0.4.7__tar.gz → 0.5.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: python-ntfy
3
- Version: 0.4.7
3
+ Version: 0.5.0
4
4
  Summary: An ntfy library aiming for feature completeness
5
5
  License: MIT
6
6
  Author: Matthew Cane
@@ -12,7 +12,6 @@ Classifier: License :: OSI Approved :: MIT License
12
12
  Classifier: Programming Language :: Python :: 3
13
13
  Classifier: Programming Language :: Python :: 3.12
14
14
  Classifier: Programming Language :: Python :: 3.13
15
- Requires-Dist: mkdocstrings[python] (>=0.26.2,<0.30.0)
16
15
  Requires-Dist: requests (>=2.31.0,<3.0.0)
17
16
  Project-URL: Documentation, https://matthewcane.github.io/python-ntfy/
18
17
  Project-URL: Repository, https://github.com/MatthewCane/python-ntfy
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-ntfy"
3
- version = "0.4.7"
3
+ version = "0.5.0"
4
4
  description = "An ntfy library aiming for feature completeness"
5
5
  authors = ["Matthew Cane <matthew.cane0@gmail.com>"]
6
6
  readme = "README.md"
@@ -17,9 +17,10 @@ classifiers = [
17
17
  [tool.poetry.dependencies]
18
18
  python = ">=3.12, <3.14"
19
19
  requests = "^2.31.0"
20
- mkdocstrings = {extras = ["python"], version = ">=0.26.2,<0.30.0"}
20
+
21
21
 
22
22
  [tool.poetry.group.dev.dependencies]
23
+ mkdocstrings = {extras = ["python"], version = ">=0.26.2,<0.30.0"}
23
24
  mypy = "^1.12.0"
24
25
  pytest = ">=7.4.1,<9.0.0"
25
26
  python-dotenv = "^1.0.0"
@@ -31,7 +32,7 @@ mkdocstrings-python = "^1.12.1"
31
32
  types-pygments = "^2.18.0.20240506"
32
33
  types-colorama = "^0.4.15.20240311"
33
34
  types-requests = "^2.32.0.20241016"
34
- types-setuptools = ">=75.2.0.20241018,<79.0.0.0"
35
+ types-setuptools = ">=75.2.0.20241018,<81.0.0.0"
35
36
  black = ">=24.10,<26.0"
36
37
 
37
38
  [build-system]
@@ -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 an empty user and token
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(self, server, topic) -> None:
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(self, topic: str) -> None:
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(self) -> str:
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