Merge pull request #165 from mcarlton00/flake8-fixes

Address flake8 warnings
This commit is contained in:
mcarlton00 2022-06-09 20:54:10 -04:00 committed by GitHub
commit 9a6e16f505
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 11 additions and 36 deletions

View File

@ -15,8 +15,7 @@ import xbmcaddon
import xbmc
from .jellyfin import api
from .utils import convert_size, translate_string, get_version, load_user_details, get_art_url, get_default_filters, translate_path, kodi_version
from .item_functions import get_art
from .utils import translate_string, get_version, load_user_details, get_art_url, get_default_filters, translate_path, kodi_version
from .kodi_utils import HomeWindow
from .datamanager import clear_cached_server_data
from .server_detect import check_server, check_connection_speed

View File

@ -21,9 +21,9 @@ from .utils import translate_path
pil_loaded = False
try:
from PIL import ImageFilter, Image, ImageOps
from PIL import Image, ImageOps
pil_loaded = True
except Exception as err:
except ImportError:
pil_loaded = False
PORT_NUMBER = 24276

View File

@ -1,12 +1,10 @@
from __future__ import division, absolute_import, print_function, unicode_literals
import sys
import os
from six.moves.urllib.parse import quote
from datetime import datetime
import xbmc
import xbmcgui
from .utils import datetime_from_string, get_art_url, image_url, kodi_version

View File

@ -41,7 +41,7 @@ class API:
response_data = {}
return response_data
def post(self, url, payload = {}):
def post(self, url, payload={}):
if 'x-mediabrowser-token' not in self.headers:
self.create_headers()
@ -112,7 +112,6 @@ class API:
self.token = token
headers['x-mediabrowser-token'] = self.token
# Make headers available to api calls
self.headers = headers

View File

@ -1,12 +1,10 @@
from __future__ import division, absolute_import, print_function, unicode_literals
import xbmc
import xbmcgui
import xbmcplugin
import xbmcaddon
import sys
import json
from .lazylogger import LazyLogger

View File

@ -16,4 +16,4 @@ class LazyLogger(object):
if self.__logger is None:
from .loghandler import getLogger
self.__logger = getLogger(self.__logger_name)
return getattr(self.__logger, name)
return getattr(self.__logger, name)

View File

@ -949,7 +949,6 @@ def prompt_for_stop_actions(item_id, data):
duration = data.get("duration", 0)
next_episode = data.get("next_episode")
item_type = data.get("item_type")
can_delete = data.get("can_delete", False)
prompt_next_percentage = int(settings.getSetting('promptPlayNextEpisodePercentage'))
play_prompt = settings.getSetting('promptPlayNextEpisodePercentage_prompt') == "true"
@ -962,8 +961,6 @@ def prompt_for_stop_actions(item_id, data):
prompt_delete_movie_percentage == 100):
return
prompt_to_delete = False
# if no runtime we cant calculate perceantge so just return
if duration == 0:
log.debug("No duration so returing")
@ -973,25 +970,12 @@ def prompt_for_stop_actions(item_id, data):
percenatge_complete = int((current_position / duration) * 100)
log.debug("Episode Percentage Complete: {0}".format(percenatge_complete))
if (can_delete and
prompt_delete_episode_percentage < 100 and
item_type == "Episode" and
percenatge_complete > prompt_delete_episode_percentage):
prompt_to_delete = True
if (can_delete and
prompt_delete_movie_percentage < 100 and
item_type == "Movie" and
percenatge_complete > prompt_delete_movie_percentage):
prompt_to_delete = True
# prompt for next episode
if (next_episode is not None and
prompt_next_percentage < 100 and
item_type == "Episode" and
percenatge_complete > prompt_next_percentage):
index = next_episode.get("IndexNumber", -1)
if play_prompt:
plugin_path = settings.getAddonInfo('path')
@ -1075,7 +1059,6 @@ def get_playing_data():
# This isn't a JellyCon item
return None
played_information_string = home_window.get_property('played_information')
if played_information_string:
played_information = json.loads(played_information_string)

View File

@ -353,11 +353,12 @@ def user_select(api, current_username):
user_item.setProperty("manual", "true")
users.append(user_item)
user_selection = xbmcgui.Dialog().select(selection_title,
users,
preselect=selected_id,
autoclose=20000,
useDetails=True)
user_selection = xbmcgui.Dialog().select(
selection_title,
users,
preselect=selected_id,
autoclose=20000,
useDetails=True)
return (users, user_selection)

View File

@ -17,7 +17,6 @@ import os
import hashlib
from datetime import datetime
from dateutil import tz
import time
import re
from uuid import uuid4
from six import ensure_text, ensure_binary, text_type
@ -208,7 +207,6 @@ def load_user_details():
user_name = window.get_property('user_name')
if not user_name:
user_name = settings.getSetting('username')
#settings_user_name = settings.getSetting('username')
save_user_to_settings = settings.getSetting('save_user_to_settings') == 'true'
addon_data = translate_path(xbmcaddon.Addon().getAddonInfo('profile'))

View File

@ -3,7 +3,6 @@ from __future__ import division, absolute_import, print_function, unicode_litera
import xbmcaddon
import xbmcplugin
import xbmcgui
import xbmc
import hashlib
import random
import time