Missed some changes.

This commit is contained in:
Michael Lazar
2016-07-19 01:11:06 -07:00
parent 61ae63438f
commit 6094b45029
4 changed files with 15 additions and 15 deletions

View File

@@ -9,7 +9,7 @@ from .content import SubredditContent
from .page import Page, PageController, logged_in from .page import Page, PageController, logged_in
from .objects import Navigator, Color, Command from .objects import Navigator, Color, Command
from .submission import SubmissionPage from .submission import SubmissionPage
from .reddits import SubscriptionPage from .subscription import SubscriptionPage
from .exceptions import TemporaryFileError from .exceptions import TemporaryFileError

View File

@@ -4,27 +4,27 @@ from __future__ import unicode_literals
import curses import curses
from .page import Page, PageController from .page import Page, PageController
from .content import ListRedditsContent from .content import SubscriptionContent
from .objects import Color, Navigator, Command from .objects import Color, Navigator, Command
class ListRedditsController(PageController): class SubscriptionController(PageController):
character_map = {} character_map = {}
class ListRedditsPage(Page): class SubscriptionPage(Page):
def __init__(self, reddit, name, func, term, config, oauth): def __init__(self, reddit, name, func, term, config, oauth):
super(ListRedditsPage, self).__init__(reddit, term, config, oauth) super(SubscriptionPage, self).__init__(reddit, term, config, oauth)
self.controller = ListRedditsController(self, keymap=config.keymap) self.controller = SubscriptionController(self, keymap=config.keymap)
self.name = name self.name = name
self.func = func self.func = func
self.content = ListRedditsContent.from_func(name, func, term.loader) self.content = SubscriptionContent.from_func(name, func, term.loader)
self.nav = Navigator(self.content.get) self.nav = Navigator(self.content.get)
self.reddit_data = None self.reddit_data = None
@ListRedditsController.register(Command('REFRESH')) @SubscriptionController.register(Command('REFRESH'))
def refresh_content(self, order=None, name=None): def refresh_content(self, order=None, name=None):
"Re-download all reddits and reset the page index" "Re-download all reddits and reset the page index"
@@ -34,21 +34,21 @@ class ListRedditsPage(Page):
return return
with self.term.loader(): with self.term.loader():
self.content = ListRedditsContent.from_func(self.name, self.content = SubscriptionContent.from_func(
self.func, self.term.loader) self.name, self.func, self.term.loader)
if not self.term.loader.exception: if not self.term.loader.exception:
self.nav = Navigator(self.content.get) self.nav = Navigator(self.content.get)
@ListRedditsController.register(Command('SUBSCRIPTION_SELECT')) @SubscriptionController.register(Command('SUBSCRIPTION_SELECT'))
def select_reddit(self): def select_reddit(self):
"Store the selected reddit and return to the subreddit page" "Store the selected reddit and return to the subreddit page"
self.reddit_data = self.content.get(self.nav.absolute_index) self.reddit_data = self.content.get(self.nav.absolute_index)
self.active = False self.active = False
@ListRedditsController.register(Command('SUBSCRIPTION_EXIT')) @SubscriptionController.register(Command('SUBSCRIPTION_EXIT'))
def close_subscriptions(self): def close_subscriptions(self):
"Close list of reddits and return to the subreddit page" "Close subscriptions and return to the subreddit page"
self.active = False self.active = False

View File

@@ -17,7 +17,7 @@ from rtv.config import Config
from rtv.terminal import Terminal from rtv.terminal import Terminal
from rtv.subreddit import SubredditPage from rtv.subreddit import SubredditPage
from rtv.submission import SubmissionPage from rtv.submission import SubmissionPage
from rtv.reddits import SubscriptionPage from rtv.subscription import SubscriptionPage
try: try:
from unittest import mock from unittest import mock

View File

@@ -6,7 +6,7 @@ import curses
import praw import praw
import pytest import pytest
from rtv.reddits import SubscriptionPage from rtv.subscription import SubscriptionPage
try: try:
from unittest import mock from unittest import mock