help message command added

This commit is contained in:
ysakamoto
2015-03-06 03:45:26 -06:00
parent a50317b311
commit b5d2852708
4 changed files with 50 additions and 10 deletions

View File

@@ -7,7 +7,7 @@ from .errors import SubredditNameError
from .page import BasePage
from .submission import SubmissionPage
from .content import SubredditContent
from .utils import LoadScreen, text_input, display_message, Color, ESCAPE
from .utils import LoadScreen, text_input, display_message, Color, ESCAPE, help_msg
class SubredditPage(BasePage):
@@ -52,6 +52,9 @@ class SubredditPage(BasePage):
elif cmd == curses.KEY_RESIZE:
self.draw()
elif cmd == ord('?'):
display_message(self.stdscr, help_msg)
elif cmd == ord('q'):
sys.exit()
@@ -132,4 +135,4 @@ class SubredditPage(BasePage):
text = '{author}'.format(**data)
win.addnstr(row, 1, text, n_cols-1, curses.A_BOLD)
text = ' {subreddit}'.format(**data)
win.addnstr(text, n_cols - win.getyx()[1], Color.YELLOW)
win.addnstr(text, n_cols - win.getyx()[1], Color.YELLOW)