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.

This commit is contained in:
Greg Von Kuster
2012-03-14 17:21:03 -04:00
parent 41b9ca70d1
commit 19862fd03b
4 changed files with 12 additions and 7 deletions
+1
View File
@@ -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" ) )
+6 -4
View File
@@ -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:
@@ -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 = ""
+1
View File
@@ -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,