Skip to content

Commit efd9d5c

Browse files
authored
Minor and insignifigant changes (typos and alike) (#1218)
1 parent a196708 commit efd9d5c

File tree

6 files changed

+16
-13
lines changed

6 files changed

+16
-13
lines changed

apprise/plugins/bulksms.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ class NotifyBulkSMS(NotifyBase):
133133
'target_group': {
134134
'name': _('Target Group'),
135135
'type': 'string',
136-
'prefix': '+',
136+
'prefix': '@',
137137
'regex': (r'^[A-Z0-9 _-]+$', 'i'),
138138
'map_to': 'targets',
139139
},

apprise/plugins/nextcloudtalk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def __init__(self, targets=None, headers=None, url_prefix=None, **kwargs):
127127
super().__init__(**kwargs)
128128

129129
if self.user is None or self.password is None:
130-
msg = 'User and password have to be specified.'
130+
msg = 'A NextCloudTalk User and Password must be specified.'
131131
self.logger.warning(msg)
132132
raise TypeError(msg)
133133

apprise/plugins/twitter.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,7 @@ def __init__(self, ckey, csecret, akey, asecret, targets=None,
268268
# and we failed to load any of them. Since it's also valid to
269269
# notify no one at all (which means we notify ourselves), it's
270270
# important we don't switch from the users original intentions
271-
msg = 'No Twitter targets to notify.'
272-
self.logger.warning(msg)
273-
raise TypeError(msg)
271+
self.targets = None
274272

275273
# Initialize our cache values
276274
self._whoami_cache = None
@@ -284,6 +282,10 @@ def send(self, body, title='', notify_type=NotifyType.INFO, attach=None,
284282
Perform Twitter Notification
285283
"""
286284

285+
if self.targets is None:
286+
self.logger.warning('No valid Twitter targets to notify.')
287+
return False
288+
287289
# Build a list of our attachments
288290
attachments = []
289291

@@ -815,7 +817,7 @@ def url(self, privacy=False, *args, **kwargs):
815817
params.update(self.url_parameters(privacy=privacy, *args, **kwargs))
816818

817819
return '{schema}://{ckey}/{csecret}/{akey}/{asecret}' \
818-
'/{targets}/?{params}'.format(
820+
'/{targets}?{params}'.format(
819821
schema=self.secure_protocol[0],
820822
ckey=self.pprint(self.ckey, privacy, safe=''),
821823
csecret=self.pprint(
@@ -825,7 +827,7 @@ def url(self, privacy=False, *args, **kwargs):
825827
self.asecret, privacy, mode=PrivacyMode.Secret, safe=''),
826828
targets='/'.join(
827829
[NotifyTwitter.quote('@{}'.format(target), safe='@')
828-
for target in self.targets]),
830+
for target in self.targets]) if self.targets else '',
829831
params=NotifyTwitter.urlencode(params))
830832

831833
def __len__(self):

setup.cfg

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ add-comments = false
3535
domain = apprise
3636
directory = apprise/i18n
3737
statistics = true
38-
use-fuzzy = true
3938

4039
[init_catalog]
4140
domain = apprise

test/test_plugin_matrix.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1402,7 +1402,7 @@ def test_plugin_matrix_transaction_ids_api_v3_no_cache(
14021402
# Instantiate our object
14031403
obj = Apprise.instantiate('matrix://user:pass@localhost/#general?v=3')
14041404

1405-
# Ensure mode is flush
1405+
# Ensure mode is memory
14061406
assert obj.store.mode == PersistentStoreMode.MEMORY
14071407

14081408
# Performs a login

test/test_plugin_twitter.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,12 @@ def test_plugin_twitter_edge_cases():
521521
)
522522

523523
# Invalid Target User
524-
with pytest.raises(TypeError):
525-
NotifyTwitter(
526-
ckey='value', csecret='value', akey='value', asecret='value',
527-
targets='%G@rB@g3')
524+
obj = NotifyTwitter(
525+
ckey='value', csecret='value', akey='value', asecret='value',
526+
targets='%G@rB@g3')
527+
528+
assert obj.notify(
529+
body='body', title='title', notify_type=NotifyType.INFO) is False
528530

529531

530532
def test_plugin_twitter_dm_caching(

0 commit comments

Comments
 (0)