Browse Source

Change fix some regexes.

tags/release_0.25.1
JackDandy 5 years ago
parent
commit
3d48c8cd60
  1. 8
      lib/apprise/plugins/NotifyGrowl/gntp/core.py
  2. 2
      lib/apprise/plugins/NotifyNotifico.py

8
lib/apprise/plugins/NotifyGrowl/gntp/core.py

@ -17,20 +17,20 @@ __all__ = [
'parse_gntp',
]
#GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
# GNTP/<version> <messagetype> <encryptionAlgorithmID>[:<ivValue>][ <keyHashAlgorithmID>:<keyHash>.<salt>]
GNTP_INFO_LINE = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
r'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)' +
' (?P<encryptionAlgorithmID>[A-Z0-9]+(:(?P<ivValue>[A-F0-9]+))?) ?' +
'((?P<keyHashAlgorithmID>[A-Z0-9]+):(?P<keyHash>[A-F0-9]+).(?P<salt>[A-F0-9]+))?\r\n',
re.IGNORECASE
)
GNTP_INFO_LINE_SHORT = re.compile(
'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)',
r'GNTP/(?P<version>\d+\.\d+) (?P<messagetype>REGISTER|NOTIFY|SUBSCRIBE|\-OK|\-ERROR)',
re.IGNORECASE
)
GNTP_HEADER = re.compile('([\w-]+):(.+)')
GNTP_HEADER = re.compile(r'([\w-]+):(.+)')
GNTP_EOL = shim.b('\r\n')
GNTP_SEP = shim.b(': ')

2
lib/apprise/plugins/NotifyNotifico.py

@ -249,7 +249,7 @@ class NotifyNotifico(NotifyBase):
# Colors were specified, make sure we capture and correctly
# allow them to exist inline in the message
# \g<1> is less ambigious than \1
body = re.sub(r'\\x03(\d{0,2})', '\x03\g<1>', body)
body = re.sub(r'\\x03(\d{0,2})', r'\x03\g<1>', body)
else:
# no colors specified, make sure we strip out any colors found

Loading…
Cancel
Save