mirror of https://github.com/caronc/apprise
Use `super()` instead of `super(__class__, self)` (#686)
Removes some further Python 2 intricicanties. It is `ruff` rule SPR001, taken from `flake8-super`. - https://github.com/charliermarsh/ruff#rules - https://pypi.org/project/flake8-super/ Implemented with: ruff --select SPR001 apprise test --fixpull/698/head
parent
44887e9c1d
commit
41b4ddb942
|
@ -67,7 +67,7 @@ class LazyTranslation:
|
|||
"""
|
||||
self.text = text
|
||||
|
||||
super(LazyTranslation, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def __str__(self):
|
||||
return gettext.gettext(self.text)
|
||||
|
|
|
@ -120,7 +120,7 @@ class AttachBase(URLBase):
|
|||
should be considered expired.
|
||||
"""
|
||||
|
||||
super(AttachBase, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if not mimetypes.inited:
|
||||
# Ensure mimetypes has been initialized
|
||||
|
|
|
@ -50,7 +50,7 @@ class AttachFile(AttachBase):
|
|||
Initialize Local File Attachment Object
|
||||
|
||||
"""
|
||||
super(AttachFile, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Store path but mark it dirty since we have not performed any
|
||||
# verification at this point.
|
||||
|
|
|
@ -61,7 +61,7 @@ class AttachHTTP(AttachBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(AttachHTTP, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.schema = 'https' if self.secure else 'http'
|
||||
|
||||
|
@ -254,7 +254,7 @@ class AttachHTTP(AttachBase):
|
|||
self._temp_file.close()
|
||||
self._temp_file = None
|
||||
|
||||
super(AttachHTTP, self).invalidate()
|
||||
super().invalidate()
|
||||
|
||||
def url(self, privacy=False, *args, **kwargs):
|
||||
"""
|
||||
|
|
|
@ -113,7 +113,7 @@ class ConfigBase(URLBase):
|
|||
these 'include' entries to be honored, this value must be set to True.
|
||||
"""
|
||||
|
||||
super(ConfigBase, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Tracks the time the content was last retrieved on. This place a role
|
||||
# for cases where we are not caching our response and are required to
|
||||
|
|
|
@ -53,7 +53,7 @@ class ConfigFile(ConfigBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(ConfigFile, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Store our file path as it was set
|
||||
self.path = os.path.abspath(os.path.expanduser(path))
|
||||
|
|
|
@ -75,7 +75,7 @@ class ConfigHTTP(ConfigBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(ConfigHTTP, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.schema = 'https' if self.secure else 'http'
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ class ConfigMemory(ConfigBase):
|
|||
Memory objects just store the raw configuration in memory. There is
|
||||
no external reference point. It's always considered cached.
|
||||
"""
|
||||
super(ConfigMemory, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Store our raw config into memory
|
||||
self.content = content
|
||||
|
|
|
@ -99,7 +99,7 @@ class HTMLConverter(HTMLParser, object):
|
|||
BLOCK_END = {}
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(HTMLConverter, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Shoudl we store the text content or not?
|
||||
self._do_store = True
|
||||
|
|
|
@ -134,7 +134,7 @@ class CustomNotifyPlugin(NotifyBase):
|
|||
|
||||
"""
|
||||
# init parent
|
||||
super(CustomNotifyPluginWrapper, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self._default_args = {}
|
||||
|
||||
|
|
|
@ -133,7 +133,7 @@ class NotifyAppriseAPI(NotifyBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(NotifyAppriseAPI, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.fullpath = kwargs.get('fullpath')
|
||||
if not isinstance(self.fullpath, str):
|
||||
|
|
|
@ -204,7 +204,7 @@ class NotifyBark(NotifyBase):
|
|||
"""
|
||||
Initialize Notify Bark Object
|
||||
"""
|
||||
super(NotifyBark, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Prepare our URL
|
||||
self.notify_url = '%s://%s%s/push' % (
|
||||
|
|
|
@ -180,7 +180,7 @@ class NotifyBase(BASE_OBJECT):
|
|||
|
||||
"""
|
||||
|
||||
super(NotifyBase, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if 'format' in kwargs:
|
||||
# Store the specified format if specified
|
||||
|
@ -423,7 +423,7 @@ class NotifyBase(BASE_OBJECT):
|
|||
'overflow': self.overflow_mode,
|
||||
}
|
||||
|
||||
params.update(super(NotifyBase, self).url_parameters(*args, **kwargs))
|
||||
params.update(super().url_parameters(*args, **kwargs))
|
||||
|
||||
# return default parameters
|
||||
return params
|
||||
|
|
|
@ -150,7 +150,7 @@ class NotifyBoxcar(NotifyBase):
|
|||
"""
|
||||
Initialize Boxcar Object
|
||||
"""
|
||||
super(NotifyBoxcar, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Initialize tag list
|
||||
self.tags = list()
|
||||
|
|
|
@ -132,7 +132,7 @@ class NotifyClickSend(NotifyBase):
|
|||
"""
|
||||
Initialize ClickSend Object
|
||||
"""
|
||||
super(NotifyClickSend, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Prepare Batch Mode Flag
|
||||
self.batch = batch
|
||||
|
|
|
@ -177,7 +177,7 @@ class NotifyD7Networks(NotifyBase):
|
|||
"""
|
||||
Initialize D7 Networks Object
|
||||
"""
|
||||
super(NotifyD7Networks, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The Priority of the message
|
||||
if priority not in D7NETWORK_SMS_PRIORITIES:
|
||||
|
|
|
@ -233,7 +233,7 @@ class NotifyDBus(NotifyBase):
|
|||
Initialize DBus Object
|
||||
"""
|
||||
|
||||
super(NotifyDBus, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Track our notifications
|
||||
self.registry = {}
|
||||
|
|
|
@ -179,7 +179,7 @@ class NotifyDapnet(NotifyBase):
|
|||
"""
|
||||
Initialize Dapnet Object
|
||||
"""
|
||||
super(NotifyDapnet, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Parse our targets
|
||||
self.targets = list()
|
||||
|
|
|
@ -124,7 +124,7 @@ class NotifyDingTalk(NotifyBase):
|
|||
"""
|
||||
Initialize DingTalk Object
|
||||
"""
|
||||
super(NotifyDingTalk, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Secret Key (associated with project)
|
||||
self.token = validate_regex(
|
||||
|
|
|
@ -164,7 +164,7 @@ class NotifyDiscord(NotifyBase):
|
|||
Initialize Discord Object
|
||||
|
||||
"""
|
||||
super(NotifyDiscord, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Webhook ID (associated with project)
|
||||
self.webhook_id = validate_regex(webhook_id)
|
||||
|
|
|
@ -419,7 +419,7 @@ class NotifyEmail(NotifyBase):
|
|||
The smtp_host and secure_mode can be automatically detected depending
|
||||
on how the URL was built
|
||||
"""
|
||||
super(NotifyEmail, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Handle SMTP vs SMTPS (Secure vs UnSecure)
|
||||
if not self.port:
|
||||
|
|
|
@ -117,7 +117,7 @@ class NotifyEmby(NotifyBase):
|
|||
Initialize Emby Object
|
||||
|
||||
"""
|
||||
super(NotifyEmby, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if self.secure:
|
||||
self.schema = 'https'
|
||||
|
|
|
@ -155,7 +155,7 @@ class NotifyEnigma2(NotifyBase):
|
|||
headers can be a dictionary of key/value pairs that you want to
|
||||
additionally include as part of the server headers to post with
|
||||
"""
|
||||
super(NotifyEnigma2, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
try:
|
||||
self.timeout = int(timeout)
|
||||
|
|
|
@ -218,7 +218,7 @@ class NotifyFCM(NotifyBase):
|
|||
Initialize Firebase Cloud Messaging
|
||||
|
||||
"""
|
||||
super(NotifyFCM, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if mode is None:
|
||||
# Detect our mode
|
||||
|
|
|
@ -84,7 +84,7 @@ class NotifyFaast(NotifyBase):
|
|||
"""
|
||||
Initialize Faast Object
|
||||
"""
|
||||
super(NotifyFaast, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Store the Authentication Token
|
||||
self.authtoken = validate_regex(authtoken)
|
||||
|
|
|
@ -145,7 +145,7 @@ class NotifyFlock(NotifyBase):
|
|||
"""
|
||||
Initialize Flock Object
|
||||
"""
|
||||
super(NotifyFlock, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Build ourselves a target list
|
||||
self.targets = list()
|
||||
|
|
|
@ -133,7 +133,7 @@ class NotifyForm(NotifyBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(NotifyForm, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.fullpath = kwargs.get('fullpath')
|
||||
if not isinstance(self.fullpath, str):
|
||||
|
|
|
@ -137,7 +137,7 @@ class NotifyGitter(NotifyBase):
|
|||
"""
|
||||
Initialize Gitter Object
|
||||
"""
|
||||
super(NotifyGitter, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Secret Key (associated with project)
|
||||
self.token = validate_regex(
|
||||
|
|
|
@ -164,7 +164,7 @@ class NotifyGnome(NotifyBase):
|
|||
Initialize Gnome Object
|
||||
"""
|
||||
|
||||
super(NotifyGnome, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The urgency of the message
|
||||
self.urgency = int(
|
||||
|
|
|
@ -138,7 +138,7 @@ class NotifyGoogleChat(NotifyBase):
|
|||
Initialize Google Chat Object
|
||||
|
||||
"""
|
||||
super(NotifyGoogleChat, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Workspace (associated with project)
|
||||
self.workspace = validate_regex(workspace)
|
||||
|
|
|
@ -155,7 +155,7 @@ class NotifyGotify(NotifyBase):
|
|||
Initialize Gotify Object
|
||||
|
||||
"""
|
||||
super(NotifyGotify, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Token (associated with project)
|
||||
self.token = validate_regex(token)
|
||||
|
|
|
@ -187,7 +187,7 @@ class NotifyGrowl(NotifyBase):
|
|||
"""
|
||||
Initialize Growl Object
|
||||
"""
|
||||
super(NotifyGrowl, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if not self.port:
|
||||
self.port = self.default_port
|
||||
|
|
|
@ -115,7 +115,7 @@ class NotifyHomeAssistant(NotifyBase):
|
|||
"""
|
||||
Initialize Home Assistant Object
|
||||
"""
|
||||
super(NotifyHomeAssistant, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.fullpath = kwargs.get('fullpath', '')
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ class NotifyIFTTT(NotifyBase):
|
|||
reference to Value1, Value2, and/or Value3
|
||||
|
||||
"""
|
||||
super(NotifyIFTTT, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Webhook ID (associated with project)
|
||||
self.webhook_id = validate_regex(webhook_id)
|
||||
|
|
|
@ -135,7 +135,7 @@ class NotifyJSON(NotifyBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(NotifyJSON, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.fullpath = kwargs.get('fullpath')
|
||||
if not isinstance(self.fullpath, str):
|
||||
|
|
|
@ -194,7 +194,7 @@ class NotifyJoin(NotifyBase):
|
|||
"""
|
||||
Initialize Join Object
|
||||
"""
|
||||
super(NotifyJoin, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Track whether or not we want to send an image with our notification
|
||||
# or not.
|
||||
|
|
|
@ -149,7 +149,7 @@ class NotifyKavenegar(NotifyBase):
|
|||
"""
|
||||
Initialize Kavenegar Object
|
||||
"""
|
||||
super(NotifyKavenegar, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -104,7 +104,7 @@ class NotifyKumulos(NotifyBase):
|
|||
"""
|
||||
Initialize Kumulos Object
|
||||
"""
|
||||
super(NotifyKumulos, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -467,7 +467,7 @@ class NotifyLametric(NotifyBase):
|
|||
"""
|
||||
Initialize LaMetric Object
|
||||
"""
|
||||
super(NotifyLametric, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.mode = mode.strip().lower() \
|
||||
if isinstance(mode, str) \
|
||||
|
|
|
@ -114,7 +114,7 @@ class NotifyLine(NotifyBase):
|
|||
"""
|
||||
Initialize Line Object
|
||||
"""
|
||||
super(NotifyLine, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Long-Lived Access token (generated from User Profile)
|
||||
self.token = validate_regex(token)
|
||||
|
|
|
@ -223,7 +223,7 @@ class NotifyMQTT(NotifyBase):
|
|||
Initialize MQTT Object
|
||||
"""
|
||||
|
||||
super(NotifyMQTT, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Initialize topics
|
||||
self.topics = parse_list(targets)
|
||||
|
|
|
@ -156,7 +156,7 @@ class NotifyMSG91(NotifyBase):
|
|||
"""
|
||||
Initialize MSG91 Object
|
||||
"""
|
||||
super(NotifyMSG91, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Authentication Key (associated with project)
|
||||
self.authkey = validate_regex(
|
||||
|
|
|
@ -214,7 +214,7 @@ class NotifyMSTeams(NotifyBase):
|
|||
template arguments that can not be over-ridden are:
|
||||
`body`, `title`, and `type`.
|
||||
"""
|
||||
super(NotifyMSTeams, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
try:
|
||||
self.version = int(version)
|
||||
|
|
|
@ -124,7 +124,7 @@ class NotifyMacOSX(NotifyBase):
|
|||
Initialize MacOSX Object
|
||||
"""
|
||||
|
||||
super(NotifyMacOSX, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Track whether or not we want to send an image with our notification
|
||||
# or not.
|
||||
|
|
|
@ -203,7 +203,7 @@ class NotifyMailgun(NotifyBase):
|
|||
"""
|
||||
Initialize Mailgun Object
|
||||
"""
|
||||
super(NotifyMailgun, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -239,7 +239,7 @@ class NotifyMatrix(NotifyBase):
|
|||
"""
|
||||
Initialize Matrix Object
|
||||
"""
|
||||
super(NotifyMatrix, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Prepare a list of rooms to connect and notify
|
||||
self.rooms = parse_list(targets)
|
||||
|
|
|
@ -145,7 +145,7 @@ class NotifyMattermost(NotifyBase):
|
|||
"""
|
||||
Initialize Mattermost Object
|
||||
"""
|
||||
super(NotifyMattermost, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if self.secure:
|
||||
self.schema = 'https'
|
||||
|
|
|
@ -115,7 +115,7 @@ class NotifyMessageBird(NotifyBase):
|
|||
"""
|
||||
Initialize MessageBird Object
|
||||
"""
|
||||
super(NotifyMessageBird, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -125,7 +125,7 @@ class NotifyNextcloud(NotifyBase):
|
|||
"""
|
||||
Initialize Nextcloud Object
|
||||
"""
|
||||
super(NotifyNextcloud, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.targets = parse_list(targets)
|
||||
if len(self.targets) == 0:
|
||||
|
|
|
@ -106,7 +106,7 @@ class NotifyNextcloudTalk(NotifyBase):
|
|||
"""
|
||||
Initialize Nextcloud Talk Object
|
||||
"""
|
||||
super(NotifyNextcloudTalk, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if self.user is None or self.password is None:
|
||||
msg = 'User and password have to be specified.'
|
||||
|
|
|
@ -160,7 +160,7 @@ class NotifyNotica(NotifyBase):
|
|||
"""
|
||||
Initialize Notica Object
|
||||
"""
|
||||
super(NotifyNotica, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Token (associated with project)
|
||||
self.token = validate_regex(token)
|
||||
|
|
|
@ -160,7 +160,7 @@ class NotifyNotifico(NotifyBase):
|
|||
"""
|
||||
Initialize Notifico Object
|
||||
"""
|
||||
super(NotifyNotifico, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Assign our message hook
|
||||
self.project_id = validate_regex(
|
||||
|
|
|
@ -242,7 +242,7 @@ class NotifyNtfy(NotifyBase):
|
|||
"""
|
||||
Initialize ntfy Object
|
||||
"""
|
||||
super(NotifyNtfy, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Prepare our mode
|
||||
self.mode = mode.strip().lower() \
|
||||
|
|
|
@ -173,7 +173,7 @@ class NotifyOffice365(NotifyBase):
|
|||
"""
|
||||
Initialize Office 365 Object
|
||||
"""
|
||||
super(NotifyOffice365, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Tenant identifier
|
||||
self.tenant = validate_regex(
|
||||
|
|
|
@ -178,7 +178,7 @@ class NotifyOneSignal(NotifyBase):
|
|||
Initialize OneSignal
|
||||
|
||||
"""
|
||||
super(NotifyOneSignal, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The apikey associated with the account
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -262,7 +262,7 @@ class NotifyOpsgenie(NotifyBase):
|
|||
"""
|
||||
Initialize Opsgenie Object
|
||||
"""
|
||||
super(NotifyOpsgenie, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -192,7 +192,7 @@ class NotifyPagerDuty(NotifyBase):
|
|||
"""
|
||||
Initialize Pager Duty Object
|
||||
"""
|
||||
super(NotifyPagerDuty, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Long-Lived Access token (generated from User Profile)
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -130,7 +130,7 @@ class NotifyParsePlatform(NotifyBase):
|
|||
"""
|
||||
Initialize Parse Platform Object
|
||||
"""
|
||||
super(NotifyParsePlatform, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.fullpath = kwargs.get('fullpath')
|
||||
if not isinstance(self.fullpath, str):
|
||||
|
|
|
@ -105,7 +105,7 @@ class NotifyPopcornNotify(NotifyBase):
|
|||
"""
|
||||
Initialize PopcornNotify Object
|
||||
"""
|
||||
super(NotifyPopcornNotify, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Access Token (associated with project)
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -143,7 +143,7 @@ class NotifyProwl(NotifyBase):
|
|||
"""
|
||||
Initialize Prowl Object
|
||||
"""
|
||||
super(NotifyProwl, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The Priority of the message
|
||||
self.priority = NotifyProwl.template_args['priority']['default'] \
|
||||
|
|
|
@ -115,7 +115,7 @@ class NotifyPushBullet(NotifyBase):
|
|||
"""
|
||||
Initialize PushBullet Object
|
||||
"""
|
||||
super(NotifyPushBullet, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Access Token (associated with project)
|
||||
self.accesstoken = validate_regex(accesstoken)
|
||||
|
|
|
@ -400,7 +400,7 @@ class NotifyPushSafer(NotifyBase):
|
|||
"""
|
||||
Initialize PushSafer Object
|
||||
"""
|
||||
super(NotifyPushSafer, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
#
|
||||
# Priority
|
||||
|
|
|
@ -120,7 +120,7 @@ class NotifyPushed(NotifyBase):
|
|||
Initialize Pushed Object
|
||||
|
||||
"""
|
||||
super(NotifyPushed, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Application Key (associated with project)
|
||||
self.app_key = validate_regex(app_key)
|
||||
|
|
|
@ -102,7 +102,7 @@ class NotifyPushjet(NotifyBase):
|
|||
"""
|
||||
Initialize Pushjet Object
|
||||
"""
|
||||
super(NotifyPushjet, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Secret Key (associated with project)
|
||||
self.secret_key = validate_regex(secret_key)
|
||||
|
|
|
@ -251,7 +251,7 @@ class NotifyPushover(NotifyBase):
|
|||
"""
|
||||
Initialize Pushover Object
|
||||
"""
|
||||
super(NotifyPushover, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Access Token (associated with project)
|
||||
self.token = validate_regex(token)
|
||||
|
|
|
@ -240,7 +240,7 @@ class NotifyReddit(NotifyBase):
|
|||
"""
|
||||
Initialize Notify Reddit Object
|
||||
"""
|
||||
super(NotifyReddit, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Initialize subreddit list
|
||||
self.subreddits = set()
|
||||
|
|
|
@ -188,7 +188,7 @@ class NotifyRocketChat(NotifyBase):
|
|||
"""
|
||||
Initialize Notify Rocket.Chat Object
|
||||
"""
|
||||
super(NotifyRocketChat, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Set our schema
|
||||
self.schema = 'https' if self.secure else 'http'
|
||||
|
|
|
@ -129,7 +129,7 @@ class NotifyRyver(NotifyBase):
|
|||
"""
|
||||
Initialize Ryver Object
|
||||
"""
|
||||
super(NotifyRyver, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Token (associated with project)
|
||||
self.token = validate_regex(
|
||||
|
|
|
@ -217,7 +217,7 @@ class NotifySES(NotifyBase):
|
|||
"""
|
||||
Initialize Notify AWS SES Object
|
||||
"""
|
||||
super(NotifySES, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Store our AWS API Access Key
|
||||
self.aws_access_key_id = validate_regex(access_key_id)
|
||||
|
|
|
@ -191,7 +191,7 @@ class NotifySMSEagle(NotifyBase):
|
|||
"""
|
||||
Initialize SMSEagle Object
|
||||
"""
|
||||
super(NotifySMSEagle, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Prepare Flash Mode Flag
|
||||
self.flash = flash
|
||||
|
|
|
@ -159,7 +159,7 @@ class NotifySMTP2Go(NotifyBase):
|
|||
"""
|
||||
Initialize SMTP2Go Object
|
||||
"""
|
||||
super(NotifySMTP2Go, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -159,7 +159,7 @@ class NotifySNS(NotifyBase):
|
|||
"""
|
||||
Initialize Notify AWS SNS Object
|
||||
"""
|
||||
super(NotifySNS, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Store our AWS API Access Key
|
||||
self.aws_access_key_id = validate_regex(access_key_id)
|
||||
|
|
|
@ -159,7 +159,7 @@ class NotifySendGrid(NotifyBase):
|
|||
"""
|
||||
Initialize Notify SendGrid Object
|
||||
"""
|
||||
super(NotifySendGrid, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -79,7 +79,7 @@ class NotifyServerChan(NotifyBase):
|
|||
"""
|
||||
Initialize ServerChan Object
|
||||
"""
|
||||
super(NotifyServerChan, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Token (associated with project)
|
||||
self.token = validate_regex(
|
||||
|
|
|
@ -157,7 +157,7 @@ class NotifySignalAPI(NotifyBase):
|
|||
"""
|
||||
Initialize SignalAPI Object
|
||||
"""
|
||||
super(NotifySignalAPI, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Prepare Batch Mode Flag
|
||||
self.batch = batch
|
||||
|
|
|
@ -125,7 +125,7 @@ class NotifySimplePush(NotifyBase):
|
|||
"""
|
||||
Initialize SimplePush Object
|
||||
"""
|
||||
super(NotifySimplePush, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -169,7 +169,7 @@ class NotifySinch(NotifyBase):
|
|||
"""
|
||||
Initialize Sinch Object
|
||||
"""
|
||||
super(NotifySinch, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The Account SID associated with the account
|
||||
self.service_plan_id = validate_regex(
|
||||
|
|
|
@ -278,7 +278,7 @@ class NotifySlack(NotifyBase):
|
|||
"""
|
||||
Initialize Slack Object
|
||||
"""
|
||||
super(NotifySlack, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Setup our mode
|
||||
self.mode = SlackMode.BOT if access_token else SlackMode.WEBHOOK
|
||||
|
|
|
@ -224,7 +224,7 @@ class NotifySparkPost(NotifyBase):
|
|||
"""
|
||||
Initialize SparkPost Object
|
||||
"""
|
||||
super(NotifySparkPost, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(apikey)
|
||||
|
|
|
@ -148,7 +148,7 @@ class NotifySpontit(NotifyBase):
|
|||
"""
|
||||
Initialize Spontit Object
|
||||
"""
|
||||
super(NotifySpontit, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# User ID (associated with project)
|
||||
user = validate_regex(
|
||||
|
|
|
@ -183,7 +183,7 @@ class NotifyStreamlabs(NotifyBase):
|
|||
Initialize Streamlabs Object
|
||||
|
||||
"""
|
||||
super(NotifyStreamlabs, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# access token is generated by user
|
||||
# using https://streamlabs.com/api/v1.0/token
|
||||
|
|
|
@ -199,7 +199,7 @@ class NotifySyslog(NotifyBase):
|
|||
"""
|
||||
Initialize Syslog Object
|
||||
"""
|
||||
super(NotifySyslog, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
if facility:
|
||||
try:
|
||||
|
|
|
@ -104,7 +104,7 @@ class NotifyTechulusPush(NotifyBase):
|
|||
"""
|
||||
Initialize Techulus Push Object
|
||||
"""
|
||||
super(NotifyTechulusPush, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The apikey associated with the account
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -315,7 +315,7 @@ class NotifyTelegram(NotifyBase):
|
|||
"""
|
||||
Initialize Telegram Object
|
||||
"""
|
||||
super(NotifyTelegram, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.bot_token = validate_regex(
|
||||
bot_token, *self.template_tokens['bot_token']['regex'],
|
||||
|
|
|
@ -163,7 +163,7 @@ class NotifyTwilio(NotifyBase):
|
|||
"""
|
||||
Initialize Twilio Object
|
||||
"""
|
||||
super(NotifyTwilio, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The Account SID associated with the account
|
||||
self.account_sid = validate_regex(
|
||||
|
|
|
@ -131,7 +131,7 @@ class NotifyTwist(NotifyBase):
|
|||
"""
|
||||
Initialize Notify Twist Object
|
||||
"""
|
||||
super(NotifyTwist, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Initialize channels list
|
||||
self.channels = set()
|
||||
|
|
|
@ -194,7 +194,7 @@ class NotifyTwitter(NotifyBase):
|
|||
Initialize Twitter Object
|
||||
|
||||
"""
|
||||
super(NotifyTwitter, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.ckey = validate_regex(ckey)
|
||||
if not self.ckey:
|
||||
|
|
|
@ -142,7 +142,7 @@ class NotifyVonage(NotifyBase):
|
|||
"""
|
||||
Initialize Vonage Object
|
||||
"""
|
||||
super(NotifyVonage, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# API Key (associated with project)
|
||||
self.apikey = validate_regex(
|
||||
|
|
|
@ -125,7 +125,7 @@ class NotifyWebexTeams(NotifyBase):
|
|||
"""
|
||||
Initialize Webex Teams Object
|
||||
"""
|
||||
super(NotifyWebexTeams, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# The token associated with the account
|
||||
self.token = validate_regex(
|
||||
|
|
|
@ -113,7 +113,7 @@ class NotifyWindows(NotifyBase):
|
|||
Initialize Windows Object
|
||||
"""
|
||||
|
||||
super(NotifyWindows, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Number of seconds to display notification for
|
||||
self.duration = self.default_popup_duration_sec \
|
||||
|
|
|
@ -131,7 +131,7 @@ class NotifyXBMC(NotifyBase):
|
|||
"""
|
||||
Initialize XBMC/KODI Object
|
||||
"""
|
||||
super(NotifyXBMC, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# Number of seconds to display notification for
|
||||
self.duration = self.template_args['duration']['default'] \
|
||||
|
|
|
@ -140,7 +140,7 @@ class NotifyXML(NotifyBase):
|
|||
additionally include as part of the server headers to post with
|
||||
|
||||
"""
|
||||
super(NotifyXML, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
self.payload = """<?xml version='1.0' encoding='utf-8'?>
|
||||
<soapenv:Envelope
|
||||
|
|
|
@ -172,7 +172,7 @@ class NotifyZulip(NotifyBase):
|
|||
"""
|
||||
Initialize Zulip Object
|
||||
"""
|
||||
super(NotifyZulip, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# our default hostname
|
||||
self.hostname = self.default_hostname
|
||||
|
|
|
@ -180,7 +180,7 @@ def apprise_test(do_notify):
|
|||
|
||||
class BadNotification(NotifyBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(BadNotification, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# We fail whenever we're initialized
|
||||
raise TypeError()
|
||||
|
@ -196,7 +196,7 @@ def apprise_test(do_notify):
|
|||
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(GoodNotification, self).__init__(
|
||||
super().__init__(
|
||||
notify_format=NotifyFormat.HTML, **kwargs)
|
||||
|
||||
def url(self, **kwargs):
|
||||
|
@ -736,7 +736,7 @@ def test_apprise_notify_formats(tmpdir):
|
|||
notify_format = NotifyFormat.TEXT
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(TextNotification, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
def notify(self, **kwargs):
|
||||
# Pretend everything is okay
|
||||
|
@ -752,7 +752,7 @@ def test_apprise_notify_formats(tmpdir):
|
|||
notify_format = NotifyFormat.HTML
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(HtmlNotification, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
def notify(self, **kwargs):
|
||||
# Pretend everything is okay
|
||||
|
@ -768,7 +768,7 @@ def test_apprise_notify_formats(tmpdir):
|
|||
notify_format = NotifyFormat.MARKDOWN
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(MarkDownNotification, self).__init__()
|
||||
super().__init__()
|
||||
|
||||
def notify(self, **kwargs):
|
||||
# Pretend everything is okay
|
||||
|
@ -990,7 +990,7 @@ def test_apprise_disabled_plugins():
|
|||
service_name = 'na02'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(TestDisabled02Notification, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# enable state changes **AFTER** we initialize
|
||||
self.enabled = False
|
||||
|
|
|
@ -269,7 +269,7 @@ def test_apprise_attachment_instantiate():
|
|||
|
||||
class BadAttachType(AttachBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(BadAttachType, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# We fail whenever we're initialized
|
||||
raise TypeError()
|
||||
|
|
|
@ -233,7 +233,7 @@ def test_apprise_multi_config_entries(tmpdir):
|
|||
# Define our good:// url
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(GoodNotification, self).__init__(
|
||||
super().__init__(
|
||||
notify_format=NotifyFormat.HTML, **kwargs)
|
||||
|
||||
def notify(self, **kwargs):
|
||||
|
@ -454,7 +454,7 @@ def test_apprise_config_instantiate():
|
|||
allow_cross_includes = ContentIncludeMode.ALWAYS
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(BadConfig, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# We fail whenever we're initialized
|
||||
raise TypeError()
|
||||
|
@ -487,7 +487,7 @@ def test_invalid_apprise_config(tmpdir):
|
|||
allow_cross_includes = ContentIncludeMode.ALWAYS
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(BadConfig, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# We intentionally fail whenever we're initialized
|
||||
raise TypeError()
|
||||
|
@ -551,7 +551,7 @@ def test_apprise_config_with_apprise_obj(tmpdir):
|
|||
# Define our good:// url
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(GoodNotification, self).__init__(
|
||||
super().__init__(
|
||||
notify_format=NotifyFormat.HTML, **kwargs)
|
||||
|
||||
def notify(self, **kwargs):
|
||||
|
|
|
@ -48,7 +48,7 @@ def test_apprise_asyncio_runtime_error():
|
|||
"""
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(GoodNotification, self).__init__(
|
||||
super().__init__(
|
||||
notify_format=NotifyFormat.HTML, **kwargs)
|
||||
|
||||
def url(self, **kwargs):
|
||||
|
@ -119,7 +119,7 @@ def test_apprise_works_in_async_loop():
|
|||
"""
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, **kwargs):
|
||||
super(GoodNotification, self).__init__(
|
||||
super().__init__(
|
||||
notify_format=NotifyFormat.HTML, **kwargs)
|
||||
|
||||
def url(self, **kwargs):
|
||||
|
|
|
@ -117,7 +117,7 @@ def test_attach_http(mock_get):
|
|||
# Define our good:// url
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(GoodNotification, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def notify(self, *args, **kwargs):
|
||||
# Pretend everything is okay
|
||||
|
|
|
@ -57,7 +57,7 @@ def test_apprise_cli_nux_env(tmpdir):
|
|||
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(GoodNotification, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def notify(self, **kwargs):
|
||||
# Pretend everything is okay
|
||||
|
@ -69,7 +69,7 @@ def test_apprise_cli_nux_env(tmpdir):
|
|||
|
||||
class BadNotification(NotifyBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(BadNotification, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def notify(self, **kwargs):
|
||||
# Force a notification failure
|
||||
|
@ -770,7 +770,7 @@ def test_apprise_cli_details(tmpdir):
|
|||
service_name = 'na02'
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(TestDisabled02Notification, self).__init__(**kwargs)
|
||||
super().__init__(**kwargs)
|
||||
|
||||
# enable state changes **AFTER** we initialize
|
||||
self.enabled = False
|
||||
|
|
|
@ -63,7 +63,7 @@ def test_config_http(mock_post):
|
|||
# Define our good:// url
|
||||
class GoodNotification(NotifyBase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(GoodNotification, self).__init__(*args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
def notify(self, *args, **kwargs):
|
||||
# Pretend everything is okay
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue