Minor style changes.
This commit is contained in:
@@ -41,8 +41,7 @@ In subreddit mode you can browse through the top submissions on either the front
|
||||
:``o`` or ``ENTER``: Open the submission link with your web browser
|
||||
:``/``: Open a prompt to switch subreddits
|
||||
:``f``: Open a prompt to search the current subreddit
|
||||
:``p``: Toggles between FrontPage and last visited subreddit
|
||||
|
||||
:``p``: Toggle between the front page and the last visited subreddit
|
||||
|
||||
The ``/`` prompt accepts subreddits in the following formats
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ HELP = """
|
||||
`l` or `RIGHT` : Enter the selected submission
|
||||
`/` : Open a prompt to switch subreddits
|
||||
`f` : Open a prompt to search the current subreddit
|
||||
'p' : Toggles between FrontPage and last visited subreddit
|
||||
'p' : Toggle between the front page and last visited subreddit
|
||||
|
||||
[Submission Mode]
|
||||
`h` or `LEFT` : Return to subreddit mode
|
||||
|
||||
@@ -77,11 +77,10 @@ class SubredditPage(Page):
|
||||
@SubredditController.register(Command('SUBREDDIT_FRONTPAGE'))
|
||||
def show_frontpage(self):
|
||||
"""
|
||||
If on a subreddit, remeber it and head back to the front page.
|
||||
If on a subreddit, remember it and head back to the front page.
|
||||
If this was pressed on the front page, go back to the last subreddit.
|
||||
"""
|
||||
|
||||
target =''
|
||||
if not self.content.name == '/r/front':
|
||||
target = '/r/front'
|
||||
self._toggled_subreddit = self.content.name
|
||||
@@ -89,7 +88,7 @@ class SubredditPage(Page):
|
||||
target = self._toggled_subreddit
|
||||
|
||||
# target still may be empty string if this command hasn't yet been used
|
||||
if not target == None:
|
||||
if target is not None:
|
||||
self.refresh_content(order='ignore', name=target)
|
||||
|
||||
@SubredditController.register(Command('SUBREDDIT_OPEN'))
|
||||
|
||||
@@ -227,7 +227,9 @@ def test_subreddit_draw_header(subreddit_page, refresh_token, terminal):
|
||||
text = 'My Submissions'.encode('utf-8')
|
||||
terminal.stdscr.subwin.addstr.assert_any_call(0, 0, text)
|
||||
|
||||
|
||||
def test_subreddit_frontpage_toggle(subreddit_page, terminal):
|
||||
|
||||
with mock.patch.object(terminal, 'prompt_input'):
|
||||
terminal.prompt_input.return_value = 'aww'
|
||||
subreddit_page.controller.trigger('/')
|
||||
|
||||
Reference in New Issue
Block a user