Fix a few weird dictionary lookups in the index
This commit is contained in:
@@ -668,23 +668,17 @@ class TagsIndex:
|
|||||||
def tagHandle(self, tagKey):
|
def tagHandle(self, tagKey):
|
||||||
"""Get the handle of a given tag.
|
"""Get the handle of a given tag.
|
||||||
"""
|
"""
|
||||||
if tagKey in self._tags:
|
return self._tags.get(tagKey, {}).get("handle", None)
|
||||||
return self._tags.get(tagKey).get("handle")
|
|
||||||
return None
|
|
||||||
|
|
||||||
def tagHeading(self, tagKey):
|
def tagHeading(self, tagKey):
|
||||||
"""Get the heading of a given tag.
|
"""Get the heading of a given tag.
|
||||||
"""
|
"""
|
||||||
if tagKey in self._tags:
|
return self._tags.get(tagKey, {}).get("heading", nwHeaders.TT_NONE)
|
||||||
return self._tags.get(tagKey).get("heading")
|
|
||||||
return nwHeaders.TT_NONE
|
|
||||||
|
|
||||||
def tagClass(self, tagKey):
|
def tagClass(self, tagKey):
|
||||||
"""Get the class of a given tag.
|
"""Get the class of a given tag.
|
||||||
"""
|
"""
|
||||||
if tagKey in self._tags:
|
return self._tags.get(tagKey, {}).get("class", None)
|
||||||
return self._tags.get(tagKey).get("class")
|
|
||||||
return None
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Pack/Unpack
|
# Pack/Unpack
|
||||||
|
|||||||
Reference in New Issue
Block a user