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 --fix
pull/698/head
Andreas Motl 2022-10-09 16:00:24 +02:00 committed by GitHub
parent 44887e9c1d
commit 41b4ddb942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
101 changed files with 122 additions and 122 deletions

View File

@ -67,7 +67,7 @@ class LazyTranslation:
""" """
self.text = text self.text = text
super(LazyTranslation, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def __str__(self): def __str__(self):
return gettext.gettext(self.text) return gettext.gettext(self.text)

View File

@ -120,7 +120,7 @@ class AttachBase(URLBase):
should be considered expired. should be considered expired.
""" """
super(AttachBase, self).__init__(**kwargs) super().__init__(**kwargs)
if not mimetypes.inited: if not mimetypes.inited:
# Ensure mimetypes has been initialized # Ensure mimetypes has been initialized

View File

@ -50,7 +50,7 @@ class AttachFile(AttachBase):
Initialize Local File Attachment Object 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 # Store path but mark it dirty since we have not performed any
# verification at this point. # verification at this point.

View File

@ -61,7 +61,7 @@ class AttachHTTP(AttachBase):
additionally include as part of the server headers to post with 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' self.schema = 'https' if self.secure else 'http'
@ -254,7 +254,7 @@ class AttachHTTP(AttachBase):
self._temp_file.close() self._temp_file.close()
self._temp_file = None self._temp_file = None
super(AttachHTTP, self).invalidate() super().invalidate()
def url(self, privacy=False, *args, **kwargs): def url(self, privacy=False, *args, **kwargs):
""" """

View File

@ -113,7 +113,7 @@ class ConfigBase(URLBase):
these 'include' entries to be honored, this value must be set to True. 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 # 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 # for cases where we are not caching our response and are required to

View File

@ -53,7 +53,7 @@ class ConfigFile(ConfigBase):
additionally include as part of the server headers to post with 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 # Store our file path as it was set
self.path = os.path.abspath(os.path.expanduser(path)) self.path = os.path.abspath(os.path.expanduser(path))

View File

@ -75,7 +75,7 @@ class ConfigHTTP(ConfigBase):
additionally include as part of the server headers to post with 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' self.schema = 'https' if self.secure else 'http'

View File

@ -46,7 +46,7 @@ class ConfigMemory(ConfigBase):
Memory objects just store the raw configuration in memory. There is Memory objects just store the raw configuration in memory. There is
no external reference point. It's always considered cached. no external reference point. It's always considered cached.
""" """
super(ConfigMemory, self).__init__(**kwargs) super().__init__(**kwargs)
# Store our raw config into memory # Store our raw config into memory
self.content = content self.content = content

View File

@ -99,7 +99,7 @@ class HTMLConverter(HTMLParser, object):
BLOCK_END = {} BLOCK_END = {}
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(HTMLConverter, self).__init__(**kwargs) super().__init__(**kwargs)
# Shoudl we store the text content or not? # Shoudl we store the text content or not?
self._do_store = True self._do_store = True

View File

@ -134,7 +134,7 @@ class CustomNotifyPlugin(NotifyBase):
""" """
# init parent # init parent
super(CustomNotifyPluginWrapper, self).__init__(**kwargs) super().__init__(**kwargs)
self._default_args = {} self._default_args = {}

View File

@ -133,7 +133,7 @@ class NotifyAppriseAPI(NotifyBase):
additionally include as part of the server headers to post with additionally include as part of the server headers to post with
""" """
super(NotifyAppriseAPI, self).__init__(**kwargs) super().__init__(**kwargs)
self.fullpath = kwargs.get('fullpath') self.fullpath = kwargs.get('fullpath')
if not isinstance(self.fullpath, str): if not isinstance(self.fullpath, str):

View File

@ -204,7 +204,7 @@ class NotifyBark(NotifyBase):
""" """
Initialize Notify Bark Object Initialize Notify Bark Object
""" """
super(NotifyBark, self).__init__(**kwargs) super().__init__(**kwargs)
# Prepare our URL # Prepare our URL
self.notify_url = '%s://%s%s/push' % ( self.notify_url = '%s://%s%s/push' % (

View File

@ -180,7 +180,7 @@ class NotifyBase(BASE_OBJECT):
""" """
super(NotifyBase, self).__init__(**kwargs) super().__init__(**kwargs)
if 'format' in kwargs: if 'format' in kwargs:
# Store the specified format if specified # Store the specified format if specified
@ -423,7 +423,7 @@ class NotifyBase(BASE_OBJECT):
'overflow': self.overflow_mode, 'overflow': self.overflow_mode,
} }
params.update(super(NotifyBase, self).url_parameters(*args, **kwargs)) params.update(super().url_parameters(*args, **kwargs))
# return default parameters # return default parameters
return params return params

View File

@ -150,7 +150,7 @@ class NotifyBoxcar(NotifyBase):
""" """
Initialize Boxcar Object Initialize Boxcar Object
""" """
super(NotifyBoxcar, self).__init__(**kwargs) super().__init__(**kwargs)
# Initialize tag list # Initialize tag list
self.tags = list() self.tags = list()

View File

@ -132,7 +132,7 @@ class NotifyClickSend(NotifyBase):
""" """
Initialize ClickSend Object Initialize ClickSend Object
""" """
super(NotifyClickSend, self).__init__(**kwargs) super().__init__(**kwargs)
# Prepare Batch Mode Flag # Prepare Batch Mode Flag
self.batch = batch self.batch = batch

View File

@ -177,7 +177,7 @@ class NotifyD7Networks(NotifyBase):
""" """
Initialize D7 Networks Object Initialize D7 Networks Object
""" """
super(NotifyD7Networks, self).__init__(**kwargs) super().__init__(**kwargs)
# The Priority of the message # The Priority of the message
if priority not in D7NETWORK_SMS_PRIORITIES: if priority not in D7NETWORK_SMS_PRIORITIES:

View File

@ -233,7 +233,7 @@ class NotifyDBus(NotifyBase):
Initialize DBus Object Initialize DBus Object
""" """
super(NotifyDBus, self).__init__(**kwargs) super().__init__(**kwargs)
# Track our notifications # Track our notifications
self.registry = {} self.registry = {}

View File

@ -179,7 +179,7 @@ class NotifyDapnet(NotifyBase):
""" """
Initialize Dapnet Object Initialize Dapnet Object
""" """
super(NotifyDapnet, self).__init__(**kwargs) super().__init__(**kwargs)
# Parse our targets # Parse our targets
self.targets = list() self.targets = list()

View File

@ -124,7 +124,7 @@ class NotifyDingTalk(NotifyBase):
""" """
Initialize DingTalk Object Initialize DingTalk Object
""" """
super(NotifyDingTalk, self).__init__(**kwargs) super().__init__(**kwargs)
# Secret Key (associated with project) # Secret Key (associated with project)
self.token = validate_regex( self.token = validate_regex(

View File

@ -164,7 +164,7 @@ class NotifyDiscord(NotifyBase):
Initialize Discord Object Initialize Discord Object
""" """
super(NotifyDiscord, self).__init__(**kwargs) super().__init__(**kwargs)
# Webhook ID (associated with project) # Webhook ID (associated with project)
self.webhook_id = validate_regex(webhook_id) self.webhook_id = validate_regex(webhook_id)

View File

@ -419,7 +419,7 @@ class NotifyEmail(NotifyBase):
The smtp_host and secure_mode can be automatically detected depending The smtp_host and secure_mode can be automatically detected depending
on how the URL was built on how the URL was built
""" """
super(NotifyEmail, self).__init__(**kwargs) super().__init__(**kwargs)
# Handle SMTP vs SMTPS (Secure vs UnSecure) # Handle SMTP vs SMTPS (Secure vs UnSecure)
if not self.port: if not self.port:

View File

@ -117,7 +117,7 @@ class NotifyEmby(NotifyBase):
Initialize Emby Object Initialize Emby Object
""" """
super(NotifyEmby, self).__init__(**kwargs) super().__init__(**kwargs)
if self.secure: if self.secure:
self.schema = 'https' self.schema = 'https'

View File

@ -155,7 +155,7 @@ class NotifyEnigma2(NotifyBase):
headers can be a dictionary of key/value pairs that you want to headers can be a dictionary of key/value pairs that you want to
additionally include as part of the server headers to post with additionally include as part of the server headers to post with
""" """
super(NotifyEnigma2, self).__init__(**kwargs) super().__init__(**kwargs)
try: try:
self.timeout = int(timeout) self.timeout = int(timeout)

View File

@ -218,7 +218,7 @@ class NotifyFCM(NotifyBase):
Initialize Firebase Cloud Messaging Initialize Firebase Cloud Messaging
""" """
super(NotifyFCM, self).__init__(**kwargs) super().__init__(**kwargs)
if mode is None: if mode is None:
# Detect our mode # Detect our mode

View File

@ -84,7 +84,7 @@ class NotifyFaast(NotifyBase):
""" """
Initialize Faast Object Initialize Faast Object
""" """
super(NotifyFaast, self).__init__(**kwargs) super().__init__(**kwargs)
# Store the Authentication Token # Store the Authentication Token
self.authtoken = validate_regex(authtoken) self.authtoken = validate_regex(authtoken)

View File

@ -145,7 +145,7 @@ class NotifyFlock(NotifyBase):
""" """
Initialize Flock Object Initialize Flock Object
""" """
super(NotifyFlock, self).__init__(**kwargs) super().__init__(**kwargs)
# Build ourselves a target list # Build ourselves a target list
self.targets = list() self.targets = list()

View File

@ -133,7 +133,7 @@ class NotifyForm(NotifyBase):
additionally include as part of the server headers to post with additionally include as part of the server headers to post with
""" """
super(NotifyForm, self).__init__(**kwargs) super().__init__(**kwargs)
self.fullpath = kwargs.get('fullpath') self.fullpath = kwargs.get('fullpath')
if not isinstance(self.fullpath, str): if not isinstance(self.fullpath, str):

View File

@ -137,7 +137,7 @@ class NotifyGitter(NotifyBase):
""" """
Initialize Gitter Object Initialize Gitter Object
""" """
super(NotifyGitter, self).__init__(**kwargs) super().__init__(**kwargs)
# Secret Key (associated with project) # Secret Key (associated with project)
self.token = validate_regex( self.token = validate_regex(

View File

@ -164,7 +164,7 @@ class NotifyGnome(NotifyBase):
Initialize Gnome Object Initialize Gnome Object
""" """
super(NotifyGnome, self).__init__(**kwargs) super().__init__(**kwargs)
# The urgency of the message # The urgency of the message
self.urgency = int( self.urgency = int(

View File

@ -138,7 +138,7 @@ class NotifyGoogleChat(NotifyBase):
Initialize Google Chat Object Initialize Google Chat Object
""" """
super(NotifyGoogleChat, self).__init__(**kwargs) super().__init__(**kwargs)
# Workspace (associated with project) # Workspace (associated with project)
self.workspace = validate_regex(workspace) self.workspace = validate_regex(workspace)

View File

@ -155,7 +155,7 @@ class NotifyGotify(NotifyBase):
Initialize Gotify Object Initialize Gotify Object
""" """
super(NotifyGotify, self).__init__(**kwargs) super().__init__(**kwargs)
# Token (associated with project) # Token (associated with project)
self.token = validate_regex(token) self.token = validate_regex(token)

View File

@ -187,7 +187,7 @@ class NotifyGrowl(NotifyBase):
""" """
Initialize Growl Object Initialize Growl Object
""" """
super(NotifyGrowl, self).__init__(**kwargs) super().__init__(**kwargs)
if not self.port: if not self.port:
self.port = self.default_port self.port = self.default_port

View File

@ -115,7 +115,7 @@ class NotifyHomeAssistant(NotifyBase):
""" """
Initialize Home Assistant Object Initialize Home Assistant Object
""" """
super(NotifyHomeAssistant, self).__init__(**kwargs) super().__init__(**kwargs)
self.fullpath = kwargs.get('fullpath', '') self.fullpath = kwargs.get('fullpath', '')

View File

@ -147,7 +147,7 @@ class NotifyIFTTT(NotifyBase):
reference to Value1, Value2, and/or Value3 reference to Value1, Value2, and/or Value3
""" """
super(NotifyIFTTT, self).__init__(**kwargs) super().__init__(**kwargs)
# Webhook ID (associated with project) # Webhook ID (associated with project)
self.webhook_id = validate_regex(webhook_id) self.webhook_id = validate_regex(webhook_id)

View File

@ -135,7 +135,7 @@ class NotifyJSON(NotifyBase):
additionally include as part of the server headers to post with additionally include as part of the server headers to post with
""" """
super(NotifyJSON, self).__init__(**kwargs) super().__init__(**kwargs)
self.fullpath = kwargs.get('fullpath') self.fullpath = kwargs.get('fullpath')
if not isinstance(self.fullpath, str): if not isinstance(self.fullpath, str):

View File

@ -194,7 +194,7 @@ class NotifyJoin(NotifyBase):
""" """
Initialize Join Object Initialize Join Object
""" """
super(NotifyJoin, self).__init__(**kwargs) super().__init__(**kwargs)
# Track whether or not we want to send an image with our notification # Track whether or not we want to send an image with our notification
# or not. # or not.

View File

@ -149,7 +149,7 @@ class NotifyKavenegar(NotifyBase):
""" """
Initialize Kavenegar Object Initialize Kavenegar Object
""" """
super(NotifyKavenegar, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -104,7 +104,7 @@ class NotifyKumulos(NotifyBase):
""" """
Initialize Kumulos Object Initialize Kumulos Object
""" """
super(NotifyKumulos, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -467,7 +467,7 @@ class NotifyLametric(NotifyBase):
""" """
Initialize LaMetric Object Initialize LaMetric Object
""" """
super(NotifyLametric, self).__init__(**kwargs) super().__init__(**kwargs)
self.mode = mode.strip().lower() \ self.mode = mode.strip().lower() \
if isinstance(mode, str) \ if isinstance(mode, str) \

View File

@ -114,7 +114,7 @@ class NotifyLine(NotifyBase):
""" """
Initialize Line Object Initialize Line Object
""" """
super(NotifyLine, self).__init__(**kwargs) super().__init__(**kwargs)
# Long-Lived Access token (generated from User Profile) # Long-Lived Access token (generated from User Profile)
self.token = validate_regex(token) self.token = validate_regex(token)

View File

@ -223,7 +223,7 @@ class NotifyMQTT(NotifyBase):
Initialize MQTT Object Initialize MQTT Object
""" """
super(NotifyMQTT, self).__init__(**kwargs) super().__init__(**kwargs)
# Initialize topics # Initialize topics
self.topics = parse_list(targets) self.topics = parse_list(targets)

View File

@ -156,7 +156,7 @@ class NotifyMSG91(NotifyBase):
""" """
Initialize MSG91 Object Initialize MSG91 Object
""" """
super(NotifyMSG91, self).__init__(**kwargs) super().__init__(**kwargs)
# Authentication Key (associated with project) # Authentication Key (associated with project)
self.authkey = validate_regex( self.authkey = validate_regex(

View File

@ -214,7 +214,7 @@ class NotifyMSTeams(NotifyBase):
template arguments that can not be over-ridden are: template arguments that can not be over-ridden are:
`body`, `title`, and `type`. `body`, `title`, and `type`.
""" """
super(NotifyMSTeams, self).__init__(**kwargs) super().__init__(**kwargs)
try: try:
self.version = int(version) self.version = int(version)

View File

@ -124,7 +124,7 @@ class NotifyMacOSX(NotifyBase):
Initialize MacOSX Object Initialize MacOSX Object
""" """
super(NotifyMacOSX, self).__init__(**kwargs) super().__init__(**kwargs)
# Track whether or not we want to send an image with our notification # Track whether or not we want to send an image with our notification
# or not. # or not.

View File

@ -203,7 +203,7 @@ class NotifyMailgun(NotifyBase):
""" """
Initialize Mailgun Object Initialize Mailgun Object
""" """
super(NotifyMailgun, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -239,7 +239,7 @@ class NotifyMatrix(NotifyBase):
""" """
Initialize Matrix Object Initialize Matrix Object
""" """
super(NotifyMatrix, self).__init__(**kwargs) super().__init__(**kwargs)
# Prepare a list of rooms to connect and notify # Prepare a list of rooms to connect and notify
self.rooms = parse_list(targets) self.rooms = parse_list(targets)

View File

@ -145,7 +145,7 @@ class NotifyMattermost(NotifyBase):
""" """
Initialize Mattermost Object Initialize Mattermost Object
""" """
super(NotifyMattermost, self).__init__(**kwargs) super().__init__(**kwargs)
if self.secure: if self.secure:
self.schema = 'https' self.schema = 'https'

View File

@ -115,7 +115,7 @@ class NotifyMessageBird(NotifyBase):
""" """
Initialize MessageBird Object Initialize MessageBird Object
""" """
super(NotifyMessageBird, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -125,7 +125,7 @@ class NotifyNextcloud(NotifyBase):
""" """
Initialize Nextcloud Object Initialize Nextcloud Object
""" """
super(NotifyNextcloud, self).__init__(**kwargs) super().__init__(**kwargs)
self.targets = parse_list(targets) self.targets = parse_list(targets)
if len(self.targets) == 0: if len(self.targets) == 0:

View File

@ -106,7 +106,7 @@ class NotifyNextcloudTalk(NotifyBase):
""" """
Initialize Nextcloud Talk Object Initialize Nextcloud Talk Object
""" """
super(NotifyNextcloudTalk, self).__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 = 'User and password have to be specified.'

View File

@ -160,7 +160,7 @@ class NotifyNotica(NotifyBase):
""" """
Initialize Notica Object Initialize Notica Object
""" """
super(NotifyNotica, self).__init__(**kwargs) super().__init__(**kwargs)
# Token (associated with project) # Token (associated with project)
self.token = validate_regex(token) self.token = validate_regex(token)

View File

@ -160,7 +160,7 @@ class NotifyNotifico(NotifyBase):
""" """
Initialize Notifico Object Initialize Notifico Object
""" """
super(NotifyNotifico, self).__init__(**kwargs) super().__init__(**kwargs)
# Assign our message hook # Assign our message hook
self.project_id = validate_regex( self.project_id = validate_regex(

View File

@ -242,7 +242,7 @@ class NotifyNtfy(NotifyBase):
""" """
Initialize ntfy Object Initialize ntfy Object
""" """
super(NotifyNtfy, self).__init__(**kwargs) super().__init__(**kwargs)
# Prepare our mode # Prepare our mode
self.mode = mode.strip().lower() \ self.mode = mode.strip().lower() \

View File

@ -173,7 +173,7 @@ class NotifyOffice365(NotifyBase):
""" """
Initialize Office 365 Object Initialize Office 365 Object
""" """
super(NotifyOffice365, self).__init__(**kwargs) super().__init__(**kwargs)
# Tenant identifier # Tenant identifier
self.tenant = validate_regex( self.tenant = validate_regex(

View File

@ -178,7 +178,7 @@ class NotifyOneSignal(NotifyBase):
Initialize OneSignal Initialize OneSignal
""" """
super(NotifyOneSignal, self).__init__(**kwargs) super().__init__(**kwargs)
# The apikey associated with the account # The apikey associated with the account
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -262,7 +262,7 @@ class NotifyOpsgenie(NotifyBase):
""" """
Initialize Opsgenie Object Initialize Opsgenie Object
""" """
super(NotifyOpsgenie, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -192,7 +192,7 @@ class NotifyPagerDuty(NotifyBase):
""" """
Initialize Pager Duty Object Initialize Pager Duty Object
""" """
super(NotifyPagerDuty, self).__init__(**kwargs) super().__init__(**kwargs)
# Long-Lived Access token (generated from User Profile) # Long-Lived Access token (generated from User Profile)
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -130,7 +130,7 @@ class NotifyParsePlatform(NotifyBase):
""" """
Initialize Parse Platform Object Initialize Parse Platform Object
""" """
super(NotifyParsePlatform, self).__init__(**kwargs) super().__init__(**kwargs)
self.fullpath = kwargs.get('fullpath') self.fullpath = kwargs.get('fullpath')
if not isinstance(self.fullpath, str): if not isinstance(self.fullpath, str):

View File

@ -105,7 +105,7 @@ class NotifyPopcornNotify(NotifyBase):
""" """
Initialize PopcornNotify Object Initialize PopcornNotify Object
""" """
super(NotifyPopcornNotify, self).__init__(**kwargs) super().__init__(**kwargs)
# Access Token (associated with project) # Access Token (associated with project)
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -143,7 +143,7 @@ class NotifyProwl(NotifyBase):
""" """
Initialize Prowl Object Initialize Prowl Object
""" """
super(NotifyProwl, self).__init__(**kwargs) super().__init__(**kwargs)
# The Priority of the message # The Priority of the message
self.priority = NotifyProwl.template_args['priority']['default'] \ self.priority = NotifyProwl.template_args['priority']['default'] \

View File

@ -115,7 +115,7 @@ class NotifyPushBullet(NotifyBase):
""" """
Initialize PushBullet Object Initialize PushBullet Object
""" """
super(NotifyPushBullet, self).__init__(**kwargs) super().__init__(**kwargs)
# Access Token (associated with project) # Access Token (associated with project)
self.accesstoken = validate_regex(accesstoken) self.accesstoken = validate_regex(accesstoken)

View File

@ -400,7 +400,7 @@ class NotifyPushSafer(NotifyBase):
""" """
Initialize PushSafer Object Initialize PushSafer Object
""" """
super(NotifyPushSafer, self).__init__(**kwargs) super().__init__(**kwargs)
# #
# Priority # Priority

View File

@ -120,7 +120,7 @@ class NotifyPushed(NotifyBase):
Initialize Pushed Object Initialize Pushed Object
""" """
super(NotifyPushed, self).__init__(**kwargs) super().__init__(**kwargs)
# Application Key (associated with project) # Application Key (associated with project)
self.app_key = validate_regex(app_key) self.app_key = validate_regex(app_key)

View File

@ -102,7 +102,7 @@ class NotifyPushjet(NotifyBase):
""" """
Initialize Pushjet Object Initialize Pushjet Object
""" """
super(NotifyPushjet, self).__init__(**kwargs) super().__init__(**kwargs)
# Secret Key (associated with project) # Secret Key (associated with project)
self.secret_key = validate_regex(secret_key) self.secret_key = validate_regex(secret_key)

View File

@ -251,7 +251,7 @@ class NotifyPushover(NotifyBase):
""" """
Initialize Pushover Object Initialize Pushover Object
""" """
super(NotifyPushover, self).__init__(**kwargs) super().__init__(**kwargs)
# Access Token (associated with project) # Access Token (associated with project)
self.token = validate_regex(token) self.token = validate_regex(token)

View File

@ -240,7 +240,7 @@ class NotifyReddit(NotifyBase):
""" """
Initialize Notify Reddit Object Initialize Notify Reddit Object
""" """
super(NotifyReddit, self).__init__(**kwargs) super().__init__(**kwargs)
# Initialize subreddit list # Initialize subreddit list
self.subreddits = set() self.subreddits = set()

View File

@ -188,7 +188,7 @@ class NotifyRocketChat(NotifyBase):
""" """
Initialize Notify Rocket.Chat Object Initialize Notify Rocket.Chat Object
""" """
super(NotifyRocketChat, self).__init__(**kwargs) super().__init__(**kwargs)
# Set our schema # Set our schema
self.schema = 'https' if self.secure else 'http' self.schema = 'https' if self.secure else 'http'

View File

@ -129,7 +129,7 @@ class NotifyRyver(NotifyBase):
""" """
Initialize Ryver Object Initialize Ryver Object
""" """
super(NotifyRyver, self).__init__(**kwargs) super().__init__(**kwargs)
# API Token (associated with project) # API Token (associated with project)
self.token = validate_regex( self.token = validate_regex(

View File

@ -217,7 +217,7 @@ class NotifySES(NotifyBase):
""" """
Initialize Notify AWS SES Object Initialize Notify AWS SES Object
""" """
super(NotifySES, self).__init__(**kwargs) super().__init__(**kwargs)
# Store our AWS API Access Key # Store our AWS API Access Key
self.aws_access_key_id = validate_regex(access_key_id) self.aws_access_key_id = validate_regex(access_key_id)

View File

@ -191,7 +191,7 @@ class NotifySMSEagle(NotifyBase):
""" """
Initialize SMSEagle Object Initialize SMSEagle Object
""" """
super(NotifySMSEagle, self).__init__(**kwargs) super().__init__(**kwargs)
# Prepare Flash Mode Flag # Prepare Flash Mode Flag
self.flash = flash self.flash = flash

View File

@ -159,7 +159,7 @@ class NotifySMTP2Go(NotifyBase):
""" """
Initialize SMTP2Go Object Initialize SMTP2Go Object
""" """
super(NotifySMTP2Go, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -159,7 +159,7 @@ class NotifySNS(NotifyBase):
""" """
Initialize Notify AWS SNS Object Initialize Notify AWS SNS Object
""" """
super(NotifySNS, self).__init__(**kwargs) super().__init__(**kwargs)
# Store our AWS API Access Key # Store our AWS API Access Key
self.aws_access_key_id = validate_regex(access_key_id) self.aws_access_key_id = validate_regex(access_key_id)

View File

@ -159,7 +159,7 @@ class NotifySendGrid(NotifyBase):
""" """
Initialize Notify SendGrid Object Initialize Notify SendGrid Object
""" """
super(NotifySendGrid, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -79,7 +79,7 @@ class NotifyServerChan(NotifyBase):
""" """
Initialize ServerChan Object Initialize ServerChan Object
""" """
super(NotifyServerChan, self).__init__(**kwargs) super().__init__(**kwargs)
# Token (associated with project) # Token (associated with project)
self.token = validate_regex( self.token = validate_regex(

View File

@ -157,7 +157,7 @@ class NotifySignalAPI(NotifyBase):
""" """
Initialize SignalAPI Object Initialize SignalAPI Object
""" """
super(NotifySignalAPI, self).__init__(**kwargs) super().__init__(**kwargs)
# Prepare Batch Mode Flag # Prepare Batch Mode Flag
self.batch = batch self.batch = batch

View File

@ -125,7 +125,7 @@ class NotifySimplePush(NotifyBase):
""" """
Initialize SimplePush Object Initialize SimplePush Object
""" """
super(NotifySimplePush, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -169,7 +169,7 @@ class NotifySinch(NotifyBase):
""" """
Initialize Sinch Object Initialize Sinch Object
""" """
super(NotifySinch, self).__init__(**kwargs) super().__init__(**kwargs)
# The Account SID associated with the account # The Account SID associated with the account
self.service_plan_id = validate_regex( self.service_plan_id = validate_regex(

View File

@ -278,7 +278,7 @@ class NotifySlack(NotifyBase):
""" """
Initialize Slack Object Initialize Slack Object
""" """
super(NotifySlack, self).__init__(**kwargs) super().__init__(**kwargs)
# Setup our mode # Setup our mode
self.mode = SlackMode.BOT if access_token else SlackMode.WEBHOOK self.mode = SlackMode.BOT if access_token else SlackMode.WEBHOOK

View File

@ -224,7 +224,7 @@ class NotifySparkPost(NotifyBase):
""" """
Initialize SparkPost Object Initialize SparkPost Object
""" """
super(NotifySparkPost, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex(apikey) self.apikey = validate_regex(apikey)

View File

@ -148,7 +148,7 @@ class NotifySpontit(NotifyBase):
""" """
Initialize Spontit Object Initialize Spontit Object
""" """
super(NotifySpontit, self).__init__(**kwargs) super().__init__(**kwargs)
# User ID (associated with project) # User ID (associated with project)
user = validate_regex( user = validate_regex(

View File

@ -183,7 +183,7 @@ class NotifyStreamlabs(NotifyBase):
Initialize Streamlabs Object Initialize Streamlabs Object
""" """
super(NotifyStreamlabs, self).__init__(**kwargs) super().__init__(**kwargs)
# access token is generated by user # access token is generated by user
# using https://streamlabs.com/api/v1.0/token # using https://streamlabs.com/api/v1.0/token

View File

@ -199,7 +199,7 @@ class NotifySyslog(NotifyBase):
""" """
Initialize Syslog Object Initialize Syslog Object
""" """
super(NotifySyslog, self).__init__(**kwargs) super().__init__(**kwargs)
if facility: if facility:
try: try:

View File

@ -104,7 +104,7 @@ class NotifyTechulusPush(NotifyBase):
""" """
Initialize Techulus Push Object Initialize Techulus Push Object
""" """
super(NotifyTechulusPush, self).__init__(**kwargs) super().__init__(**kwargs)
# The apikey associated with the account # The apikey associated with the account
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -315,7 +315,7 @@ class NotifyTelegram(NotifyBase):
""" """
Initialize Telegram Object Initialize Telegram Object
""" """
super(NotifyTelegram, self).__init__(**kwargs) super().__init__(**kwargs)
self.bot_token = validate_regex( self.bot_token = validate_regex(
bot_token, *self.template_tokens['bot_token']['regex'], bot_token, *self.template_tokens['bot_token']['regex'],

View File

@ -163,7 +163,7 @@ class NotifyTwilio(NotifyBase):
""" """
Initialize Twilio Object Initialize Twilio Object
""" """
super(NotifyTwilio, self).__init__(**kwargs) super().__init__(**kwargs)
# The Account SID associated with the account # The Account SID associated with the account
self.account_sid = validate_regex( self.account_sid = validate_regex(

View File

@ -131,7 +131,7 @@ class NotifyTwist(NotifyBase):
""" """
Initialize Notify Twist Object Initialize Notify Twist Object
""" """
super(NotifyTwist, self).__init__(**kwargs) super().__init__(**kwargs)
# Initialize channels list # Initialize channels list
self.channels = set() self.channels = set()

View File

@ -194,7 +194,7 @@ class NotifyTwitter(NotifyBase):
Initialize Twitter Object Initialize Twitter Object
""" """
super(NotifyTwitter, self).__init__(**kwargs) super().__init__(**kwargs)
self.ckey = validate_regex(ckey) self.ckey = validate_regex(ckey)
if not self.ckey: if not self.ckey:

View File

@ -142,7 +142,7 @@ class NotifyVonage(NotifyBase):
""" """
Initialize Vonage Object Initialize Vonage Object
""" """
super(NotifyVonage, self).__init__(**kwargs) super().__init__(**kwargs)
# API Key (associated with project) # API Key (associated with project)
self.apikey = validate_regex( self.apikey = validate_regex(

View File

@ -125,7 +125,7 @@ class NotifyWebexTeams(NotifyBase):
""" """
Initialize Webex Teams Object Initialize Webex Teams Object
""" """
super(NotifyWebexTeams, self).__init__(**kwargs) super().__init__(**kwargs)
# The token associated with the account # The token associated with the account
self.token = validate_regex( self.token = validate_regex(

View File

@ -113,7 +113,7 @@ class NotifyWindows(NotifyBase):
Initialize Windows Object Initialize Windows Object
""" """
super(NotifyWindows, self).__init__(**kwargs) super().__init__(**kwargs)
# Number of seconds to display notification for # Number of seconds to display notification for
self.duration = self.default_popup_duration_sec \ self.duration = self.default_popup_duration_sec \

View File

@ -131,7 +131,7 @@ class NotifyXBMC(NotifyBase):
""" """
Initialize XBMC/KODI Object Initialize XBMC/KODI Object
""" """
super(NotifyXBMC, self).__init__(**kwargs) super().__init__(**kwargs)
# Number of seconds to display notification for # Number of seconds to display notification for
self.duration = self.template_args['duration']['default'] \ self.duration = self.template_args['duration']['default'] \

View File

@ -140,7 +140,7 @@ class NotifyXML(NotifyBase):
additionally include as part of the server headers to post with 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'?> self.payload = """<?xml version='1.0' encoding='utf-8'?>
<soapenv:Envelope <soapenv:Envelope

View File

@ -172,7 +172,7 @@ class NotifyZulip(NotifyBase):
""" """
Initialize Zulip Object Initialize Zulip Object
""" """
super(NotifyZulip, self).__init__(**kwargs) super().__init__(**kwargs)
# our default hostname # our default hostname
self.hostname = self.default_hostname self.hostname = self.default_hostname

View File

@ -180,7 +180,7 @@ def apprise_test(do_notify):
class BadNotification(NotifyBase): class BadNotification(NotifyBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(BadNotification, self).__init__(**kwargs) super().__init__(**kwargs)
# We fail whenever we're initialized # We fail whenever we're initialized
raise TypeError() raise TypeError()
@ -196,7 +196,7 @@ def apprise_test(do_notify):
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(GoodNotification, self).__init__( super().__init__(
notify_format=NotifyFormat.HTML, **kwargs) notify_format=NotifyFormat.HTML, **kwargs)
def url(self, **kwargs): def url(self, **kwargs):
@ -736,7 +736,7 @@ def test_apprise_notify_formats(tmpdir):
notify_format = NotifyFormat.TEXT notify_format = NotifyFormat.TEXT
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(TextNotification, self).__init__() super().__init__()
def notify(self, **kwargs): def notify(self, **kwargs):
# Pretend everything is okay # Pretend everything is okay
@ -752,7 +752,7 @@ def test_apprise_notify_formats(tmpdir):
notify_format = NotifyFormat.HTML notify_format = NotifyFormat.HTML
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(HtmlNotification, self).__init__() super().__init__()
def notify(self, **kwargs): def notify(self, **kwargs):
# Pretend everything is okay # Pretend everything is okay
@ -768,7 +768,7 @@ def test_apprise_notify_formats(tmpdir):
notify_format = NotifyFormat.MARKDOWN notify_format = NotifyFormat.MARKDOWN
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(MarkDownNotification, self).__init__() super().__init__()
def notify(self, **kwargs): def notify(self, **kwargs):
# Pretend everything is okay # Pretend everything is okay
@ -990,7 +990,7 @@ def test_apprise_disabled_plugins():
service_name = 'na02' service_name = 'na02'
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(TestDisabled02Notification, self).__init__(**kwargs) super().__init__(**kwargs)
# enable state changes **AFTER** we initialize # enable state changes **AFTER** we initialize
self.enabled = False self.enabled = False

View File

@ -269,7 +269,7 @@ def test_apprise_attachment_instantiate():
class BadAttachType(AttachBase): class BadAttachType(AttachBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(BadAttachType, self).__init__(**kwargs) super().__init__(**kwargs)
# We fail whenever we're initialized # We fail whenever we're initialized
raise TypeError() raise TypeError()

View File

@ -233,7 +233,7 @@ def test_apprise_multi_config_entries(tmpdir):
# Define our good:// url # Define our good:// url
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(GoodNotification, self).__init__( super().__init__(
notify_format=NotifyFormat.HTML, **kwargs) notify_format=NotifyFormat.HTML, **kwargs)
def notify(self, **kwargs): def notify(self, **kwargs):
@ -454,7 +454,7 @@ def test_apprise_config_instantiate():
allow_cross_includes = ContentIncludeMode.ALWAYS allow_cross_includes = ContentIncludeMode.ALWAYS
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(BadConfig, self).__init__(**kwargs) super().__init__(**kwargs)
# We fail whenever we're initialized # We fail whenever we're initialized
raise TypeError() raise TypeError()
@ -487,7 +487,7 @@ def test_invalid_apprise_config(tmpdir):
allow_cross_includes = ContentIncludeMode.ALWAYS allow_cross_includes = ContentIncludeMode.ALWAYS
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(BadConfig, self).__init__(**kwargs) super().__init__(**kwargs)
# We intentionally fail whenever we're initialized # We intentionally fail whenever we're initialized
raise TypeError() raise TypeError()
@ -551,7 +551,7 @@ def test_apprise_config_with_apprise_obj(tmpdir):
# Define our good:// url # Define our good:// url
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(GoodNotification, self).__init__( super().__init__(
notify_format=NotifyFormat.HTML, **kwargs) notify_format=NotifyFormat.HTML, **kwargs)
def notify(self, **kwargs): def notify(self, **kwargs):

View File

@ -48,7 +48,7 @@ def test_apprise_asyncio_runtime_error():
""" """
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(GoodNotification, self).__init__( super().__init__(
notify_format=NotifyFormat.HTML, **kwargs) notify_format=NotifyFormat.HTML, **kwargs)
def url(self, **kwargs): def url(self, **kwargs):
@ -119,7 +119,7 @@ def test_apprise_works_in_async_loop():
""" """
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, **kwargs): def __init__(self, **kwargs):
super(GoodNotification, self).__init__( super().__init__(
notify_format=NotifyFormat.HTML, **kwargs) notify_format=NotifyFormat.HTML, **kwargs)
def url(self, **kwargs): def url(self, **kwargs):

View File

@ -117,7 +117,7 @@ def test_attach_http(mock_get):
# Define our good:// url # Define our good:// url
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(GoodNotification, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def notify(self, *args, **kwargs): def notify(self, *args, **kwargs):
# Pretend everything is okay # Pretend everything is okay

View File

@ -57,7 +57,7 @@ def test_apprise_cli_nux_env(tmpdir):
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(GoodNotification, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def notify(self, **kwargs): def notify(self, **kwargs):
# Pretend everything is okay # Pretend everything is okay
@ -69,7 +69,7 @@ def test_apprise_cli_nux_env(tmpdir):
class BadNotification(NotifyBase): class BadNotification(NotifyBase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(BadNotification, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def notify(self, **kwargs): def notify(self, **kwargs):
# Force a notification failure # Force a notification failure
@ -770,7 +770,7 @@ def test_apprise_cli_details(tmpdir):
service_name = 'na02' service_name = 'na02'
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(TestDisabled02Notification, self).__init__(**kwargs) super().__init__(**kwargs)
# enable state changes **AFTER** we initialize # enable state changes **AFTER** we initialize
self.enabled = False self.enabled = False

View File

@ -63,7 +63,7 @@ def test_config_http(mock_post):
# Define our good:// url # Define our good:// url
class GoodNotification(NotifyBase): class GoodNotification(NotifyBase):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
super(GoodNotification, self).__init__(*args, **kwargs) super().__init__(*args, **kwargs)
def notify(self, *args, **kwargs): def notify(self, *args, **kwargs):
# Pretend everything is okay # Pretend everything is okay

Some files were not shown because too many files have changed in this diff Show More