← Back to team overview

openlp-core team mailing list archive

[Merge] lp:~trb143/openlp/webfixes into lp:openlp

 

Tim Bentley has proposed merging lp:~trb143/openlp/webfixes into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)

For more details, see:
https://code.launchpad.net/~trb143/openlp/webfixes/+merge/331163

some fixes for the web remote
* make the remote plugin active all the time so the directories get created
* hide the plugin as it cannot be made inactive
* add the missing return statements


lp:~trb143/openlp/webfixes (revision 2765)
[SUCCESS] https://ci.openlp.io/job/Branch-01-Pull/2194/
[SUCCESS] https://ci.openlp.io/job/Branch-02-Functional-Tests/2097/
[SUCCESS] https://ci.openlp.io/job/Branch-03-Interface-Tests/1984/
[SUCCESS] https://ci.openlp.io/job/Branch-04a-Code_Analysis/1354/
[SUCCESS] https://ci.openlp.io/job/Branch-04b-Test_Coverage/1188/
[SUCCESS] https://ci.openlp.io/job/Branch-04c-Code_Analysis2/318/
[FAILURE] https://ci.openlp.io/job/Branch-05-AppVeyor-Tests/160/
Stopping after failure

-- 
Your team OpenLP Core is requested to review the proposed merge of lp:~trb143/openlp/webfixes into lp:openlp.
=== modified file 'openlp/core/lib/plugin.py'
--- openlp/core/lib/plugin.py	2017-08-26 15:06:11 +0000
+++ openlp/core/lib/plugin.py	2017-09-21 20:04:58 +0000
@@ -148,6 +148,7 @@
         self.media_item = None
         self.weight = 0
         self.status = PluginStatus.Inactive
+        self.allow_status_change = True
         # Add the default status to the default settings.
         default_settings[name + '/status'] = PluginStatus.Inactive
         default_settings[name + '/last directory'] = None

=== modified file 'openlp/core/ui/pluginform.py'
--- openlp/core/ui/pluginform.py	2017-06-09 06:06:49 +0000
+++ openlp/core/ui/pluginform.py	2017-09-21 20:04:58 +0000
@@ -62,6 +62,8 @@
         self.programatic_change = True
         plugin_list_width = 0
         for plugin in self.plugin_manager.plugins:
+            if not plugin.allow_status_change:
+                continue
             item = QtWidgets.QListWidgetItem(self.plugin_list_widget)
             # We do this just to make 100% sure the status is an integer as
             # sometimes when it's loaded from the config, it isn't cast to int.

=== modified file 'openlp/plugins/bibles/endpoint.py'
--- openlp/plugins/bibles/endpoint.py	2017-08-13 06:17:47 +0000
+++ openlp/plugins/bibles/endpoint.py	2017-09-21 20:04:58 +0000
@@ -62,7 +62,7 @@
 
     :param request: The http request object.
     """
-    service(request, 'bibles', log)
+    return service(request, 'bibles', log)
 
 
 @api_bibles_endpoint.route('bibles/search')
@@ -95,6 +95,6 @@
     :param request: The http request object.
     """
     try:
-        search(request, 'bibles', log)
+        return search(request, 'bibles', log)
     except NotFound:
         return {'results': {'items': []}}

=== modified file 'openlp/plugins/custom/endpoint.py'
--- openlp/plugins/custom/endpoint.py	2017-08-13 06:29:04 +0000
+++ openlp/plugins/custom/endpoint.py	2017-09-21 20:04:58 +0000
@@ -62,7 +62,7 @@
 
     :param request: The http request object.
     """
-    service(request, 'custom', log)
+    return service(request, 'custom', log)
 
 
 @api_custom_endpoint.route('custom/search')
@@ -95,6 +95,6 @@
     :param request: The http request object.
     """
     try:
-        search(request, 'custom', log)
+        return search(request, 'custom', log)
     except NotFound:
         return {'results': {'items': []}}

=== modified file 'openlp/plugins/images/endpoint.py'
--- openlp/plugins/images/endpoint.py	2017-08-13 06:17:47 +0000
+++ openlp/plugins/images/endpoint.py	2017-09-21 20:04:58 +0000
@@ -75,7 +75,7 @@
 
     :param request: The http request object.
     """
-    service(request, 'images', log)
+    return service(request, 'images', log)
 
 
 @api_images_endpoint.route('images/search')
@@ -108,6 +108,6 @@
     :param request: The http request object.
     """
     try:
-        search(request, 'images', log)
+        return search(request, 'images', log)
     except NotFound:
         return {'results': {'items': []}}

=== modified file 'openlp/plugins/media/endpoint.py'
--- openlp/plugins/media/endpoint.py	2017-08-13 06:17:47 +0000
+++ openlp/plugins/media/endpoint.py	2017-09-21 20:04:58 +0000
@@ -62,7 +62,7 @@
 
     :param request: The http request object.
     """
-    service(request, 'media', log)
+    return service(request, 'media', log)
 
 
 @api_media_endpoint.route('media/search')
@@ -95,6 +95,6 @@
     :param request: The http request object.
     """
     try:
-        search(request, 'media', log)
+        return search(request, 'media', log)
     except NotFound:
         return {'results': {'items': []}}

=== modified file 'openlp/plugins/presentations/endpoint.py'
--- openlp/plugins/presentations/endpoint.py	2017-08-13 06:17:47 +0000
+++ openlp/plugins/presentations/endpoint.py	2017-09-21 20:04:58 +0000
@@ -76,7 +76,7 @@
 
     :param request: The http request object.
     """
-    service(request, 'presentations', log)
+    return service(request, 'presentations', log)
 
 
 @api_presentations_endpoint.route('presentations/search')
@@ -109,6 +109,6 @@
     :param request: The http request object.
     """
     try:
-        search(request, 'presentations', log)
+        return search(request, 'presentations', log)
     except NotFound:
         return {'results': {'items': []}}

=== modified file 'openlp/plugins/remotes/remoteplugin.py'
--- openlp/plugins/remotes/remoteplugin.py	2017-08-24 19:53:55 +0000
+++ openlp/plugins/remotes/remoteplugin.py	2017-09-21 20:04:58 +0000
@@ -28,13 +28,14 @@
 
 from openlp.core.api.http import register_endpoint
 from openlp.core.common import AppLocation, Registry, Settings, OpenLPMixin, UiStrings, check_directory_exists
-from openlp.core.lib import Plugin, StringContent, translate, build_icon
+from openlp.core.lib import Plugin, PluginStatus, StringContent, translate, build_icon
 from openlp.plugins.remotes.endpoint import remote_endpoint
 from openlp.plugins.remotes.deploy import download_and_check, download_sha256
 
 log = logging.getLogger(__name__)
 __default_settings__ = {
-    'remotes/download version': '0000_00_00'
+    'remotes/download version': '0000_00_00',
+    'remotes/status': True
 }
 
 
@@ -77,6 +78,14 @@
             'services.\nPredefined interfaces can be download as well as custom developed interfaces.')
         return about_text
 
+    def check_pre_conditions(self):
+        """
+        Override the settings as the remote plugin is always active
+        """
+        Settings().setValue('remotes/status', PluginStatus.Active)
+        self.allow_status_change = False
+        return True
+
     def set_plugin_text_strings(self):
         """
         Called to define all translatable texts of the plugin


Follow ups