mirror of
https://github.com/lightning/bolts.git
synced 2025-03-13 11:35:41 +01:00
tools/extract-formats: suppress modern Python warnings.
It complains about escapes unless we tell it it's a regex: ``` /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:27: SyntaxWarning: invalid escape sequence '\.' '(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:29: SyntaxWarning: invalid escape sequence '\.' '(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:31: SyntaxWarning: invalid escape sequence '\.' '(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:33: SyntaxWarning: invalid escape sequence '\s' '\s+([0-9]+\.|\*) \[`(?P<typefield>[-._a-zA-Z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:35: SyntaxWarning: invalid escape sequence '\.' '(2\.|\*) data:') /home/rusty/devel/cvs/bolts/./tools/extract-formats.py:37: SyntaxWarning: invalid escape sequence '\.' '(2\.|\*) types:') ``` Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
79101063c3
commit
a09564a8b7
1 changed files with 6 additions and 6 deletions
|
@ -24,17 +24,17 @@ import fileinput
|
||||||
|
|
||||||
# We allow either ordered or unordered lists.
|
# We allow either ordered or unordered lists.
|
||||||
typeline = re.compile(
|
typeline = re.compile(
|
||||||
'(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?')
|
r'(1\.|\*) type: (?P<value>[-0-9A-Za-z_|]+) \(`(?P<name>[A-Za-z0-9_]+)`\)( \(`?(?P<option>[^)`]*)`\))?')
|
||||||
tlvline = re.compile(
|
tlvline = re.compile(
|
||||||
'(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`')
|
r'(1\.|\*) `tlv_stream`: `(?P<name>[A-Za-z0-9_]+)`')
|
||||||
subtypeline = re.compile(
|
subtypeline = re.compile(
|
||||||
'(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`')
|
r'(1\.|\*) subtype: `(?P<name>[A-Za-z0-9_]+)`')
|
||||||
dataline = re.compile(
|
dataline = re.compile(
|
||||||
'\s+([0-9]+\.|\*) \[`(?P<typefield>[-._a-zA-Z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]')
|
r'\s+([0-9]+\.|\*) \[`(?P<typefield>[-._a-zA-Z0-9*+]+)`:`(?P<name>[_a-z0-9]+)`\]')
|
||||||
datastartline = re.compile(
|
datastartline = re.compile(
|
||||||
'(2\.|\*) data:')
|
r'(2\.|\*) data:')
|
||||||
tlvtypesline = re.compile(
|
tlvtypesline = re.compile(
|
||||||
'(2\.|\*) types:')
|
r'(2\.|\*) types:')
|
||||||
|
|
||||||
# Generator to give us one line at a time.
|
# Generator to give us one line at a time.
|
||||||
def next_line(args, lines):
|
def next_line(args, lines):
|
||||||
|
|
Loading…
Add table
Reference in a new issue