galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
December 2013
- 1 participants
- 207 discussions
commit/galaxy-central: greg: Allow uninstallation of repositories whose dependency relationship is restricted to a single circular dependency.
by commits-noreply@bitbucket.org 12 Dec '13
by commits-noreply@bitbucket.org 12 Dec '13
12 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8946e734862f/
Changeset: 8946e734862f
User: greg
Date: 2013-12-12 19:37:55
Summary: Allow uninstallation of repositories whose dependency relationship is restricted to a single circular dependency.
Affected #: 1 file
diff -r efc27a70bda323d9b0240733cef9e9db4b95cf05 -r 8946e734862f662715142fb333f385caa0dda6ea lib/galaxy/model/tool_shed_install/__init__.py
--- a/lib/galaxy/model/tool_shed_install/__init__.py
+++ b/lib/galaxy/model/tool_shed_install/__init__.py
@@ -1,9 +1,12 @@
+import logging
import os
from galaxy.model.item_attrs import Dictifiable
from galaxy.util.bunch import Bunch
from galaxy.util import asbool
from tool_shed.util import common_util
+log = logging.getLogger( __name__ )
+
class ToolShedRepository( object ):
dict_collection_visible_keys = ( 'id', 'tool_shed', 'name', 'owner', 'installed_changeset_revision', 'changeset_revision', 'ctx_rev', 'includes_datatypes',
@@ -64,6 +67,32 @@
if self.status == self.installation_status.UNINSTALLED:
return False
irm = app.installed_repository_manager
+ # See if this repository's current dependencies are restricted to a single circular relationship. This
+ # means that this repository has a single repository dependency which itself depends upon this repository.
+ # The repository dependency may have other dependent repositories, but that is not relevant here.
+ single_repository_dependency = None
+ for repository in irm.installed_repository_dependencies_of_installed_repositories:
+ if repository.id == self.id:
+ installed_repository_dependencies = irm.installed_repository_dependencies_of_installed_repositories[ repository ]
+ # If this repository defines a circular relationship to another repository, then the list of installed
+ # repository dependencies will include itself.
+ if len( installed_repository_dependencies ) == 2:
+ installed_repository_dependency_ids = [ rd.id for rd in installed_repository_dependencies ]
+ if self.id in installed_repository_dependency_ids:
+ # We have a single circular dependency definition, so get the other repository.
+ for installed_repository_dependency in installed_repository_dependencies:
+ if installed_repository_dependency != self.id:
+ single_repository_dependency = installed_repository_dependency
+ break
+ if single_repository_dependency is not None:
+ for repository in irm.installed_repository_dependencies_of_installed_repositories:
+ if repository.id == single_repository_dependency.id:
+ installed_repository_dependencies = irm.installed_repository_dependencies_of_installed_repositories[ repository ]
+ installed_repository_dependency_ids = [ rd.id for rd in installed_repository_dependencies ]
+ if self.id in installed_repository_dependency_ids:
+ # This repository is a dependency of the single repository upon which it depends, so we have
+ # a single circular relationship and this repository can be uninstalled.
+ return True
# Find other installed repositories that require this repository.
for repository in irm.installed_dependent_repositories_of_installed_repositories:
if repository.id == self.id:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix for uninstalling a repository from Galaxy.
by commits-noreply@bitbucket.org 12 Dec '13
by commits-noreply@bitbucket.org 12 Dec '13
12 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/efc27a70bda3/
Changeset: efc27a70bda3
User: greg
Date: 2013-12-12 18:06:13
Summary: Fix for uninstalling a repository from Galaxy.
Affected #: 1 file
diff -r e1b310faa7a0b04d273ad1b0960ebe5050297412 -r efc27a70bda323d9b0240733cef9e9db4b95cf05 lib/tool_shed/galaxy_install/installed_repository_manager.py
--- a/lib/tool_shed/galaxy_install/installed_repository_manager.py
+++ b/lib/tool_shed/galaxy_install/installed_repository_manager.py
@@ -324,7 +324,7 @@
if repository.id in rd_ids:
debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
- debug_msg += "from the dependent list for revision %s of repository %s owned by %s " \
+ debug_msg += "from the dependent list for revision %s of repository %s owned by %s " % \
( str( r.changeset_revision ), str( r.name ), str( r.owner ) )
debug_msg += "in installed_repository_dependencies_of_installed_repositories."
log.debug( debug_msg )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Designate repositories that can be uninstalled in the Manage installed tool shed repositories grid in Galaxy.
by commits-noreply@bitbucket.org 12 Dec '13
by commits-noreply@bitbucket.org 12 Dec '13
12 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e1b310faa7a0/
Changeset: e1b310faa7a0
User: greg
Date: 2013-12-12 17:46:46
Summary: Designate repositories that can be uninstalled in the Manage installed tool shed repositories grid in Galaxy.
Affected #: 1 file
diff -r 1af0dd28079a8c2501437aa753ef230b8229724d -r e1b310faa7a0b04d273ad1b0960ebe5050297412 lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
--- a/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
+++ b/lib/tool_shed/galaxy_install/grids/admin_toolshed_grids.py
@@ -31,6 +31,13 @@
latest_revision_tip_str = ''
return '<img src="%s/june_2007_style/blue/ok_small.png" %s/>' % ( url_for( '/static' ), latest_revision_tip_str )
+def generate_repository_can_be_uninstalled_img_str( include_mouse_over=False ):
+ if include_mouse_over:
+ can_be_uninstalled_tip_str = 'class="icon-button" title="This repository can be uninstalled"'
+ else:
+ can_be_uninstalled_tip_str = ''
+ return '<img src="%s/images/fugue/toggle-bw.png" %s/>' % ( url_for( '/static' ), can_be_uninstalled_tip_str )
+
def generate_revision_updates_img_str( include_mouse_over=False ):
if include_mouse_over:
revision_updates_tip_str = 'class="icon-button" title="Updates are available in the Tool Shed for this revision"'
@@ -73,6 +80,8 @@
tool_shed_status_str += generate_includes_workflows_img_str( include_mouse_over=True )
else:
tool_shed_status_str = generate_unknown_img_str( include_mouse_over=True )
+ if tool_shed_repository.can_uninstall( trans.app ):
+ tool_shed_status_str += generate_repository_can_be_uninstalled_img_str( include_mouse_over=True )
return tool_shed_status_str
@@ -210,6 +219,7 @@
legend_str += '%s This repository is deprecated in the Tool Shed<br/>' % generate_deprecated_repository_img_str()
legend_str += '%s This repository contains exported workflows<br/>' % generate_includes_workflows_img_str()
legend_str += '%s Unable to get information from the Tool Shed<br/>' % generate_unknown_img_str()
+ legend_str += '%s This repository can be uninstalled<br/>' % generate_repository_can_be_uninstalled_img_str()
return legend_str
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Use dependent repositories rather than repository dependencies to define restriction rules allowing for uninstalling repositories.
by commits-noreply@bitbucket.org 12 Dec '13
by commits-noreply@bitbucket.org 12 Dec '13
12 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/1af0dd28079a/
Changeset: 1af0dd28079a
User: greg
Date: 2013-12-12 16:45:30
Summary: Use dependent repositories rather than repository dependencies to define restriction rules allowing for uninstalling repositories.
Affected #: 3 files
diff -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce -r 1af0dd28079a8c2501437aa753ef230b8229724d lib/galaxy/model/tool_shed_install/__init__.py
--- a/lib/galaxy/model/tool_shed_install/__init__.py
+++ b/lib/galaxy/model/tool_shed_install/__init__.py
@@ -65,11 +65,11 @@
return False
irm = app.installed_repository_manager
# Find other installed repositories that require this repository.
- for repository in irm.repository_dependencies_of_installed_repositories:
+ for repository in irm.installed_dependent_repositories_of_installed_repositories:
if repository.id == self.id:
- installed_repository_dependencies = \
- irm.installed_repository_dependencies_of_installed_repositories[ repository ]
- if installed_repository_dependencies:
+ installed_dependent_repositories = \
+ irm.installed_dependent_repositories_of_installed_repositories[ repository ]
+ if installed_dependent_repositories:
# This repository cannot be uninstalled because other installed repositories require it.
return False
# Find installed tool dependencies that require this repository's installed tool dependencies.
diff -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce -r 1af0dd28079a8c2501437aa753ef230b8229724d lib/tool_shed/galaxy_install/installed_repository_manager.py
--- a/lib/tool_shed/galaxy_install/installed_repository_manager.py
+++ b/lib/tool_shed/galaxy_install/installed_repository_manager.py
@@ -41,6 +41,9 @@
# entire repository dependency tree.
self.installed_repository_dependencies_of_installed_repositories = {}
# Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values
+ # are a list of tool_shed_repository objects (whose status is 'Installed') that require the key.
+ self.installed_dependent_repositories_of_installed_repositories = {}
+ # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values
# are a list of its immediate tool_dependency objects (whose status can be anything). The value defines only the immediate
# tool dependencies of the repository and does not include any dependencies of the tool dependencies.
self.tool_dependencies_of_installed_repositories = {}
@@ -60,19 +63,39 @@
self.load_dependency_relationships()
def add_entry_to_installed_repository_dependencies_of_installed_repositories( self, repository ):
- """Add an entry to self.installed_repository_dependencies_of_installed_repositories."""
+ """
+ Add an entry to self.installed_repository_dependencies_of_installed_repositories. A side-effect of this method
+ is the population of self.installed_dependent_repositories_of_installed_repositories. Since this method discovers
+ all repositories required by the received repository, it can use the list to add entries to the reverse dictionary.
+ """
+ # Get the list of repository dependencies for this repository.
+ status = self.install_model.ToolShedRepository.installation_status.INSTALLED
+ repository_dependency_tree = \
+ repository_dependency_util.get_repository_dependency_tree_for_repository( self.app,
+ repository,
+ status=status )
+ # Add an entry to self.installed_repository_dependencies_of_installed_repositories.
if repository.id not in self.ids_of_installed_repository_dependencies_of_installed_repositories_keys:
debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \
( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
debug_msg += "to installed_repository_dependencies_of_installed_repositories."
log.debug( debug_msg )
- status = self.install_model.ToolShedRepository.installation_status.INSTALLED
- repository_dependency_tree = \
- repository_dependency_util.get_repository_dependency_tree_for_repository( self.app,
- repository,
- status=status )
self.installed_repository_dependencies_of_installed_repositories[ repository ] = \
repository_dependency_tree
+ # Use the repository_dependency_tree to add entries to the reverse dictionary
+ # self.installed_dependent_repositories_of_installed_repositories.
+ for required_repository in repository_dependency_tree:
+ debug_msg = "Appending revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "to all dependent repositories in installed_dependent_repositories_of_installed_repositories."
+ log.debug( debug_msg )
+ if required_repository.id in self.ids_of_installed_dependent_repositories_of_installed_repositories_keys:
+ for rd in self.installed_dependent_repositories_of_installed_repositories:
+ if rd.id == required_repository.id:
+ self.installed_dependent_repositories_of_installed_repositories[ rd ].append( repository )
+ break
+ else:
+ self.installed_dependent_repositories_of_installed_repositories[ required_repository ] = [ repository ]
def add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ):
"""Add an entry to self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies."""
@@ -222,6 +245,10 @@
break
@property
+ def ids_of_installed_dependent_repositories_of_installed_repositories_keys( self ):
+ return [ r.id for r in self.installed_dependent_repositories_of_installed_repositories.keys() ]
+
+ @property
def ids_of_installed_repository_dependencies_of_installed_repositories_keys( self ):
return [ r.id for r in self.installed_repository_dependencies_of_installed_repositories.keys() ]
@@ -287,7 +314,26 @@
datatype_util.load_installed_display_applications( self.app, installed_repository_dict, deactivate=deactivate )
def remove_entry_from_installed_repository_dependencies_of_installed_repositories( self, repository ):
- """Remove an entry from self.installed_repository_dependencies_of_installed_repositories"""
+ """
+ Remove an entry from self.installed_repository_dependencies_of_installed_repositories. A side-effect of this method
+ is removal of appropriate value items from self.installed_dependent_repositories_of_installed_repositories.
+ """
+ # Remove this repository from value lists in self.installed_dependent_repositories_of_installed_repositories.
+ for r, v in self.installed_dependent_repositories_of_installed_repositories.items():
+ rd_ids = [ rd.id for rd in v ]
+ if repository.id in rd_ids:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "from the dependent list for revision %s of repository %s owned by %s " \
+ ( str( r.changeset_revision ), str( r.name ), str( r.owner ) )
+ debug_msg += "in installed_repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ new_v = []
+ for rd in v:
+ if rd.id != repository.id:
+ new_v.append( rd )
+ self.installed_dependent_repositories_of_installed_repositories[ r ] = new_v
+ # Remove this repository's entry from self.installed_repository_dependencies_of_installed_repositories.
for r in self.installed_repository_dependencies_of_installed_repositories:
if r.id == repository.id:
debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
@@ -309,7 +355,7 @@
break
def remove_entry_from_installed_tool_dependencies_of_installed_repositories( self, repository ):
- """Remove an entry from self.installed_tool_dependencies_of_installed_repositories"""
+ """Remove an entry from self.installed_tool_dependencies_of_installed_repositories."""
for r in self.installed_tool_dependencies_of_installed_repositories:
if r.id == repository.id:
debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
diff -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce -r 1af0dd28079a8c2501437aa753ef230b8229724d templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
--- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
+++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
@@ -56,12 +56,12 @@
<%
irm = trans.app.installed_repository_manager
- # Get installed repositories that require this repository.
- installed_repository_dependencies = []
+ # Get installed repositories that this repository requires.
+ installed_dependent_repositories = []
installed_runtime_dependent_tool_dependencies = []
- for r in irm.installed_repository_dependencies_of_installed_repositories:
+ for r in irm.installed_dependent_repositories_of_installed_repositories:
if r.id == repository.id:
- installed_repository_dependencies = irm.installed_repository_dependencies_of_installed_repositories[ r ]
+ installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories[ r ]
break
# Get this repository's installed tool dependencies.
@@ -81,7 +81,7 @@
if installed_dependent_tds:
installed_runtime_dependent_tool_dependencies.extend( installed_dependent_tds )
%>
- %if installed_repository_dependencies or installed_runtime_dependent_tool_dependencies:
+ %if installed_dependent_repositories or installed_runtime_dependent_tool_dependencies:
<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="#D8D8D8">
@@ -89,14 +89,14 @@
</td></tr></table>
- %if installed_repository_dependencies:
+ %if installed_dependent_repositories:
<label>Dependent repositories:</label><ul>
- %for installed_repository_dependency in installed_repository_dependencies:
+ %for installed_dependent_repository in installed_dependent_repositories:
<%
- changeset_revision = installed_repository_dependency.changeset_revision
- name = installed_repository_dependency.name
- owner = installed_repository_dependency.owner
+ changeset_revision = installed_dependent_repository.changeset_revision
+ name = installed_dependent_repository.name
+ owner = installed_dependent_repository.owner
%><li>Revision <b>${ changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li>
%endfor
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Handle installation of a tool_dependency independent of its containing repository (due to it being in an error state) in the installed_repository_manager.
by commits-noreply@bitbucket.org 11 Dec '13
by commits-noreply@bitbucket.org 11 Dec '13
11 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c5915b15b421/
Changeset: c5915b15b421
User: greg
Date: 2013-12-12 01:05:18
Summary: Handle installation of a tool_dependency independent of its containing repository (due to it being in an error state) in the installed_repository_manager.
Affected #: 5 files
diff -r 4501db4f8ac29c0c351a861611217d23159272c5 -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -267,7 +267,7 @@
tool_shed_repository.error_message = None
# Remove the uninstalled repository and any tool dependencies from the in-memory dictionaries in the
# installed_repository_manager.
- trans.app.installed_repository_manager.handle_uninstall( tool_shed_repository )
+ trans.app.installed_repository_manager.handle_repository_uninstall( tool_shed_repository )
else:
tool_shed_repository.status = trans.install_model.ToolShedRepository.installation_status.DEACTIVATED
trans.install_model.context.add( tool_shed_repository )
diff -r 4501db4f8ac29c0c351a861611217d23159272c5 -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce lib/tool_shed/galaxy_install/installed_repository_manager.py
--- a/lib/tool_shed/galaxy_install/installed_repository_manager.py
+++ b/lib/tool_shed/galaxy_install/installed_repository_manager.py
@@ -160,7 +160,7 @@
return relative_path
return None
- def handle_install( self, repository ):
+ def handle_repository_install( self, repository ):
"""Load the dependency relationships for a repository that was just installed or reinstalled."""
# Populate self.repository_dependencies_of_installed_repositories.
self.add_entry_to_repository_dependencies_of_installed_repositories( repository )
@@ -176,10 +176,10 @@
# Populate self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.
self.add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
- def handle_uninstall( self, repository ):
+ def handle_repository_uninstall( self, repository ):
"""Remove the dependency relationships for a repository that was just uninstalled."""
for tool_dependency in repository.tool_dependencies:
- # Remove all this tool_dependency from all values in
+ # Remove this tool_dependency from all values in
# self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies
altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = {}
for td, installed_runtime_dependent_tool_dependencies in \
@@ -208,6 +208,19 @@
# Remove this repository's entry from self.repository_dependencies_of_installed_repositories.
self.remove_entry_from_repository_dependencies_of_installed_repositories( repository )
+ def handle_tool_dependency_install( self, repository, tool_dependency ):
+ """Load the dependency relationships for a tool dependency that was just installed independently of its containing repository."""
+ # The received repository must have a status of 'Installed'. The value of tool_dependency.status will either be
+ # 'Installed' or 'Error', but we only need to change the in-memory dictionaries if it is 'Installed'.
+ if tool_dependency.is_installed:
+ # Populate self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.
+ self.add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+ # Populate self.installed_tool_dependencies_of_installed_repositories.
+ for r in self.installed_tool_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ self.installed_tool_dependencies_of_installed_repositories[ r ].append( tool_dependency )
+ break
+
@property
def ids_of_installed_repository_dependencies_of_installed_repositories_keys( self ):
return [ r.id for r in self.installed_repository_dependencies_of_installed_repositories.keys() ]
diff -r 4501db4f8ac29c0c351a861611217d23159272c5 -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -583,7 +583,7 @@
tool_shed_repository,
trans.install_model.ToolShedRepository.installation_status.INSTALLED )
# Add the installed repository and any tool dependencies to the in-memory dictionaries in the installed_repository_manager.
- trans.app.installed_repository_manager.handle_install( tool_shed_repository )
+ trans.app.installed_repository_manager.handle_repository_install( tool_shed_repository )
else:
# An error occurred while cloning the repository, so reset everything necessary to enable another attempt.
set_repository_attributes( trans,
diff -r 4501db4f8ac29c0c351a861611217d23159272c5 -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce lib/tool_shed/util/common_install_util.py
--- a/lib/tool_shed/util/common_install_util.py
+++ b/lib/tool_shed/util/common_install_util.py
@@ -489,6 +489,8 @@
if tool_dependency and tool_dependency.status in [ app.install_model.ToolDependency.installation_status.INSTALLED,
app.install_model.ToolDependency.installation_status.ERROR ]:
installed_tool_dependencies.append( tool_dependency )
+ # Add the tool_dependency to the in-memory dictionaries in the installed_repository_manager.
+ app.installed_repository_manager.handle_tool_dependency_install( tool_shed_repository, tool_dependency )
elif elem.tag == 'set_environment':
# <set_environment version="1.0">
# <environment_variable name="R_SCRIPT_PATH"action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
diff -r 4501db4f8ac29c0c351a861611217d23159272c5 -r c5915b15b4211aa1fe75c6d9238ea1ae094a71ce lib/tool_shed/util/tool_dependency_util.py
--- a/lib/tool_shed/util/tool_dependency_util.py
+++ b/lib/tool_shed/util/tool_dependency_util.py
@@ -512,6 +512,7 @@
return installed_tool_dependencies, missing_tool_dependencies
def remove_tool_dependency( app, tool_dependency ):
+ """The received tool_dependency must be in an error state."""
context = app.install_model.context
dependency_install_dir = tool_dependency.installation_directory( app )
removed, error_message = remove_tool_dependency_installation_directory( dependency_install_dir )
@@ -520,6 +521,9 @@
tool_dependency.error_message = None
context.add( tool_dependency )
context.flush()
+ # Since the received tool_dependency is in an error state, nothing will need to be changed in any
+ # of the in-memory dictionaries in the installed_repository_manager because changing the state from
+ # error to uninstalled requires no in-memory changes..
return removed, error_message
def remove_tool_dependency_installation_directory( dependency_install_dir ):
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: Grids: Fix forms grid sorting
by commits-noreply@bitbucket.org 11 Dec '13
by commits-noreply@bitbucket.org 11 Dec '13
11 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4501db4f8ac2/
Changeset: 4501db4f8ac2
User: guerler
Date: 2013-12-12 00:41:26
Summary: Grids: Fix forms grid sorting
Affected #: 1 file
diff -r 5ab8b88ae58e99be83e6a2488a7855a02b260c18 -r 4501db4f8ac29c0c351a861611217d23159272c5 lib/galaxy/webapps/galaxy/controllers/forms.py
--- a/lib/galaxy/webapps/galaxy/controllers/forms.py
+++ b/lib/galaxy/webapps/galaxy/controllers/forms.py
@@ -65,6 +65,9 @@
global_actions = [
grids.GridAction( "Create new form", dict( controller='forms', action='create_form_definition' ) )
]
+
+ def build_initial_query( self, trans, **kwargs ):
+ return trans.sa_session.query( self.model_class ).join (model.FormDefinition, self.model_class.latest_form_id == model.FormDefinition.id)
class Forms( BaseUIController ):
# Empty TextField
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: Add modebutton jq plugin: creates an element that switches between N 'modes' of displayed contents/click functions
by commits-noreply@bitbucket.org 11 Dec '13
by commits-noreply@bitbucket.org 11 Dec '13
11 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5ab8b88ae58e/
Changeset: 5ab8b88ae58e
User: carlfeberhard
Date: 2013-12-11 23:47:17
Summary: Add modebutton jq plugin: creates an element that switches between N 'modes' of displayed contents/click functions
Affected #: 2 files
diff -r a0e7daee0399f71ef7203d949796cbfa0dec5ec2 -r 5ab8b88ae58e99be83e6a2488a7855a02b260c18 static/scripts/mvc/ui.js
--- a/static/scripts/mvc/ui.js
+++ b/static/scripts/mvc/ui.js
@@ -655,6 +655,147 @@
//==============================================================================
+(function(){
+ /** Multi 'mode' button (or any element really) that changes the html
+ * contents of itself when clicked. Pass in an ordered list of
+ * objects with 'html' and (optional) onclick functions.
+ *
+ * When clicked in a particular node, the onclick function will
+ * be called (with the element as this) and the element will
+ * switch to the next mode, replacing it's html content with
+ * that mode's html.
+ *
+ * If there is no next mode, the element will switch back to
+ * the first mode.
+ * @example:
+ * $( '.myElement' ).modeButton({
+ * modes : [
+ * {
+ * mode: 'bler',
+ * html: '<h5>Bler</h5>',
+ * onclick : function(){
+ * $( 'body' ).css( 'background-color', 'red' );
+ * }
+ * },
+ * {
+ * mode: 'bloo',
+ * html: '<h4>Bloo</h4>',
+ * onclick : function(){
+ * $( 'body' ).css( 'background-color', 'blue' );
+ * }
+ * },
+ * {
+ * mode: 'blah',
+ * html: '<h3>Blah</h3>',
+ * onclick : function(){
+ * $( 'body' ).css( 'background-color', 'grey' );
+ * }
+ * },
+ * ]
+ * });
+ * $( '.myElement' ).modeButton( 'callModeFn', 'bler' );
+ */
+ function ModeButton( element, options ){
+ this.currModeIndex = 0;
+ return this.init( element, options );
+ }
+
+ ModeButton.prototype.DATA_KEY = 'mode-button';
+ ModeButton.prototype.defaults = {
+ modes : [
+ { mode: 'default' }
+ ]
+ };
+
+ ModeButton.prototype.init = function _init( element, options ){
+ options = options || {};
+ this.$element = $( element );
+ this.options = jQuery.extend( true, this.defaults, options );
+
+ var modeButton = this;
+ this.$element.click( function _ModeButtonClick( event ){
+
+ // call the curr mode fn
+ modeButton.callModeFn();
+ // inc the curr mode index
+ modeButton._incModeIndex();
+ // set the element html
+ $( this ).html( modeButton.options.modes[ modeButton.currModeIndex ].html );
+ });
+
+ this.currModeIndex = 0;
+ if( this.options.initialMode ){
+ this.currModeIndex = this._getModeIndex( this.options.initialMode );
+ }
+ return this;
+ };
+
+
+ ModeButton.prototype._getModeIndex = function __getModeIndex( modeKey ){
+ for( var i=0; i<this.options.modes.length; i+=1 ){
+ if( this.options.modes[ i ].mode === modeKey ){ return i; }
+ }
+ throw new Error( 'mode not found: ' + modeKey );
+ };
+ ModeButton.prototype.getCurrMode = function _getCurrMode(){
+ return this.options.modes[ this.currModeIndex ];
+ };
+ ModeButton.prototype.getMode = function _getMode( modeKey ){
+ if( !modeKey ){ return this.getCurrMode(); }
+ return this.options.modes[( this._getModeIndex( modeKey ) )];
+ };
+ ModeButton.prototype.hasMode = function _hasMode( modeKey ){
+ return !!this.getMode( modeKey );
+ };
+ ModeButton.prototype.currentMode = function _currentMode(){
+ return this.options.modes[ this.currModeIndex ];
+ };
+ ModeButton.prototype.setMode = function _setMode( newModeKey ){
+ var newMode = this.getMode( newModeKey );
+ this.$element.html( newMode.html || null );
+ return this;
+ };
+ ModeButton.prototype._incModeIndex = function __incModeIndex(){
+ this.currModeIndex += 1;
+ if( this.currModeIndex >= this.options.modes.length ){
+ this.currModeIndex = 0;
+ }
+ return this;
+ };
+ ModeButton.prototype.callModeFn = function _callModeFn( modeKey ){
+ var modeFn = this.getMode( modeKey ).onclick;
+ if( modeFn && jQuery.type( modeFn === 'function' ) ){
+ return modeFn.call( this );
+ }
+ return undefined;
+ };
+
+ // as jq plugin
+ jQuery.fn.extend({
+ modeButton : function $modeButton( options ){
+ var nonOptionsArgs = jQuery.makeArray( arguments ).slice( 1 );
+ return this.each( function(){
+ var $this = $( this ),
+ data = $this.data( 'mode-button' );
+
+ if( jQuery.type( options ) === 'object' ){
+ data = new ModeButton( $this, options );
+ $this.data( 'mode-button', data );
+ }
+ if( data && jQuery.type( options ) === 'string' ){
+ var fn = data[ options ];
+ if( jQuery.type( fn ) === 'function' ){
+ return fn.apply( data, nonOptionsArgs );
+ }
+ }
+ return this;
+ });
+ }
+ });
+}());
+
+
+//==============================================================================
function LoadingIndicator( $where, options ){
//TODO: move out of global
//TODO: too specific to history panel
diff -r a0e7daee0399f71ef7203d949796cbfa0dec5ec2 -r 5ab8b88ae58e99be83e6a2488a7855a02b260c18 static/scripts/packed/mvc/ui.js
--- a/static/scripts/packed/mvc/ui.js
+++ b/static/scripts/packed/mvc/ui.js
@@ -1,1 +1,1 @@
-var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,is_menu_button:true,id:null,href:null,target:null,enabled:true,visible:true,tooltip_config:{}}});var IconButtonView=Backbone.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"};this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var a=this.template(this.model.toJSON());a.tooltip(this.model.get("tooltip_config"));this.$el.replaceWith(a);this.setElement(a);return this},events:{click:"click"},click:function(a){if(_.isFunction(this.model.get("on_click"))){this.model.get("on_click")(a);return false}return true},template:function(b){var a='title="'+b.title+'" class="icon-button';if(b.is_menu_button){a+=" menu-button"}a+=" "+b.icon_class;if(!b.enabled){a+="_disabled"}a+='"';if(b.id){a+=' id="'+b.id+'"'}a+=' href="'+b.href+'"';if(b.target){a+=' target="'+b.target+'"'}if(!b.visible){a+=' style="display: none;"'}if(b.enabled){a="<a "+a+"/>"}else{a="<span "+a+"/>"}return $(a)}});var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var a=this;this.collection.each(function(d){var b=$("<a/>").attr("href","javascript:void(0)").attr("title",d.attributes.title).addClass("icon-button menu-button").addClass(d.attributes.icon_class).appendTo(a.$el).click(d.attributes.on_click);if(d.attributes.tooltip_config){b.tooltip(d.attributes.tooltip_config)}var c=d.get("options");if(c){make_popupmenu(b,c)}});return this}});var create_icon_buttons_menu=function(b,a){if(!a){a={}}var c=new IconButtonCollection(_.map(b,function(d){return new IconButton(_.extend(d,a))}));return new IconButtonMenuView({collection:c})};var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});var PopupMenu=Backbone.View.extend({initialize:function(b,a){this.$button=b;if(!this.$button.size()){this.$button=$("<div/>")}this.options=a||[];var c=this;this.$button.click(function(d){$(".popmenu-wrapper").remove();c._renderAndShow(d);return false})},_renderAndShow:function(a){this.render();this.$el.appendTo("body").css(this._getShownPosition(a)).show();this._setUpCloseBehavior()},render:function(){this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options));if(this.options.length){var a=this;this.$el.find("li").each(function(c,b){var d=a.options[c];if(d.func){$(this).children("a.popupmenu-option").click(function(e){d.func.call(a,e,d)})}})}return this},template:function(b,a){return['<ul id="',b,'-menu" class="dropdown-menu">',this._templateOptions(a),"</ul>"].join("")},_templateOptions:function(a){if(!a.length){return"<li>(no options)</li>"}return _.map(a,function(d){if(d.divider){return'<li class="divider"></li>'}else{if(d.header){return['<li class="head"><a href="javascript:void(0);">',d.html,"</a></li>"].join("")}}var c=d.href||"javascript:void(0);",e=(d.target)?(' target="'+d.target+'"'):(""),b=(d.checked)?('<span class="fa fa-check"></span>'):("");return['<li><a class="popupmenu-option" href="',c,'"',e,">",b,d.html,"</a></li>"].join("")}).join("")},_getShownPosition:function(b){var c=this.$el.width();var a=b.pageX-c/2;a=Math.min(a,$(document).scrollLeft()+$(window).width()-c-5);a=Math.max(a,$(document).scrollLeft()+5);return{top:b.pageY,left:a}},_setUpCloseBehavior:function(){var c=this;function a(e){$(document).off("click.close_popup");if(window.parent!==window){try{$(window.parent.document).off("click.close_popup")}catch(d){}}else{try{$("iframe#galaxy_main").contents().off("click.close_popup")}catch(d){}}c.remove()}$("html").one("click.close_popup",a);if(window.parent!==window){try{$(window.parent.document).find("html").one("click.close_popup",a)}catch(b){}}else{try{$("iframe#galaxy_main").contents().one("click.close_popup",a)}catch(b){}}},addItem:function(b,a){a=(a>=0)?a:this.options.length;this.options.splice(a,0,b);return this},removeItem:function(a){if(a>=0){this.options.splice(a,1)}return this},findIndexByHtml:function(b){for(var a=0;a<this.options.length;a++){if(_.has(this.options[a],"html")&&(this.options[a].html===b)){return a}}return null},findItemByHtml:function(a){return this.options[(this.findIndexByHtml(a))]},toString:function(){return"PopupMenu"}});PopupMenu.make_popupmenu=function(b,c){var a=[];_.each(c,function(f,d){var e={html:d};if(f===null){e.header=true}else{if(jQuery.type(f)==="function"){e.func=f}}a.push(e)});return new PopupMenu($(b),a)};PopupMenu.convertLinksToOptions=function(c,a){c=$(c);a=a||"a";var b=[];c.find(a).each(function(g,e){var f={},d=$(g);f.html=d.text();if(d.attr("href")){var j=d.attr("href"),k=d.attr("target"),h=d.attr("confirm");f.func=function(){if((h)&&(!confirm(h))){return}switch(k){case"_parent":window.parent.location=j;break;case"_top":window.top.location=j;break;default:window.location=j}}}b.push(f)});return b};PopupMenu.fromExistingDom=function(d,c,a){d=$(d);c=$(c);var b=PopupMenu.convertLinksToOptions(c,a);c.remove();return new PopupMenu(d,b)};PopupMenu.make_popup_menus=function(c,b,d){c=c||document;b=b||"div[popupmenu]";d=d||function(e,f){return"#"+e.attr("popupmenu")};var a=[];$(c).find(b).each(function(){var e=$(this),f=$(c).find(d(e,c));a.push(PopupMenu.fromDom(f,e));f.addClass("popup")});return a};var faIconButton=function(a){a=a||{};a.tooltipConfig=a.tooltipConfig||{placement:"bottom"};a.classes=["icon-btn"].concat(a.classes||[]);if(a.disabled){a.classes.push("disabled")}var b=['<a class="',a.classes.join(" "),'"',((a.title)?(' title="'+a.title+'"'):("")),((!a.disabled&&a.target)?(' target="'+a.target+'"'):("")),' href="',((!a.disabled&&a.href)?(a.href):("javascript:void(0);")),'">','<span class="fa ',a.faIcon,'"></span>',"</a>"].join("");var c=$(b).tooltip(a.tooltipConfig);if(_.isFunction(a.onclick)){c.click(a.onclick)}return c};(function(){function a(j,p){var d=27,m=13,c=$(j),e=true,g={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(q){},minSearchLen:0,escWillClear:true,oninit:function(){}};function i(q){var r=$(this).parent().children("input");r.val("");r.trigger("clear:searchInput");p.onclear()}function o(r,q){$(this).trigger("search:searchInput",q);if(typeof p.onfirstsearch==="function"&&e){e=false;p.onfirstsearch(q)}else{p.onsearch(q)}}function f(){return['<input type="text" name="',p.name,'" placeholder="',p.placeholder,'" ','class="search-query ',p.classes,'" ',"/>"].join("")}function l(){return $(f()).focus(function(q){$(this).select()}).keyup(function(r){if(r.which===d&&p.escWillClear){i.call(this,r)}else{var q=$(this).val();if((r.which===m)||(p.minSearchLen&&q.length>=p.minSearchLen)){o.call(this,r,q)}else{if(!q.length){i.call(this,r)}}}}).val(p.initialVal)}function k(){return $(['<span class="search-clear fa fa-times-circle" ','title="',_l("clear search (esc)"),'"></span>'].join("")).tooltip({placement:"bottom"}).click(function(q){i.call(this,q)})}function n(){return $(['<span class="search-loading fa fa-spinner fa-spin" ','title="',_l("loading..."),'"></span>'].join("")).hide().tooltip({placement:"bottom"})}function h(){c.find(".search-loading").toggle();c.find(".search-clear").toggle()}if(jQuery.type(p)==="string"){if(p==="toggle-loading"){h()}return c}if(jQuery.type(p)==="object"){p=jQuery.extend(true,g,p)}return c.addClass("search-input").prepend([l(),k(),n()])}jQuery.fn.extend({searchInput:function b(c){return this.each(function(){return a(this,c)})}})}());function LoadingIndicator(a,c){var b=this;c=jQuery.extend({cover:false},c||{});function d(){var e=['<div class="loading-indicator">','<div class="loading-indicator-text">','<span class="fa fa-spinner fa-spin fa-lg"></span>','<span class="loading-indicator-message">loading...</span>',"</div>","</div>"].join("\n");var g=$(e).hide().css(c.css||{position:"fixed"}),f=g.children(".loading-indicator-text");if(c.cover){g.css({"z-index":2,top:a.css("top"),bottom:a.css("bottom"),left:a.css("left"),right:a.css("right"),opacity:0.5,"background-color":"white","text-align":"center"});f=g.children(".loading-indicator-text").css({"margin-top":"20px"})}else{f=g.children(".loading-indicator-text").css({margin:"12px 0px 0px 10px",opacity:"0.85",color:"grey"});f.children(".loading-indicator-message").css({margin:"0px 8px 0px 0px","font-style":"italic"})}return g}b.show=function(f,e,g){f=f||"loading...";e=e||"fast";b.$indicator=d().insertBefore(a);b.message(f);b.$indicator.fadeIn(e,g);return b};b.message=function(e){b.$indicator.find("i").text(e)};b.hide=function(e,f){e=e||"fast";if(b.$indicator&&b.$indicator.size()){b.$indicator.fadeOut(e,function(){b.$indicator.remove();if(f){f()}})}else{if(f){f()}}return b};return b};
\ No newline at end of file
+var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,is_menu_button:true,id:null,href:null,target:null,enabled:true,visible:true,tooltip_config:{}}});var IconButtonView=Backbone.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"};this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var a=this.template(this.model.toJSON());a.tooltip(this.model.get("tooltip_config"));this.$el.replaceWith(a);this.setElement(a);return this},events:{click:"click"},click:function(a){if(_.isFunction(this.model.get("on_click"))){this.model.get("on_click")(a);return false}return true},template:function(b){var a='title="'+b.title+'" class="icon-button';if(b.is_menu_button){a+=" menu-button"}a+=" "+b.icon_class;if(!b.enabled){a+="_disabled"}a+='"';if(b.id){a+=' id="'+b.id+'"'}a+=' href="'+b.href+'"';if(b.target){a+=' target="'+b.target+'"'}if(!b.visible){a+=' style="display: none;"'}if(b.enabled){a="<a "+a+"/>"}else{a="<span "+a+"/>"}return $(a)}});var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var a=this;this.collection.each(function(d){var b=$("<a/>").attr("href","javascript:void(0)").attr("title",d.attributes.title).addClass("icon-button menu-button").addClass(d.attributes.icon_class).appendTo(a.$el).click(d.attributes.on_click);if(d.attributes.tooltip_config){b.tooltip(d.attributes.tooltip_config)}var c=d.get("options");if(c){make_popupmenu(b,c)}});return this}});var create_icon_buttons_menu=function(b,a){if(!a){a={}}var c=new IconButtonCollection(_.map(b,function(d){return new IconButton(_.extend(d,a))}));return new IconButtonMenuView({collection:c})};var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});var PopupMenu=Backbone.View.extend({initialize:function(b,a){this.$button=b;if(!this.$button.size()){this.$button=$("<div/>")}this.options=a||[];var c=this;this.$button.click(function(d){$(".popmenu-wrapper").remove();c._renderAndShow(d);return false})},_renderAndShow:function(a){this.render();this.$el.appendTo("body").css(this._getShownPosition(a)).show();this._setUpCloseBehavior()},render:function(){this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options));if(this.options.length){var a=this;this.$el.find("li").each(function(c,b){var d=a.options[c];if(d.func){$(this).children("a.popupmenu-option").click(function(e){d.func.call(a,e,d)})}})}return this},template:function(b,a){return['<ul id="',b,'-menu" class="dropdown-menu">',this._templateOptions(a),"</ul>"].join("")},_templateOptions:function(a){if(!a.length){return"<li>(no options)</li>"}return _.map(a,function(d){if(d.divider){return'<li class="divider"></li>'}else{if(d.header){return['<li class="head"><a href="javascript:void(0);">',d.html,"</a></li>"].join("")}}var c=d.href||"javascript:void(0);",e=(d.target)?(' target="'+d.target+'"'):(""),b=(d.checked)?('<span class="fa fa-check"></span>'):("");return['<li><a class="popupmenu-option" href="',c,'"',e,">",b,d.html,"</a></li>"].join("")}).join("")},_getShownPosition:function(b){var c=this.$el.width();var a=b.pageX-c/2;a=Math.min(a,$(document).scrollLeft()+$(window).width()-c-5);a=Math.max(a,$(document).scrollLeft()+5);return{top:b.pageY,left:a}},_setUpCloseBehavior:function(){var c=this;function a(e){$(document).off("click.close_popup");if(window.parent!==window){try{$(window.parent.document).off("click.close_popup")}catch(d){}}else{try{$("iframe#galaxy_main").contents().off("click.close_popup")}catch(d){}}c.remove()}$("html").one("click.close_popup",a);if(window.parent!==window){try{$(window.parent.document).find("html").one("click.close_popup",a)}catch(b){}}else{try{$("iframe#galaxy_main").contents().one("click.close_popup",a)}catch(b){}}},addItem:function(b,a){a=(a>=0)?a:this.options.length;this.options.splice(a,0,b);return this},removeItem:function(a){if(a>=0){this.options.splice(a,1)}return this},findIndexByHtml:function(b){for(var a=0;a<this.options.length;a++){if(_.has(this.options[a],"html")&&(this.options[a].html===b)){return a}}return null},findItemByHtml:function(a){return this.options[(this.findIndexByHtml(a))]},toString:function(){return"PopupMenu"}});PopupMenu.make_popupmenu=function(b,c){var a=[];_.each(c,function(f,d){var e={html:d};if(f===null){e.header=true}else{if(jQuery.type(f)==="function"){e.func=f}}a.push(e)});return new PopupMenu($(b),a)};PopupMenu.convertLinksToOptions=function(c,a){c=$(c);a=a||"a";var b=[];c.find(a).each(function(g,e){var f={},d=$(g);f.html=d.text();if(d.attr("href")){var j=d.attr("href"),k=d.attr("target"),h=d.attr("confirm");f.func=function(){if((h)&&(!confirm(h))){return}switch(k){case"_parent":window.parent.location=j;break;case"_top":window.top.location=j;break;default:window.location=j}}}b.push(f)});return b};PopupMenu.fromExistingDom=function(d,c,a){d=$(d);c=$(c);var b=PopupMenu.convertLinksToOptions(c,a);c.remove();return new PopupMenu(d,b)};PopupMenu.make_popup_menus=function(c,b,d){c=c||document;b=b||"div[popupmenu]";d=d||function(e,f){return"#"+e.attr("popupmenu")};var a=[];$(c).find(b).each(function(){var e=$(this),f=$(c).find(d(e,c));a.push(PopupMenu.fromDom(f,e));f.addClass("popup")});return a};var faIconButton=function(a){a=a||{};a.tooltipConfig=a.tooltipConfig||{placement:"bottom"};a.classes=["icon-btn"].concat(a.classes||[]);if(a.disabled){a.classes.push("disabled")}var b=['<a class="',a.classes.join(" "),'"',((a.title)?(' title="'+a.title+'"'):("")),((!a.disabled&&a.target)?(' target="'+a.target+'"'):("")),' href="',((!a.disabled&&a.href)?(a.href):("javascript:void(0);")),'">','<span class="fa ',a.faIcon,'"></span>',"</a>"].join("");var c=$(b).tooltip(a.tooltipConfig);if(_.isFunction(a.onclick)){c.click(a.onclick)}return c};(function(){function a(j,p){var d=27,m=13,c=$(j),e=true,g={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onfirstsearch:null,onsearch:function(q){},minSearchLen:0,escWillClear:true,oninit:function(){}};function i(q){var r=$(this).parent().children("input");r.val("");r.trigger("clear:searchInput");p.onclear()}function o(r,q){$(this).trigger("search:searchInput",q);if(typeof p.onfirstsearch==="function"&&e){e=false;p.onfirstsearch(q)}else{p.onsearch(q)}}function f(){return['<input type="text" name="',p.name,'" placeholder="',p.placeholder,'" ','class="search-query ',p.classes,'" ',"/>"].join("")}function l(){return $(f()).focus(function(q){$(this).select()}).keyup(function(r){if(r.which===d&&p.escWillClear){i.call(this,r)}else{var q=$(this).val();if((r.which===m)||(p.minSearchLen&&q.length>=p.minSearchLen)){o.call(this,r,q)}else{if(!q.length){i.call(this,r)}}}}).val(p.initialVal)}function k(){return $(['<span class="search-clear fa fa-times-circle" ','title="',_l("clear search (esc)"),'"></span>'].join("")).tooltip({placement:"bottom"}).click(function(q){i.call(this,q)})}function n(){return $(['<span class="search-loading fa fa-spinner fa-spin" ','title="',_l("loading..."),'"></span>'].join("")).hide().tooltip({placement:"bottom"})}function h(){c.find(".search-loading").toggle();c.find(".search-clear").toggle()}if(jQuery.type(p)==="string"){if(p==="toggle-loading"){h()}return c}if(jQuery.type(p)==="object"){p=jQuery.extend(true,g,p)}return c.addClass("search-input").prepend([l(),k(),n()])}jQuery.fn.extend({searchInput:function b(c){return this.each(function(){return a(this,c)})}})}());(function(){function b(m,l){this.currModeIndex=0;return this.init(m,l)}b.prototype.DATA_KEY="mode-button";b.prototype.defaults={modes:[{mode:"default"}]};b.prototype.init=function f(m,l){l=l||{};this.$element=$(m);this.options=jQuery.extend(true,this.defaults,l);var o=this;this.$element.click(function n(p){o.callModeFn();o._incModeIndex();$(this).html(o.options.modes[o.currModeIndex].html)});this.currModeIndex=0;if(this.options.initialMode){this.currModeIndex=this._getModeIndex(this.options.initialMode)}return this};b.prototype._getModeIndex=function j(l){for(var m=0;m<this.options.modes.length;m+=1){if(this.options.modes[m].mode===l){return m}}throw new Error("mode not found: "+l)};b.prototype.getCurrMode=function a(){return this.options.modes[this.currModeIndex]};b.prototype.getMode=function g(l){if(!l){return this.getCurrMode()}return this.options.modes[(this._getModeIndex(l))]};b.prototype.hasMode=function k(l){return !!this.getMode(l)};b.prototype.currentMode=function e(){return this.options.modes[this.currModeIndex]};b.prototype.setMode=function c(m){var l=this.getMode(m);this.$element.html(l.html||null);return this};b.prototype._incModeIndex=function d(){this.currModeIndex+=1;if(this.currModeIndex>=this.options.modes.length){this.currModeIndex=0}return this};b.prototype.callModeFn=function h(l){var m=this.getMode(l).onclick;if(m&&jQuery.type(m==="function")){return m.call(this)}return undefined};jQuery.fn.extend({modeButton:function i(m){var l=jQuery.makeArray(arguments).slice(1);return this.each(function(){var p=$(this),o=p.data("mode-button");if(jQuery.type(m)==="object"){o=new b(p,m);p.data("mode-button",o)}if(o&&jQuery.type(m)==="string"){var n=o[m];if(jQuery.type(n)==="function"){return n.apply(o,l)}}return this})}})}());function LoadingIndicator(a,c){var b=this;c=jQuery.extend({cover:false},c||{});function d(){var e=['<div class="loading-indicator">','<div class="loading-indicator-text">','<span class="fa fa-spinner fa-spin fa-lg"></span>','<span class="loading-indicator-message">loading...</span>',"</div>","</div>"].join("\n");var g=$(e).hide().css(c.css||{position:"fixed"}),f=g.children(".loading-indicator-text");if(c.cover){g.css({"z-index":2,top:a.css("top"),bottom:a.css("bottom"),left:a.css("left"),right:a.css("right"),opacity:0.5,"background-color":"white","text-align":"center"});f=g.children(".loading-indicator-text").css({"margin-top":"20px"})}else{f=g.children(".loading-indicator-text").css({margin:"12px 0px 0px 10px",opacity:"0.85",color:"grey"});f.children(".loading-indicator-message").css({margin:"0px 8px 0px 0px","font-style":"italic"})}return g}b.show=function(f,e,g){f=f||"loading...";e=e||"fast";b.$indicator=d().insertBefore(a);b.message(f);b.$indicator.fadeIn(e,g);return b};b.message=function(e){b.$indicator.find("i").text(e)};b.hide=function(e,f){e=e||"fast";if(b.$indicator&&b.$indicator.size()){b.$indicator.fadeOut(e,function(){b.$indicator.remove();if(f){f()}})}else{if(f){f()}}return b};return b};
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: History view: allow switching when viewing own
by commits-noreply@bitbucket.org 11 Dec '13
by commits-noreply@bitbucket.org 11 Dec '13
11 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a0e7daee0399/
Changeset: a0e7daee0399
User: carlfeberhard
Date: 2013-12-11 23:29:22
Summary: History view: allow switching when viewing own
Affected #: 1 file
diff -r d19e22bce1b880b86b6245760bdf0d8c7d13366e -r a0e7daee0399f71ef7203d949796cbfa0dec5ec2 templates/webapps/galaxy/history/view.mako
--- a/templates/webapps/galaxy/history/view.mako
+++ b/templates/webapps/galaxy/history/view.mako
@@ -17,6 +17,13 @@
<script type="text/javascript">
$(function() {
init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
+ $( '#switch-to-link' ).click( function( event ){
+ var galaxy = window.Galaxy || window.parent.Galaxy;
+ if( galaxy ){
+ galaxy.currHistoryPanel.switchToHistory( '${ trans.security.encode_id( history.id ) }' );
+ }
+ });
+ $( '#refresh' ).click( function( event ){ window.location.reload( true ); })
});
</script></%def>
@@ -119,9 +126,15 @@
</div><div id="top-links" class="historyLinks" style="padding: 0px 0px 5px 0px">
- %if not history.purged:
- <a href="${h.url_for(controller='history', action='imp', id=trans.security.encode_id(history.id) )}">import and start using history</a> |
- <a href="${get_history_link( history )}">${_('refresh')}</a> |
+ %if not history.purged and history.user != trans.user:
+ ##TODO: need to remove _top
+ <a href="${h.url_for(controller='history', action='imp', id=trans.security.encode_id(history.id) )}"
+ >import and start using history</a> |
+ <a id="refresh" href="javascript:void(0)" >${_('refresh')}</a> |
+ %endif
+ %if not history.purged and history.user == trans.user:
+ <a id="switch-to-link" href="javascript:void(0)">${_('switch to this history')}</a> |
+ <a id="refresh" href="javascript:void(0)" >${_('refresh')}</a> |
%endif
%if show_deleted:
<a href="${h.url_for(controller='history', action='view', id=trans.security.encode_id(history.id), show_deleted=False, use_panels=use_panels )}">${_('hide deleted')}</a> |
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: guerler: UI: Fix nested history bug
by commits-noreply@bitbucket.org 11 Dec '13
by commits-noreply@bitbucket.org 11 Dec '13
11 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d19e22bce1b8/
Changeset: d19e22bce1b8
User: guerler
Date: 2013-12-11 22:39:20
Summary: UI: Fix nested history bug
Affected #: 1 file
diff -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc -r d19e22bce1b880b86b6245760bdf0d8c7d13366e lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -838,8 +838,8 @@
# Set imported history to be user's current history.
trans.set_history( new_history )
return trans.show_ok_message(
- message="""History "%s" has been imported. <br>You can <a href="%s">start using this history</a> or %s."""
- % ( new_history.name, web.url_for( '/' ), referer_message ), use_panels=True )
+ message="""History "%s" has been imported. <br>You can <a href="%s" onclick="parent.window.location='%s';">start using this history</a> or %s."""
+ % ( new_history.name, web.url_for( '/' ), web.url_for( '/' ), referer_message ), use_panels=True )
elif not user_history or not user_history.datasets or confirm:
new_history = import_history.copy()
new_history.name = "imported: " + new_history.name
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Allow a tool dependency to be uninstalled from Galaxy only if it is in an error state. Allow an installed repository to be uninstalled from Galaxy only if it has no dependent repositories and none of its contents are dependencies of other repository contents.
by commits-noreply@bitbucket.org 11 Dec '13
by commits-noreply@bitbucket.org 11 Dec '13
11 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b56f6e027d2c/
Changeset: b56f6e027d2c
User: greg
Date: 2013-12-11 22:36:32
Summary: Allow a tool dependency to be uninstalled from Galaxy only if it is in an error state. Allow an installed repository to be uninstalled from Galaxy only if it has no dependent repositories and none of its contents are dependencies of other repository contents.
Affected #: 13 files
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -87,7 +87,8 @@
self.install_model = install_mapping.init( install_db_url,
install_db_engine_options )
# Manage installed tool shed repositories.
- self.installed_repository_manager = tool_shed.galaxy_install.InstalledRepositoryManager( self )
+ from tool_shed.galaxy_install import installed_repository_manager
+ self.installed_repository_manager = installed_repository_manager.InstalledRepositoryManager( self )
# Create an empty datatypes registry.
self.datatypes_registry = galaxy.datatypes.registry.Registry()
# Load proprietary datatypes defined in datatypes_conf.xml files in all installed tool shed repositories. We
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/galaxy/model/tool_shed_install/__init__.py
--- a/lib/galaxy/model/tool_shed_install/__init__.py
+++ b/lib/galaxy/model/tool_shed_install/__init__.py
@@ -1,10 +1,7 @@
import os
-
from galaxy.model.item_attrs import Dictifiable
-
from galaxy.util.bunch import Bunch
from galaxy.util import asbool
-
from tool_shed.util import common_util
@@ -61,9 +58,38 @@
def can_reset_metadata( self ):
return self.status == self.installation_status.INSTALLED
- @property
- def can_uninstall( self ):
- return self.status != self.installation_status.UNINSTALLED
+ def can_uninstall( self, app ):
+ # An installed repository cannot be uninstalled if other installed repositories or installed repository
+ # contents (i.e., tool dependencies) require it.
+ if self.status == self.installation_status.UNINSTALLED:
+ return False
+ irm = app.installed_repository_manager
+ # Find other installed repositories that require this repository.
+ for repository in irm.repository_dependencies_of_installed_repositories:
+ if repository.id == self.id:
+ installed_repository_dependencies = \
+ irm.installed_repository_dependencies_of_installed_repositories[ repository ]
+ if installed_repository_dependencies:
+ # This repository cannot be uninstalled because other installed repositories require it.
+ return False
+ # Find installed tool dependencies that require this repository's installed tool dependencies.
+ installed_tool_dependencies = []
+ for repository in irm.installed_tool_dependencies_of_installed_repositories:
+ if repository.id == self.id:
+ installed_tool_dependencies = \
+ irm.installed_tool_dependencies_of_installed_repositories[ repository ]
+ break
+ for td in installed_tool_dependencies:
+ if td.id in irm.ids_of_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies_keys:
+ for installed_td in irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ if installed_td.id == td.id:
+ installed_dependent_tds = \
+ irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ installed_td ]
+ if installed_dependent_tds:
+ # This repository cannot be uninstalled because it contains installed tool dependencies that
+ # are required at run time by other installed tool dependencies.
+ return False
+ return True
@property
def can_deactivate( self ):
@@ -218,7 +244,7 @@
@property
def installed_tool_dependencies( self ):
- """Return the repository's tool dependencies that are currently installed."""
+ """Return the repository's tool dependencies that are currently installed, but possibly in an error state."""
installed_dependencies = []
for tool_dependency in self.tool_dependencies:
if tool_dependency.status in [ ToolDependency.installation_status.INSTALLED,
@@ -313,9 +339,9 @@
required_repositories_missing_or_being_installed = []
for required_repository in self.repository_dependencies:
if required_repository.status in [ self.installation_status.ERROR,
- self.installation_status.INSTALLING,
- self.installation_status.NEVER_INSTALLED,
- self.installation_status.UNINSTALLED ]:
+ self.installation_status.INSTALLING,
+ self.installation_status.NEVER_INSTALLED,
+ self.installation_status.UNINSTALLED ]:
required_repositories_missing_or_being_installed.append( required_repository )
return required_repositories_missing_or_being_installed
@@ -507,7 +533,9 @@
@property
def can_uninstall( self ):
- return self.status in [ self.installation_status.ERROR, self.installation_status.INSTALLED ]
+ # A tool dependency can be uninstalled only if it is currently in an error state. Only the containing
+ # repository can be uninstalled if a tool dependency is properly installed.
+ return self.status in [ self.installation_status.ERROR ]
@property
def can_update( self ):
@@ -516,6 +544,13 @@
self.installation_status.ERROR,
self.installation_status.UNINSTALLED ]
+ def get_env_shell_file_path( self, app ):
+ installation_directory = self.installation_directory( app )
+ file_path = os.path.join( installation_directory, 'env.sh' )
+ if os.path.exists( file_path ):
+ return file_path
+ return None
+
@property
def in_error_state( self ):
return self.status == self.installation_status.ERROR
@@ -536,6 +571,10 @@
self.tool_shed_repository.name,
self.tool_shed_repository.installed_changeset_revision )
+ @property
+ def is_installed( self ):
+ return self.status == self.installation_status.INSTALLED
+
class ToolVersion( object, Dictifiable ):
dict_element_visible_keys = ( 'id', 'tool_shed_repository' )
@@ -549,23 +588,23 @@
def get_previous_version( self, app ):
context = app.install_model.context
tva = context.query( app.install_model.ToolVersionAssociation ) \
- .filter( app.install_model.ToolVersionAssociation.table.c.tool_id == self.id ) \
- .first()
+ .filter( app.install_model.ToolVersionAssociation.table.c.tool_id == self.id ) \
+ .first()
if tva:
return context.query( app.install_model.ToolVersion ) \
- .filter( app.install_model.ToolVersion.table.c.id == tva.parent_id ) \
- .first()
+ .filter( app.install_model.ToolVersion.table.c.id == tva.parent_id ) \
+ .first()
return None
def get_next_version( self, app ):
context = app.install_model.context
tva = context.query( app.install_model.ToolVersionAssociation ) \
- .filter( app.install_model.ToolVersionAssociation.table.c.parent_id == self.id ) \
- .first()
+ .filter( app.install_model.ToolVersionAssociation.table.c.parent_id == self.id ) \
+ .first()
if tva:
return context.query( app.install_model.ToolVersion ) \
- .filter( app.install_model.ToolVersion.table.c.id == tva.tool_id ) \
- .first()
+ .filter( app.install_model.ToolVersion.table.c.id == tva.tool_id ) \
+ .first()
return None
def get_versions( self, app ):
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/galaxy/model/tool_shed_install/mapping.py
--- a/lib/galaxy/model/tool_shed_install/mapping.py
+++ b/lib/galaxy/model/tool_shed_install/mapping.py
@@ -7,10 +7,8 @@
from galaxy.model.base import ModelMapping
from galaxy.model.orm.engine_factory import build_engine
-
metadata = MetaData()
-
install_model.ToolShedRepository.table = Table( "tool_shed_repository", metadata,
Column( "id", Integer, primary_key=True ),
Column( "create_time", DateTime, default=now ),
@@ -72,7 +70,6 @@
Column( "repository_path", TEXT ),
Column( "version", Integer ) )
-
mapper( install_model.ToolShedRepository, install_model.ToolShedRepository.table,
properties=dict( tool_versions=relation( install_model.ToolVersion,
primaryjoin=( install_model.ToolShedRepository.table.c.id == install_model.ToolVersion.table.c.tool_shed_repository_id ),
@@ -112,17 +109,13 @@
"""Connect mappings to the database"""
# Load the appropriate db module
engine = build_engine( url, engine_options )
-
# Connect the metadata to the database.
metadata.bind = engine
-
- result = ModelMapping([install_model], engine=engine)
-
+ result = ModelMapping( [ install_model ], engine=engine )
# Create tables if needed
if create_tables:
metadata.create_all()
# metadata.engine.commit()
-
result.create_tables = create_tables
#load local galaxy security policy
return result
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -265,6 +265,9 @@
if remove_from_disk_checked:
tool_shed_repository.status = trans.install_model.ToolShedRepository.installation_status.UNINSTALLED
tool_shed_repository.error_message = None
+ # Remove the uninstalled repository and any tool dependencies from the in-memory dictionaries in the
+ # installed_repository_manager.
+ trans.app.installed_repository_manager.handle_uninstall( tool_shed_repository )
else:
tool_shed_repository.status = trans.install_model.ToolShedRepository.installation_status.DEACTIVATED
trans.install_model.context.add( tool_shed_repository )
@@ -1564,7 +1567,7 @@
tool_shed_repository = tool_dependencies[ 0 ].tool_shed_repository
if kwd.get( 'uninstall_tool_dependencies_button', False ):
errors = False
- # Filter tool dependencies to only those that are installed.
+ # Filter tool dependencies to only those that are installed but in an error state.
tool_dependencies_for_uninstallation = []
for tool_dependency in tool_dependencies:
if tool_dependency.can_uninstall:
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/tool_shed/galaxy_install/__init__.py
--- a/lib/tool_shed/galaxy_install/__init__.py
+++ b/lib/tool_shed/galaxy_install/__init__.py
@@ -1,54 +0,0 @@
-"""
-Classes encapsulating the management of repositories installed from Galaxy tool sheds.
-"""
-import os, logging
-import tool_shed.util.shed_util_common
-import tool_shed.util.datatype_util
-from galaxy.model.orm import and_
-from tool_shed.util import xml_util
-
-log = logging.getLogger( __name__ )
-
-class InstalledRepositoryManager( object ):
- def __init__( self, app ):
- self.app = app
- self.install_model = self.app.install_model
- self.context = self.install_model.context
- self.tool_configs = self.app.config.tool_configs
- if self.app.config.migrated_tools_config not in self.tool_configs:
- self.tool_configs.append( self.app.config.migrated_tools_config )
- self.installed_repository_dicts = []
- def get_repository_install_dir( self, tool_shed_repository ):
- for tool_config in self.tool_configs:
- tree, error_message = xml_util.parse_xml( tool_config )
- if tree is None:
- return None
- root = tree.getroot()
- tool_path = root.get( 'tool_path', None )
- if tool_path:
- ts = tool_shed.util.shed_util_common.clean_tool_shed_url( tool_shed_repository.tool_shed )
- relative_path = os.path.join( tool_path,
- ts,
- 'repos',
- tool_shed_repository.owner,
- tool_shed_repository.name,
- tool_shed_repository.installed_changeset_revision )
- if os.path.exists( relative_path ):
- return relative_path
- return None
- def load_proprietary_datatypes( self ):
- for tool_shed_repository in self.context.query( self.install_model.ToolShedRepository ) \
- .filter( and_( self.install_model.ToolShedRepository.table.c.includes_datatypes==True,
- self.install_model.ToolShedRepository.table.c.deleted==False ) ) \
- .order_by( self.install_model.ToolShedRepository.table.c.id ):
- relative_install_dir = self.get_repository_install_dir( tool_shed_repository )
- if relative_install_dir:
- installed_repository_dict = tool_shed.util.datatype_util.load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir )
- if installed_repository_dict:
- self.installed_repository_dicts.append( installed_repository_dict )
- def load_proprietary_converters_and_display_applications( self, deactivate=False ):
- for installed_repository_dict in self.installed_repository_dicts:
- if installed_repository_dict[ 'converter_path' ]:
- tool_shed.util.datatype_util.load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate )
- if installed_repository_dict[ 'display_path' ]:
- tool_shed.util.datatype_util.load_installed_display_applications( self.app, installed_repository_dict, deactivate=deactivate )
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/tool_shed/galaxy_install/installed_repository_manager.py
--- /dev/null
+++ b/lib/tool_shed/galaxy_install/installed_repository_manager.py
@@ -0,0 +1,340 @@
+"""
+Class encapsulating the management of repositories installed from Galaxy tool sheds.
+"""
+import logging
+import os
+import tool_shed.util.shed_util_common as suc
+from tool_shed.util import datatype_util
+from tool_shed.util import repository_dependency_util
+from tool_shed.util import tool_dependency_util
+from tool_shed.util import xml_util
+from galaxy.model.orm import and_
+
+log = logging.getLogger( __name__ )
+
+
+class InstalledRepositoryManager( object ):
+
+ def __init__( self, app ):
+ """
+ Among other things, eep in in-memory set of installed repositories and tool dependencies along with the relationships
+ between each of them. This will allow for quick discovery of those repositories or components that can be uninstalled.
+ The feature allowing a Galaxy administrator to uninstall a repository should not be available to repositories or tool
+ dependency packages that are required by other repositories or their contents (packages). The uninstall feature should
+ be available only at the repository hierarchy level where every dependency will be uninstalled. The exception for this
+ is if an item (repository or tool dependency package) is not in an INSTALLED state - in these cases, the specific item
+ can be uninstalled in order to attempt re-installation.
+ """
+ self.app = app
+ self.install_model = self.app.install_model
+ self.context = self.install_model.context
+ self.tool_configs = self.app.config.tool_configs
+ if self.app.config.migrated_tools_config not in self.tool_configs:
+ self.tool_configs.append( self.app.config.migrated_tools_config )
+ self.installed_repository_dicts = []
+ # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values
+ # are a list of tool_shed_repository objects (whose status can be anything) required by the key. The value defines the
+ # entire repository dependency tree.
+ self.repository_dependencies_of_installed_repositories = {}
+ # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values
+ # are a list of tool_shed_repository objects (whose status is 'Installed') required by the key. The value defines the
+ # entire repository dependency tree.
+ self.installed_repository_dependencies_of_installed_repositories = {}
+ # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values
+ # are a list of its immediate tool_dependency objects (whose status can be anything). The value defines only the immediate
+ # tool dependencies of the repository and does not include any dependencies of the tool dependencies.
+ self.tool_dependencies_of_installed_repositories = {}
+ # Keep an in-memory dictionary whose keys are tool_shed_repository objects (whose status is 'Installed') and whose values
+ # are a list of its immediate tool_dependency objects (whose status is 'Installed'). The value defines only the immediate
+ # tool dependencies of the repository and does not include any dependencies of the tool dependencies.
+ self.installed_tool_dependencies_of_installed_repositories = {}
+ # Keep an in-memory dictionary whose keys are tool_dependency objects (whose status is 'Installed') and whose values are
+ # a list of tool_dependency objects (whose status can be anything) required by the installed tool dependency at runtime.
+ # The value defines the entire tool dependency tree.
+ self.runtime_tool_dependencies_of_installed_tool_dependencies = {}
+ # Keep an in-memory dictionary whose keys are tool_dependency objects (whose status is 'Installed') and whose values are
+ # a list of tool_dependency objects (whose status is 'Installed') that require the key at runtime. The value defines the
+ # entire tool dependency tree.
+ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = {}
+ # Load defined dependency relationships for installed tool shed repositories and their contents.
+ self.load_dependency_relationships()
+
+ def add_entry_to_installed_repository_dependencies_of_installed_repositories( self, repository ):
+ """Add an entry to self.installed_repository_dependencies_of_installed_repositories."""
+ if repository.id not in self.ids_of_installed_repository_dependencies_of_installed_repositories_keys:
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "to installed_repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ status = self.install_model.ToolShedRepository.installation_status.INSTALLED
+ repository_dependency_tree = \
+ repository_dependency_util.get_repository_dependency_tree_for_repository( self.app,
+ repository,
+ status=status )
+ self.installed_repository_dependencies_of_installed_repositories[ repository ] = \
+ repository_dependency_tree
+
+ def add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ):
+ """Add an entry to self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies."""
+ if tool_dependency.id not in self.ids_of_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies_keys:
+ debug_msg = "Adding an entry for version %s of %s %s " % \
+ ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) )
+ debug_msg += "to installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies."
+ log.debug( debug_msg )
+ status = self.install_model.ToolDependency.installation_status.INSTALLED
+ installed_runtime_dependent_tool_dependencies = \
+ tool_dependency_util.get_runtime_dependent_tool_dependencies( self.app, tool_dependency, status=status )
+ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ tool_dependency ] = \
+ installed_runtime_dependent_tool_dependencies
+
+ def add_entry_to_installed_tool_dependencies_of_installed_repositories( self, repository ):
+ """Add an entry to self.installed_tool_dependencies_of_installed_repositories."""
+ if repository.id not in self.ids_of_installed_tool_dependencies_of_installed_repositories_keys:
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "to installed_tool_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ installed_tool_dependencies = []
+ for td in repository.tool_dependencies:
+ if td.status == self.app.install_model.ToolDependency.installation_status.INSTALLED:
+ installed_tool_dependencies.append( td )
+ self.installed_tool_dependencies_of_installed_repositories[ repository ] = installed_tool_dependencies
+
+ def add_entry_to_repository_dependencies_of_installed_repositories( self, repository ):
+ """Add an entry to self.repository_dependencies_of_installed_repositories."""
+ if repository.id not in self.ids_of_repository_dependencies_of_installed_repositories_keys:
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "to repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ repository_dependency_tree = \
+ repository_dependency_util.get_repository_dependency_tree_for_repository( self.app,
+ repository,
+ status=None )
+ self.repository_dependencies_of_installed_repositories[ repository ] = repository_dependency_tree
+
+ def add_entry_to_runtime_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ):
+ """Add an entry to self.runtime_tool_dependencies_of_installed_tool_dependencies."""
+ if tool_dependency.id not in self.ids_of_runtime_tool_dependencies_of_installed_tool_dependencies_keys:
+ debug_msg = "Adding an entry for version %s of %s %s " % \
+ ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) )
+ debug_msg += "to runtime_tool_dependencies_of_installed_tool_dependencies."
+ log.debug( debug_msg )
+ runtime_dependent_tool_dependencies = \
+ tool_dependency_util.get_runtime_dependent_tool_dependencies( self.app, tool_dependency, status=None )
+ self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency ] = \
+ runtime_dependent_tool_dependencies
+
+ def add_entry_to_tool_dependencies_of_installed_repositories( self, repository ):
+ """Add an entry to self.tool_dependencies_of_installed_repositories."""
+ if repository.id not in self.ids_of_tool_dependencies_of_installed_repositories_keys:
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "to tool_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ self.tool_dependencies_of_installed_repositories[ repository ] = repository.tool_dependencies
+
+ def get_containing_repository_for_tool_dependency( self, tool_dependency ):
+ for installed_repository, tool_dependencies in self.tool_dependencies_of_installed_repositories.items():
+ td_ids = [ td.id for td in tool_dependencies ]
+ if tool_dependency.id in td_ids:
+ return installed_repository
+ return None
+
+ def get_repository_install_dir( self, tool_shed_repository ):
+ for tool_config in self.tool_configs:
+ tree, error_message = xml_util.parse_xml( tool_config )
+ if tree is None:
+ return None
+ root = tree.getroot()
+ tool_path = root.get( 'tool_path', None )
+ if tool_path:
+ ts = suc.clean_tool_shed_url( tool_shed_repository.tool_shed )
+ relative_path = os.path.join( tool_path,
+ ts,
+ 'repos',
+ tool_shed_repository.owner,
+ tool_shed_repository.name,
+ tool_shed_repository.installed_changeset_revision )
+ if os.path.exists( relative_path ):
+ return relative_path
+ return None
+
+ def handle_install( self, repository ):
+ """Load the dependency relationships for a repository that was just installed or reinstalled."""
+ # Populate self.repository_dependencies_of_installed_repositories.
+ self.add_entry_to_repository_dependencies_of_installed_repositories( repository )
+ # Populate self.installed_repository_dependencies_of_installed_repositories.
+ self.add_entry_to_installed_repository_dependencies_of_installed_repositories( repository )
+ # Populate self.tool_dependencies_of_installed_repositories.
+ self.add_entry_to_tool_dependencies_of_installed_repositories( repository )
+ # Populate self.installed_tool_dependencies_of_installed_repositories.
+ self.add_entry_to_installed_tool_dependencies_of_installed_repositories( repository )
+ for tool_dependency in repository.tool_dependencies:
+ # Populate self.runtime_tool_dependencies_of_installed_tool_dependencies.
+ self.add_entry_to_runtime_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+ # Populate self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.
+ self.add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+
+ def handle_uninstall( self, repository ):
+ """Remove the dependency relationships for a repository that was just uninstalled."""
+ for tool_dependency in repository.tool_dependencies:
+ # Remove all this tool_dependency from all values in
+ # self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies
+ altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = {}
+ for td, installed_runtime_dependent_tool_dependencies in \
+ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.items():
+ irdtd_ids = [ irdtd.id for irdtd in installed_runtime_dependent_tool_dependencies ]
+ if td.id in irdtd_ids:
+ index = irdtd_ids[ td.id ]
+ # Remove the tool_dependency from the list.
+ del installed_runtime_dependent_tool_dependencies[ index ]
+ # Add the possibly altered list to the altered dictionary.
+ altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td ] = \
+ installed_runtime_dependent_tool_dependencies
+ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies = \
+ altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies
+ # Remove the entry for this tool_dependency from self.runtime_tool_dependencies_of_installed_tool_dependencies.
+ self.remove_entry_from_runtime_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+ # Remove the entry for this tool_dependency from
+ # self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.
+ self.remove_entry_from_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+ # Remove this repository's entry from self.installed_tool_dependencies_of_installed_repositories.
+ self.remove_entry_from_installed_tool_dependencies_of_installed_repositories( repository )
+ # Remove this repository's entry from self.tool_dependencies_of_installed_repositories
+ self.remove_entry_from_tool_dependencies_of_installed_repositories( repository )
+ # Remove this repository's entry from self.installed_repository_dependencies_of_installed_repositories.
+ self.remove_entry_from_installed_repository_dependencies_of_installed_repositories( repository )
+ # Remove this repository's entry from self.repository_dependencies_of_installed_repositories.
+ self.remove_entry_from_repository_dependencies_of_installed_repositories( repository )
+
+ @property
+ def ids_of_installed_repository_dependencies_of_installed_repositories_keys( self ):
+ return [ r.id for r in self.installed_repository_dependencies_of_installed_repositories.keys() ]
+
+ @property
+ def ids_of_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies_keys( self ):
+ return [ td.id for td in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.keys() ]
+
+ @property
+ def ids_of_installed_tool_dependencies_of_installed_repositories_keys( self ):
+ return [ r.id for r in self.installed_tool_dependencies_of_installed_repositories.keys() ]
+
+ @property
+ def ids_of_repository_dependencies_of_installed_repositories_keys( self ):
+ return [ r.id for r in self.repository_dependencies_of_installed_repositories.keys() ]
+
+ @property
+ def ids_of_runtime_tool_dependencies_of_installed_tool_dependencies_keys( self ):
+ return [ td.id for td in self.runtime_tool_dependencies_of_installed_tool_dependencies.keys() ]
+
+ @property
+ def ids_of_tool_dependencies_of_installed_repositories_keys( self ):
+ return [ r.id for r in self.tool_dependencies_of_installed_repositories.keys() ]
+
+ def load_dependency_relationships( self ):
+ """Load relationships for all installed repositories and tool dependencies into in-memnory dictionaries."""
+ # Get the list of installed tool shed repositories.
+ for repository in self.context.query( self.app.install_model.ToolShedRepository ) \
+ .filter( self.app.install_model.ToolShedRepository.table.c.status ==
+ self.app.install_model.ToolShedRepository.installation_status.INSTALLED ):
+ # Populate self.repository_dependencies_of_installed_repositories.
+ self.add_entry_to_repository_dependencies_of_installed_repositories( repository )
+ # Populate self.installed_repository_dependencies_of_installed_repositories.
+ self.add_entry_to_installed_repository_dependencies_of_installed_repositories( repository )
+ # Populate self.tool_dependencies_of_installed_repositories.
+ self.add_entry_to_tool_dependencies_of_installed_repositories( repository )
+ # Populate self.installed_tool_dependencies_of_installed_repositories.
+ self.add_entry_to_installed_tool_dependencies_of_installed_repositories( repository )
+ # Get the list of installed tool dependencies.
+ for tool_dependency in self.context.query( self.app.install_model.ToolDependency ) \
+ .filter( self.app.install_model.ToolDependency.table.c.status ==
+ self.app.install_model.ToolDependency.installation_status.INSTALLED ):
+ # Populate self.runtime_tool_dependencies_of_installed_tool_dependencies.
+ self.add_entry_to_runtime_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+ # Populate self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.
+ self.add_entry_to_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( tool_dependency )
+
+ def load_proprietary_datatypes( self ):
+ for tool_shed_repository in self.context.query( self.install_model.ToolShedRepository ) \
+ .filter( and_( self.install_model.ToolShedRepository.table.c.includes_datatypes==True,
+ self.install_model.ToolShedRepository.table.c.deleted==False ) ) \
+ .order_by( self.install_model.ToolShedRepository.table.c.id ):
+ relative_install_dir = self.get_repository_install_dir( tool_shed_repository )
+ if relative_install_dir:
+ installed_repository_dict = datatype_util.load_installed_datatypes( self.app, tool_shed_repository, relative_install_dir )
+ if installed_repository_dict:
+ self.installed_repository_dicts.append( installed_repository_dict )
+
+ def load_proprietary_converters_and_display_applications( self, deactivate=False ):
+ for installed_repository_dict in self.installed_repository_dicts:
+ if installed_repository_dict[ 'converter_path' ]:
+ datatype_util.load_installed_datatype_converters( self.app, installed_repository_dict, deactivate=deactivate )
+ if installed_repository_dict[ 'display_path' ]:
+ datatype_util.load_installed_display_applications( self.app, installed_repository_dict, deactivate=deactivate )
+
+ def remove_entry_from_installed_repository_dependencies_of_installed_repositories( self, repository ):
+ """Remove an entry from self.installed_repository_dependencies_of_installed_repositories"""
+ for r in self.installed_repository_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "from installed_repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.installed_repository_dependencies_of_installed_repositories[ r ]
+ break
+
+ def remove_entry_from_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ):
+ """Remove an entry from self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies."""
+ for td in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ if td.id == tool_dependency.id:
+ debug_msg = "Removing entry for version %s of %s %s " % \
+ ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) )
+ debug_msg += "from installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies."
+ log.debug( debug_msg )
+ del self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td ]
+ break
+
+ def remove_entry_from_installed_tool_dependencies_of_installed_repositories( self, repository ):
+ """Remove an entry from self.installed_tool_dependencies_of_installed_repositories"""
+ for r in self.installed_tool_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "from installed_tool_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.installed_tool_dependencies_of_installed_repositories[ r ]
+ break
+
+ def remove_entry_from_repository_dependencies_of_installed_repositories( self, repository ):
+ """Remove an entry from self.repository_dependencies_of_installed_repositories."""
+ for r in self.repository_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "from repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.repository_dependencies_of_installed_repositories[ r ]
+ break
+
+ def remove_entry_from_runtime_tool_dependencies_of_installed_tool_dependencies( self, tool_dependency ):
+ """Remove an entry from self.runtime_tool_dependencies_of_installed_tool_dependencies."""
+ for td in self.runtime_tool_dependencies_of_installed_tool_dependencies:
+ if td.id == tool_dependency.id:
+ debug_msg = "Removing entry for version %s of %s %s " % \
+ ( str( tool_dependency.version ), str( tool_dependency.type ), str( tool_dependency.name ) )
+ debug_msg += "from runtime_tool_dependencies_of_installed_tool_dependencies."
+ log.debug( debug_msg )
+ del self.runtime_tool_dependencies_of_installed_tool_dependencies[ td ]
+ break
+
+ def remove_entry_from_tool_dependencies_of_installed_repositories( self, repository ):
+ """Remove an entry from self.tool_dependencies_of_installed_repositories."""
+ for r in self.tool_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
+ ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ debug_msg += "from tool_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.tool_dependencies_of_installed_repositories[ r ]
+ break
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -504,8 +504,8 @@
query = trans.install_model.context.query( trans.install_model.ToolShedRepository ).filter( or_( *clause_list ) )
return encoded_kwd, query, tool_shed_repositories, encoded_repository_ids
-def install_tool_shed_repository( trans, tool_shed_repository, repo_info_dict, tool_panel_section_key, shed_tool_conf, tool_path, install_tool_dependencies,
- reinstalling=False ):
+def install_tool_shed_repository( trans, tool_shed_repository, repo_info_dict, tool_panel_section_key, shed_tool_conf, tool_path,
+ install_tool_dependencies, reinstalling=False ):
if tool_panel_section_key:
try:
tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
@@ -579,7 +579,11 @@
tool_dependencies_config=tool_dependencies_config,
tool_dependencies=tool_shed_repository.tool_dependencies )
suc.remove_dir( work_dir )
- suc.update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.install_model.ToolShedRepository.installation_status.INSTALLED )
+ suc.update_tool_shed_repository_status( trans.app,
+ tool_shed_repository,
+ trans.install_model.ToolShedRepository.installation_status.INSTALLED )
+ # Add the installed repository and any tool dependencies to the in-memory dictionaries in the installed_repository_manager.
+ trans.app.installed_repository_manager.handle_install( tool_shed_repository )
else:
# An error occurred while cloning the repository, so reset everything necessary to enable another attempt.
set_repository_attributes( trans,
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/tool_shed/galaxy_install/update_manager.py
--- a/lib/tool_shed/galaxy_install/update_manager.py
+++ b/lib/tool_shed/galaxy_install/update_manager.py
@@ -30,7 +30,7 @@
# repository. This information includes items like newer installable repository revisions, current revision updates, whether
# the repository revision is the latest installable revision, and whether the repository has been deprecated in the tool shed.
for repository in self.context.query( self.app.install_model.ToolShedRepository ) \
- .filter( self.app.install_model.ToolShedRepository.table.c.deleted == False ):
+ .filter( self.app.install_model.ToolShedRepository.table.c.deleted == False ):
tool_shed_status_dict = suc.get_tool_shed_status_for_installed_repository( self.app, repository )
if tool_shed_status_dict:
if tool_shed_status_dict != repository.tool_shed_status:
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/tool_shed/util/repository_dependency_util.py
--- a/lib/tool_shed/util/repository_dependency_util.py
+++ b/lib/tool_shed/util/repository_dependency_util.py
@@ -355,14 +355,43 @@
handled_key_rd_dicts,
circular_repository_dependencies )
elif key_rd_dicts_to_be_processed:
- handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies )
+ handle_next_repository_dependency( trans,
+ key_rd_dicts_to_be_processed,
+ all_repository_dependencies,
+ handled_key_rd_dicts,
+ circular_repository_dependencies )
elif key_rd_dicts_to_be_processed:
- handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies )
+ handle_next_repository_dependency( trans,
+ key_rd_dicts_to_be_processed,
+ all_repository_dependencies,
+ handled_key_rd_dicts,
+ circular_repository_dependencies )
elif key_rd_dicts_to_be_processed:
- handle_next_repository_dependency( trans, key_rd_dicts_to_be_processed, all_repository_dependencies, handled_key_rd_dicts, circular_repository_dependencies )
+ handle_next_repository_dependency( trans,
+ key_rd_dicts_to_be_processed,
+ all_repository_dependencies,
+ handled_key_rd_dicts,
+ circular_repository_dependencies )
all_repository_dependencies = prune_invalid_repository_dependencies( all_repository_dependencies )
return all_repository_dependencies
+def get_repository_dependency_tree_for_repository( app, repository, dependency_tree=None, status=None ):
+ """
+ Return a list of of tool_shed_repository ids (whose status can be anything) required by the received repository. The
+ returned list defines the entire repository dependency tree.
+ """
+ if dependency_tree is None:
+ dependency_tree = []
+ tree_object_ids = [ r.id for r in dependency_tree ]
+ for rrda in repository.required_repositories:
+ repository_dependency = rrda.repository_dependency
+ required_repository = repository_dependency.repository
+ if status is None or required_repository.status == status:
+ if required_repository.id not in tree_object_ids:
+ dependency_tree.append( required_repository )
+ return get_repository_dependency_tree_for_repository( app, required_repository, dependency_tree=dependency_tree )
+ return dependency_tree
+
def get_updated_changeset_revisions_for_repository_dependencies( trans, key_rd_dicts ):
updated_key_rd_dicts = []
for key_rd_dict in key_rd_dicts:
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc lib/tool_shed/util/tool_dependency_util.py
--- a/lib/tool_shed/util/tool_dependency_util.py
+++ b/lib/tool_shed/util/tool_dependency_util.py
@@ -4,6 +4,7 @@
from galaxy import eggs
from galaxy import util
from galaxy.model.orm import and_
+from galaxy.model.orm import or_
import tool_shed.util.shed_util_common as suc
import tool_shed.repository_types.util as rt_util
from tool_shed.util import xml_util
@@ -13,9 +14,10 @@
def add_installation_directories_to_tool_dependencies( trans, tool_dependencies ):
"""
- Determine the path to the installation directory for each of the received tool dependencies. This path will be displayed within the tool dependencies
- container on the select_tool_panel_section or reselect_tool_panel_section pages when installing or reinstalling repositories that contain tools with the
- defined tool dependencies. The list of tool dependencies may be associated with more than a single repository.
+ Determine the path to the installation directory for each of the received tool dependencies. This path will be
+ displayed within the tool dependencies container on the select_tool_panel_section or reselect_tool_panel_section
+ pages when installing or reinstalling repositories that contain tools with the defined tool dependencies. The
+ list of tool dependencies may be associated with more than a single repository.
"""
for dependency_key, requirements_dict in tool_dependencies.items():
if dependency_key in [ 'set_environment' ]:
@@ -64,7 +66,10 @@
return tool_dependency
def create_tool_dependency_objects( app, tool_shed_repository, relative_install_dir, set_status=True ):
- """Create or update a ToolDependency for each entry in tool_dependencies_config. This method is called when installing a new tool_shed_repository."""
+ """
+ Create or update a ToolDependency for each entry in tool_dependencies_config. This method is called when
+ installing a new tool_shed_repository.
+ """
tool_dependency_objects = []
shed_config_dict = tool_shed_repository.get_shed_config_dict( app )
if shed_config_dict.get( 'tool_path' ):
@@ -82,12 +87,13 @@
name = elem.get( 'name', None )
version = elem.get( 'version', None )
if name and version:
+ status = app.install_model.ToolDependency.installation_status.NEVER_INSTALLED
tool_dependency = create_or_update_tool_dependency( app,
tool_shed_repository,
name=name,
version=version,
type=tool_dependency_type,
- status=app.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
+ status=status,
set_status=set_status )
tool_dependency_objects.append( tool_dependency )
elif tool_dependency_type == 'set_environment':
@@ -96,12 +102,13 @@
name = env_elem.get( 'name', None )
action = env_elem.get( 'action', None )
if name and action:
+ status = app.install_model.ToolDependency.installation_status.NEVER_INSTALLED
tool_dependency = create_or_update_tool_dependency( app,
tool_shed_repository,
name=name,
version=None,
type=tool_dependency_type,
- status=app.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
+ status=status,
set_status=set_status )
tool_dependency_objects.append( tool_dependency )
return tool_dependency_objects
@@ -185,12 +192,38 @@
def generate_message_for_repository_type_change( trans, repository ):
message = ''
if repository.can_change_type_to( trans.app, rt_util.TOOL_DEPENDENCY_DEFINITION ):
- tool_dependency_definition_type_class = trans.app.repository_types_registry.get_class_by_label( rt_util.TOOL_DEPENDENCY_DEFINITION )
- message += "This repository currently contains a single file named <b>%s</b>. If additional files will " % suc.TOOL_DEPENDENCY_DEFINITION_FILENAME
- message += "not be added to this repository, then it's type should be set to <b>%s</b>.<br/>" % tool_dependency_definition_type_class.label
+ tool_dependency_definition_type_class = \
+ trans.app.repository_types_registry.get_class_by_label( rt_util.TOOL_DEPENDENCY_DEFINITION )
+ message += "This repository currently contains a single file named <b>%s</b>. If additional files will " % \
+ suc.TOOL_DEPENDENCY_DEFINITION_FILENAME
+ message += "not be added to this repository, then it's type should be set to <b>%s</b>.<br/>" % \
+ tool_dependency_definition_type_class.label
return message
-
-
+
+def get_runtime_dependent_tool_dependencies( app, tool_dependency, status=None ):
+ """
+ Return the list of tool dependency objects that require the received tool dependency at run time. The returned
+ list will be filtered by the received status if it is not None. This method is called only from Galaxy.
+ """
+ runtime_dependent_tool_dependencies = []
+ required_env_shell_file_path = tool_dependency.get_env_shell_file_path( app )
+ if required_env_shell_file_path:
+ required_env_shell_file_path = os.path.abspath( required_env_shell_file_path )
+ if required_env_shell_file_path is not None:
+ for td in app.install_model.context.query( app.install_model.ToolDependency ):
+ if status is None or td.status == status:
+ env_shell_file_path = td.get_env_shell_file_path( app )
+ if env_shell_file_path is not None:
+ try:
+ contents = open( env_shell_file_path, 'r' ).read()
+ except Exception, e:
+ contents = None
+ log.debug( 'Error reading file %s, so cannot determine if package %s requires package %s at run time: %s' % \
+ ( str( env_shell_file_path ), str( td.name ), str( tool_dependency.name ), str( e ) ) )
+ if contents is not None and contents.find( required_env_shell_file_path ) >= 0:
+ runtime_dependent_tool_dependencies.append( td )
+ return runtime_dependent_tool_dependencies
+
def get_download_url_for_platform( url_templates, platform_info_dict ):
'''
Compare the dict returned by get_platform_info() with the values specified in the url_template element. Return
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
--- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
+++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
@@ -36,12 +36,100 @@
${repository.deleted}
</div><div class="form-row">
- %if repository.can_deactivate:
+ <%
+ can_deactivate_repository = repository.can_deactivate
+ can_uninstall_repository = repository.can_uninstall( trans.app )
+ %>
+ %if can_deactivate_repository and can_uninstall_repository:
<% deactivate_uninstall_button_text = "Deactivate or Uninstall" %>
${remove_from_disk_check_box.get_html()}
<label for="repository" style="display: inline;font-weight:normal;">Check to uninstall or leave blank to deactivate</label><br/><br/>
- <label>Deactivating this repository will result in the following:</label>
+ %elif can_deactivate_repository:
+ <% deactivate_uninstall_button_text = "Deactivate" %>
+ %else:
+ <% deactivate_uninstall_button_text = "Uninstall" %>
+ ##hack to mimic check box
+ <input type="hidden" name="remove_from_disk" value="true"/><input type="hidden" name="remove_from_disk" value="true"/>
+ %endif
+ %if not can_uninstall_repository:
+ <%
+ irm = trans.app.installed_repository_manager
+
+ # Get installed repositories that require this repository.
+ installed_repository_dependencies = []
+ installed_runtime_dependent_tool_dependencies = []
+ for r in irm.installed_repository_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ installed_repository_dependencies = irm.installed_repository_dependencies_of_installed_repositories[ r ]
+ break
+
+ # Get this repository's installed tool dependencies.
+ installed_tool_dependencies = []
+ for r in irm.installed_tool_dependencies_of_installed_repositories:
+ if r.id == repository.id:
+ installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories[ r ]
+ break
+
+ # Get installed runtime dependent tool dependencies of this repository's installed tool dependencies.
+ installed_runtime_dependent_tool_dependencies = []
+ for itd in installed_tool_dependencies:
+ for td in irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ if td.id == itd.id:
+ installed_dependent_tds = \
+ irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td ]
+ if installed_dependent_tds:
+ installed_runtime_dependent_tool_dependencies.extend( installed_dependent_tds )
+ %>
+ %if installed_repository_dependencies or installed_runtime_dependent_tool_dependencies:
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td bgcolor="#D8D8D8">
+ <label>This repository cannot be uninstalled because it is required by the following installed items:</label>
+ </td>
+ </tr>
+ </table>
+ %if installed_repository_dependencies:
+ <label>Dependent repositories:</label>
+ <ul>
+ %for installed_repository_dependency in installed_repository_dependencies:
+ <%
+ changeset_revision = installed_repository_dependency.changeset_revision
+ name = installed_repository_dependency.name
+ owner = installed_repository_dependency.owner
+ %>
+ <li>Revision <b>${ changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li>
+ %endfor
+ </ul>
+ %endif
+ %if installed_runtime_dependent_tool_dependencies:
+ <label>Runtime dependent tool dependencies of this repository's tool dependencies:</label>
+ <ul>
+ %for td in installed_runtime_dependent_tool_dependencies:
+ <%
+ containing_repository = irm.get_containing_repository_for_tool_dependency( td )
+ repository_name = containing_repository.name
+ changeset_revision = containing_repository.changeset_revision
+ owner = containing_repository.owner
+ %>
+ <li>
+ Version <b>${td.version}</b> of ${td.type} <b>${td.name}</b> contained in revision
+ <b>${changeset_revision | h}</b> of repository <b>${repository_name | h}</b> owned by <b>${owner}</b>
+ </li>
+ %endfor
+ </ul>
+ %endif
+ <br/>
+ %endif
+ %endif
+ %if can_deactivate_repository:
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td bgcolor="#D8D8D8">
+ <label>Deactivating this repository will result in the following:</label>
+ </td>
+ </tr>
+ </table><div class="toolParamHelp" style="clear: both;">
* The repository and all of it's contents will remain on disk.
</div>
@@ -64,40 +152,45 @@
* The repository record's deleted column in the tool_shed_repository database table will be set to True.
</div><br/>
- %else:
- <% deactivate_uninstall_button_text = "Uninstall" %>
- ##hack to mimic check box
- <input type="hidden" name="remove_from_disk" value="true"/><input type="hidden" name="remove_from_disk" value="true"/>
%endif
- <label>Uninstalling this repository will result in the following:</label>
- <div class="toolParamHelp" style="clear: both;">
- * The repository and all of it's contents will be removed from disk.
- </div>
- %if repository.includes_tools_for_display_in_tool_panel:
+ %if can_uninstall_repository:
+ <table width="100%" border="0" cellpadding="0" cellspacing="0">
+ <tr>
+ <td bgcolor="#D8D8D8">
+ <label>Uninstalling this repository will result in the following:</label>
+ </td>
+ </tr>
+ </table><div class="toolParamHelp" style="clear: both;">
- * The repository's tool tag sets will be removed from the tool config file in which they are defined.
+ * The repository and all of it's contents will be removed from disk.
</div>
- %endif
- %if repository.includes_tool_dependencies:
+ %if repository.includes_tools_for_display_in_tool_panel:
+ <div class="toolParamHelp" style="clear: both;">
+ * The repository's tool tag sets will be removed from the tool config file in which they are defined.
+ </div>
+ %endif
+ %if repository.includes_tool_dependencies:
+ <div class="toolParamHelp" style="clear: both;">
+ * The repository's installed tool dependencies will be removed from disk.
+ </div>
+ <div class="toolParamHelp" style="clear: both;">
+ * Each associated tool dependency record's status column in the tool_dependency database table will be set to 'Uninstalled'.
+ </div>
+ %endif
+ %if repository.includes_datatypes:
+ <div class="toolParamHelp" style="clear: both;">
+ * The repository's datatypes, datatype converters and display applications will be eliminated from the datatypes registry.
+ </div>
+ %endif
<div class="toolParamHelp" style="clear: both;">
- * The repository's installed tool dependencies will be removed from disk.
+ * The repository record's deleted column in the tool_shed_repository database table will be set to True.
</div><div class="toolParamHelp" style="clear: both;">
- * Each associated tool dependency record's status column in the tool_dependency database table will be set to 'Uninstalled'.
+ * The repository record's uninstalled column in the tool_shed_repository database table will be set to True.
</div>
+ <div style="clear: both"></div>
+ <br/>
%endif
- %if repository.includes_datatypes:
- <div class="toolParamHelp" style="clear: both;">
- * The repository's datatypes, datatype converters and display applications will be eliminated from the datatypes registry.
- </div>
- %endif
- <div class="toolParamHelp" style="clear: both;">
- * The repository record's deleted column in the tool_shed_repository database table will be set to True.
- </div>
- <div class="toolParamHelp" style="clear: both;">
- * The repository record's uninstalled column in the tool_shed_repository database table will be set to True.
- </div>
- <div style="clear: both"></div></div><div class="form-row"><input type="submit" name="deactivate_or_uninstall_repository_button" value="${deactivate_uninstall_button_text}"/>
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
+++ b/templates/admin/tool_shed_repository/manage_repository_tool_dependencies.mako
@@ -30,6 +30,8 @@
<tr><th bgcolor="#D8D8D8">Name</th><th bgcolor="#D8D8D8">Version</th><th bgcolor="#D8D8D8">Type</th><th bgcolor="#D8D8D8">Status</th><th bgcolor="#D8D8D8">Error</th></tr>
%for tool_dependency in repository.tool_dependencies:
<%
+ # Tool dependencies cannot be uninstalled if they have a status of 'Installed'. Only the containing repository
+ # can be uninstalled (only if it has no dependent repositories) if a tool dependency has been successfully installed.
if tool_dependency.error_message:
error_message = tool_dependency.error_message
else:
@@ -39,7 +41,8 @@
trans.install_model.ToolDependency.installation_status.UNINSTALLED ]:
can_install = True
if not can_uninstall:
- if tool_dependency.status not in [ trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
+ if tool_dependency.status not in [ trans.install_model.ToolDependency.installation_status.INSTALLED,
+ trans.install_model.ToolDependency.installation_status.NEVER_INSTALLED,
trans.install_model.ToolDependency.installation_status.UNINSTALLED ]:
can_uninstall = True
%>
diff -r 392469f092a67318ed25a4c675e72850e0a8f4b4 -r b56f6e027d2ca3e8cb5ef6f6514e085107ac5dfc templates/admin/tool_shed_repository/repository_actions_menu.mako
--- a/templates/admin/tool_shed_repository/repository_actions_menu.mako
+++ b/templates/admin/tool_shed_repository/repository_actions_menu.mako
@@ -5,6 +5,12 @@
from tool_shed.util.encoding_util import tool_shed_encode
in_error_state = repository.in_error_state
tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ]
+ if repository.status in [ trans.install_model.ToolShedRepository.installation_status.DEACTIVATED,
+ trans.install_model.ToolShedRepository.installation_status.ERROR,
+ trans.install_model.ToolShedRepository.installation_status.INSTALLED ]:
+ can_administer = True
+ else:
+ can_administer = False
%><br/><br/><ul class="manage-table-actions">
@@ -20,7 +26,7 @@
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='reset_to_install', id=trans.security.encode_id( repository.id ), reset_repository=True )}">Reset to install</a>
%elif repository.can_install:
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ), operation='install' )}">Install</a>
- %elif repository.can_uninstall:
+ %elif can_administer:
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0