going-flying.com gemini git repository
2a88cf85c05ef3f883a7cd1ce15d21032cf6252d - Matthew Ernisse - 1649385890
thinko?
diff --git a/build/build.py b/build/build.py index d5d258b..4bdcd96 100755 --- a/build/build.py +++ b/build/build.py @@ -112,7 +112,6 @@ class GeminiFeed(object): # the date of it so that we can notify Antenna if we end up # having new posts in it. self.last_date = 0 - print(f'looking for {self.file_name}') if os.path.exists(self.file_name): try: parsed = feedparser.parse(self.file_name) @@ -121,7 +120,6 @@ class GeminiFeed(object): return self.last_date = parsed['feed']['updated'] - print(self.last_date) def add(self, title, link, pubdate): ''' Add an entry to the feed. ''' @@ -135,18 +133,15 @@ class GeminiFeed(object): ''' Return True if we should notifiy services that we've updated the feed.''' if self.last_date == 0: - print('no last date') return False if self.feed['updated'] <= self.last_date: - print('updated earlier than last date') return False - print('do update') return True - def write(self, fn): - self.feed.atom_file(fn) + def write(self): + self.feed.atom_file(self.file_name) class GeminiTextUnfolder(object): @@ -213,7 +208,7 @@ if __name__ == '__main__': adir = os.path.join(bdir, 'articles') tdir = os.path.dirname(os.path.realpath(__file__)) - feed = GeminiFeed(os.path.join(bdir, 'feed.xml')) + feed = GeminiFeed(os.path.join(bdir, 'atom.xml')) with open(os.path.join(tdir, 'template.txt'), encoding='utf-8') as fd: article_template = fd.read() @@ -262,7 +257,7 @@ if __name__ == '__main__': with open(output, 'w', encoding='utf-8') as fd: fd.write(index_template.render({'articles': articles})) - feed.write(os.path.join(bdir, 'atom.xml')) + feed.write() if not feed.should_notify(): sys.exit()