From 4d6b32d988071bf770f89f758c79fd5df506145e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Odd=20Str=C3=A5b=C3=B8?= Date: Fri, 4 Oct 2019 02:36:48 +0200 Subject: [PATCH] Fixed some flake8 F841 --- resources/lib/dialogs/context.py | 1 - resources/lib/dialogs/loginmanual.py | 1 - resources/lib/objects/movies.py | 6 ++---- resources/lib/objects/music.py | 9 +++------ resources/lib/objects/musicvideos.py | 3 +-- resources/lib/objects/tvshows.py | 9 +++------ 6 files changed, 9 insertions(+), 20 deletions(-) diff --git a/resources/lib/dialogs/context.py b/resources/lib/dialogs/context.py index d5371167..63ba0052 100644 --- a/resources/lib/dialogs/context.py +++ b/resources/lib/dialogs/context.py @@ -47,7 +47,6 @@ class ContextMenu(xbmcgui.WindowXMLDialog): if window('JellyfinUserImage'): self.getControl(USER_IMAGE).setImage(window('JellyfinUserImage')) - height = 479 + (len(self._options) * 55) LOG.info("options: %s", self._options) self.list_ = self.getControl(LIST) diff --git a/resources/lib/dialogs/loginmanual.py b/resources/lib/dialogs/loginmanual.py index 40416c4f..4b9d3fcd 100644 --- a/resources/lib/dialogs/loginmanual.py +++ b/resources/lib/dialogs/loginmanual.py @@ -117,7 +117,6 @@ class LoginManual(xbmcgui.WindowXMLDialog): def _login(self, username, password): - mode = self.connect_manager.get_server_info(self.connect_manager.server_id)['LastConnectionMode'] server_data = self.connect_manager.get_server_info(self.connect_manager.server_id) server = self.connect_manager.get_server_address(server_data, server_data['LastConnectionMode']) result = self.connect_manager.login(server, username, password) diff --git a/resources/lib/objects/movies.py b/resources/lib/objects/movies.py index 19fced67..748ecc61 100644 --- a/resources/lib/objects/movies.py +++ b/resources/lib/objects/movies.py @@ -51,8 +51,7 @@ class Movies(KodiDb): obj['MovieId'] = e_item[0] obj['FileId'] = e_item[1] obj['PathId'] = e_item[2] - except TypeError as error: - + except TypeError: update = False LOG.debug("MovieId %s not found", obj['Id']) obj['MovieId'] = self.create_entry() @@ -209,8 +208,7 @@ class Movies(KodiDb): try: obj['SetId'] = e_item[0] self.update_boxset(*values(obj, QU.update_set_obj)) - except TypeError as error: - + except TypeError: LOG.debug("SetId %s not found", obj['Id']) obj['SetId'] = self.add_boxset(*values(obj, QU.add_set_obj)) diff --git a/resources/lib/objects/music.py b/resources/lib/objects/music.py index b927187a..ae65495e 100644 --- a/resources/lib/objects/music.py +++ b/resources/lib/objects/music.py @@ -48,8 +48,7 @@ class Music(KodiDb): try: obj['ArtistId'] = e_item[0] - except TypeError as error: - + except TypeError: update = False obj['ArtistId'] = None LOG.debug("ArtistId %s not found", obj['Id']) @@ -116,8 +115,7 @@ class Music(KodiDb): try: obj['AlbumId'] = e_item[0] - except TypeError as error: - + except TypeError: update = False obj['AlbumId'] = None LOG.debug("AlbumId %s not found", obj['Id']) @@ -226,8 +224,7 @@ class Music(KodiDb): obj['SongId'] = e_item[0] obj['PathId'] = e_item[2] obj['AlbumId'] = e_item[3] - except TypeError as error: - + except TypeError: update = False obj['SongId'] = self.create_entry_song() LOG.debug("SongId %s not found", obj['Id']) diff --git a/resources/lib/objects/musicvideos.py b/resources/lib/objects/musicvideos.py index d7e8a291..f717100a 100644 --- a/resources/lib/objects/musicvideos.py +++ b/resources/lib/objects/musicvideos.py @@ -55,8 +55,7 @@ class MusicVideos(KodiDb): obj['MvideoId'] = e_item[0] obj['FileId'] = e_item[1] obj['PathId'] = e_item[2] - except TypeError as error: - + except TypeError: update = False LOG.debug("MvideoId for %s not found", obj['Id']) obj['MvideoId'] = self.create_entry() diff --git a/resources/lib/objects/tvshows.py b/resources/lib/objects/tvshows.py index 55d4bba8..79680d5c 100644 --- a/resources/lib/objects/tvshows.py +++ b/resources/lib/objects/tvshows.py @@ -64,8 +64,7 @@ class TVShows(KodiDb): try: obj['ShowId'] = e_item[0] obj['PathId'] = e_item[2] - except TypeError as error: - + except TypeError: update = False LOG.debug("ShowId %s not found", obj['Id']) obj['ShowId'] = self.create_entry() @@ -269,8 +268,7 @@ class TVShows(KodiDb): obj['EpisodeId'] = e_item[0] obj['FileId'] = e_item[1] obj['PathId'] = e_item[2] - except TypeError as error: - + except TypeError: update = False LOG.debug("EpisodeId %s not found", obj['Id']) obj['EpisodeId'] = self.create_entry_episode() @@ -361,8 +359,7 @@ class TVShows(KodiDb): try: self.add_episode(*values(obj, QU.add_episode_obj)) - except sqlite3.IntegrityError as error: - + except sqlite3.IntegrityError: LOG.error("IntegrityError for %s", obj) obj['EpisodeId'] = self.create_entry_episode()