From c83518430e9b5e289852831725cc4405eb1f9537 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Thu, 11 Jul 2024 19:17:30 -0400 Subject: [PATCH] pkginfo: Use AppStream's function for formatting flatpak descriptions. This avoids an extra dependency also. --- debian/control | 1 - .../python3/dist-packages/mintcommon/installer/pkgInfo.py | 7 +++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index 734d7e7..d529540 100644 --- a/debian/control +++ b/debian/control @@ -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}, diff --git a/usr/lib/python3/dist-packages/mintcommon/installer/pkgInfo.py b/usr/lib/python3/dist-packages/mintcommon/installer/pkgInfo.py index 3397f7c..7be2cd5 100644 --- a/usr/lib/python3/dist-packages/mintcommon/installer/pkgInfo.py +++ b/usr/lib/python3/dist-packages/mintcommon/installer/pkgInfo.py @@ -1,4 +1,3 @@ -import html2text import sys if sys.version_info.major < 3: raise "python3 required" @@ -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 ""