From 56a811c094a2e4a6982f6f40a2808e9f88fc6426 Mon Sep 17 00:00:00 2001 From: Tomas Groth Date: Wed, 4 Jul 2018 22:42:55 +0200 Subject: [PATCH] More pycodestyle fixes --- openlp/core/api/http/wsgiapp.py | 2 +- openlp/core/lib/htmlbuilder.py | 4 ++-- openlp/plugins/bibles/lib/__init__.py | 2 +- openlp/plugins/songs/lib/importers/dreambeam.py | 2 +- openlp/plugins/songs/lib/importers/powersong.py | 2 +- tests/functional/openlp_core/common/test_init.py | 5 +++-- tests/functional/openlp_core/lib/test_htmlbuilder.py | 2 +- 7 files changed, 10 insertions(+), 9 deletions(-) diff --git a/openlp/core/api/http/wsgiapp.py b/openlp/core/api/http/wsgiapp.py index 48364f340..aa90a28aa 100644 --- a/openlp/core/api/http/wsgiapp.py +++ b/openlp/core/api/http/wsgiapp.py @@ -39,7 +39,7 @@ log = logging.getLogger(__name__) def _route_to_regex(route): - """ + r""" Convert a route to a regular expression For example: diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index f6a0c6e61..5ef94288c 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -19,7 +19,7 @@ # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### -""" +r""" This module is responsible for generating the HTML for :class:`~openlp.core.ui.maindisplay`. The ``build_html`` function is the function which has to be called from outside. The generated and returned HTML will look similar to this:: @@ -416,7 +416,7 @@ from openlp.core.lib.theme import BackgroundType, BackgroundGradientType, Vertic log = logging.getLogger(__name__) -HTML_SRC = Template(""" +HTML_SRC = Template(r""" diff --git a/openlp/plugins/bibles/lib/__init__.py b/openlp/plugins/bibles/lib/__init__.py index da6913647..b1a51bfd7 100644 --- a/openlp/plugins/bibles/lib/__init__.py +++ b/openlp/plugins/bibles/lib/__init__.py @@ -255,7 +255,7 @@ def get_reference_match(match_type): def parse_reference(reference, bible, language_selection, book_ref_id=False): - """ + r""" This is the next generation über-awesome function that takes a person's typed in string and converts it to a list of references to be queried from the Bible database files. diff --git a/openlp/plugins/songs/lib/importers/dreambeam.py b/openlp/plugins/songs/lib/importers/dreambeam.py index 532bd865d..71e233eed 100644 --- a/openlp/plugins/songs/lib/importers/dreambeam.py +++ b/openlp/plugins/songs/lib/importers/dreambeam.py @@ -73,7 +73,7 @@ class DreamBeamImport(SongImport): Valid extensions for a DreamBeam song file are: - * \*.xml + * .xml """ def do_import(self): diff --git a/openlp/plugins/songs/lib/importers/powersong.py b/openlp/plugins/songs/lib/importers/powersong.py index d73e3ed9c..c21586166 100644 --- a/openlp/plugins/songs/lib/importers/powersong.py +++ b/openlp/plugins/songs/lib/importers/powersong.py @@ -70,7 +70,7 @@ class PowerSongImport(SongImport): """ Checks if source is a PowerSong 1.0 folder: * is a directory - * contains at least one \*.song file + * contains at least one * .song file :param openlp.core.common.path.Path import_source: Should be a Path object that fulfills the above criteria :return: If the source is valid diff --git a/tests/functional/openlp_core/common/test_init.py b/tests/functional/openlp_core/common/test_init.py index 6256517d0..552bb9f29 100644 --- a/tests/functional/openlp_core/common/test_init.py +++ b/tests/functional/openlp_core/common/test_init.py @@ -238,13 +238,14 @@ class TestInit(TestCase, TestMixin): Test the clean_filename() function """ # GIVEN: A invalid file name and the valid file name. - invalid_name = 'A_file_with_invalid_characters_[\\/:\*\?"<>\|\+\[\]%].py' # nopep8 - wanted_name = 'A_file_with_invalid_characters______________________.py' + invalid_name = 'A_file_with_invalid_characters_[\\/:*?"<>|+[]%].py' + wanted_name = 'A_file_with_invalid_characters________________.py' # WHEN: Clean the name. result = clean_filename(invalid_name) # THEN: The file name should be cleaned. + print(result) assert wanted_name == result, 'The file name should not contain any special characters.' def test_delete_file_no_path(self): diff --git a/tests/functional/openlp_core/lib/test_htmlbuilder.py b/tests/functional/openlp_core/lib/test_htmlbuilder.py index 11bfde2b6..a1c749d50 100644 --- a/tests/functional/openlp_core/lib/test_htmlbuilder.py +++ b/tests/functional/openlp_core/lib/test_htmlbuilder.py @@ -12,7 +12,7 @@ from openlp.core.lib.htmlbuilder import build_html, build_background_css, build_ from openlp.core.lib.theme import HorizontalType, VerticalType from tests.helpers.testmixin import TestMixin -HTML = """ +HTML = r"""