Minor and insignifigant changes (typos and alike) (#1218)

This commit is contained in:
Chris Caron 2025-03-24 20:49:03 -04:00 committed by GitHub
parent a196708a69
commit efd9d5cd67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 16 additions and 13 deletions

View File

@ -133,7 +133,7 @@ class NotifyBulkSMS(NotifyBase):
'target_group': { 'target_group': {
'name': _('Target Group'), 'name': _('Target Group'),
'type': 'string', 'type': 'string',
'prefix': '+', 'prefix': '@',
'regex': (r'^[A-Z0-9 _-]+$', 'i'), 'regex': (r'^[A-Z0-9 _-]+$', 'i'),
'map_to': 'targets', 'map_to': 'targets',
}, },

View File

@ -127,7 +127,7 @@ class NotifyNextcloudTalk(NotifyBase):
super().__init__(**kwargs) super().__init__(**kwargs)
if self.user is None or self.password is None: if self.user is None or self.password is None:
msg = 'User and password have to be specified.' msg = 'A NextCloudTalk User and Password must be specified.'
self.logger.warning(msg) self.logger.warning(msg)
raise TypeError(msg) raise TypeError(msg)

View File

@ -268,9 +268,7 @@ class NotifyTwitter(NotifyBase):
# and we failed to load any of them. Since it's also valid to # and we failed to load any of them. Since it's also valid to
# notify no one at all (which means we notify ourselves), it's # notify no one at all (which means we notify ourselves), it's
# important we don't switch from the users original intentions # important we don't switch from the users original intentions
msg = 'No Twitter targets to notify.' self.targets = None
self.logger.warning(msg)
raise TypeError(msg)
# Initialize our cache values # Initialize our cache values
self._whoami_cache = None self._whoami_cache = None
@ -284,6 +282,10 @@ class NotifyTwitter(NotifyBase):
Perform Twitter Notification Perform Twitter Notification
""" """
if self.targets is None:
self.logger.warning('No valid Twitter targets to notify.')
return False
# Build a list of our attachments # Build a list of our attachments
attachments = [] attachments = []
@ -815,7 +817,7 @@ class NotifyTwitter(NotifyBase):
params.update(self.url_parameters(privacy=privacy, *args, **kwargs)) params.update(self.url_parameters(privacy=privacy, *args, **kwargs))
return '{schema}://{ckey}/{csecret}/{akey}/{asecret}' \ return '{schema}://{ckey}/{csecret}/{akey}/{asecret}' \
'/{targets}/?{params}'.format( '/{targets}?{params}'.format(
schema=self.secure_protocol[0], schema=self.secure_protocol[0],
ckey=self.pprint(self.ckey, privacy, safe=''), ckey=self.pprint(self.ckey, privacy, safe=''),
csecret=self.pprint( csecret=self.pprint(
@ -825,7 +827,7 @@ class NotifyTwitter(NotifyBase):
self.asecret, privacy, mode=PrivacyMode.Secret, safe=''), self.asecret, privacy, mode=PrivacyMode.Secret, safe=''),
targets='/'.join( targets='/'.join(
[NotifyTwitter.quote('@{}'.format(target), safe='@') [NotifyTwitter.quote('@{}'.format(target), safe='@')
for target in self.targets]), for target in self.targets]) if self.targets else '',
params=NotifyTwitter.urlencode(params)) params=NotifyTwitter.urlencode(params))
def __len__(self): def __len__(self):

View File

@ -35,7 +35,6 @@ add-comments = false
domain = apprise domain = apprise
directory = apprise/i18n directory = apprise/i18n
statistics = true statistics = true
use-fuzzy = true
[init_catalog] [init_catalog]
domain = apprise domain = apprise

View File

@ -1402,7 +1402,7 @@ def test_plugin_matrix_transaction_ids_api_v3_no_cache(
# Instantiate our object # Instantiate our object
obj = Apprise.instantiate('matrix://user:pass@localhost/#general?v=3') obj = Apprise.instantiate('matrix://user:pass@localhost/#general?v=3')
# Ensure mode is flush # Ensure mode is memory
assert obj.store.mode == PersistentStoreMode.MEMORY assert obj.store.mode == PersistentStoreMode.MEMORY
# Performs a login # Performs a login

View File

@ -521,11 +521,13 @@ def test_plugin_twitter_edge_cases():
) )
# Invalid Target User # Invalid Target User
with pytest.raises(TypeError): obj = NotifyTwitter(
NotifyTwitter(
ckey='value', csecret='value', akey='value', asecret='value', ckey='value', csecret='value', akey='value', asecret='value',
targets='%G@rB@g3') targets='%G@rB@g3')
assert obj.notify(
body='body', title='title', notify_type=NotifyType.INFO) is False
def test_plugin_twitter_dm_caching( def test_plugin_twitter_dm_caching(
mocker, twitter_url, mocker, twitter_url,