diff --git a/castero/__main__.py b/castero/__main__.py index 419b807..484e393 100644 --- a/castero/__main__.py +++ b/castero/__main__.py @@ -13,7 +13,7 @@ from castero.config import Config from castero.database import Database from castero.display import Display -from castero.feed import Feed, FeedDownloadError +from castero.feed import Feed from castero.subscriptions import Subscriptions @@ -32,8 +32,8 @@ def import_subscriptions(path: str, database: Database) -> None: database.replace_episodes(feed, episodes) print("Added \"%s\" with %d episodes" % (str(feed), len(episodes))) else: - print("ERROR: Failed to download %s -- %s" % - (str(generated[0]), str(generated[1]))) + print("ERROR: Failed to download %s -- %s" % + (str(generated[0]), str(generated[1]))) print("Imported %d feeds" % len(subscriptions.feeds)) @@ -124,7 +124,7 @@ def main(): castero.__help__.replace(field, adjusted) # instantiate display - temp_file = redirect_stderr() + redirect_stderr() stdscr = curses.initscr() display = Display(stdscr, database) display.clear() diff --git a/castero/datafile.py b/castero/datafile.py index 980c968..058666f 100644 --- a/castero/datafile.py +++ b/castero/datafile.py @@ -102,7 +102,7 @@ def download_to_file(url, file, name, download_queue, display=None): ) if download_queue.length > 1: status_str += " (+%d downloads in queue)" % \ - (download_queue.length - 1) + (download_queue.length - 1) display.change_status(status_str) if chunk: diff --git a/castero/menus/downloadedmenu.py b/castero/menus/downloadedmenu.py index ef9d4f9..e068bac 100644 --- a/castero/menus/downloadedmenu.py +++ b/castero/menus/downloadedmenu.py @@ -5,7 +5,6 @@ from castero.config import Config from castero.datafile import DataFile from castero.episode import Episode -from castero.feed import Feed from castero.menu import Menu @@ -107,7 +106,7 @@ def _find_downloaded_episodes(self): episode = self._source.episode(int(ep_id)) if episode is not None: self._episodes.append(episode) - + if self._inverted: self._episodes.reverse() self._sanitize() diff --git a/castero/perspectives/downloadedperspective.py b/castero/perspectives/downloadedperspective.py index 42b5011..8281c6b 100644 --- a/castero/perspectives/downloadedperspective.py +++ b/castero/perspectives/downloadedperspective.py @@ -44,7 +44,7 @@ def create_windows(self) -> None: parent_y = self._display.parent_y third_x = helpers.third(parent_x) self._downloaded_window = curses.newwin(parent_y - 2, third_x * 2, - 2, 0) + 2, 0) metadata_width = parent_x - ((third_x * 2) - 1) self._metadata_window = curses.newwin(parent_y - 3, metadata_width, 2, 2 * third_x) @@ -75,24 +75,27 @@ def display(self) -> None: 0, 0, " " * self._downloaded_window.getmaxyx()[1]) # add window headers - self._downloaded_window.addstr(0, 0, self._downloaded_menu.title, - curses.color_pair(7) | curses.A_BOLD) - self._metadata_window.addstr(0, 0, "Metadata", - curses.color_pair(7) | curses.A_BOLD) + self._downloaded_window.addstr( + 0, 0, self._downloaded_menu.title, + curses.color_pair(7) | curses.A_BOLD) + self._metadata_window.addstr( + 0, 0, "Metadata", + curses.color_pair(7) | curses.A_BOLD) # add window borders - self._downloaded_window.hline(1, 0, - 0, self._downloaded_window.getmaxyx()[1], - curses.ACS_HLINE | curses.color_pair(8)) - self._metadata_window.hline(1, 0, - 0, self._metadata_window.getmaxyx()[1] - 1, - curses.ACS_HLINE | curses.color_pair(8)) + self._downloaded_window.hline( + 1, 0, + 0, self._downloaded_window.getmaxyx()[1], + curses.ACS_HLINE | curses.color_pair(8)) + self._metadata_window.hline( + 1, 0, + 0, self._metadata_window.getmaxyx()[1] - 1, + curses.ACS_HLINE | curses.color_pair(8)) if not helpers.is_true(Config["disable_vertical_borders"]): - self._downloaded_window.vline(0, - self._downloaded_window.getmaxyx()[1] - 1, - 0, - self._downloaded_window.getmaxyx()[0] - 2, - curses.ACS_VLINE | curses.color_pair(8)) + self._downloaded_window.vline( + 0, self._downloaded_window.getmaxyx()[1] - 1, + 0, self._downloaded_window.getmaxyx()[0] - 2, + curses.ACS_VLINE | curses.color_pair(8)) # display menu content self._downloaded_menu.display()