python-ntfy 0.2.5__tar.gz → 0.3.5__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.1
2
2
  Name: python-ntfy
3
- Version: 0.2.5
3
+ Version: 0.3.5
4
4
  Summary: An ntfy library aiming for feature completeness
5
5
  Home-page: https://github.com/MatthewCane/python-ntfy
6
6
  License: MIT
@@ -49,6 +49,7 @@ See the full documentation site at [https://matthewcane.github.io/python-ntfy/](
49
49
  ## Supported Features
50
50
 
51
51
  - Username + password auth
52
+ - Access token auth
52
53
  - Custom servers
53
54
  - Sending plaintext messages
54
55
  - Sending Markdown formatted text messages
@@ -59,7 +60,6 @@ See the full documentation site at [https://matthewcane.github.io/python-ntfy/](
59
60
 
60
61
  ## Future Features
61
62
 
62
- - Access token auth
63
63
  - Email notifications
64
64
  - Send to multiple topics at once
65
65
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-ntfy"
3
- version = "0.2.5"
3
+ version = "0.3.5"
4
4
  description = "An ntfy library aiming for feature completeness"
5
5
  authors = ["Matthew Cane <matthew.cane0@gmail.com>"]
6
6
  readme = "README.md"
@@ -32,10 +32,15 @@ class NtfyClient:
32
32
  self._topic = topic
33
33
  self.__set_url(self._server, topic)
34
34
 
35
+ # If the user has set the user and password, use that
36
+ # If the user has set the token, use that
37
+ # Otherwise, use an empty user and token
35
38
  if (user := os.environ.get("NTFY_USER")) and (
36
39
  password := os.environ.get("NTFY_PASSWORD")
37
40
  ):
38
41
  self._auth = (user, password)
42
+ elif token := os.environ.get("NTFY_TOKEN"):
43
+ self._auth = ("", token)
39
44
  else:
40
45
  self._auth = ("", "")
41
46
 
File without changes
@@ -27,6 +27,7 @@ See the full documentation site at [https://matthewcane.github.io/python-ntfy/](
27
27
  ## Supported Features
28
28
 
29
29
  - Username + password auth
30
+ - Access token auth
30
31
  - Custom servers
31
32
  - Sending plaintext messages
32
33
  - Sending Markdown formatted text messages
@@ -37,7 +38,6 @@ See the full documentation site at [https://matthewcane.github.io/python-ntfy/](
37
38
 
38
39
  ## Future Features
39
40
 
40
- - Access token auth
41
41
  - Email notifications
42
42
  - Send to multiple topics at once
43
43