mirror of https://github.com/python/cpython
ignore_from_idx(): Fixed bug in regular expression.
This commit is contained in:
parent
684f78fafe
commit
093c97a36f
|
@ -66,7 +66,7 @@ def main():
|
||||||
if data[:1] == "\\":
|
if data[:1] == "\\":
|
||||||
ignore_from_idx(data, ignore_dict)
|
ignore_from_idx(data, ignore_dict)
|
||||||
else:
|
else:
|
||||||
ignore_from_filelist(data, ignore_dict)
|
ignore_from_modulelist(data, ignore_dict)
|
||||||
if args or (annotate and categorize):
|
if args or (annotate and categorize):
|
||||||
usage()
|
usage()
|
||||||
sys.exit(2)
|
sys.exit(2)
|
||||||
|
@ -135,13 +135,13 @@ def main():
|
||||||
print string.join(modules, "\n")
|
print string.join(modules, "\n")
|
||||||
|
|
||||||
|
|
||||||
def ignore_from_filelist(data, ignore_dict):
|
def ignore_from_modulelist(data, ignore_dict):
|
||||||
for name in string.split(data):
|
for name in string.split(data):
|
||||||
ignore_dict[name] = name
|
ignore_dict[name] = name
|
||||||
|
|
||||||
def ignore_from_idx(data, ignore_dict):
|
def ignore_from_idx(data, ignore_dict):
|
||||||
data = string.replace(data, r"\hackscore {}", "_")
|
data = string.replace(data, r"\hackscore {}", "_")
|
||||||
rx = re.compile(r"\indexentry {([^@]*)@")
|
rx = re.compile(r"\\indexentry\s*{([^@]*)@")
|
||||||
for line in string.split(data, "\n"):
|
for line in string.split(data, "\n"):
|
||||||
m = rx.match(line)
|
m = rx.match(line)
|
||||||
if m:
|
if m:
|
||||||
|
|
Loading…
Reference in New Issue