Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The app is failing for a lot of people right now. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions doxyclean.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,12 @@ def fileIsDocumented(filePath):
return False

# Check if the object is documented
originaldoc = minidom.parse(filePath)

try:
originaldoc = minidom.parse(filePath)
except Exception:
return False

briefList = originaldoc.getElementsByTagName('briefdescription')
detailList = originaldoc.getElementsByTagName('detaileddescription')

Expand All @@ -80,14 +85,21 @@ def nameForFile(filePath):
return None

xmlDoc = minidom.parse(filePath)
return xmlDoc.getElementsByTagName("name")[0].firstChild.data

try:
return xmlDoc.getElementsByTagName("name")[0].firstChild.data
except Exception:
return "<NoName/>"

def typeForFile(filePath):
if not os.path.splitext(filePath)[1] == ".xml":
return None

xmlDoc = minidom.parse(filePath)
return xmlDoc.getElementsByTagName("object")[0].attributes["kind"].value
try:
return xmlDoc.getElementsByTagName("object")[0].attributes["kind"].value
except Exception:
return "<NoType/>"

def cleanXML(filePath, outputDirectory):
if not fileIsDocumented(filePath):
Expand Down Expand Up @@ -1050,6 +1062,8 @@ def linkify(directory, shouldEstablishIPhoneLinks):
target = "../Categories/{name}"
elif objectType == "protocol":
target = "../Protocols/{name}"
else:
continue

documentedTargets[objectName] = target

Expand All @@ -1071,6 +1085,10 @@ def linkify(directory, shouldEstablishIPhoneLinks):
continue

refName = refNode.childNodes[0].nodeValue

if documentedTargets.has_key(refName) == False:
continue

formatString = documentedTargets[refName]
refTarget = formatString.format(name=refName)
refNode.setAttribute("id", refTarget)
Expand Down Expand Up @@ -1217,4 +1235,4 @@ def main(argv=None):
return 0

if __name__ == '__main__':
sys.exit(main())
sys.exit(main())