26
26
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
27
# POSSIBILITY OF SUCH DAMAGE.
28
28
29
- # Chantify
29
+ # Chanify
30
30
# 1. Visit https://chanify.net/
31
31
32
32
# The API URL will look something like this:
41
41
from ..locale import gettext_lazy as _
42
42
43
43
44
- class NotifyChantify (NotifyBase ):
44
+ class NotifyChanify (NotifyBase ):
45
45
"""
46
- A wrapper for Chantify Notifications
46
+ A wrapper for Chanify Notifications
47
47
"""
48
48
49
49
# The default descriptive name associated with the Notification
50
- service_name = _ ('Chantify ' )
50
+ service_name = _ ('Chanify ' )
51
51
52
52
# The services URL
53
53
service_url = 'https://chanify.net/'
54
54
55
55
# The default secure protocol
56
- secure_protocol = 'chantify '
56
+ secure_protocol = 'chanify '
57
57
58
58
# A URL that takes you to the setup/help of the specific protocol
59
- setup_url = 'https://github.com/caronc/apprise/wiki/Notify_chantify '
59
+ setup_url = 'https://github.com/caronc/apprise/wiki/Notify_chanify '
60
60
61
61
# Notification URL
62
62
notify_url = 'https://api.chanify.net/v1/sender/{token}/'
@@ -91,14 +91,14 @@ class NotifyChantify(NotifyBase):
91
91
92
92
def __init__ (self , token , ** kwargs ):
93
93
"""
94
- Initialize Chantify Object
94
+ Initialize Chanify Object
95
95
"""
96
96
super ().__init__ (** kwargs )
97
97
98
98
self .token = validate_regex (
99
99
token , * self .template_tokens ['token' ]['regex' ])
100
100
if not self .token :
101
- msg = 'The Chantify token specified ({}) is invalid.' \
101
+ msg = 'The Chanify token specified ({}) is invalid.' \
102
102
.format (token )
103
103
self .logger .warning (msg )
104
104
raise TypeError (msg )
@@ -121,9 +121,9 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
121
121
'text' : body
122
122
}
123
123
124
- self .logger .debug ('Chantify GET URL: %s (cert_verify=%r)' % (
124
+ self .logger .debug ('Chanify GET URL: %s (cert_verify=%r)' % (
125
125
self .notify_url , self .verify_certificate ))
126
- self .logger .debug ('Chantify Payload: %s' % str (payload ))
126
+ self .logger .debug ('Chanify Payload: %s' % str (payload ))
127
127
128
128
# Always call throttle before any remote server i/o is made
129
129
self .throttle ()
@@ -139,10 +139,10 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
139
139
if r .status_code != requests .codes .ok :
140
140
# We had a problem
141
141
status_str = \
142
- NotifyChantify .http_response_code_lookup (r .status_code )
142
+ NotifyChanify .http_response_code_lookup (r .status_code )
143
143
144
144
self .logger .warning (
145
- 'Failed to send Chantify notification: '
145
+ 'Failed to send Chanify notification: '
146
146
'{}{}error={}.' .format (
147
147
status_str ,
148
148
', ' if status_str else '' ,
@@ -154,11 +154,11 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
154
154
return False
155
155
156
156
else :
157
- self .logger .info ('Sent Chantify notification.' )
157
+ self .logger .info ('Sent Chanify notification.' )
158
158
159
159
except requests .RequestException as e :
160
160
self .logger .warning (
161
- 'A Connection error occurred sending Chantify '
161
+ 'A Connection error occurred sending Chanify '
162
162
'notification.' )
163
163
self .logger .debug ('Socket Exception: %s' % str (e ))
164
164
@@ -178,7 +178,7 @@ def url(self, privacy=False, *args, **kwargs):
178
178
return '{schema}://{token}/?{params}' .format (
179
179
schema = self .secure_protocol ,
180
180
token = self .pprint (self .token , privacy , safe = '' ),
181
- params = NotifyChantify .urlencode (params ),
181
+ params = NotifyChanify .urlencode (params ),
182
182
)
183
183
184
184
@property
@@ -207,9 +207,9 @@ def parse_url(url):
207
207
208
208
# Allow over-ride
209
209
if 'token' in results ['qsd' ] and len (results ['qsd' ]['token' ]):
210
- results ['token' ] = NotifyChantify .unquote (results ['qsd' ]['token' ])
210
+ results ['token' ] = NotifyChanify .unquote (results ['qsd' ]['token' ])
211
211
212
212
else :
213
- results ['token' ] = NotifyChantify .unquote (results ['host' ])
213
+ results ['token' ] = NotifyChanify .unquote (results ['host' ])
214
214
215
215
return results
0 commit comments