1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/a3915a264f6c/
changeset: a3915a264f6c
user: greg
date: 2012-12-22 21:12:41
summary: Slight enhancements for managing simple repository dependencies.
affected #: 3 files
diff -r 32ea53484cec638021a38c0c252d5dc1d4bf5da4 -r a3915a264f6c3ae7cec12778b3c3e7794ca5a8e8 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -3014,6 +3014,7 @@
installation_status = Bunch( NEW='New',
CLONING='Cloning',
SETTING_TOOL_VERSIONS='Setting tool versions',
+ INSTALLING_REPOSITORY_DEPENDENCIES='Installing repository dependencies',
INSTALLING_TOOL_DEPENDENCIES='Installing tool dependencies',
LOADING_PROPRIETARY_DATATYPES='Loading proprietary datatypes',
INSTALLED='Installed',
@@ -3166,6 +3167,62 @@
def has_readme_files( self ):
return self.metadata and 'readme_files' in self.metadata
@property
+ def required_repositories( self ):
+ required_repositories = []
+ for rrda in self.repository_dependencies:
+ repository_dependency = rrda.repository_dependency
+ required_repository = repository_dependency.repository
+ required_repositories.append( required_repository )
+ return required_repositories
+ @property
+ def installed_required_repositories( self ):
+ """Return the repository's repository dependencies that are currently installed."""
+ installed_required_repositories = []
+ for required_repository in self.required_repositories:
+ if required_repository.status == self.installation_status.INSTALLED:
+ installed_required_repositories.append( required_repository )
+ return installed_required_repositories
+ @property
+ def missing_required_repositories( self ):
+ """Return the repository's repository dependencies that are not currently installed, and may not ever have been installed."""
+ missing_required_repositories = []
+ for required_repository in self.required_repositories:
+ if required_repository.status not in [ self.installation_status.INSTALLED ]:
+ missing_required_repositories.append( required_repository )
+ return missing_required_repositories
+ @property
+ def required_repositories_being_installed( self ):
+ required_repositories_being_installed = []
+ for required_repository in self.required_repositories:
+ if tool_dependency.status == ToolDependency.installation_status.INSTALLING:
+ required_repositories_being_installed.append( required_repository )
+ return required_repositories_being_installed
+ @property
+ def required_repositories_missing_or_being_installed( self ):
+ required_repositories_missing_or_being_installed = []
+ for required_repository in self.required_repositories:
+ if required_repository.status in [ self.installation_status.ERROR,
+ 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
+ @property
+ def required_repositories_with_installation_errors( self ):
+ required_repositories_with_installation_errors = []
+ for required_repository in self.required_repositories:
+ if required_repository.status == self.installation_status.ERROR:
+ required_repositories_with_installation_errors.append( required_repository )
+ return required_repositories_with_installation_errors
+ @property
+ def uninstalled_required_repositories( self ):
+ """Return the repository's repository dependencies that have been uninstalled."""
+ uninstalled_required_repositories = []
+ for required_repository in self.required_repositories:
+ if required_repository.status == self.installation_status.UNINSTALLED:
+ uninstalled_required_repositories.append( required_repository )
+ return uninstalled_required_repositories
+ @property
def installed_tool_dependencies( self ):
"""Return the repository's tool dependencies that are currently installed."""
installed_dependencies = []
diff -r 32ea53484cec638021a38c0c252d5dc1d4bf5da4 -r a3915a264f6c3ae7cec12778b3c3e7794ca5a8e8 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -856,7 +856,8 @@
def populate_containers_dict_from_repository_metadata( trans, tool_shed_url, tool_path, repository, reinstalling=False ):
"""
Retrieve necessary information from the received repository's metadata to populate the containers_dict for display. This methos is called only
- from Galaxy and not the tool shed.
+ from Galaxy (not the tool shed) when displaying repository dependencies for installed repositories and when displaying them for uninstalled
+ repositories that are being reinstalled.
"""
metadata = repository.metadata
if metadata:
@@ -876,43 +877,24 @@
readme_files_dict = suc.build_readme_files_dict( repository.metadata, tool_path )
else:
readme_files_dict = None
- repository_dependencies = metadata.get( 'repository_dependencies', None )
repository_dependencies_dict_for_display = {}
- if repository_dependencies:
- # We need to add a root_key entry to the repository_dependencies dictionary since it will not be included in the installed tool shed repository metadata.
+ if repository.has_repository_dependencies:
+ rd_tups = []
+ # We need to add a root_key entry to the repository_dependencies dictionary for proper display parsing.
root_key = container_util.generate_repository_dependencies_key_for_repository( repository.tool_shed,
repository.name,
repository.owner,
- repository.installed_changeset_revision )
- rd_tups_for_display = []
- rd_tups = repository_dependencies[ 'repository_dependencies' ]
- for index, rd_tup in enumerate( rd_tups ):
- # Get the id and the installation status of the required repository.
- tool_shed, name, owner, changeset_revision = rd_tup
- required_repository = suc.get_repository_for_dependency_relationship( trans.app, tool_shed, name, owner, changeset_revision )
- # TODO: Since the changeset revision defined in the tool shed repository's repository_dependencies.xml file may have a changeset_revision
- # value that is outdated, we ened to make a call to the tool shed get the update dchangeset revision if repository is still None here.
- if required_repository:
- rd_tup.append( required_repository.id )
- rd_tup.append( str( required_repository.status ) )
- else:
- # See above TODO. For now, we'll take a short cut and attempt to find the repository by name and owner only. This will not work long
- # term because multiple revisions of a reposiory with the same name and owner could be installed into a Galaxy instance. The long term
- # fix is to call get_update_to_changeset_revision_and_ctx_rev( trans, repository ) for each required repository.
- required_repository = trans.sa_session.query( trans.model.ToolShedRepository ) \
- .filter( and_( trans.model.ToolShedRepository.table.c.name == name,
- trans.model.ToolShedRepository.table.c.owner == owner ) ) \
- .first()
- if required_repository:
- rd_tup.append( required_repository.id )
- rd_tup.append( str( required_repository.status ) )
- else:
- rd_tup.append( None )
- rd_tup.append( None )
- rd_tups[ index ] = rd_tup
+ repository.installed_changeset_revision )
+ # The repository dependencies container will include only the immediate repository dependencies of this repository, so
+ # the container will be only a single level in depth.
+ for rr in repository.required_repositories:
+ rd_tup = [ rr.tool_shed, rr.name, rr.owner, rr.changeset_revision, rr.id, rr.status ]
+ rd_tups.append( rd_tup )
repository_dependencies_dict_for_display[ 'root_key' ] = root_key
repository_dependencies_dict_for_display[ root_key ] = rd_tups
- repository_dependencies_dict_for_display[ 'description' ] = repository_dependencies[ 'description' ]
+ # Get the description from the metadata in case it has a value.
+ repository_dependencies = metadata.get( 'repository_dependencies', {} )
+ repository_dependencies_dict_for_display[ 'description' ] = repository_dependencies.get( 'description', None )
all_tool_dependencies = metadata.get( 'tool_dependencies', None )
tool_dependencies, missing_tool_dependencies = get_installed_and_missing_tool_dependencies( trans, repository, all_tool_dependencies )
if reinstalling:
diff -r 32ea53484cec638021a38c0c252d5dc1d4bf5da4 -r a3915a264f6c3ae7cec12778b3c3e7794ca5a8e8 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
@@ -32,6 +32,7 @@
status_label = tool_shed_repository.status
if tool_shed_repository.status in [ trans.model.ToolShedRepository.installation_status.CLONING,
trans.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS,
+ trans.model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES,
trans.model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES,
trans.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES ]:
bgcolor = trans.model.ToolShedRepository.states.INSTALLING
@@ -43,9 +44,12 @@
elif tool_shed_repository.status in [ trans.model.ToolShedRepository.installation_status.DEACTIVATED ]:
bgcolor = trans.model.ToolShedRepository.states.WARNING
elif tool_shed_repository.status in [ trans.model.ToolShedRepository.installation_status.INSTALLED ]:
- if tool_shed_repository.missing_tool_dependencies:
+ if tool_shed_repository.missing_required_repositories:
bgcolor = trans.model.ToolShedRepository.states.WARNING
- status_label = '%s, missing dependencies' % status_label
+ status_label = '%s, missing repository dependencies' % status_label
+ elif tool_shed_repository.missing_tool_dependencies:
+ bgcolor = trans.model.ToolShedRepository.states.WARNING
+ status_label = '%s, missing tool dependencies' % status_label
else:
bgcolor = trans.model.ToolShedRepository.states.OK
else:
@@ -182,6 +186,7 @@
[ model.ToolShedRepository.installation_status.NEW,
model.ToolShedRepository.installation_status.CLONING,
model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS,
+ model.ToolShedRepository.installation_status.INSTALLING_REPOSITORY_DEPENDENCIES,
model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES,
model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES,
model.ToolShedRepository.installation_status.UNINSTALLED ], \
@@ -500,7 +505,7 @@
removed = False
if removed:
tool_shed_repository.uninstalled = True
- # Remove all installed tool dependencies.
+ # Remove all installed tool dependencies, but don't touch any repository dependencies..
for tool_dependency in tool_shed_repository.installed_tool_dependencies:
uninstalled, error_message = shed_util.remove_tool_dependency( trans, tool_dependency )
if error_message:
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/c54ebfe2c008/
changeset: c54ebfe2c008
user: jgoecks
date: 2012-12-21 22:08:16
summary: Fixes for sorting and merging genomic regions during visual analysis.
affected #: 1 file
diff -r 692a1e8b69998d99465838cb5c8b1d56f3a37d2d -r c54ebfe2c0086b6e690e98a958e2d41ecf722bec lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -158,17 +158,16 @@
if len( regions ) > 1:
# Sort by chrom name, start so that data is not fetched out of order.
- regions.sort( key=lambda r: r.chrom )
- regions.sort( key=lambda r: r.start )
-
+ regions = sorted(regions, key=lambda r: (r.chrom.lower(), r.start))
+
# Merge overlapping regions so that regions do not overlap
# and hence data is not included multiple times.
prev = regions[0]
cur = regions[1]
index = 1
while True:
- if cur.start <= prev.end:
- # Found overlapping regions, so join them.
+ if cur.chrom == prev.chrom and cur.start <= prev.end:
+ # Found overlapping regions, so join them into prev.
prev.end = cur.end
del regions[ index ]
else:
@@ -182,7 +181,7 @@
break
else:
cur = regions[ index ]
-
+
run_on_regions = True
# Dataset check.
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.