Skip to content

Commit f892936

Browse files
authored
Resolved chanify:// naming confusion (#1266)
1 parent 0a9f338 commit f892936

File tree

5 files changed

+36
-36
lines changed

5 files changed

+36
-36
lines changed

KEYWORDS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ AWS
66
BulkSMS
77
BulkVS
88
Burst SMS
9-
Chantify
9+
Chanify
1010
Chat
1111
CLI
1212
ClickSend

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ The table below identifies the services this tool supports and some example serv
6161
| [Apprise API](https://github.com/caronc/apprise/wiki/Notify_apprise_api) | apprise:// or apprises:// | (TCP) 80 or 443 | apprise://hostname/Token
6262
| [AWS SES](https://github.com/caronc/apprise/wiki/Notify_ses) | ses:// | (TCP) 443 | ses://user@domain/AccessKeyID/AccessSecretKey/RegionName<br/>ses://user@domain/AccessKeyID/AccessSecretKey/RegionName/email1/email2/emailN
6363
| [Bark](https://github.com/caronc/apprise/wiki/Notify_bark) | bark:// | (TCP) 80 or 443 | bark://hostname<br />bark://hostname/device_key<br />bark://hostname/device_key1/device_key2/device_keyN<br/>barks://hostname<br />barks://hostname/device_key<br />barks://hostname/device_key1/device_key2/device_keyN
64-
| [Chantify](https://github.com/caronc/apprise/wiki/Notify_chantify) | chantify:// | (TCP) 443 | chantify://token
64+
| [Chanify](https://github.com/caronc/apprise/wiki/Notify_chanify) | chantify:// | (TCP) 443 | chantify://token
6565
| [Discord](https://github.com/caronc/apprise/wiki/Notify_discord) | discord:// | (TCP) 443 | discord://webhook_id/webhook_token<br />discord://avatar@webhook_id/webhook_token
6666
| [Emby](https://github.com/caronc/apprise/wiki/Notify_emby) | emby:// or embys:// | (TCP) 8096 | emby://user@hostname/<br />emby://user:password@hostname
6767
| [Enigma2](https://github.com/caronc/apprise/wiki/Notify_enigma2) | enigma2:// or enigma2s:// | (TCP) 80 or 443 | enigma2://hostname

apprise/plugins/chantify.py renamed to apprise/plugins/chanify.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
2727
# POSSIBILITY OF SUCH DAMAGE.
2828

29-
# Chantify
29+
# Chanify
3030
# 1. Visit https://chanify.net/
3131

3232
# The API URL will look something like this:
@@ -41,22 +41,22 @@
4141
from ..locale import gettext_lazy as _
4242

4343

44-
class NotifyChantify(NotifyBase):
44+
class NotifyChanify(NotifyBase):
4545
"""
46-
A wrapper for Chantify Notifications
46+
A wrapper for Chanify Notifications
4747
"""
4848

4949
# The default descriptive name associated with the Notification
50-
service_name = _('Chantify')
50+
service_name = _('Chanify')
5151

5252
# The services URL
5353
service_url = 'https://chanify.net/'
5454

5555
# The default secure protocol
56-
secure_protocol = 'chantify'
56+
secure_protocol = 'chanify'
5757

5858
# 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'
6060

6161
# Notification URL
6262
notify_url = 'https://api.chanify.net/v1/sender/{token}/'
@@ -91,14 +91,14 @@ class NotifyChantify(NotifyBase):
9191

9292
def __init__(self, token, **kwargs):
9393
"""
94-
Initialize Chantify Object
94+
Initialize Chanify Object
9595
"""
9696
super().__init__(**kwargs)
9797

9898
self.token = validate_regex(
9999
token, *self.template_tokens['token']['regex'])
100100
if not self.token:
101-
msg = 'The Chantify token specified ({}) is invalid.'\
101+
msg = 'The Chanify token specified ({}) is invalid.'\
102102
.format(token)
103103
self.logger.warning(msg)
104104
raise TypeError(msg)
@@ -121,9 +121,9 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
121121
'text': body
122122
}
123123

124-
self.logger.debug('Chantify GET URL: %s (cert_verify=%r)' % (
124+
self.logger.debug('Chanify GET URL: %s (cert_verify=%r)' % (
125125
self.notify_url, self.verify_certificate))
126-
self.logger.debug('Chantify Payload: %s' % str(payload))
126+
self.logger.debug('Chanify Payload: %s' % str(payload))
127127

128128
# Always call throttle before any remote server i/o is made
129129
self.throttle()
@@ -139,10 +139,10 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
139139
if r.status_code != requests.codes.ok:
140140
# We had a problem
141141
status_str = \
142-
NotifyChantify.http_response_code_lookup(r.status_code)
142+
NotifyChanify.http_response_code_lookup(r.status_code)
143143

144144
self.logger.warning(
145-
'Failed to send Chantify notification: '
145+
'Failed to send Chanify notification: '
146146
'{}{}error={}.'.format(
147147
status_str,
148148
', ' if status_str else '',
@@ -154,11 +154,11 @@ def send(self, body, title='', notify_type=NotifyType.INFO, **kwargs):
154154
return False
155155

156156
else:
157-
self.logger.info('Sent Chantify notification.')
157+
self.logger.info('Sent Chanify notification.')
158158

159159
except requests.RequestException as e:
160160
self.logger.warning(
161-
'A Connection error occurred sending Chantify '
161+
'A Connection error occurred sending Chanify '
162162
'notification.')
163163
self.logger.debug('Socket Exception: %s' % str(e))
164164

@@ -178,7 +178,7 @@ def url(self, privacy=False, *args, **kwargs):
178178
return '{schema}://{token}/?{params}'.format(
179179
schema=self.secure_protocol,
180180
token=self.pprint(self.token, privacy, safe=''),
181-
params=NotifyChantify.urlencode(params),
181+
params=NotifyChanify.urlencode(params),
182182
)
183183

184184
@property
@@ -207,9 +207,9 @@ def parse_url(url):
207207

208208
# Allow over-ride
209209
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'])
211211

212212
else:
213-
results['token'] = NotifyChantify.unquote(results['host'])
213+
results['token'] = NotifyChanify.unquote(results['host'])
214214

215215
return results

packaging/redhat/python-apprise.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ notification services that are out there. Apprise opens the door and makes
4040
it easy to access:
4141

4242
Africas Talking, Apprise API, APRS, AWS SES, AWS SNS, Bark, Burst SMS,
43-
BulkSMS, BulkVS, Chantify, ClickSend, DAPNET, DingTalk, Discord, E-Mail, Emby,
43+
BulkSMS, BulkVS, Chanify, ClickSend, DAPNET, DingTalk, Discord, E-Mail, Emby,
4444
FCM, Feishu, Flock, Free Mobile, Google Chat, Gotify, Growl, Guilded, Home
4545
Assistant, httpSMS, IFTTT, Join, Kavenegar, KODI, Kumulos, LaMetric, Line,
4646
LunaSea, MacOSX, Mailgun, Mastodon, Mattermost,Matrix, MessageBird, Microsoft

test/test_plugin_chantify.py renamed to test/test_plugin_chanify.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
import requests
3030

31-
from apprise.plugins.chantify import NotifyChantify
31+
from apprise.plugins.chanify import NotifyChanify
3232
from helpers import AppriseURLTester
3333

3434
# Disable logging for a cleaner testing output
@@ -37,47 +37,47 @@
3737

3838
# Our Testing URLs
3939
apprise_url_tests = (
40-
('chantify://', {
40+
('chanify://', {
4141
'instance': TypeError,
4242
}),
43-
('chantify://:@/', {
43+
('chanify://:@/', {
4444
'instance': TypeError,
4545
}),
46-
('chantify://%badtoken%', {
46+
('chanify://%badtoken%', {
4747
'instance': TypeError,
4848
}),
49-
('chantify://abc123', {
49+
('chanify://abc123', {
5050
# Test token
51-
'instance': NotifyChantify,
51+
'instance': NotifyChanify,
5252
}),
53-
('chantify://?token=abc123', {
53+
('chanify://?token=abc123', {
5454
# Test token
55-
'instance': NotifyChantify,
55+
'instance': NotifyChanify,
5656
}),
57-
('chantify://token', {
58-
'instance': NotifyChantify,
57+
('chanify://token', {
58+
'instance': NotifyChanify,
5959
# force a failure
6060
'response': False,
6161
'requests_response_code': requests.codes.internal_server_error,
6262
}),
63-
('chantify://token', {
64-
'instance': NotifyChantify,
63+
('chanify://token', {
64+
'instance': NotifyChanify,
6565
# throw a bizzare code forcing us to fail to look it up
6666
'response': False,
6767
'requests_response_code': 999,
6868
}),
69-
('chantify://token', {
70-
'instance': NotifyChantify,
69+
('chanify://token', {
70+
'instance': NotifyChanify,
7171
# Throws a series of connection and transfer exceptions when this flag
7272
# is set and tests that we gracfully handle them
7373
'test_requests_exceptions': True,
7474
}),
7575
)
7676

7777

78-
def test_plugin_chantify_urls():
78+
def test_plugin_chanify_urls():
7979
"""
80-
NotifyChantify() Apprise URLs
80+
NotifyChanify() Apprise URLs
8181
8282
"""
8383

0 commit comments

Comments
 (0)