Skip to content

Commit

Permalink
Merge pull request SchrodingersGat#177 from SchrodingersGat/user-desc…
Browse files Browse the repository at this point in the history
…ription-field

Allow user to specify description field if desired
  • Loading branch information
SchrodingersGat committed Nov 9, 2022
2 parents bb80ab2 + c415d7b commit ac29a12
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kibom/component.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ def getSheetpathNames(self):
return self.element.get("sheetpath", "names")

def getDescription(self):
"""Extract the 'description' field for this component"""

# Give priority to a user "description" field
ret = self.element.get("field", "name", "description")
if ret:
return ret

try:
ret = self.element.get("libsource", "description")
except:
Expand Down

0 comments on commit ac29a12

Please sign in to comment.