Fix some linting issues, and fix the test for newer versions of PyLint

This commit is contained in:
Raoul Snyman 2017-11-09 21:11:03 -07:00
parent f7e1dcbea1
commit a408e3d74e
2 changed files with 23 additions and 5 deletions

View File

@ -101,6 +101,20 @@ class RegistryProperties(object):
""" """
This adds registry components to classes to use at run time. This adds registry components to classes to use at run time.
""" """
_application = None
_plugin_manager = None
_image_manager = None
_media_controller = None
_service_manager = None
_preview_controller = None
_live_controller = None
_main_window = None
_renderer = None
_theme_manager = None
_settings_form = None
_alerts_manager = None
_projector_manager = None
@property @property
def application(self): def application(self):
""" """

View File

@ -58,17 +58,21 @@ class TestPylint(TestCase):
# GIVEN: Some checks to disable and enable, and the pylint script # GIVEN: Some checks to disable and enable, and the pylint script
disabled_checks = 'import-error,no-member' disabled_checks = 'import-error,no-member'
enabled_checks = 'missing-format-argument-key,unused-format-string-argument,bad-format-string' enabled_checks = 'missing-format-argument-key,unused-format-string-argument,bad-format-string'
if is_win() or 'arch' in platform.dist()[0].lower(): pylint_kwargs = {
pylint_script = 'pylint' 'return_std': True
else: }
pylint_script = 'pylint3' if version < '1.7.0':
if is_win() or 'arch' in platform.dist()[0].lower():
pylint_kwargs.update({'script': 'pylint'})
else:
pylint_kwargs.update({'script': 'pylint3'})
# WHEN: Running pylint # WHEN: Running pylint
(pylint_stdout, pylint_stderr) = \ (pylint_stdout, pylint_stderr) = \
lint.py_run('openlp --errors-only --disable={disabled} --enable={enabled} ' lint.py_run('openlp --errors-only --disable={disabled} --enable={enabled} '
'--reports=no --output-format=parseable'.format(disabled=disabled_checks, '--reports=no --output-format=parseable'.format(disabled=disabled_checks,
enabled=enabled_checks), enabled=enabled_checks),
return_std=True, script=pylint_script) **pylint_kwargs)
stdout = pylint_stdout.read() stdout = pylint_stdout.read()
stderr = pylint_stderr.read() stderr = pylint_stderr.read()
filtered_stdout = self._filter_tolerated_errors(stdout) filtered_stdout = self._filter_tolerated_errors(stdout)