'#', text.ColouredString("Timeline for a #hashtag",
" K ")))
self.items.append(text.BlankLine())
+ self.items.append(text.MenuKeypressLine(
+ 'I', text.ColouredString("View a post by its ID",
+ " K ")))
+ self.items.append(text.BlankLine())
self.items.append(text.MenuKeypressLine(
'C', text.ColouredString("Compose a post",
"K ")))
self.push_to(BottomLinePrompt(
self.cc, self.got_hashtag_to_view,
"View feed for hashtag: "))
+ elif ch in {'i', 'I'}:
+ self.push_to(BottomLinePrompt(
+ self.cc, self.got_post_id_to_view,
+ "View post with id: "))
else:
return super().handle_key(ch)
f"Posts mentioning hashtag #{tag}", 'H')
self.push_to(StatusFile(self.cc, feed, title))
+ def got_post_id_to_view(self, post_id):
+ post_id = post_id.strip()
+ if post_id == "":
+ return
+
+ try:
+ self.push_to(StatusInfoFile(self.cc, post_id))
+ except client.HTTPError:
+ curses.beep()
+
class EscMenu(Menu):
def __init__(self, cc):
super().__init__(cc)