Fix a few weird dictionary lookups in the index

This commit is contained in:
Veronica Berglyd Olsen
2022-10-19 00:04:31 +02:00
parent f34d95edaa
commit c40ace1290
+3 -9
View File
@@ -668,23 +668,17 @@ class TagsIndex:
def tagHandle(self, tagKey):
"""Get the handle of a given tag.
"""
if tagKey in self._tags:
return self._tags.get(tagKey).get("handle")
return None
return self._tags.get(tagKey, {}).get("handle", None)
def tagHeading(self, tagKey):
"""Get the heading of a given tag.
"""
if tagKey in self._tags:
return self._tags.get(tagKey).get("heading")
return nwHeaders.TT_NONE
return self._tags.get(tagKey, {}).get("heading", nwHeaders.TT_NONE)
def tagClass(self, tagKey):
"""Get the class of a given tag.
"""
if tagKey in self._tags:
return self._tags.get(tagKey).get("class")
return None
return self._tags.get(tagKey, {}).get("class", None)
##
# Pack/Unpack