]> oss.titaniummirror.com Git - webber.git/blobdiff - plugins/rss_feed.py
Fix directories key error in get_path_to_root
[webber.git] / plugins / rss_feed.py
index 580d3040925ec0e07af77fd8af67eab82add60b4..6104bf51139da3f5b8aced75c0f81f3ef93dbfad 100644 (file)
@@ -27,16 +27,16 @@ def checkconfig(params):
 # Helper class needed for datetime.datetime to generate GMT timestamps
 ZERO = datetime.timedelta(0)
 class UTC(datetime.tzinfo):
-    """UTC"""
+       """UTC"""
 
-    def utcoffset(self, dt):
-        return ZERO
+       def utcoffset(self, dt):
+               return ZERO
 
-    def tzname(self, dt):
-        return "UTC"
+       def tzname(self, dt):
+               return "UTC"
 
-    def dst(self, dt):
-        return ZERO
+       def dst(self, dt):
+               return ZERO
 utc = UTC()
 
 
@@ -45,17 +45,22 @@ def sitemap_scan(params):
        global items
 
        file = params.file
+       # Only consider new stuff
        if max_age and file["mtime"] < max_age:
                return
+       # Ignore non-pages
        if not file.has_key("linktitle"):
                return
+       # Ignore hidden pages
+       if file.has_key("hide") and file.hide:
+               return
+
        if file.has_key("change"):
                change = file["change"]
        else:
                change = ""
 
-       fname_out = os.path.join(cfg.out_dir, file.out_path)
-       full_url = "http://%s/%s" % (cfg.main_url, fname_out)
+       full_url = "http://%s/%s" % (cfg.main_url, file.out_path)
        item = PyRSS2Gen.RSSItem(
                title = file["title"],
                link = full_url,