]> oss.titaniummirror.com Git - webber.git/blobdiff - plugins/rss_feed.py
rss_feed.py: simply XML formatting
[webber.git] / plugins / rss_feed.py
index 71c54111bd786660143ed6d5ca0c98603ced7671..a4197b1e16fd37845f51d363ad08ede01f6a7fee 100644 (file)
@@ -50,7 +50,7 @@ def sitemap_scan(params):
        item = PyRSS2Gen.RSSItem(
                title = file["title"],
                link = full_url,
-               guid = PyRSS2Gen.Guid("%s %s" % (full_url, file["mtime"])),
+               guid = PyRSS2Gen.Guid("%s %s" % (full_url, file["mtime"]), isPermaLink=0),
                description = change,
                pubDate = datetime.datetime.fromtimestamp(file["mtime"], utc),
        )
@@ -71,4 +71,8 @@ def finish(params):
                os.makedirs(cfg.out_dir)
        except:
                pass
-       rss.write_xml( open(os.path.join(cfg.out_dir, cfg.rss_file), "w"))
+       f = open(os.path.join(cfg.out_dir, cfg.rss_file), "w")
+       # Ugly XML beautification
+       s = rss.to_xml().replace("<", "\n<").replace("\n\n", "\n")[1:]
+       f.write(s)
+       f.write("\n")