From 93ed31e54d03287ea3986b0cf07e5a8b4b866371 Mon Sep 17 00:00:00 2001 From: STEPHANVS Date: Sun, 6 Feb 2022 01:37:30 +0100 Subject: [PATCH] pipeline fixes --- openlp/plugins/songs/forms/editversedialog.py | 1 - openlp/plugins/songs/forms/editverseform.py | 32 +++++++++---------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/openlp/plugins/songs/forms/editversedialog.py b/openlp/plugins/songs/forms/editversedialog.py index 0ac93f334..4cc3d7319 100644 --- a/openlp/plugins/songs/forms/editversedialog.py +++ b/openlp/plugins/songs/forms/editversedialog.py @@ -83,7 +83,6 @@ class Ui_EditVerseDialog(object): self.transpose_down_button.setIcon(UiIcons().arrow_down) self.transpose_down_button.setObjectName('transpose_down') self.transpose_layout.addWidget(self.transpose_down_button) - #self.dialog_layout.addLayout(self.transpose_layout) self.dialog_layout.addWidget(self.transpose_widget) self.button_box = create_button_box(edit_verse_dialog, 'button_box', ['cancel', 'ok']) self.dialog_layout.addWidget(self.button_box) diff --git a/openlp/plugins/songs/forms/editverseform.py b/openlp/plugins/songs/forms/editverseform.py index ca4642415..ee0d6e9a8 100644 --- a/openlp/plugins/songs/forms/editverseform.py +++ b/openlp/plugins/songs/forms/editverseform.py @@ -21,7 +21,6 @@ import logging import re -from warnings import WarningMessage from PyQt5 import QtCore, QtGui, QtWidgets @@ -117,22 +116,22 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog): The cursor position has been changed """ self.update_suggested_verse_number() - + def on_transpose_up_button_clicked(self): """ The transpose up button clicked """ try: - lyrics_stripped = re.sub(r'\[---\]',"\n", re.sub(r'---\[.*?\]---', "\n", re.sub(r'\[--}{--\]', "\n", + lyrics_stripped = re.sub(r'\[---\]', "\n", re.sub(r'---\[.*?\]---', "\n", re.sub(r'\[--}{--\]', "\n", self.verse_text_edit.toPlainText()))) transposed_lyrics = transpose_lyrics(self.verse_text_edit.toPlainText(), 1) self.verse_text_edit.setPlainText(transposed_lyrics) if not re.search(r'\[(.*?)\]', lyrics_stripped)[1].startswith("="): QtWidgets.QMessageBox.warning(self, translate('SongsPlugin.EditVerseForm', 'Song key warning'), - translate('SongsPlugin.EditVerseForm', - 'No song key is present or song key is not the first ' - 'chord.\nFor optimal chord experience, please, include a ' - 'song key before any chord. Ex.: [=G]')) + translate('SongsPlugin.EditVerseForm', + 'No song key is present or song key is not the first ' + 'chord.\nFor optimal chord experience, please, include a ' + 'song key before any chord. Ex.: [=G]')) except KeyError as ke: # Transposing failed critical_error_message_box(title=translate('SongsPlugin.EditVerseForm', 'Transposing failed'), @@ -144,22 +143,21 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog): self.verse_text_edit.setFocus() self.verse_text_edit.moveCursor(QtGui.QTextCursor.End) - def on_transpose_down_button_clicked(self): """ The transpose down button clicked """ try: - lyrics_stripped = re.sub(r'\[---\]',"\n", re.sub(r'---\[.*?\]---', "\n", re.sub(r'\[--}{--\]', "\n", + lyrics_stripped = re.sub(r'\[---\]', "\n", re.sub(r'---\[.*?\]---', "\n", re.sub(r'\[--}{--\]', "\n", self.verse_text_edit.toPlainText()))) transposed_lyrics = transpose_lyrics(self.verse_text_edit.toPlainText(), -1) self.verse_text_edit.setPlainText(transposed_lyrics) if not re.search(r'\[(.*?)\]', lyrics_stripped)[1].startswith("="): QtWidgets.QMessageBox.warning(self, translate('SongsPlugin.EditVerseForm', 'Song key warning'), - translate('SongsPlugin.EditVerseForm', - 'No song key is present or song key is not the first ' - 'chord.\nFor optimal chord experience, please, include a ' - 'song key before any chord. Ex.: [=G]')) + translate('SongsPlugin.EditVerseForm', + 'No song key is present or song key is not the first ' + 'chord.\nFor optimal chord experience, please, include a ' + 'song key before any chord. Ex.: [=G]')) except KeyError as ke: # Transposing failed critical_error_message_box(title=translate('SongsPlugin.EditVerseForm', 'Transposing failed'), @@ -254,11 +252,13 @@ class EditVerseForm(QtWidgets.QDialog, Ui_EditVerseDialog): """ if Registry().get('settings').value('songs/enable chords'): try: - lyrics_stripped = re.sub(r'\[---\]',"\n", re.sub(r'---\[.*?\]---', "\n", re.sub(r'\[--}{--\]', "\n", - self.verse_text_edit.toPlainText()))) + lyrics_stripped = re.sub(r'\[---\]', "\n", + re.sub(r'---\[.*?\]---', "\n", + re.sub(r'\[--}{--\]', "\n", + self.verse_text_edit.toPlainText()))) if not re.search(r'\[(.*?)\]', lyrics_stripped)[1].startswith("="): QtWidgets.QMessageBox.warning(self, translate('SongsPlugin.EditVerseForm', 'Song key warning'), - translate('SongsPlugin.EditVerseForm', + translate('SongsPlugin.EditVerseForm', 'No song key is present or song key is not the first ' 'chord.\nFor optimal chord experience, please, include a ' 'song key before any chord. Ex.: [=G]'))