diff --git a/openlp/core/ui/formattingtagform.py b/openlp/core/ui/formattingtagform.py index be4247bc1..4f3d5d251 100644 --- a/openlp/core/ui/formattingtagform.py +++ b/openlp/core/ui/formattingtagform.py @@ -91,10 +91,9 @@ class FormattingTagForm(QtGui.QDialog, Ui_FormattingTagDialog, FormattingTagCont """ new_row = self.tag_table_widget.rowCount() self.tag_table_widget.insertRow(new_row) - self.tag_table_widget.setItem(new_row, 0, - QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', 'New Tag%s') - % str(new_row))) - self.tag_table_widget.setItem(new_row, 1, QtGui.QTableWidgetItem('n%s' % str(new_row))) + self.tag_table_widget.setItem(new_row, 0, QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', + 'New Tag %d' % new_row))) + self.tag_table_widget.setItem(new_row, 1, QtGui.QTableWidgetItem('n%d' % new_row)) self.tag_table_widget.setItem(new_row, 2, QtGui.QTableWidgetItem(translate('OpenLP.FormattingTagForm', ''))) self.tag_table_widget.setItem(new_row, 3, QtGui.QTableWidgetItem('')) diff --git a/openlp/core/ui/themeform.py b/openlp/core/ui/themeform.py index 321071c49..46fd227dd 100644 --- a/openlp/core/ui/themeform.py +++ b/openlp/core/ui/themeform.py @@ -18,11 +18,11 @@ # Software Foundation; version 2 of the License. # # # # This program is distributed in the hope that it will be useful, but WITHOUT # -# AN_y WARRANT_y; without even the implied warranty of MERCHANTABILIT_y or # +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or # # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for # # more details. # # # -# _you should have received a copy of the GNU General Public License along # +# You should have received a copy of the GNU General Public License along # # with this program; if not, write to the Free Software Foundation, Inc., 59 # # Temple Place, Suite 330, Boston, MA 02111-1307 USA # ############################################################################### @@ -179,7 +179,7 @@ class ThemeForm(QtGui.QWizard, Ui_ThemeWizard, RegistryProperties): if self.page(self.currentId()) == self.background_page and \ self.theme.background_type == background_image and is_not_image_file(self.theme.background_filename): QtGui.QMessageBox.critical(self, translate('OpenLP.ThemeWizard', 'Background Image Empty'), - translate('OpenLP.ThemeWizard', '_you have not selected a ' + translate('OpenLP.ThemeWizard', 'You have not selected a ' 'background image. Please select one before continuing.')) return False else: diff --git a/openlp/plugins/bibles/lib/csvbible.py b/openlp/plugins/bibles/lib/csvbible.py index c7d37cb7b..9bffb25fe 100644 --- a/openlp/plugins/bibles/lib/csvbible.py +++ b/openlp/plugins/bibles/lib/csvbible.py @@ -149,7 +149,7 @@ class CSVBible(BibleDB): book_ptr = book.name self.wizard.increment_progress_bar( translate('BiblesPlugin.CSVBible', - 'Importing verses from %s... Importing verses from ...') % book.name) + 'Importing verses from %s...' % book.name, 'Importing verses from ...')) self.session.commit() try: verse_text = str(line[3], details['encoding']) diff --git a/openlp/plugins/songs/lib/cclifileimport.py b/openlp/plugins/songs/lib/cclifileimport.py index 5c1fbdcb2..eda235ca1 100644 --- a/openlp/plugins/songs/lib/cclifileimport.py +++ b/openlp/plugins/songs/lib/cclifileimport.py @@ -63,7 +63,6 @@ class CCLIFileImport(SongImport): for filename in self.import_source: filename = str(filename) log.debug('Importing CCLI File: %s', filename) - lines = [] if os.path.isfile(filename): detect_file = open(filename, 'r') detect_content = detect_file.read(2048) @@ -250,7 +249,7 @@ class CCLIFileImport(SongImport): # e.g. For use solely with the SongSelect Terms of Use. All rights Reserved. www.ccli.com CCLI Licence number of user - # e.g. CCL-Liedlizenznummer: 14 / CCLI License No. 14 + # e.g. CCLI-Liedlizenznummer: 14 / CCLI License No. 14 """ log.debug('TXT file text: %s', text_list) diff --git a/openlp/plugins/songs/lib/db.py b/openlp/plugins/songs/lib/db.py index 93c27d32e..16f7ea719 100644 --- a/openlp/plugins/songs/lib/db.py +++ b/openlp/plugins/songs/lib/db.py @@ -74,10 +74,11 @@ class AuthorType(object): WordsAndMusic = 'words+music' Translation = 'translation' Types = { - Words: translate('OpenLP.Ui', 'Words'), - Music: translate('OpenLP.Ui', 'Music'), - WordsAndMusic: translate('OpenLP.Ui', 'Words and Music'), - Translation: translate('OpenLP.Ui', 'Translation') + Words: translate('SongsPlugin.AuthorType', 'Words', 'Author who wrote the lyrics of a song'), + Music: translate('SongsPlugin.AuthorType', 'Music', 'Author who wrote the music of a song'), + WordsAndMusic: translate('SongsPlugin.AuthorType', 'Words and Music', + 'Author who wrote both lyrics and music of a song'), + Translation: translate('SongsPlugin.AuthorType', 'Translation', 'Author who translated the song') } diff --git a/openlp/plugins/songs/lib/xml.py b/openlp/plugins/songs/lib/xml.py index 5481ea1c4..9458d6180 100644 --- a/openlp/plugins/songs/lib/xml.py +++ b/openlp/plugins/songs/lib/xml.py @@ -661,7 +661,7 @@ class OpenLyrics(object): # OpenLyrics 0.8 uses
for new lines. Append text from "lines" element to verse text. if version > '0.7': text = self._process_lines_mixed_content(element) - # OpenLyrics version <= 0.7 contais elements to represent lines. First child element is tested. + # OpenLyrics version <= 0.7 contains elements to represent lines. First child element is tested. else: # Loop over the "line" elements removing comments and chords. for line in element: diff --git a/scripts/translation_utils.py b/scripts/translation_utils.py index ad3edcaa3..2e9dffb12 100755 --- a/scripts/translation_utils.py +++ b/scripts/translation_utils.py @@ -175,7 +175,7 @@ def run(command): process = QtCore.QProcess() process.start(command) while process.waitForReadyRead(): - print_verbose('ReadyRead: %s' % QtCore.QString(process.readAll())) + print_verbose('ReadyRead: %s' % process.readAll()) print_verbose('Error(s):\n%s' % process.readAllStandardError()) print_verbose('Output:\n%s' % process.readAllStandardOutput()) @@ -194,7 +194,7 @@ def download_translations(): password = getpass(' Transifex password: ') # First get the list of languages url = SERVER_URL + 'resource/ents/' - base64string = base64.encodbytes('%s:%s' % (username, password))[:-1] + base64string = base64.encodebytes('%s:%s' % (username, password))[:-1] auth_header = 'Basic %s' % base64string request = urllib.request.Request(url + '?details') request.add_header('Authorization', auth_header) @@ -261,7 +261,7 @@ def prepare_project(): lines.append('TRANSLATIONS += %s' % line) lines.sort() file = open(os.path.join(start_dir, 'openlp.pro'), 'w') - file.write('\n'.join(lines).encode('utf8')) + file.write('\n'.join(lines)) file.close() print_quiet(' Done.') diff --git a/setup.cfg b/setup.cfg new file mode 100644 index 000000000..7b4bf5a3c --- /dev/null +++ b/setup.cfg @@ -0,0 +1,3 @@ +[pep8] +exclude=resources.py,vlc.py +max-line-length = 120 diff --git a/tests/functional/openlp_core_lib/test_ui.py b/tests/functional/openlp_core_lib/test_ui.py index fa098ba84..b637cf298 100644 --- a/tests/functional/openlp_core_lib/test_ui.py +++ b/tests/functional/openlp_core_lib/test_ui.py @@ -198,6 +198,20 @@ class TestUi(TestCase): # THEN: The index should have changed self.assertEqual(2, combo.currentIndex()) + def test_create_widget_action(self): + """ + Test creating an action for a widget + """ + # GIVEN: A button + button = QtGui.QPushButton() + + # WHEN: We call the function + action = create_widget_action(button, 'some action') + + # THEN: The action should be returned + self.assertIsInstance(action, QtGui.QAction) + self.assertEqual(action.objectName(), 'some action') + def test_set_case_insensitive_completer(self): """ Test setting a case insensitive completer on a widget