diff --git a/.pylintrc b/.pylintrc index 8253dea9..726f5ea0 100644 --- a/.pylintrc +++ b/.pylintrc @@ -16,4 +16,5 @@ disable= too-many-public-methods, too-many-return-statements, too-many-statements, + unspecified-encoding, max-line-length=160 diff --git a/resources/lib/apihelper.py b/resources/lib/apihelper.py index e68d54b9..86145ccc 100644 --- a/resources/lib/apihelper.py +++ b/resources/lib/apihelper.py @@ -372,7 +372,7 @@ def get_upnext(self, info): def get_single_episode_data(self, video_id=None, whatson_id=None, video_url=None): """Get single episode api data by videoId, whatsonId or url""" episode = None - api_data = list() + api_data = [] if video_id: api_data = self.get_episodes(video_id=video_id, variety='single') elif whatson_id: diff --git a/resources/lib/data.py b/resources/lib/data.py index c6e28a8b..29a7551b 100644 --- a/resources/lib/data.py +++ b/resources/lib/data.py @@ -277,6 +277,7 @@ dict(name='Exclusief online', id='exclusief-online', msgctxt=30100), dict(name='Volledig seizoen', id='volledig-seizoen', msgctxt=30101), dict(name='Volledige reeks', id='volledige-reeks', msgctxt=30102), + dict(name='Uit het archief', id='uit-het-archief', msgctxt=30103), # Inhoudsgerelateerd dict(name='Kortfilm', id='kortfilm', msgctxt=30120), # Thema diff --git a/resources/lib/favorites.py b/resources/lib/favorites.py index 6fec70ee..894c3b21 100644 --- a/resources/lib/favorites.py +++ b/resources/lib/favorites.py @@ -22,7 +22,7 @@ class Favorites: def __init__(self): """Initialize favorites, relies on XBMC vfs and a special VRT token""" - self._data = dict() # Our internal representation + self._data = {} # Our internal representation @staticmethod def is_activated(): diff --git a/resources/lib/kodiutils.py b/resources/lib/kodiutils.py index 1eb2ce22..9be16ac6 100644 --- a/resources/lib/kodiutils.py +++ b/resources/lib/kodiutils.py @@ -604,7 +604,7 @@ def notify(sender, message, data): def get_playerid(): """Get current playerid""" - result = dict() + result = {} while not result.get('result'): result = jsonrpc(method='Player.GetActivePlayers') return result.get('result', [{}])[0].get('playerid') @@ -1094,7 +1094,7 @@ def open_url(url, data=None, headers=None, method=None, cookiejar=None, follow_r opener = build_opener(*opener_args) if not headers: - headers = dict() + headers = {} req = Request(url, headers=headers) if data is not None: req.data = data @@ -1111,7 +1111,7 @@ def open_url(url, data=None, headers=None, method=None, cookiejar=None, follow_r req.get_method = lambda: method if raise_errors is None: - raise_errors = list() + raise_errors = [] try: return opener.open(req) except HTTPError as exc: diff --git a/resources/lib/resumepoints.py b/resources/lib/resumepoints.py index 8b1013b4..a2eb903f 100644 --- a/resources/lib/resumepoints.py +++ b/resources/lib/resumepoints.py @@ -20,7 +20,7 @@ class ResumePoints: def __init__(self): """Initialize resumepoints, relies on XBMC vfs and a special VRT token""" - self._data = dict() # Our internal representation + self._data = {} # Our internal representation @staticmethod def is_activated(): diff --git a/resources/lib/search.py b/resources/lib/search.py index 49d8d197..f581ea95 100644 --- a/resources/lib/search.py +++ b/resources/lib/search.py @@ -101,7 +101,7 @@ def search(self, keywords=None, page=0, edit=False): label=colour(localize(30300)), # Moreā€¦ path=url_for('search_query', keywords=keywords, page=page + 1), art_dict=dict(thumb='DefaultAddonSearch.png'), - info_dict=dict(), + info_dict={}, )) self._favorites.refresh(ttl=ttl('indirect')) diff --git a/resources/lib/tvguide.py b/resources/lib/tvguide.py index 65422c53..a98deba4 100644 --- a/resources/lib/tvguide.py +++ b/resources/lib/tvguide.py @@ -221,7 +221,7 @@ def get_epg_data(self): """Return EPG data""" now = datetime.now(dateutil.tz.tzlocal()) - epg_data = dict() + epg_data = {} for date in ['yesterday', 'today', 'tomorrow']: epg = self.parse(date, now) epg_url = epg.strftime(self.VRT_TVGUIDE) diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 062b2574..e3424386 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -191,7 +191,7 @@ def play_url_to_id(url): """Convert a plugin:// url (e.g. plugin://plugin.video.vrt.nu/play/id/vid-5b12c0f6-b8fe-426f-a600-557f501f3be9/pbs-pub-7e2764cf-a8c0-4e78-9cbc-46d39381c237) to an id dictionary (e.g. {'video_id': 'vid-5b12c0f6-b8fe-426f-a600-557f501f3be9'} """ - play_id = dict() + play_id = {} if 'play/id/' in url: play_id['video_id'] = url.split('play/id/')[1].split('/')[0] elif 'play/upnext/' in url: diff --git a/resources/lib/vrtplayer.py b/resources/lib/vrtplayer.py index ced5f85f..963accaa 100644 --- a/resources/lib/vrtplayer.py +++ b/resources/lib/vrtplayer.py @@ -293,7 +293,7 @@ def show_recent_menu(self, page=0, use_favorites=False): label=colour(localize(30300)), path=url_for(recent, page=page + 1), art_dict=dict(thumb='DefaultRecentlyAddedEpisodes.png'), - info_dict=dict(), + info_dict={}, )) show_listing(episode_items, category=30020, sort=sort, ascending=ascending, content=content, cache=False) @@ -317,7 +317,7 @@ def show_offline_menu(self, page=0, use_favorites=False): label=localize(30300), path=url_for(offline, page=page + 1), art_dict=dict(thumb='DefaultYear.png'), - info_dict=dict(), + info_dict={}, )) show_listing(episode_items, category=30022, sort=sort, ascending=ascending, content=content, cache=False) diff --git a/resources/lib/webscraper.py b/resources/lib/webscraper.py index f60a367b..2cfcebe7 100644 --- a/resources/lib/webscraper.py +++ b/resources/lib/webscraper.py @@ -20,7 +20,7 @@ def get_video_attributes(vrtnu_url): cache_file = 'web_video_attrs_multi.json' video_attrs_multi = get_cache(cache_file, ttl=ttl('indirect')) if not video_attrs_multi: - video_attrs_multi = dict() + video_attrs_multi = {} if vrtnu_url in video_attrs_multi: return video_attrs_multi[vrtnu_url] diff --git a/tests/test_apihelper.py b/tests/test_apihelper.py index 8e848a6a..1e55b0e3 100644 --- a/tests/test_apihelper.py +++ b/tests/test_apihelper.py @@ -48,7 +48,7 @@ def test_get_api_data_multiple_seasons(self): def test_get_api_data_specific_season(self): """Test listing episodes for a specific season (pano)""" title_items, sort, ascending, content = self._apihelper.list_episodes(program='pano') - self.assertEqual(len(title_items), 7) + self.assertEqual(len(title_items), 8) self.assertEqual(sort, 'label') self.assertFalse(ascending) self.assertEqual(content, 'files') diff --git a/tests/test_vrtplayer.py b/tests/test_vrtplayer.py index 9d5a3150..df02f26f 100644 --- a/tests/test_vrtplayer.py +++ b/tests/test_vrtplayer.py @@ -112,7 +112,7 @@ def test_featured(self): self.assertTrue(feature.label in [item.get('name') for item in FEATURED], msg='%s is missing' % feature.label) for feature in FEATURED: self.assertTrue(feature.get('name') in [item.label for item in featured_items], msg='%s doesn\'t exist online' % feature.get('name')) - self.assertEqual(len(featured_items), 7) + self.assertEqual(len(featured_items), 8) def test_play_unknown_program(self): """Test playing latest episode of an unknown program""" diff --git a/tests/xbmcgui.py b/tests/xbmcgui.py index dedfcc9d..25978d46 100644 --- a/tests/xbmcgui.py +++ b/tests/xbmcgui.py @@ -259,19 +259,19 @@ def __init__(self, label='', label2='', path='', offscreen=False): self.path = path self.offscreen = offscreen - self.art = dict() + self.art = {} self.content_lookup = None - self.context_menu = list() - self.info = dict() + self.context_menu = [] + self.info = {} self.info_type = None self.is_folder = False self.mimetype = None - self.properties = dict() + self.properties = {} self.rating = None - self.stream_info = dict() + self.stream_info = {} self.stream_type = None - self.subtitles = list() - self.unique_ids = list() + self.subtitles = [] + self.unique_ids = [] def addContextMenuItems(self, items, replaceItems=False): """A stub implementation for the xbmcgui ListItem class addContextMenuItems() method"""