From 52296aaabfab3fd89036e1acca23cd26d2a00173 Mon Sep 17 00:00:00 2001 From: davyd Date: Sat, 6 Mar 2004 09:13:58 +0000 Subject: [PATCH] compliancy fixes --- RSS1Writer.py | 20 +++++++++----------- RSS2Writer.py | 6 +++--- update-planet | 1 - 3 files changed, 12 insertions(+), 15 deletions(-) diff --git a/RSS1Writer.py b/RSS1Writer.py index 571998c..678f98d 100644 --- a/RSS1Writer.py +++ b/RSS1Writer.py @@ -2,12 +2,11 @@ # RSS1Writer # # A plugin to XMLWriter to output RSS version 1.0. -# This plugin has been developed with no regard for the RSS1.0 spec. # # (c) 2004, Davyd Madeley # -import time +import time, cgi class RSS1Writer: def __init__(self, planet): @@ -20,20 +19,20 @@ class RSS1Writer: output += '\n' % item.itemURL output += ' %s: %s\n' % (item.blogTitle, item.itemTitle) output += ' %s\n' % item.itemURL - output += ' \n' - output += item.contents - output += '\n \n' + output += ' \n' + output += cgi.escape(item.contents) + output += '\n \n' output += ' %s\n' % time.strftime('%Y-%m-%dT%H:%M:%S+00:00', time.gmtime(item.itemDate)) output += '\n' return output def write(self): itemcount = 0 - output = '= self.maxitems: break - output += '\n' - output += '' + output += '' return output diff --git a/RSS2Writer.py b/RSS2Writer.py index 848f78e..07a7f35 100644 --- a/RSS2Writer.py +++ b/RSS2Writer.py @@ -6,7 +6,7 @@ # (c) 2004, Davyd Madeley # -import time +import time, cgi class RSS2Writer: def __init__(self, planet): @@ -18,10 +18,10 @@ class RSS2Writer: output = '' output += '\n' output += ' %s: %s\n' % (item.blogTitle, item.itemTitle) - output += ' %s\n' % item.itemURL +# output += ' %s\n' % item.itemURL output += ' %s\n' % item.itemURL output += ' \n' - output += item.contents + output += cgi.escape(item.contents) output += '\n \n' output += '%s\n' % time.strftime('%a, %d %b %Y %H:%M:%S +0000', time.gmtime(item.itemDate)) output += '\n' diff --git a/update-planet b/update-planet index 91cd899..86fc4a8 100755 --- a/update-planet +++ b/update-planet @@ -59,4 +59,3 @@ try: codecs.open('rss1.xml', 'wb', 'utf-8').write(xmlwriter.write(RSS1Writer.RSS1Writer)) except: sys.stderr.write('DEBUG: update-planet: could not write rss1.xml, aborting\n') - raise -- 2.20.1