python-ntfy 0.4.0__tar.gz → 0.4.2__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.4.0
3
+ Version: 0.4.2
4
4
  Summary: An ntfy library aiming for feature completeness
5
5
  Home-page: https://github.com/MatthewCane/python-ntfy
6
6
  License: MIT
@@ -46,7 +46,9 @@ client = NtfyClient(topic="Your topic")
46
46
  client.send("Your message here")
47
47
  ```
48
48
 
49
- See the full documentation site at [https://matthewcane.github.io/python-ntfy/](https://matthewcane.github.io/python-ntfy/).
49
+ ## Documentation
50
+
51
+ See the full documentation at [https://matthewcane.github.io/python-ntfy/](https://matthewcane.github.io/python-ntfy/).
50
52
 
51
53
  ## Supported Features
52
54
 
@@ -91,7 +93,7 @@ These tools are also run in the CI pipeline and must pass before merging.
91
93
 
92
94
  ### Tests
93
95
 
94
- This project is aiming for 95% code coverage. Any added features must include comprihensive tests.
96
+ This project is aiming for 95% code coverage. Any added features must include comprehensive tests.
95
97
 
96
98
  #### Testing Steps
97
99
 
@@ -26,7 +26,9 @@ client = NtfyClient(topic="Your topic")
26
26
  client.send("Your message here")
27
27
  ```
28
28
 
29
- See the full documentation site at [https://matthewcane.github.io/python-ntfy/](https://matthewcane.github.io/python-ntfy/).
29
+ ## Documentation
30
+
31
+ See the full documentation at [https://matthewcane.github.io/python-ntfy/](https://matthewcane.github.io/python-ntfy/).
30
32
 
31
33
  ## Supported Features
32
34
 
@@ -71,7 +73,7 @@ These tools are also run in the CI pipeline and must pass before merging.
71
73
 
72
74
  ### Tests
73
75
 
74
- This project is aiming for 95% code coverage. Any added features must include comprihensive tests.
76
+ This project is aiming for 95% code coverage. Any added features must include comprehensive tests.
75
77
 
76
78
  #### Testing Steps
77
79
 
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "python-ntfy"
3
- version = "0.4.0"
3
+ version = "0.4.2"
4
4
  description = "An ntfy library aiming for feature completeness"
5
5
  authors = ["Matthew Cane <matthew.cane0@gmail.com>"]
6
6
  readme = "README.md"
@@ -69,6 +69,7 @@ ignore = [
69
69
  "ANN001", # Missing type annotation for function argument
70
70
  "ANN101", # Missing type annotation for self in method
71
71
  "S101", # Use of assert detected
72
+ "TRY003", # Use of vanilla exception messages
72
73
  ]
73
74
 
74
75
 
@@ -0,0 +1,3 @@
1
+ from ._ntfy import NtfyClient as NtfyClient
2
+
3
+ __all__ = ["NtfyClient"]
@@ -11,24 +11,36 @@ Typical usage example:
11
11
 
12
12
  import os
13
13
 
14
+ from ._get_functions import get_cached_messages
15
+ from ._send_functions import (
16
+ BroadcastAction,
17
+ HttpAction,
18
+ MessagePriority,
19
+ ViewAction,
20
+ send,
21
+ send_file,
22
+ )
23
+
24
+
25
+ class GetFunctionsMixin:
26
+ """Mixin for getting messages."""
27
+
28
+ get_cached_messages = get_cached_messages
14
29
 
15
- class NtfyClient:
16
- """A class for interacting with the ntfy notification service."""
17
30
 
18
- # The functions need to be imported here to:
19
- # 1. Keep the functions in a separate file
20
- # 2. Keep the docstrings working in the IDE
21
- # 3. Allow the functions to be called with self
22
- # MyPy does not like this, but it works
23
- from ._get_functions import get_cached_messages # type: ignore
24
- from ._send_functions import ( # type: ignore
25
- BroadcastAction,
26
- HttpAction,
27
- MessagePriority,
28
- ViewAction,
29
- send,
30
- send_file,
31
- )
31
+ class SendFunctionsMixin:
32
+ """Mixin for sending messages."""
33
+
34
+ send = send
35
+ send_file = send_file
36
+ BroadcastAction = BroadcastAction
37
+ HttpAction = HttpAction
38
+ MessagePriority = MessagePriority
39
+ ViewAction = ViewAction
40
+
41
+
42
+ class NtfyClient(GetFunctionsMixin, SendFunctionsMixin):
43
+ """A class for interacting with the ntfy notification service."""
32
44
 
33
45
  def __init__(
34
46
  self,
File without changes