Skip to content

Commit

Permalink
pkginfo: Use AppStream's function for formatting flatpak
Browse files Browse the repository at this point in the history
descriptions.

This avoids an extra dependency also.
  • Loading branch information
mtwebster committed Jul 11, 2024
1 parent 8ec5d4f commit c835184
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion debian/control
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ Depends: python3,
gir1.2-xapp-1.0,
gir1.2-appstream-1.0,
gir1.2-xmlb-2.0,
html2text,
mint-translations,
libgtk3-perl
${misc:Depends},
Expand Down
7 changes: 5 additions & 2 deletions usr/lib/python3/dist-packages/mintcommon/installer/pkgInfo.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import html2text
import sys
if sys.version_info.major < 3:
raise "python3 required"
Expand Down Expand Up @@ -373,7 +372,11 @@ def get_description(self, as_component=None):
description = as_component.get_description()

if description is not None:
self.description = html2text.html2text(description)
try:
self.description = AppStream.markup_convert(description, AppStream.MarkupKind.TEXT)
except GLib.Error as e:
warn("Could not convert description to text: %s" % e.message)
self.description = description

if self.description is None:
return ""
Expand Down

0 comments on commit c835184

Please sign in to comment.