From 19862fd03bcda24c92364f1eb5dfdcbef934f2ca Mon Sep 17 00:00:00 2001 From: Greg Von Kuster Date: Wed, 14 Mar 2012 17:21:03 -0400 Subject: [PATCH] Update the integrated_toon_conf.xml file only if a new config setting is True. This keeps things that start up the app (like functional tests) from updating the file. --- lib/galaxy/config.py | 1 + lib/galaxy/tools/__init__.py | 10 ++++++---- lib/galaxy/webapps/community/controllers/admin.py | 7 ++++--- scripts/functional_tests.py | 1 + 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/galaxy/config.py b/lib/galaxy/config.py index 9860469de1b..b56e933f4da 100644 --- a/lib/galaxy/config.py +++ b/lib/galaxy/config.py @@ -70,6 +70,7 @@ class Configuration( object ): self.hours_between_check = 12 except: self.hours_between_check = 12 + self.update_integrated_tool_panel = kwargs.get( "update_integrated_tool_panel", True ) self.tool_secret = kwargs.get( "tool_secret", "" ) self.id_secret = kwargs.get( "id_secret", "USING THE DEFAULT IS NOT SECURE!" ) self.set_metadata_externally = string_as_bool( kwargs.get( "set_metadata_externally", "False" ) ) diff --git a/lib/galaxy/tools/__init__.py b/lib/galaxy/tools/__init__.py index 6f0152480ec..98b1ee847d3 100755 --- a/lib/galaxy/tools/__init__.py +++ b/lib/galaxy/tools/__init__.py @@ -75,10 +75,12 @@ class ToolBox( object ): if self.integrated_tool_panel_config_has_contents: # Load self.tool_panel based on the order in self.integrated_tool_panel. self.load_tool_panel() - # Always write the current in-memory integrated_tool_panel to the integrated_tool_panel.xml file. - # This will cover cases where the Galaxy administrator manually edited one or more of the tool panel - # config files, adding or removing locally developed tools or workflows. - self.write_integrated_tool_panel_config_file() + if app.config.update_integrated_tool_panel: + # Write the current in-memory integrated_tool_panel to the integrated_tool_panel.xml file. + # This will cover cases where the Galaxy administrator manually edited one or more of the tool panel + # config files, adding or removing locally developed tools or workflows. The value of integrated_tool_panel + # will be False when things like functional tests are the caller. + self.write_integrated_tool_panel_config_file() def init_tools( self, config_filename ): """ Read the configuration file and load each tool. The following tags are currently supported: diff --git a/lib/galaxy/webapps/community/controllers/admin.py b/lib/galaxy/webapps/community/controllers/admin.py index 62c4fb4cbe3..230600e6f7f 100644 --- a/lib/galaxy/webapps/community/controllers/admin.py +++ b/lib/galaxy/webapps/community/controllers/admin.py @@ -430,7 +430,6 @@ class AdminController( BaseUIController, Admin ): return trans.response.send_redirect( web.url_for( controller='repository', action='browse_repositories', **kwd ) ) - # Render the list view return self.repository_metadata_list_grid( trans, **kwd ) @web.expose @web.require_admin @@ -504,7 +503,7 @@ class AdminController( BaseUIController, Admin ): else: del kwd[ 'operation' ] elif operation == 'delete': - return self.mark_repository_deleted( trans, **kwd ) + return self.delete_repository( trans, **kwd ) elif operation == "undelete": return self.undelete_repository( trans, **kwd ) # The changeset_revision_select_field in the RepositoryListGrid performs a refresh_on_change @@ -528,12 +527,13 @@ class AdminController( BaseUIController, Admin ): return self.repository_list_grid( trans, **kwd ) @web.expose @web.require_admin - def mark_repository_deleted( self, trans, **kwd ): + def delete_repository( self, trans, **kwd ): params = util.Params( kwd ) message = util.restore_text( params.get( 'message', '' ) ) status = params.get( 'status', 'done' ) id = kwd.get( 'id', None ) if id: + # Deleting multiple items is currently not allowed (allow_multiple=False), so there will only be 1 id. ids = util.listify( id ) count = 0 deleted_repositories = "" @@ -564,6 +564,7 @@ class AdminController( BaseUIController, Admin ): status = params.get( 'status', 'done' ) id = kwd.get( 'id', None ) if id: + # Undeleting multiple items is currently not allowed (allow_multiple=False), so there will only be 1 id. ids = util.listify( id ) count = 0 undeleted_repositories = "" diff --git a/scripts/functional_tests.py b/scripts/functional_tests.py index b504b1ce68a..7022bd5c445 100644 --- a/scripts/functional_tests.py +++ b/scripts/functional_tests.py @@ -167,6 +167,7 @@ def main(): file_path = file_path, new_file_path = new_file_path, tool_path = tool_path, + update_integrated_tool_panel = False, tool_config_file = tool_config_file, datatype_converters_config_file = "datatype_converters_conf.xml.sample", tool_parse_help = False,