From f5786437f555e93048af2511e0d603ce1ff8736f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Arnauts?= Date: Fri, 20 Mar 2020 15:05:49 +0100 Subject: [PATCH] Fix imports --- .pylintrc | 1 + resources/lib/kodiutils.py | 8 ++++---- resources/lib/modules/tvguide.py | 9 ++++++--- test/__init__.py | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/.pylintrc b/.pylintrc index e29df18..edb8912 100644 --- a/.pylintrc +++ b/.pylintrc @@ -13,3 +13,4 @@ disable= too-many-instance-attributes, too-many-locals, too-many-public-methods, + cyclic-import, # This shoud be fixed \ No newline at end of file diff --git a/resources/lib/kodiutils.py b/resources/lib/kodiutils.py index c85685a..c56fcef 100644 --- a/resources/lib/kodiutils.py +++ b/resources/lib/kodiutils.py @@ -113,13 +113,13 @@ def addon_profile(): def url_for(name, *args, **kwargs): """Wrapper for routing.url_for() to lookup by name""" - import addon # pylint: disable=import-error + import resources.lib.addon as addon return addon.routing.url_for(getattr(addon, name), *args, **kwargs) def show_listing(title_items, category=None, sort=None, content=None, cache=True): """ Show a virtual directory in Kodi """ - from addon import routing # pylint: disable=import-error + from resources.lib.addon import routing if content: # content is one of: files, songs, artists, albums, movies, tvshows, episodes, musicvideos, videos, images, games @@ -190,7 +190,7 @@ def show_listing(title_items, category=None, sort=None, content=None, cache=True def play(stream, title=None, art_dict=None, info_dict=None, prop_dict=None): """Play the given stream""" - from addon import routing # pylint: disable=import-error + from resources.lib.addon import routing play_item = xbmcgui.ListItem(label=title, path=stream) if art_dict: @@ -476,7 +476,7 @@ def container_update(url): def end_of_directory(): """Close a virtual directory, required to avoid a waiting Kodi""" - from addon import routing # pylint: disable=import-error + from resources.lib.addon import routing xbmcplugin.endOfDirectory(handle=routing.handle, succeeded=False, updateListing=False, cacheToDisc=False) diff --git a/resources/lib/modules/tvguide.py b/resources/lib/modules/tvguide.py index 50452af..f907c52 100644 --- a/resources/lib/modules/tvguide.py +++ b/resources/lib/modules/tvguide.py @@ -119,6 +119,11 @@ class TvGuide: else: context_menu = None + stream_dict = STREAM_DICT.copy() + stream_dict.update({ + 'duration': program.duration, + }) + title = '{time} - {title}'.format( time=program.start.strftime('%H:%M'), title=program.program_title @@ -146,9 +151,7 @@ class TvGuide: 'duration': program.duration, 'mediatype': 'video', }, - stream_dict=STREAM_DICT + { - 'duration': program.duration, - }, + stream_dict=stream_dict, context_menu=context_menu, is_playable=True) ) diff --git a/test/__init__.py b/test/__init__.py index 31cfeb1..8272521 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -5,4 +5,4 @@ from __future__ import absolute_import, division, unicode_literals import logging -logging.basicConfig(level=logging.DEBUG) +logging.basicConfig()