From 8b428ef5219abcd06c27aae690790af6b3dfcf2e Mon Sep 17 00:00:00 2001 From: Louis Abel Date: Tue, 12 Sep 2023 03:25:27 -0700 Subject: [PATCH] ensure double descriptions aren't happening --- mangle/generators/rss.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mangle/generators/rss.py b/mangle/generators/rss.py index 45bb967..33fee18 100644 --- a/mangle/generators/rss.py +++ b/mangle/generators/rss.py @@ -117,7 +117,10 @@ class RepoRSS: package_hex = binascii.hexlify(package.chksum[1]).decode() title = xmlescape(str(package)) date = time.gmtime(float(package.buildtime)) - description = package.description + pkg_description = package.description + # package.description is sometimes a NoneType. Don't know why. + if not pkg_description: + pkg_description = '' link = xmlescape(package.remote_location()) # form description changelog = '' @@ -136,7 +139,7 @@ class RepoRSS: desc = meta['text'] changelog += f'{cl_date} - {author}\n{desc}\n\n' description = '

{} - {}

\n\n'.format(xmlescape(package.name), xmlescape(package.summary)) - description += '

%s

\n\n

Change Log:

\n\n' % xmlescape(to_unicode(description.replace("\n", "
\n"))) + description += '

%s

\n\n

Change Log:

\n\n' % xmlescape(to_unicode(pkg_description.replace("\n", "
\n"))) description += xmlescape('
{}
'.format(xmlescape(to_unicode(changelog)))) # start item