diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1a79990..079b1c7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -12,7 +12,7 @@ stages: .apt_get_update: &apt_get_update - apt-get update > /dev/null -.python3_prep: &python3_prep +.python_prep: &python_prep - apt-get install --yes python3-dev python3-pip > /dev/null - python3 -m pip --quiet install -r misc/python_requirements.txt @@ -34,7 +34,7 @@ quality: when: manual before_script: - *apt_get_update - - *python3_prep + - *python_prep script: - find . -iname '*.py' | xargs -t python3 -m pylint --rcfile=misc/pylint-rcfile.txt | tee pylint.log artifacts: diff --git a/addon.xml b/addon.xml index fd90bd0..ab84990 100644 --- a/addon.xml +++ b/addon.xml @@ -1,10 +1,10 @@ - - - - + + + + video diff --git a/misc/python_requirements.txt b/misc/python_requirements.txt index 15d426a..6e21364 100644 --- a/misc/python_requirements.txt +++ b/misc/python_requirements.txt @@ -1,3 +1,3 @@ -Kodistubs==18.0.0 +Kodistubs>=19.0.0 pylint requests diff --git a/resources/lib/addon.py b/resources/lib/addon.py index bfca624..2c3d8f3 100644 --- a/resources/lib/addon.py +++ b/resources/lib/addon.py @@ -195,13 +195,13 @@ class PeerTubeAddon(): """ next_index = current_index + self.items_per_page if total > next_index: - next_page = (next_index / self.items_per_page) + 1 - total_pages = (total / self.items_per_page) + 1 + next_page = (next_index // self.items_per_page) + 1 + total_pages = (total // self.items_per_page) + 1 next_page_item = kodi.generate_item_info( - name=u"{} ({}/{})".format(kodi.get_string(30405), - next_page, - total_pages), + name="{} ({}/{})".format(kodi.get_string(30405), + next_page, + total_pages), url=url ) diff --git a/resources/lib/kodi_utils.py b/resources/lib/kodi_utils.py index 054d06f..aac419a 100644 --- a/resources/lib/kodi_utils.py +++ b/resources/lib/kodi_utils.py @@ -8,18 +8,13 @@ See LICENSE.txt for more information. """ import os -try: - # Python 3.x - from urllib.parse import parse_qsl -except ImportError: - # Python 2.x - from urlparse import parse_qsl from requests.compat import urlencode +from urllib.parse import parse_qsl -import xbmc # Kodistubs for Leia is not compatible with python3 / pylint: disable=syntax-error +import xbmc import xbmcaddon -import xbmcgui # Kodistubs for Leia is not compatible with python3 / pylint: disable=syntax-error +import xbmcgui import xbmcplugin @@ -210,7 +205,7 @@ class KodiUtils: :param str title: Title of the box :param str message: Message in the box """ - xbmcgui.Dialog().ok(heading=title, line1=message) + xbmcgui.Dialog().ok(heading=title, message=message) def open_input_box(self, title): """Open a box for the user to input alphanumeric data diff --git a/resources/lib/peertube.py b/resources/lib/peertube.py index 13b7383..29d9da9 100644 --- a/resources/lib/peertube.py +++ b/resources/lib/peertube.py @@ -112,8 +112,7 @@ class PeerTube: params = self.list_settings.copy() # Add all the arguments to the dict - for param in kwargs: - params[param] = kwargs[param] + params.update(kwargs) return params diff --git a/service.py b/service.py index 7c406b1..cb48728 100644 --- a/service.py +++ b/service.py @@ -11,8 +11,8 @@ import AddonSignals # Module exists only in Kodi - pylint: disable=import-error from threading import Thread -import xbmc # Kodistubs for Leia is not compatible with python3 / pylint: disable=syntax-error -import xbmcvfs # Kodistubs for Leia is not compatible with python3 / pylint: disable=syntax-error +import xbmc +import xbmcvfs from resources.lib.kodi_utils import kodi