1
0
mirror of https://github.com/JoelBender/bacpypes synced 2025-09-28 22:15:23 +08:00

clean up string escape sequences

This commit is contained in:
Joel Bender 2021-02-26 23:00:36 -05:00
parent af20a040bc
commit 332fd4b739
4 changed files with 9 additions and 9 deletions

View File

@ -88,7 +88,7 @@ class CurrentPropertyListMixIn(Object):
# character reference patterns
HEX = u"[0-9A-Fa-f]"
PERCENT = u"%" + HEX + HEX
UCHAR = u"[\\\]u" + HEX * 4 + "|" + u"[\\\]U" + HEX * 8
UCHAR = u"[\\]u" + HEX * 4 + "|" + u"[\\]U" + HEX * 8
# character sets
PN_CHARS_BASE = (
@ -102,7 +102,7 @@ PN_CHARS_U = PN_CHARS_BASE + u"_"
PN_CHARS = u"-" + PN_CHARS_U + u"0-9\u00B7\u0300-\u036F\u203F-\u2040"
# patterns
IRIREF = u'[<]([^\u0000-\u0020<>"{}|^`\\\]|' + UCHAR + u")*[>]"
IRIREF = u'[<]([^\u0000-\u0020<>"{}|^`\\]|' + UCHAR + u")*[>]"
PN_PREFIX = u"[" + PN_CHARS_BASE + u"](([." + PN_CHARS + u"])*[" + PN_CHARS + u"])?"
PN_LOCAL_ESC = u"[-\\_~.!$&'()*+,;=/?#@%]"

View File

@ -87,7 +87,7 @@ class CurrentPropertyListMixIn(Object):
# character reference patterns
HEX = u"[0-9A-Fa-f]"
PERCENT = u"%" + HEX + HEX
UCHAR = u"[\\\]u" + HEX * 4 + "|" + u"[\\\]U" + HEX * 8
UCHAR = u"[\\]u" + HEX * 4 + "|" + u"[\\]U" + HEX * 8
# character sets
PN_CHARS_BASE = (
@ -101,7 +101,7 @@ PN_CHARS_U = PN_CHARS_BASE + u"_"
PN_CHARS = u"-" + PN_CHARS_U + u"0-9\u00B7\u0300-\u036F\u203F-\u2040"
# patterns
IRIREF = u'[<]([^\u0000-\u0020<>"{}|^`\\\]|' + UCHAR + u")*[>]"
IRIREF = u'[<]([^\u0000-\u0020<>"{}|^`\\]|' + UCHAR + u")*[>]"
PN_PREFIX = u"[" + PN_CHARS_BASE + u"](([." + PN_CHARS + u"])*[" + PN_CHARS + u"])?"
PN_LOCAL_ESC = u"[-\\_~.!$&'()*+,;=/?#@%]"

View File

@ -87,7 +87,7 @@ class CurrentPropertyListMixIn(Object):
# character reference patterns
HEX = u"[0-9A-Fa-f]"
PERCENT = u"%" + HEX + HEX
UCHAR = u"[\\\]u" + HEX * 4 + "|" + u"[\\\]U" + HEX * 8
UCHAR = u"[\\]u" + HEX * 4 + "|" + u"[\\]U" + HEX * 8
# character sets
PN_CHARS_BASE = (
@ -101,7 +101,7 @@ PN_CHARS_U = PN_CHARS_BASE + u"_"
PN_CHARS = u"-" + PN_CHARS_U + u"0-9\u00B7\u0300-\u036F\u203F-\u2040"
# patterns
IRIREF = u'[<]([^\u0000-\u0020<>"{}|^`\\\]|' + UCHAR + u")*[>]"
IRIREF = u'[<]([^\u0000-\u0020<>"{}|^`\\]|' + UCHAR + u")*[>]"
PN_PREFIX = u"[" + PN_CHARS_BASE + u"](([." + PN_CHARS + u"])*[" + PN_CHARS + u"])?"
PN_LOCAL_ESC = u"[-\\_~.!$&'()*+,;=/?#@%]"

View File

@ -22,9 +22,9 @@ _log = ModuleLogger(globals())
time_machine = None
# some patterns
_date_regex = re.compile("^(\d{4})[-](0?[1-9]|1[0-4])[-]([0-3]?\d)$")
_time_regex = re.compile("^(\d+)[:](\d+)(?:[:](\d+)(?:[.](\d+))?)?$")
_deltatime_regex = re.compile("^(\d+(?:[.]\d+))?$")
_date_regex = re.compile(r"^(\d{4})[-](0?[1-9]|1[0-4])[-]([0-3]?\d)$")
_time_regex = re.compile(r"^(\d+)[:](\d+)(?:[:](\d+)(?:[.](\d+))?)?$")
_deltatime_regex = re.compile(r"^(\d+(?:[.]\d+))?$")
# @bacpypes_debugging - implicit via metaclass