mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-07-31 05:57:16 +00:00
apibuild: Fix -refs.xml building
Another usage of deprecated 'string' functions. We are just trying to match ascii letters here, so use a simple regex. And again drop the aggressive exception handling, it doesn't seem to trigger for anything in libvirt code. Signed-off-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
parent
960ff97be3
commit
e39a7cd256
@ -11,7 +11,6 @@
|
|||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
import os, sys
|
import os, sys
|
||||||
import string
|
|
||||||
import glob
|
import glob
|
||||||
import re
|
import re
|
||||||
|
|
||||||
@ -2092,23 +2091,20 @@ class docBuilder:
|
|||||||
str = str.replace(';', ' ')
|
str = str.replace(';', ' ')
|
||||||
tokens = str.split()
|
tokens = str.split()
|
||||||
for token in tokens:
|
for token in tokens:
|
||||||
try:
|
c = token[0]
|
||||||
c = token[0]
|
if not re.match(r"[a-zA-Z]", c):
|
||||||
if string.letters.find(c) < 0:
|
|
||||||
pass
|
|
||||||
elif len(token) < 3:
|
|
||||||
pass
|
|
||||||
else:
|
|
||||||
lower = string.lower(token)
|
|
||||||
# TODO: generalize this a bit
|
|
||||||
if lower == 'and' or lower == 'the':
|
|
||||||
pass
|
|
||||||
elif token in self.xref:
|
|
||||||
self.xref[token].append(id)
|
|
||||||
else:
|
|
||||||
self.xref[token] = [id]
|
|
||||||
except:
|
|
||||||
pass
|
pass
|
||||||
|
elif len(token) < 3:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
lower = token.lower()
|
||||||
|
# TODO: generalize this a bit
|
||||||
|
if lower == 'and' or lower == 'the':
|
||||||
|
pass
|
||||||
|
elif token in self.xref:
|
||||||
|
self.xref[token].append(id)
|
||||||
|
else:
|
||||||
|
self.xref[token] = [id]
|
||||||
|
|
||||||
def analyze(self):
|
def analyze(self):
|
||||||
if not quiet:
|
if not quiet:
|
||||||
|
Loading…
Reference in New Issue
Block a user