gemini.git

going-flying.com gemini git repository

summary

tree

log

refs

c392855f72512bfabd4c792a452718540465599b - Matthew Ernisse - 1698498093

update for new python

view tree

view raw

diff --git a/files/thoughts-to-gemini.py b/files/thoughts-to-gemini.py
index 8e9a4ce..f55d610 100755
--- a/files/thoughts-to-gemini.py
+++ b/files/thoughts-to-gemini.py
@@ -31,10 +31,10 @@ import datetime
 import jinja2
 import json
 import os
-import pytz
 import requests
 import sys
 import time
+import zoneinfo
 
 from bs4 import BeautifulSoup
 from feedgen.feed import FeedGenerator
@@ -239,7 +239,7 @@ class Thoughts(object):
 			self._processThought(thought)
 			self._downloadAttachments(thoughtdir, thought)
 
-		now = datetime.datetime.now(pytz.timezone('US/Eastern'))
+		now = datetime.datetime.now(zoneinfo.ZoneInfo('US/Eastern'))
 		tmpl = jinja2.Template(
 			index_template,
 			trim_blocks=True,
@@ -274,7 +274,9 @@ class Thoughts(object):
 			pubdate = datetime.datetime.utcfromtimestamp(
 				entry['id']
 			)
-			pubdate = pubdate.replace(tzinfo=pytz.utc)
+			pubdate = pubdate.replace(
+				tzinfo=zoneinfo.ZoneInfo('UTC')
+			)
 
 			e = feed.add_entry()