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
|
:``o`` or ``ENTER``: Open the submission link with your web browser
|
||||||
:``/``: Open a prompt to switch subreddits
|
:``/``: Open a prompt to switch subreddits
|
||||||
:``f``: Open a prompt to search the current subreddit
|
:``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
|
The ``/`` prompt accepts subreddits in the following formats
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ HELP = """
|
|||||||
`l` or `RIGHT` : Enter the selected submission
|
`l` or `RIGHT` : Enter the selected submission
|
||||||
`/` : Open a prompt to switch subreddits
|
`/` : Open a prompt to switch subreddits
|
||||||
`f` : Open a prompt to search the current subreddit
|
`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]
|
[Submission Mode]
|
||||||
`h` or `LEFT` : Return to subreddit mode
|
`h` or `LEFT` : Return to subreddit mode
|
||||||
|
|||||||
@@ -77,20 +77,19 @@ class SubredditPage(Page):
|
|||||||
@SubredditController.register(Command('SUBREDDIT_FRONTPAGE'))
|
@SubredditController.register(Command('SUBREDDIT_FRONTPAGE'))
|
||||||
def show_frontpage(self):
|
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.
|
If this was pressed on the front page, go back to the last subreddit.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
target =''
|
|
||||||
if not self.content.name == '/r/front':
|
if not self.content.name == '/r/front':
|
||||||
target = '/r/front'
|
target = '/r/front'
|
||||||
self._toggled_subreddit = self.content.name
|
self._toggled_subreddit = self.content.name
|
||||||
else:
|
else:
|
||||||
target = self._toggled_subreddit
|
target = self._toggled_subreddit
|
||||||
|
|
||||||
# target still may be emptystring if this command hasn't yet been used
|
# 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)
|
self.refresh_content(order='ignore', name=target)
|
||||||
|
|
||||||
@SubredditController.register(Command('SUBREDDIT_OPEN'))
|
@SubredditController.register(Command('SUBREDDIT_OPEN'))
|
||||||
def open_submission(self, url=None):
|
def open_submission(self, url=None):
|
||||||
|
|||||||
@@ -227,7 +227,9 @@ def test_subreddit_draw_header(subreddit_page, refresh_token, terminal):
|
|||||||
text = 'My Submissions'.encode('utf-8')
|
text = 'My Submissions'.encode('utf-8')
|
||||||
terminal.stdscr.subwin.addstr.assert_any_call(0, 0, text)
|
terminal.stdscr.subwin.addstr.assert_any_call(0, 0, text)
|
||||||
|
|
||||||
|
|
||||||
def test_subreddit_frontpage_toggle(subreddit_page, terminal):
|
def test_subreddit_frontpage_toggle(subreddit_page, terminal):
|
||||||
|
|
||||||
with mock.patch.object(terminal, 'prompt_input'):
|
with mock.patch.object(terminal, 'prompt_input'):
|
||||||
terminal.prompt_input.return_value = 'aww'
|
terminal.prompt_input.return_value = 'aww'
|
||||||
subreddit_page.controller.trigger('/')
|
subreddit_page.controller.trigger('/')
|
||||||
|
|||||||
Reference in New Issue
Block a user