Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Less pylint ignores and more tests #105

Merged
merged 12 commits into from
Oct 16, 2019
11 changes: 0 additions & 11 deletions pylintrc → .pylintrc
Original file line number Diff line number Diff line change
@@ -1,25 +1,14 @@
[MESSAGES CONTROL]
disable=
bad-option-value,
broad-except,
cyclic-import,
duplicate-code,
fixme,
import-error,
import-outside-toplevel,
invalid-name,
line-too-long,
missing-docstring,
no-init,
no-self-use,
old-style-class,
too-few-public-methods,
too-many-arguments,
too-many-branches,
too-many-instance-attributes,
too-many-locals,
too-many-lines,
too-many-public-methods,
too-many-return-statements,
too-many-statements,
unused-argument,
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ test-unit:
ifdef TRAVIS_JOB_ID
@coverage run -m unittest discover
else
@python -m unittest discover
@python -m unittest discover -v -b -f
endif

clean:
Expand Down
2 changes: 2 additions & 0 deletions plugin.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# -*- coding: utf-8 -*-
""" Addon entry point """

from __future__ import absolute_import, division, unicode_literals
import sys
from resources.lib import plugin
Expand Down
11 changes: 0 additions & 11 deletions resources/language/resource.language.en_gb/strings.po
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
# Kodi Media Center language file
# Addon Name: VTM GO
# Addon id: plugin.video.vtm.go
# Addon Provider: michaelarnauts
msgid ""
msgstr ""
"Project-Id-Version: plugin.video.vtm.go\n"
"Report-Msgid-Bugs-To: https://github.com/michaelarnauts/plugin.video.vtm.go\n"
"POT-Creation-Date: 2019-09-11 23:00+0000\n"
"PO-Revision-Date: 2019-09-11 23:00+0000\n"
"Last-Translator: Dag Wieers <dag@wieers.com>\n"
"Language-Team: English\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
Expand Down
10 changes: 0 additions & 10 deletions resources/language/resource.language.nl_nl/strings.po
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Kodi Media Center language file
# Addon Name: VTM GO
# Addon id: plugin.video.vtm.go
# Addon Provider: michaelarnauts
msgid ""
msgstr ""
"Project-Id-Version: plugin.video.vtm.go\n"
"Report-Msgid-Bugs-To: https://github.com/michaelarnauts/plugin.video.vtm.go\n"
"POT-Creation-Date: 2019-09-13 22:00+0000\n"
"PO-Revision-Date: 2019-09-13 22:00+0000\n"
"Last-Translator: Dag Wieers <dag@wieers.com>\n"
"Language-Team: Nederlands\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
Expand Down
5 changes: 3 additions & 2 deletions resources/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
""" Static data for this addon """

from __future__ import absolute_import, division, unicode_literals

Expand Down Expand Up @@ -111,8 +112,8 @@


class GeoblockedException(Exception):
pass
""" Is thrown when a geoblocked item is played. """


class UnavailableException(Exception):
pass
""" Is thrown when an unavailable item is played. """
9 changes: 7 additions & 2 deletions resources/lib/kodiwrapper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
""" Library around all Kodi functions """

from __future__ import absolute_import, division, unicode_literals

Expand Down Expand Up @@ -212,7 +213,8 @@ def play(self, title_item, license_key=None):
xbmc.sleep(100)
xbmc.Player().showSubtitles(True)

def get_search_string(self, heading='', message=''):
@staticmethod
def get_search_string(heading='', message=''):
""" Ask the user for a search string """
search_string = None
keyboard = xbmc.Keyboard(message, heading)
Expand Down Expand Up @@ -290,6 +292,7 @@ def get_setting(self, setting_id, default=None):
return value

def get_setting_as_bool(self, setting):
""" Get an add-on setting as a boolean value """
return self.get_setting(setting).lower() == "true"

def set_setting(self, setting_id, setting_value):
Expand Down Expand Up @@ -347,8 +350,10 @@ def set_cache(self, key, data):

def invalidate_cache(self, ttl=None):
""" Clear the cache """
import time
if not self.check_if_path_exists(self._cache_path):
return
_, files = self.listdir(self._cache_path)
import time
now = time.mktime(time.localtime())
for filename in files:
fullpath = self._cache_path + filename
Expand Down
Loading