Fixed stuff

This commit is contained in:
Thomas Baruchel 2022-11-05 15:33:01 +01:00
parent b09626dc20
commit 52426bf0ab
2 changed files with 6 additions and 3 deletions

View File

@ -2,12 +2,13 @@
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<id>https://git.sdf.org/baruchel/feeds/raw/branch/master/src/blog.rst</id> <id>https://git.sdf.org/baruchel/feeds/raw/branch/master/src/blog.rst</id>
<title>Th. Baruchel's personal Atom feed</title> <title>Th. Baruchel's personal Atom feed</title>
<subtitle>Thomas Baruchel's casual blog concerning Computer Science</subtitle>
<author> <author>
<name>Thomas Baruchel</name> <name>Thomas Baruchel</name>
<email>baruchel@sdf.org</email> <email>baruchel@sdf.org</email>
</author> </author>
<rights>CC BY-SA 4.0</rights> <rights>CC BY-SA 4.0</rights>
<updated>2022-11-05T15:24:47.592152</updated> <updated>2022-11-05T15:32:51</updated>
<link href="https://git.sdf.org/baruchel/feeds/raw/branch/master/src/blog.rst" /> <link href="https://git.sdf.org/baruchel/feeds/raw/branch/master/src/blog.rst" />
<link href="https://git.sdf.org/baruchel/feeds/raw/branch/master/atom/blog.xml" rel="self" /> <link href="https://git.sdf.org/baruchel/feeds/raw/branch/master/atom/blog.xml" rel="self" />
<generator uri="https://git.sdf.org/baruchel/feeds/src/branch/master/rst2atom.py">rst2atom</generator> <generator uri="https://git.sdf.org/baruchel/feeds/src/branch/master/rst2atom.py">rst2atom</generator>

View File

@ -60,7 +60,7 @@ def find_date(d):
for k in c.extract().split(" "): for k in c.extract().split(" "):
try: try:
t = dateutil.parser.parse(k) t = dateutil.parser.parse(k)
return t.isoformat() return t.isoformat(timespec='seconds')
except dateutil.parser.ParserError: except dateutil.parser.ParserError:
pass pass
raise dateutil.parser.ParserError raise dateutil.parser.ParserError
@ -101,6 +101,7 @@ print("""<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"> <feed xmlns="http://www.w3.org/2005/Atom">
<id>%s</id> <id>%s</id>
<title>%s</title> <title>%s</title>
<subtitle>%s</subtitle>
<author> <author>
<name>%s</name> <name>%s</name>
<email>%s</email> <email>%s</email>
@ -113,10 +114,11 @@ print("""<?xml version="1.0" encoding="utf-8"?>
""" % ( """ % (
meta["original-source"], meta["original-source"],
html["title"], html["title"],
meta["description"],
docinfos["Author:"], docinfos["Author:"],
docinfos["Contact:"], docinfos["Contact:"],
meta["copyright"], meta["copyright"],
datetime.datetime.now().isoformat(), datetime.datetime.now().isoformat(timespec='seconds'),
meta["original-source"], meta["original-source"],
meta["syndication-source"], meta["syndication-source"],
generator_uri, generator_name generator_uri, generator_name