Skip to content

Commit 7807c7a

Browse files
committed
PEP E501 (file length) fix applied
1 parent 2d4ad01 commit 7807c7a

40 files changed

Lines changed: 140 additions & 93 deletions

apprise/plugins/base.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ class NotifyBase(URLBase):
187187
"default": overflow_mode,
188188
# look up default using the following parent class value at
189189
# runtime. The variable name identified here (in this case
190-
# overflow_mode) is checked and it's result is placed over-top of
191-
# the 'default'. This is done because once a parent class inherits
192-
# this one, the overflow_mode already set as a default 'could' be
193-
# potentially over-ridden and changed to a different value.
190+
# overflow_mode) is checked and it's result is placed over-top
191+
# of the 'default'. This is done because once a parent class
192+
# inherits this one, the overflow_mode already set as a default
193+
# 'could' be potentially over-ridden and changed to a different
194+
# value.
194195
"_lookup_default": "overflow_mode",
195196
},
196197
"format": {

apprise/plugins/d7networks.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,11 @@ class NotifyD7Networks(NotifyBase):
133133
"alias_of": "targets",
134134
},
135135
"source": {
136-
# Originating address,In cases where the rewriting of the sender's
137-
# address is supported or permitted by the SMS-C. This is used to
138-
# transmit the message, this number is transmitted as the
139-
# originating address and is completely optional.
136+
# Originating address,In cases where the rewriting of the
137+
# sender's address is supported or permitted by the SMS-C.
138+
# This is used to transmit the message, this number is
139+
# transmitted as the originating address and is completely
140+
# optional.
140141
"name": _("Originating Address"),
141142
"type": "string",
142143
"map_to": "source",

apprise/plugins/gnome.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ class NotifyGnome(NotifyBase):
144144
"default": GnomeUrgency.NORMAL,
145145
},
146146
"priority": {
147-
# Apprise uses 'priority' everywhere; it's just a nice consistent
148-
# feel to be able to use it here as well. Just map the
149-
# value back to 'priority'
147+
# Apprise uses 'priority' everywhere; it's just a nice
148+
# consistent feel to be able to use it here as well. Just map
149+
# the value back to 'priority'
150150
"alias_of": "urgency",
151151
},
152152
"image": {

apprise/plugins/gotify.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
# Gotify Docker configuration: https://hub.docker.com/r/gotify/server
2929
# Example: https://github.com/gotify/server/blob/\
30-
# f2c2688f0b5e6a816bbcec768ca1c0de5af76b88/ADD_MESSAGE_EXAMPLES.md#python
30+
# f2c2688f0b5e6a816bbcec768ca1c0de5af76b88/ADD_MESSAGE_EXAMPLES.md#python
3131
# API: https://gotify.net/docs/swagger-docs
3232

3333
from json import dumps

apprise/plugins/lark.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ def url(self, privacy=False, *args, **kwargs):
9696
"""Returns the URL built dynamically based on specified arguments."""
9797
params = self.url_parameters(privacy=privacy, *args, **kwargs)
9898
return (
99-
f"{self.secure_protocol}://{self.pprint(self.token, privacy, mode=PrivacyMode.Secret)}/?{NotifyLark.urlencode(params)}"
99+
f"{self.secure_protocol}://"
100+
f"{self.pprint(self.token, privacy, mode=PrivacyMode.Secret)}/"
101+
f"?{NotifyLark.urlencode(params)}"
100102
)
101103

102104
def send(self, body, title="", notify_type=NotifyType.INFO, **kwargs):

apprise/plugins/nextcloud.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,8 @@ class NotifyNextcloud(NotifyBase):
108108
NotifyBase.template_args,
109109
**{
110110
# Nextcloud uses different API end points depending on the version
111-
# being used however the (API) payload remains the same. Allow users
112-
# to specify the version they are using:
111+
# being used however the (API) payload remains the same. Allow
112+
# users to specify the version they are using:
113113
"version": {
114114
"name": _("Version"),
115115
"type": "int",

apprise/plugins/one_signal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,8 @@ def send(self, body, title="", notify_type=NotifyType.INFO, **kwargs):
454454

455455
self.logger.debug(
456456
"OneSignal POST URL:"
457-
f" {self.notify_url} (cert_verify={self.verify_certificate!r})"
457+
f" {self.notify_url} "
458+
f"(cert_verify={self.verify_certificate!r})"
458459
)
459460
self.logger.debug(f"OneSignal Payload: {payload!s}")
460461

apprise/plugins/pagerduty.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ class NotifyPagerDuty(NotifyBase):
179179
"default": PagerDutyRegion.US,
180180
"map_to": "region_name",
181181
},
182-
# The severity is automatically determined, however you can optionally
183-
# over-ride its value and force it to be what you want
182+
# The severity is automatically determined, however you can
183+
# optionally over-ride its value and force it to be what you want
184184
"severity": {
185185
"name": _("Severity"),
186186
"type": "choice:string",
@@ -276,8 +276,9 @@ def __init__(
276276

277277
if self.region_name not in PAGERDUTY_REGIONS:
278278
# allow the outer except to handle this common response
279-
raise
280-
except:
279+
raise IndexError()
280+
281+
except (AttributeError, IndexError, TypeError):
281282
# Invalid region specified
282283
msg = f"The PagerDuty region specified ({region_name}) is invalid."
283284
self.logger.warning(msg)

apprise/plugins/popcorn_notify.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,8 +240,8 @@ def send(self, body, title="", notify_type=NotifyType.INFO, **kwargs):
240240
except requests.RequestException as e:
241241
self.logger.warning(
242242
"A Connection error occured sending"
243-
f" {len(self.targets[index:index + batch_size])} PopcornNotify"
244-
" notification(s)."
243+
f" {len(self.targets[index:index + batch_size])} "
244+
"PopcornNotify notification(s)."
245245
)
246246
self.logger.debug(f"Socket Exception: {e!s}")
247247

apprise/plugins/pushplus.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,9 @@ def url(self, privacy=False, *args, **kwargs):
9090
"""Returns the URL built dynamically based on specified arguments."""
9191
params = self.url_parameters(privacy=privacy, *args, **kwargs)
9292
return (
93-
f"{self.secure_protocol}://{self.pprint(self.token, privacy, mode=PrivacyMode.Secret)}/?{self.urlencode(params)}"
93+
f"{self.secure_protocol}://"
94+
f"{self.pprint(self.token, privacy, mode=PrivacyMode.Secret)}/"
95+
f"?{self.urlencode(params)}"
9496
)
9597

9698
@property

0 commit comments

Comments
 (0)