The first try of implementing fetching all articles at once and a splash screen.

master
VikingKong 3 years ago
parent 788b8bf39a
commit d17dd66c44

@ -31,3 +31,8 @@ class Fetcher:
def articlesFromFeed(self, feed, category):
return [article for article in self.articles[category] if article["origin"]["streamId"] == feed]
def fetch(self):
for category in self.categories:
yield "Fetching category " + category["name"]
self.articlesFromCategory(category["name"], str(self.unreadCounts[category["id"]][0]))

@ -197,7 +197,6 @@ class TUI(urwid.Frame):
self.activePane = False
self.executor = ThreadPoolExecutor(max_workers=1)
self.loop = None
self.articleItems = [urwid.Text("Article# " + str(i)) for i in range(0, 10)]
self.feedView = LeftPane(self.fetcher.categories)
self.articleView = RightPane([])
self.leftBox = urwid.LineBox(self.feedView, title="Categories")
@ -225,6 +224,18 @@ class TUI(urwid.Frame):
self.container.set_focus(int(self.activePane))
elif key == "q":
raise urwid.ExitMainLoop()
elif key == "f":
self.olb = urwid.ListBox(urwid.SimpleListWalker([urwid.Text("TEST")]))
overlay = urwid.Overlay(
urwid.LineBox(self.olb),
self.body, align="center", width=("relative", 50), valign="middle", height=3)
self.body = overlay
elif key == "F":
articles = tui.fetcher.fetch()
# for text in articles:
# print(text)
# self.olb.body = urwid.SimpleListWalker([urwid.Text(text)])
# self.body = overlay.bottom_w
tui = TUI.create()

Loading…
Cancel
Save