Skip to content

Commit

Permalink
fixed pylint errors. scored improved from 9.49/10 to 10/10 - Issue xb…
Browse files Browse the repository at this point in the history
  • Loading branch information
Shanmugapriya03 committed Oct 3, 2019
1 parent bcd8274 commit 802960b
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 3 deletions.
4 changes: 2 additions & 2 deletions kodi_addon_checker/addons/Addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 2 additions & 1 deletion kodi_addon_checker/addons/addon_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))
Expand Down
3 changes: 3 additions & 0 deletions kodi_addon_checker/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
3 changes: 3 additions & 0 deletions kodi_addon_checker/plugins/array_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
3 changes: 3 additions & 0 deletions kodi_addon_checker/plugins/console_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,6 @@ def report(self, report):
else:
for rep in report:
self.report(rep)

def __str__(self):
return self.__class__.__name__
3 changes: 3 additions & 0 deletions kodi_addon_checker/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__
3 changes: 3 additions & 0 deletions kodi_addon_checker/reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ class Reporter(ABC):
def report(self, report):
pass

def __str__(self):
return self.__class__.__name__


class ReportManager():
reporters = {}
Expand Down
1 change: 1 addition & 0 deletions tests/test_check_addon.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@


class Args():
# pylint: disable=too-few-public-methods
PR = False
allow_folder_id_mismatch = False
branch = "krypton"
Expand Down

0 comments on commit 802960b

Please sign in to comment.