From 802960bf115136af6b57e9419620e9d723e45e85 Mon Sep 17 00:00:00 2001 From: Shanmugapriya03 Date: Thu, 3 Oct 2019 21:22:38 +0530 Subject: [PATCH] fixed pylint errors. scored improved from 9.49/10 to 10/10 - Issue #186 --- kodi_addon_checker/addons/Addon.py | 4 ++-- kodi_addon_checker/addons/addon_dependency.py | 3 ++- kodi_addon_checker/logger.py | 3 +++ kodi_addon_checker/plugins/array_reporter.py | 3 +++ kodi_addon_checker/plugins/console_reporter.py | 3 +++ kodi_addon_checker/report.py | 3 +++ kodi_addon_checker/reporter.py | 3 +++ tests/test_check_addon.py | 1 + 8 files changed, 20 insertions(+), 3 deletions(-) diff --git a/kodi_addon_checker/addons/Addon.py b/kodi_addon_checker/addons/Addon.py index 1bbbdfcd..ee4dfd05 100644 --- a/kodi_addon_checker/addons/Addon.py +++ b/kodi_addon_checker/addons/Addon.py @@ -14,14 +14,14 @@ class Addon(): def __init__(self, addon_xml: ET.Element): super(Addon, self).__init__() - self.id = addon_xml.get('id') + self.addon_id = addon_xml.get('id') self.version = addon_xml.get('version') self.dependencies = [] for dependency in addon_xml.findall('./requires/import'): self.dependencies.append(AddonDependency(dependency)) def __eq__(self, other): - return self.id == other.id and self.version == other.version + return self.addon_id == other.id and self.version == other.version def depends_on(self, addon_id): for dependency in self.dependencies: diff --git a/kodi_addon_checker/addons/addon_dependency.py b/kodi_addon_checker/addons/addon_dependency.py index 94acc1d5..962985af 100644 --- a/kodi_addon_checker/addons/addon_dependency.py +++ b/kodi_addon_checker/addons/addon_dependency.py @@ -11,9 +11,10 @@ class AddonDependency(): + # pylint: disable=too-few-public-methods def __init__(self, import_xml: ET.Element): super(AddonDependency, self).__init__() - self.id = import_xml.get('addon') + self.addon_id = import_xml.get('addon') self.version = None if import_xml.get('version') is not None: self.version = LooseVersion(import_xml.get('version')) diff --git a/kodi_addon_checker/logger.py b/kodi_addon_checker/logger.py index 047774a6..13d6b7b5 100644 --- a/kodi_addon_checker/logger.py +++ b/kodi_addon_checker/logger.py @@ -35,3 +35,6 @@ def create_logger(debug_filename, logger_name, enabled=False): logger.addHandler(logging.NullHandler()) return logger + + def __str__(self): + return self.__class__.__name__ diff --git a/kodi_addon_checker/plugins/array_reporter.py b/kodi_addon_checker/plugins/array_reporter.py index 5986c6ce..1730214d 100644 --- a/kodi_addon_checker/plugins/array_reporter.py +++ b/kodi_addon_checker/plugins/array_reporter.py @@ -18,3 +18,6 @@ def __init__(self): def report(self, report): if isinstance(report, Record): self.reports.append(report) + + def __str__(self): + return self.__class__.__name__ diff --git a/kodi_addon_checker/plugins/console_reporter.py b/kodi_addon_checker/plugins/console_reporter.py index 089c5497..971dec7f 100644 --- a/kodi_addon_checker/plugins/console_reporter.py +++ b/kodi_addon_checker/plugins/console_reporter.py @@ -36,3 +36,6 @@ def report(self, report): else: for rep in report: self.report(rep) + + def __str__(self): + return self.__class__.__name__ diff --git a/kodi_addon_checker/report.py b/kodi_addon_checker/report.py index f237a016..73faa256 100644 --- a/kodi_addon_checker/report.py +++ b/kodi_addon_checker/report.py @@ -40,3 +40,6 @@ def add(self, report): self.problem_count += report.problem_count self.warning_count += report.warning_count self.information_count += report.information_count + + def __str__(self): + return self.__class__.__name__ diff --git a/kodi_addon_checker/reporter.py b/kodi_addon_checker/reporter.py index cab2bb5b..3e375bf0 100644 --- a/kodi_addon_checker/reporter.py +++ b/kodi_addon_checker/reporter.py @@ -15,6 +15,9 @@ class Reporter(ABC): def report(self, report): pass + def __str__(self): + return self.__class__.__name__ + class ReportManager(): reporters = {} diff --git a/tests/test_check_addon.py b/tests/test_check_addon.py index 84669a48..dbe18084 100644 --- a/tests/test_check_addon.py +++ b/tests/test_check_addon.py @@ -8,6 +8,7 @@ class Args(): + # pylint: disable=too-few-public-methods PR = False allow_folder_id_mismatch = False branch = "krypton"