← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~sam92/openlp/string-fixes into lp:openlp

 

Samuel Mehrbrodt has proposed merging lp:~sam92/openlp/string-fixes into lp:openlp.

Requested reviews:
  Raoul Snyman (raoul-snyman)
  Tim Bentley (trb143)

For more details, see:
https://code.launchpad.net/~sam92/openlp/string-fixes/+merge/221946

- Fix some string errors
- remove unused variable
- Fix method name
- Add setup.cfg with config for pep8 (pep8 reads this file)
- Fixed errors in translation utils

lp:~sam92/openlp/string-fixes (revision 2385)
[SUCCESS] http://ci.openlp.org/job/Branch-01-Pull/463/
[SUCCESS] http://ci.openlp.org/job/Branch-02-Functional-Tests/419/
[SUCCESS] http://ci.openlp.org/job/Branch-03-Interface-Tests/364/
[SUCCESS] http://ci.openlp.org/job/Branch-04-Windows_Tests/325/
[SUCCESS] http://ci.openlp.org/job/Branch-05a-Code_Analysis/222/
[SUCCESS] http://ci.openlp.org/job/Branch-05b-Test_Coverage/96/
-- 
https://code.launchpad.net/~sam92/openlp/string-fixes/+merge/221946
Your team OpenLP Core is subscribed to branch lp:openlp.
=== modified file 'openlp/core/ui/formattingtagform.py'
--- openlp/core/ui/formattingtagform.py	2014-04-12 20:19:22 +0000
+++ openlp/core/ui/formattingtagform.py	2014-06-03 19:25:26 +0000
@@ -91,10 +91,9 @@
         """
         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', '<HTML here>')))
         self.tag_table_widget.setItem(new_row, 3, QtGui.QTableWidgetItem(''))

=== modified file 'openlp/core/ui/themeform.py'
--- openlp/core/ui/themeform.py	2014-04-21 09:49:17 +0000
+++ openlp/core/ui/themeform.py	2014-06-03 19:25:26 +0000
@@ -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 @@
         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:

=== modified file 'openlp/plugins/bibles/lib/csvbible.py'
--- openlp/plugins/bibles/lib/csvbible.py	2014-03-08 22:02:34 +0000
+++ openlp/plugins/bibles/lib/csvbible.py	2014-06-03 19:25:26 +0000
@@ -149,7 +149,7 @@
                     book_ptr = book.name
                     self.wizard.increment_progress_bar(
                         translate('BiblesPlugin.CSVBible',
-                                  'Importing verses from %s... Importing verses from <book name>...') % book.name)
+                                  'Importing verses from %s...' % book.name, 'Importing verses from <book name>...'))
                     self.session.commit()
                 try:
                     verse_text = str(line[3], details['encoding'])

=== modified file 'openlp/plugins/songs/lib/cclifileimport.py'
--- openlp/plugins/songs/lib/cclifileimport.py	2014-04-12 20:19:22 +0000
+++ openlp/plugins/songs/lib/cclifileimport.py	2014-06-03 19:25:26 +0000
@@ -63,7 +63,6 @@
         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 @@
                 # 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)

=== modified file 'openlp/plugins/songs/lib/db.py'
--- openlp/plugins/songs/lib/db.py	2014-05-07 13:59:31 +0000
+++ openlp/plugins/songs/lib/db.py	2014-06-03 19:25:26 +0000
@@ -74,10 +74,11 @@
     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')
     }
 
 

=== modified file 'openlp/plugins/songs/lib/xml.py'
--- openlp/plugins/songs/lib/xml.py	2014-05-07 20:30:52 +0000
+++ openlp/plugins/songs/lib/xml.py	2014-06-03 19:25:26 +0000
@@ -661,7 +661,7 @@
         # OpenLyrics 0.8 uses <br/> 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 <line> elements to represent lines. First child element is tested.
+        # OpenLyrics version <= 0.7 contains <line> elements to represent lines. First child element is tested.
         else:
             # Loop over the "line" elements removing comments and chords.
             for line in element:

=== modified file 'scripts/translation_utils.py'
--- scripts/translation_utils.py	2014-04-20 20:19:21 +0000
+++ scripts/translation_utils.py	2014-06-03 19:25:26 +0000
@@ -175,7 +175,7 @@
     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 @@
         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 @@
                 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.')
 

=== added file 'setup.cfg'
--- setup.cfg	1970-01-01 00:00:00 +0000
+++ setup.cfg	2014-06-03 19:25:26 +0000
@@ -0,0 +1,3 @@
+[pep8]
+exclude=resources.py,vlc.py
+max-line-length = 120

=== modified file 'tests/functional/openlp_core_lib/test_ui.py'
--- tests/functional/openlp_core_lib/test_ui.py	2014-06-03 16:20:46 +0000
+++ tests/functional/openlp_core_lib/test_ui.py	2014-06-03 19:25:26 +0000
@@ -198,6 +198,20 @@
         # 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


Follow ups