Fixed stuff

This commit is contained in:
Thomas Baruchel 2022-11-05 15:38:35 +01:00
parent 52426bf0ab
commit d325942185
2 changed files with 5 additions and 5 deletions

View File

@ -8,7 +8,7 @@
<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:32:51</updated> <updated>2022-11-05T14:38:33+00:00Z</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>
@ -16,7 +16,7 @@
<entry> <entry>
<title>Initial entry</title> <title>Initial entry</title>
<id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id> <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
<updated>2022-11-05T00:00:00</updated> <updated>2022-11-05T00:00:00Z</updated>
<content type="xhtml"> <content type="xhtml">
<div xmlns="http://www.w3.org/1999/xhtml"><div class="section" id="initial-entry"> <div xmlns="http://www.w3.org/1999/xhtml"><div class="section" id="initial-entry">
<h1>Initial entry</h1> <h1>Initial entry</h1>

View File

@ -43,7 +43,7 @@ def extract_meta(html):
def find_date(d): def find_date(d):
""" """
Parse the comments in a <div> section and return a an ISO8601 formatted Parse the comments in a <div> section and return a an RFC 3339 formatted
string being the first recognized date string. string being the first recognized date string.
Raise dateutil.parser.ParserError if no such comment contains a date. Raise dateutil.parser.ParserError if no such comment contains a date.
@ -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(timespec='seconds') return t.isoformat(timespec='seconds') + "Z"
except dateutil.parser.ParserError: except dateutil.parser.ParserError:
pass pass
raise dateutil.parser.ParserError raise dateutil.parser.ParserError
@ -118,7 +118,7 @@ print("""<?xml version="1.0" encoding="utf-8"?>
docinfos["Author:"], docinfos["Author:"],
docinfos["Contact:"], docinfos["Contact:"],
meta["copyright"], meta["copyright"],
datetime.datetime.now().isoformat(timespec='seconds'), datetime.datetime.now(datetime.timezone.utc).isoformat(timespec='seconds') + "Z",
meta["original-source"], meta["original-source"],
meta["syndication-source"], meta["syndication-source"],
generator_uri, generator_name generator_uri, generator_name