Modify re.match usage in scripts directory.
This commit is contained in:
parent
747a9bc5b6
commit
f74832328f
@ -154,17 +154,17 @@ class AsciiDoc:
|
|||||||
hidden = False
|
hidden = False
|
||||||
elif line == "The Compiler <mail@qutebrowser.org>\n":
|
elif line == "The Compiler <mail@qutebrowser.org>\n":
|
||||||
continue
|
continue
|
||||||
elif re.match(r'^:\w+:.*', line):
|
elif re.fullmatch(r':\w+:.*', line):
|
||||||
# asciidoc field
|
# asciidoc field
|
||||||
continue
|
continue
|
||||||
|
|
||||||
if not found_title:
|
if not found_title:
|
||||||
if re.match(r'^=+$', line):
|
if re.fullmatch(r'=+', line):
|
||||||
line = line.replace('=', '-')
|
line = line.replace('=', '-')
|
||||||
found_title = True
|
found_title = True
|
||||||
title = last_line.rstrip('\n') + " | qutebrowser\n"
|
title = last_line.rstrip('\n') + " | qutebrowser\n"
|
||||||
title += "=" * (len(title) - 1)
|
title += "=" * (len(title) - 1)
|
||||||
elif re.match(r'^= .+', line):
|
elif re.fullmatch(r'= .+', line):
|
||||||
line = '==' + line[1:]
|
line = '==' + line[1:]
|
||||||
found_title = True
|
found_title = True
|
||||||
title = last_line.rstrip('\n') + " | qutebrowser\n"
|
title = last_line.rstrip('\n') + " | qutebrowser\n"
|
||||||
|
@ -132,7 +132,7 @@ def filter_func(item):
|
|||||||
True if the missing function should be filtered/ignored, False
|
True if the missing function should be filtered/ignored, False
|
||||||
otherwise.
|
otherwise.
|
||||||
"""
|
"""
|
||||||
return bool(re.match(r'[a-z]+[A-Z][a-zA-Z]+', item.name))
|
return bool(re.fullmatch(r'[a-z]+[A-Z][a-zA-Z]+', item.name))
|
||||||
|
|
||||||
|
|
||||||
def report(items):
|
def report(items):
|
||||||
|
@ -142,7 +142,7 @@ def parse_entry(entry):
|
|||||||
dict_re = re.compile(r"""
|
dict_re = re.compile(r"""
|
||||||
(?P<filename>(?P<code>[a-z]{2}(-[A-Z]{2})?).*)\.bdic
|
(?P<filename>(?P<code>[a-z]{2}(-[A-Z]{2})?).*)\.bdic
|
||||||
""", re.VERBOSE)
|
""", re.VERBOSE)
|
||||||
match = dict_re.match(entry['name'])
|
match = dict_re.fullmatch(entry['name'])
|
||||||
if match is not None:
|
if match is not None:
|
||||||
return match.group('code'), match.group('filename')
|
return match.group('code'), match.group('filename')
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user