Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix deprecation warnings in doxygen parser
  • Loading branch information
nyalldawson committed Jan 13, 2020
1 parent 7dfdd28 commit 4c8ce04
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions tests/code_layout/doxygen_parser.py
Expand Up @@ -212,9 +212,9 @@ def classElemIsBindable(self, elem):
# check for classes with special python doc notes (probably 'not available' or renamed classes, either way
# they should be safe to ignore as obviously some consideration has been given to Python bindings)
detailed_sec = elem.find('detaileddescription')
for p in detailed_sec.getiterator('para'):
for s in p.getiterator('simplesect'):
for ps in s.getiterator('para'):
for p in detailed_sec.iter('para'):
for s in p.iter('simplesect'):
for ps in s.iter('para'):
if ps.text and 'python' in ps.text.lower():
return False
return True
Expand All @@ -232,7 +232,7 @@ def parseClassElem(self, e):
bindable_members = []
broken_links = {}
# loop through all members
for m in e.getiterator('memberdef'):
for m in e.iter('memberdef'):
signature = self.memberSignature(m)
if signature is None:
continue
Expand Down Expand Up @@ -263,10 +263,10 @@ def parseClassElem(self, e):
# test for "added in QGIS xxx" string
d = e.find('detaileddescription')
found_version_added = False
for para in d.getiterator('para'):
for s in para.getiterator('simplesect'):
for para in d.iter('para'):
for s in para.iter('simplesect'):
if s.get('kind') == 'since':
for p in s.getiterator('para'):
for p in s.iter('para'):
if self.version_regex.match(p.text):
found_version_added = True
break
Expand Down Expand Up @@ -320,9 +320,9 @@ def elemIsBindableMember(self, elem):
# they should be safe to ignore as obviously some consideration has been given to Python bindings)
try:
detailed_sec = elem.find('detaileddescription')
for p in detailed_sec.getiterator('para'):
for s in p.getiterator('simplesect'):
for ps in s.getiterator('para'):
for p in detailed_sec.iter('para'):
for s in p.iter('simplesect'):
for ps in s.iter('para'):
if ps.text and 'python' in ps.text.lower():
return False
except:
Expand Down Expand Up @@ -525,8 +525,8 @@ def isDeprecated(self, member_elem):
doxy_deprecated = False
has_description = True
try:
for p in member_elem.find('detaileddescription').getiterator('para'):
for s in p.getiterator('xrefsect'):
for p in member_elem.find('detaileddescription').iter('para'):
for s in p.iter('xrefsect'):
if s.find('xreftitle') is not None and 'Deprecated' in s.find('xreftitle').text:
doxy_deprecated = True
if s.find('xrefdescription') is None or s.find('xrefdescription').find('para') is None:
Expand Down Expand Up @@ -566,7 +566,7 @@ def memberDocIsNonCompliant(self, member_elem):
for doc_type in ['briefdescription']:
doc = member_elem.find(doc_type)
if doc is not None:
for para in doc.getiterator('para'):
for para in doc.iter('para'):
if not para.text:
continue
if para.text.strip().lower().startswith('getter'):
Expand All @@ -591,12 +591,12 @@ def checkForBrokenSeeAlsoLinks(self, elem):
"""
broken = []
detailed_sec = elem.find('detaileddescription')
for p in detailed_sec.getiterator('para'):
for s in p.getiterator('simplesect'):
for p in detailed_sec.iter('para'):
for s in p.iter('simplesect'):
if s.get('kind') != 'see':
continue

para = s.getchildren()[0]
para = list(s.iter())[1]
if para.find('ref') is None and para.text and (not para.text.startswith('Q') or para.text.startswith('Qgs')):
broken.append(para.text)

Expand Down

0 comments on commit 4c8ce04

Please sign in to comment.