openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #30152
[Merge] lp:~tomasgroth/openlp/pylint-fix into lp:openlp
Tomas Groth has proposed merging lp:~tomasgroth/openlp/pylint-fix into lp:openlp.
Requested reviews:
Raoul Snyman (raoul-snyman)
For more details, see:
https://code.launchpad.net/~tomasgroth/openlp/pylint-fix/+merge/301828
Fix a few pylint issues and only run the pylint test if mentioned in the nosetest arguments.
--
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/lib/screen.py'
--- openlp/core/lib/screen.py 2016-05-15 17:33:42 +0000
+++ openlp/core/lib/screen.py 2016-08-02 19:37:10 +0000
@@ -167,7 +167,7 @@
:param number: The screen number (int).
"""
- log.info('remove_screen {number:d}'.forma(number=number))
+ log.info('remove_screen {number:d}'.format(number=number))
for screen in self.screen_list:
if screen['number'] == number:
self.screen_list.remove(screen)
=== modified file 'openlp/plugins/songs/lib/openlyricsxml.py'
--- openlp/plugins/songs/lib/openlyricsxml.py 2016-05-27 08:29:31 +0000
+++ openlp/plugins/songs/lib/openlyricsxml.py 2016-08-02 19:37:10 +0000
@@ -458,7 +458,7 @@
self._add_tag_to_formatting(tag, tags_element)
# Replace end tags.
for tag in end_tags:
- text = text.replace('{/{tag}}}'.format(tag=tag), '</tag>')
+ text = text.replace('{{{tag}}}'.format(tag=tag), '</tag>')
# Replace \n with <br/>.
text = text.replace('\n', '<br/>')
element = etree.XML('<lines>{text}</lines>'.format(text=text))
@@ -643,7 +643,7 @@
# Append text from tail and add formatting end tag.
# TODO: Verify format() with template variables
if element.tag == NSMAP % 'tag' and use_endtag:
- text += '{/{name}}}'.format(name=element.get('name'))
+ text += '{{{name}}}'.format(name=element.get('name'))
# Append text from tail.
if element.tail:
text += element.tail
=== modified file 'scripts/jenkins_script.py'
--- scripts/jenkins_script.py 2015-12-31 22:46:06 +0000
+++ scripts/jenkins_script.py 2016-08-02 19:37:10 +0000
@@ -63,9 +63,10 @@
Branch_Windows_Interface = 'Branch-04b-Windows_Interface_Tests'
Branch_PEP = 'Branch-05a-Code_Analysis'
Branch_Coverage = 'Branch-05b-Test_Coverage'
+ Branch_Pylint = 'Branch-05c-Code_Analysis2'
Jobs = [Branch_Pull, Branch_Functional, Branch_Interface, Branch_Windows_Functional, Branch_Windows_Interface,
- Branch_PEP, Branch_Coverage]
+ Branch_PEP, Branch_Coverage, Branch_Pylint]
class Colour(object):
=== modified file 'tests/utils/test_pylint.py'
--- tests/utils/test_pylint.py 2016-07-06 19:48:57 +0000
+++ tests/utils/test_pylint.py 2016-08-02 19:37:10 +0000
@@ -23,8 +23,8 @@
Package to test for proper bzr tags.
"""
import os
-import logging
import platform
+import sys
from unittest import TestCase, SkipTest
try:
@@ -46,9 +46,18 @@
"""
Test for pylint errors
"""
+ # Test if this file is specified in the arguments, if not skip the test.
+ in_argv = False
+ for arg in sys.argv:
+ if arg.endswith('test_pylint.py') or arg.endswith('test_pylint'):
+ in_argv = True
+ break
+ if not in_argv:
+ raise SkipTest('test_pylint.py not specified in arguments - skipping tests using pylint.')
+
# GIVEN: Some checks to disable and enable, and the pylint script
disabled_checks = 'import-error,no-member'
- enabled_checks = 'missing-format-argument-key,unused-format-string-argument'
+ enabled_checks = 'missing-format-argument-key,unused-format-string-argument,bad-format-string'
if is_win() or 'arch' in platform.dist()[0].lower():
pylint_script = 'pylint'
else:
@@ -84,6 +93,9 @@
# Filter out PyQt related errors
elif ('no-name-in-module' in line or 'no-member' in line) and 'PyQt5' in line:
continue
+ # Filter out distutils related errors
+ elif 'distutils' in line:
+ continue
elif self._is_line_tolerated(line):
continue
else:
References