diff --git a/examples/images/feed-icon-10x10.png b/examples/images/feed-icon-10x10.png deleted file mode 100644 index cc869bc..0000000 Binary files a/examples/images/feed-icon-10x10.png and /dev/null differ diff --git a/examples/images/logo.png b/examples/images/logo.png deleted file mode 100644 index f277bf9..0000000 Binary files a/examples/images/logo.png and /dev/null differ diff --git a/examples/planet.css b/examples/planet.css deleted file mode 100644 index 05653c0..0000000 --- a/examples/planet.css +++ /dev/null @@ -1,150 +0,0 @@ -body { - border-right: 1px solid black; - margin-right: 200px; - - padding-left: 20px; - padding-right: 20px; -} - -h1 { - margin-top: 0px; - padding-top: 20px; - - font-family: "Bitstream Vera Sans", sans-serif; - font-weight: normal; - letter-spacing: -2px; - text-transform: lowercase; - text-align: right; - - color: grey; -} - -.admin { - text-align: right; -} - -h2 { - font-family: "Bitstream Vera Sans", sans-serif; - font-weight: normal; - color: #200080; - - margin-left: -20px; -} - -h3 { - font-family: "Bitstream Vera Sans", sans-serif; - font-weight: normal; - - background-color: #a0c0ff; - border: 1px solid #5080b0; - - padding: 4px; -} - -h3 a { - text-decoration: none; - color: inherit; -} - -h4 { - font-family: "Bitstream Vera Sans", sans-serif; - font-weight: bold; -} - -h4 a { - text-decoration: none; - color: inherit; -} - -img.face { - float: right; - margin-top: -3em; -} - -.entry { - margin-bottom: 2em; -} - -.entry .date { - font-family: "Bitstream Vera Sans", sans-serif; - color: grey; -} - -.entry .date a { - text-decoration: none; - color: inherit; -} - -.sidebar { - position: absolute; - top: 0px; - right: 0px; - width: 200px; - - margin-left: 0px; - margin-right: 0px; - padding-right: 0px; - - padding-top: 20px; - padding-left: 0px; - - font-family: "Bitstream Vera Sans", sans-serif; - font-size: 85%; -} - -.sidebar h2 { - font-size: 110%; - font-weight: bold; - color: black; - - padding-left: 5px; - margin-left: 0px; -} - -.sidebar ul { - padding-left: 1em; - margin-left: 0px; - - list-style-type: none; -} - -.sidebar ul li:hover { - color: grey; -} - -.sidebar ul li a { - text-decoration: none; -} - -.sidebar ul li a:hover { - text-decoration: underline; -} - -.sidebar ul li a img { - border: 0; -} - -.sidebar p { - border-top: 1px solid grey; - margin-top: 30px; - padding-top: 10px; - - padding-left: 5px; -} - -.sidebar .message { - cursor: help; - border-bottom: 1px dashed red; -} - -.sidebar a.message:hover { - cursor: help; - background-color: #ff0000; - color: #ffffff !important; - text-decoration: none !important; -} - -a:hover { - text-decoration: underline !important; - color: blue !important; -} diff --git a/examples/planet.xslt b/examples/planet.xslt deleted file mode 100644 index c9bc464..0000000 --- a/examples/planet.xslt +++ /dev/null @@ -1,67 +0,0 @@ - - - - - - - <xsl:value-of select="atom:title"/> - - -

- - - - - - -
- - - - -

-
- -

- - - - — - - - -

- -
- - - - - - - - -
-
-
diff --git a/planet/config.py b/planet/config.py index 69a4e76..77c4512 100644 --- a/planet/config.py +++ b/planet/config.py @@ -88,13 +88,14 @@ def __init__(): def load(config_file): """ initialize and load a configuration""" - import config, planet - log = planet.getLogger(config.log_level()) - global parser parser = ConfigParser() parser.read(config_file) + import config, planet + from planet import opml + log = planet.getLogger(config.log_level()) + # Theme support theme = config.output_theme() if theme: @@ -144,7 +145,7 @@ def load(config_file): except: log.exception("Unable to read %s readinglist", list) continue - planet.opml.opml2config(data, parser) + opml.opml2config(data, parser) # planet.foaf.foaf2config(data, list, config) def cache_sources_directory(): diff --git a/planet/reconstitute.py b/planet/reconstitute.py index cc72054..eb1548a 100644 --- a/planet/reconstitute.py +++ b/planet/reconstitute.py @@ -25,6 +25,7 @@ illegal_xml_chars = re.compile("[\x01-\x08\x0B\x0C\x0E-\x1F]") def createTextElement(parent, name, value): """ utility function to create a child element with the specified text""" if not value: return + if isinstance(value,str): value=value.decode('utf-8') xdoc = parent.ownerDocument xelement = xdoc.createElement(name) xelement.appendChild(xdoc.createTextNode(value)) @@ -64,17 +65,18 @@ def normalize(text, bozo): def id(xentry, entry): """ copy or compute an id for the entry """ - if entry.has_key("id"): + if entry.has_key("id") and entry.id: entry_id = entry.id - elif entry.has_key("link"): + elif entry.has_key("link") and entry.link: entry_id = entry.link - elif entry.has_key("title"): - entry_id = (entry.title_detail.base + "/" + + elif entry.has_key("title") and entry.title: + entry_id = (entry.title_detail.base + "/" + md5.new(entry.title).hexdigest()) - elif entry.has_key("summary"): - entry_id = (entry.summary_detail.base + "/" + + elif entry.has_key("summary") and entry.summary: + entry_id = (entry.summary_detail.base + "/" + md5.new(entry.summary).hexdigest()) - elif entry.has_key("content"): + elif entry.has_key("content") and entry.content: + entry_id = (entry.content[0].base + "/" + md5.new(entry.content[0].value).hexdigest()) else: diff --git a/planet/spider.py b/planet/spider.py index 8b1733b..e3fc7bd 100644 --- a/planet/spider.py +++ b/planet/spider.py @@ -69,7 +69,7 @@ def spiderFeed(feed): # write each entry to the cache cache = config.cache_directory() for entry in data.entries: - if not entry.has_key('id'): + if not entry.has_key('id') or not entry.id: entry['id'] = reconstitute.id(None, entry) if not entry['id']: continue diff --git a/themes/asf/index.html.xslt b/themes/asf/index.html.xslt index 5665700..718816e 100644 --- a/themes/asf/index.html.xslt +++ b/themes/asf/index.html.xslt @@ -1,13 +1,14 @@ - - - + + + <xsl:value-of select="atom:title"/> @@ -30,6 +31,7 @@

Subscriptions

+
    @@ -51,7 +53,7 @@
    Last updated:
    -
    +
    Powered by:
    Planet
    Export:
    @@ -65,7 +67,11 @@ - + +
    + + +
    @@ -76,7 +82,11 @@ -

    +

    + + , + +

    @@ -109,22 +119,14 @@ -
    - - - - - - - - - - - - - - -
    + + + + + + + + @@ -143,11 +145,32 @@ - + + + + + + + + + content + + + + + + +
    + + + + +
    +
    diff --git a/themes/common/atom.xml.xslt b/themes/common/atom.xml.xslt index aa608e2..1c35452 100644 --- a/themes/common/atom.xml.xslt +++ b/themes/common/atom.xml.xslt @@ -5,7 +5,7 @@ xmlns="http://www.w3.org/1999/xhtml"> - + @@ -15,6 +15,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + +