Tue Dec 13 14:12:44 UTC 2005  Alberto Bertogli <albertogli@telpin.com.ar>
  * Small changes to do_atom(), make it validate.
{
hunk ./darcsweb.cgi 22
+import email.Utils
hunk ./darcsweb.cgi 237
+<link rel="alternate" title="%(reponame)s" href="%(url)s;a=atom"
+		type='application/atom+xml'/>
hunk ./darcsweb.cgi 1727
-	print """<feed xmlns="http://www.w3.org/2005/Atom">
+	str_lastmod = time.strftime(iso_datetime,
+			time.localtime(repo_lastmod))
+
+	print """
+<feed xmlns="http://www.w3.org/2005/Atom">
hunk ./darcsweb.cgi 1734
-  <link rel="self" type="application/atom+xml" href="%(url)s/%(reponame)s;a=atom"/>
+  <link rel="self" type="application/atom+xml" href="%(url)s;a=atom"/>
hunk ./darcsweb.cgi 1744
-		'lastmod': 	time.strftime(iso_datetime, time.localtime(repo_lastmod))}
+		'lastmod': str_lastmod,
+	}
+
hunk ./darcsweb.cgi 1756
+		addr, author = email.Utils.parseaddr(p.author)
+		if not addr:
+			addr = "unknown_email@example.com"
+		if not author:
+			author = addr
+
hunk ./darcsweb.cgi 1765
-    <author><name>%(author)s</name><!-- TODO: parse it to get the email. Not obvious, darcs authors can be anything --></author>
+    <author>
+      <name>%(author)s</name>
+      <email>%(email)s</email>
+    </author>
hunk ./darcsweb.cgi 1770
-    <id>%(url)s/%(pname)s</id> <!-- TODO: find a better <id>, see RFC 4151 -->
+    <id>%(link)s</id>
hunk ./darcsweb.cgi 1773
+    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>
hunk ./darcsweb.cgi 1776
-			'author': p.author,
+			'author': author,
+			'email': addr,
hunk ./darcsweb.cgi 1780
+			'myrname': config.myreponame,
+			'hash': p.hash,
hunk ./darcsweb.cgi 1786
+
hunk ./darcsweb.cgi 1788
-		print '    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>'
hunk ./darcsweb.cgi 1802
-[_^I_][_$_]
+
}