← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~raoul-snyman/openlp/fix-formatting into lp:openlp

 

Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/fix-formatting into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/fix-formatting/+merge/296117

Fix formatting issues. See https://code.launchpad.net/~knightrider0xd/openlp/non-text-item-height-default/+merge/295318/comments/758254
-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/fix-formatting into lp:openlp.
=== modified file 'openlp/core/ui/media/__init__.py'
--- openlp/core/ui/media/__init__.py	2016-04-23 00:40:59 +0000
+++ openlp/core/ui/media/__init__.py	2016-05-31 16:15:54 +0000
@@ -134,6 +134,7 @@
     :param milliseconds: Milliseconds to format
     :return: Time string in format: hh.mm.ss,ttt
     """
+    milliseconds = int(milliseconds)
     seconds, millis = divmod(milliseconds, 1000)
     minutes, seconds = divmod(seconds, 60)
     hours, minutes = divmod(minutes, 60)

=== modified file 'openlp/plugins/bibles/lib/mediaitem.py'
--- openlp/plugins/bibles/lib/mediaitem.py	2016-05-21 08:31:24 +0000
+++ openlp/plugins/bibles/lib/mediaitem.py	2016-05-31 16:15:54 +0000
@@ -407,7 +407,7 @@
             self.initialise_chapter_verse(bible, first_book['name'], first_book['book_reference_id'])
 
     def initialise_chapter_verse(self, bible, book, book_ref_id):
-        log.debug('initialise_chapter_verse {bible}, {book), {ref}'.format(bible=bible, book=book, ref=book_ref_id))
+        log.debug('initialise_chapter_verse {bible}, {book}, {ref}'.format(bible=bible, book=book, ref=book_ref_id))
         book = self.plugin.manager.get_book_by_id(bible, book_ref_id)
         self.chapter_count = self.plugin.manager.get_chapter_count(bible, book)
         verse_count = self.plugin.manager.get_verse_count_by_book_ref_id(bible, book_ref_id, 1)

=== modified file 'tests/functional/openlp_core_common/test_registryproperties.py'
--- tests/functional/openlp_core_common/test_registryproperties.py	2015-12-31 22:46:06 +0000
+++ tests/functional/openlp_core_common/test_registryproperties.py	2016-05-31 16:15:54 +0000
@@ -25,7 +25,8 @@
 from unittest import TestCase
 
 from openlp.core.common import Registry, RegistryProperties
-from tests.functional import MagicMock
+
+from tests.functional import MagicMock, patch
 
 
 class TestRegistryProperties(TestCase, RegistryProperties):
@@ -53,7 +54,25 @@
         """
         # GIVEN an Empty Registry
         application = MagicMock()
-        # WHEN the application is registered
-        Registry().register('application', application)
-        # THEN the application should be none
-        self.assertEqual(self.application, application, 'The application value should match')
+
+        # WHEN the application is registered
+        Registry().register('application', application)
+
+        # THEN the application should be none
+        self.assertEqual(self.application, application, 'The application value should match')
+
+    @patch('openlp.core.common.registryproperties.is_win')
+    def application_on_windows_test(self, mocked_is_win):
+        """
+        Test property if registry value assigned on Windows
+        """
+        # GIVEN an Empty Registry and we're on Windows
+        application = MagicMock()
+        mocked_is_win.return_value = True
+
+        # WHEN the application is registered
+        Registry().register('application', application)
+
+        # THEN the application should be none
+        self.assertEqual(self.application, application, 'The application value should match')
+


Follow ups