galaxy-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 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
- 15302 discussions
commit/galaxy-central: jmchilton: Introduce mixin to reduce duplication between app.py and migrate/common.py.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a32dcf32dffc/
Changeset: a32dcf32dffc
User: jmchilton
Date: 2013-12-13 22:00:23
Summary: Introduce mixin to reduce duplication between app.py and migrate/common.py.
This includes a mix so that tool migrations will target the galaxy install database (if different than the general galaxy database).
Affected #: 3 files
diff -r 09533cfe154682bdfb1b8786fb827a99461022a6 -r a32dcf32dffc6dd7175092f4fda7476258fe061e lib/galaxy/app.py
--- a/lib/galaxy/app.py
+++ b/lib/galaxy/app.py
@@ -1,16 +1,10 @@
from __future__ import absolute_import
-import sys, os, atexit
+import sys
+import os
-from galaxy import config, jobs, util, tools, web
-import galaxy.tools.search
-import galaxy.tools.data
-import tool_shed.galaxy_install
-import tool_shed.tool_shed_registry
-from galaxy.web import security
+from galaxy import config, jobs
import galaxy.model
-import galaxy.datatypes.registry
import galaxy.security
-from galaxy.objectstore import build_object_store_from_config
import galaxy.quota
from galaxy.tags.tag_handler import GalaxyTagHandler
from galaxy.visualization.genomes import Genomes
@@ -27,7 +21,8 @@
import logging
log = logging.getLogger( __name__ )
-class UniverseApplication( object ):
+
+class UniverseApplication( object, config.ConfiguresGalaxyMixin ):
"""Encapsulates the state of a Universe application"""
def __init__( self, **kwargs ):
print >> sys.stderr, "python path is: " + ", ".join( sys.path )
@@ -38,93 +33,38 @@
self.config.check()
config.configure_logging( self.config )
self.configure_fluent_log()
- # Determine the database url
- if self.config.database_connection:
- db_url = self.config.database_connection
- else:
- db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config.database
- install_db_url = self.config.install_database_connection
- # TODO: Consider more aggressive check here that this is not the same
- # database file under the hood.
- combined_install_database = not( install_db_url and install_db_url != db_url )
- # Set up the tool sheds registry
- if os.path.isfile( self.config.tool_sheds_config ):
- self.tool_shed_registry = tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
- else:
- self.tool_shed_registry = None
- # Initialize database / check for appropriate schema version. # If this
- # is a new installation, we'll restrict the tool migration messaging.
- from galaxy.model.migrate.check import create_or_verify_database
- create_or_verify_database( db_url, kwargs.get( 'global_conf', {} ).get( '__file__', None ), self.config.database_engine_options, app=self )
- if not combined_install_database:
- from galaxy.model.tool_shed_install.migrate.check import create_or_verify_database as tsi_create_or_verify_database
- tsi_create_or_verify_database( install_db_url, self.config.install_database_engine_options, app=self )
- # Alert the Galaxy admin to tools that have been moved from the distribution to the tool shed.
- from tool_shed.galaxy_install.migrate.check import verify_tools
- verify_tools( self, db_url, kwargs.get( 'global_conf', {} ).get( '__file__', None ), self.config.database_engine_options )
- # Object store manager
- self.object_store = build_object_store_from_config(self.config, fsmon=True)
+ self._configure_tool_shed_registry()
+
+ self._configure_object_store( fsmon=True )
+
# Setup the database engine and ORM
- from galaxy.model import mapping
- self.model = mapping.init( self.config.file_path,
- db_url,
- self.config.database_engine_options,
- map_install_models=combined_install_database,
- database_query_profiling_proxy = self.config.database_query_profiling_proxy,
- object_store = self.object_store,
- trace_logger=self.trace_logger,
- use_pbkdf2=self.config.get_bool( 'use_pbkdf2', True ) )
+ config_file = kwargs.get( 'global_conf', {} ).get( '__file__', None )
+ self._configure_models( check_migrate_databases=True, check_migrate_tools=True, config_file=config_file )
- if combined_install_database:
- log.info("Install database targetting Galaxy's database configuration.")
- self.install_model = self.model
- else:
- from galaxy.model.tool_shed_install import mapping as install_mapping
- install_db_url = self.config.install_database_connection
- log.info("Install database using its own connection %s" % install_db_url)
- install_db_engine_options = self.config.install_database_engine_options
- self.install_model = install_mapping.init( install_db_url,
- install_db_engine_options )
# Manage installed tool shed repositories.
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
- # load proprietary datatypes before datatypes in the distribution because Galaxy's default sniffers include some
- # generic sniffers (eg text,xml) which catch anything, so it's impossible for proprietary sniffers to be used.
- # However, if there is a conflict (2 datatypes with the same extension) between a proprietary datatype and a datatype
- # in the Galaxy distribution, the datatype in the Galaxy distribution will take precedence. If there is a conflict
- # between 2 proprietary datatypes, the datatype from the repository that was installed earliest will take precedence.
- self.installed_repository_manager.load_proprietary_datatypes()
- # Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config.
- self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
+
+ self._configure_datatypes_registry( self.installed_repository_manager )
galaxy.model.set_datatypes_registry( self.datatypes_registry )
+
# Security helper
- self.security = security.SecurityHelper( id_secret=self.config.id_secret )
+ self._configure_security()
# Tag handler
self.tag_handler = GalaxyTagHandler()
# Genomes
self.genomes = Genomes( self )
# Data providers registry.
self.data_provider_registry = DataProviderRegistry()
- # Initialize tool data tables using the config defined by self.config.tool_data_table_config_path.
- self.tool_data_tables = galaxy.tools.data.ToolDataTableManager( tool_data_path=self.config.tool_data_path,
- config_filename=self.config.tool_data_table_config_path )
- # Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables.
- self.tool_data_tables.load_from_config_file( config_filename=self.config.shed_tool_data_table_config,
- tool_data_path=self.tool_data_tables.tool_data_path,
- from_shed_config=False )
+
+ self._configure_tool_data_tables( from_shed_config=False )
+
# Initialize the job management configuration
self.job_config = jobs.JobConfiguration(self)
- # Initialize the tools, making sure the list of tool configs includes the reserved migrated_tools_conf.xml file.
- tool_configs = self.config.tool_configs
- if self.config.migrated_tools_config not in tool_configs:
- tool_configs.append( self.config.migrated_tools_config )
- self.toolbox = tools.ToolBox( tool_configs, self.config.tool_path, self )
- # Search support for tools
- self.toolbox_search = galaxy.tools.search.ToolBoxSearch( self.toolbox )
+
+ self._configure_toolbox()
+
# Load Data Manager
self.data_managers = DataManagers( self )
# If enabled, poll respective tool sheds to see if updates are available for any installed tool shed repositories.
diff -r 09533cfe154682bdfb1b8786fb827a99461022a6 -r a32dcf32dffc6dd7175092f4fda7476258fe061e lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -473,6 +473,7 @@
rval[ key ] = value
return rval
+
def configure_logging( config ):
"""
Allow some basic logging configuration to be read from ini file.
@@ -513,3 +514,110 @@
sentry_handler.setLevel( logging.WARN )
root.addHandler( sentry_handler )
+
+class ConfiguresGalaxyMixin:
+ """ Shared code for configuring Galaxy-like app objects.
+ """
+
+ def _configure_toolbox( self ):
+ # Initialize the tools, making sure the list of tool configs includes the reserved migrated_tools_conf.xml file.
+ tool_configs = self.config.tool_configs
+ if self.config.migrated_tools_config not in tool_configs:
+ tool_configs.append( self.config.migrated_tools_config )
+ from galaxy import tools
+ self.toolbox = tools.ToolBox( tool_configs, self.config.tool_path, self )
+ # Search support for tools
+ import galaxy.tools.search
+ self.toolbox_search = galaxy.tools.search.ToolBoxSearch( self.toolbox )
+
+ def _configure_tool_data_tables( self, from_shed_config ):
+ from galaxy.tools.data import ToolDataTableManager
+
+ # Initialize tool data tables using the config defined by self.config.tool_data_table_config_path.
+ self.tool_data_tables = ToolDataTableManager( tool_data_path=self.config.tool_data_path,
+ config_filename=self.config.tool_data_table_config_path )
+ # Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables.
+ self.tool_data_tables.load_from_config_file( config_filename=self.config.shed_tool_data_table_config,
+ tool_data_path=self.tool_data_tables.tool_data_path,
+ from_shed_config=from_shed_config )
+
+ def _configure_datatypes_registry( self, installed_repository_manager=None ):
+ from galaxy.datatypes import registry
+ # Create an empty datatypes registry.
+ self.datatypes_registry = registry.Registry()
+ if installed_repository_manager:
+ # Load proprietary datatypes defined in datatypes_conf.xml files in all installed tool shed repositories. We
+ # load proprietary datatypes before datatypes in the distribution because Galaxy's default sniffers include some
+ # generic sniffers (eg text,xml) which catch anything, so it's impossible for proprietary sniffers to be used.
+ # However, if there is a conflict (2 datatypes with the same extension) between a proprietary datatype and a datatype
+ # in the Galaxy distribution, the datatype in the Galaxy distribution will take precedence. If there is a conflict
+ # between 2 proprietary datatypes, the datatype from the repository that was installed earliest will take precedence.
+ installed_repository_manager.load_proprietary_datatypes()
+ # Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config.
+ self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
+
+ def _configure_object_store( self, **kwds ):
+ from galaxy.objectstore import build_object_store_from_config
+ self.object_store = build_object_store_from_config( self.config, **kwds )
+
+ def _configure_security( self ):
+ from galaxy.web import security
+ self.security = security.SecurityHelper( id_secret=self.config.id_secret )
+
+ def _configure_tool_shed_registry( self ):
+ import tool_shed.tool_shed_registry
+
+ # Set up the tool sheds registry
+ if os.path.isfile( self.config.tool_sheds_config ):
+ self.tool_shed_registry = tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
+ else:
+ self.tool_shed_registry = None
+
+ def _configure_models( self, check_migrate_databases=False, check_migrate_tools=False, config_file=None ):
+ """
+ Preconditions: object_store must be set on self.
+ """
+ if self.config.database_connection:
+ db_url = self.config.database_connection
+ else:
+ db_url = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config.database
+ install_db_url = self.config.install_database_connection
+ # TODO: Consider more aggressive check here that this is not the same
+ # database file under the hood.
+ combined_install_database = not( install_db_url and install_db_url != db_url )
+ install_db_url = install_db_url or db_url
+
+ if check_migrate_databases:
+ # Initialize database / check for appropriate schema version. # If this
+ # is a new installation, we'll restrict the tool migration messaging.
+ from galaxy.model.migrate.check import create_or_verify_database
+ create_or_verify_database( db_url, config_file, self.config.database_engine_options, app=self )
+ if not combined_install_database:
+ from galaxy.model.tool_shed_install.migrate.check import create_or_verify_database as tsi_create_or_verify_database
+ tsi_create_or_verify_database( install_db_url, self.config.install_database_engine_options, app=self )
+
+ if check_migrate_tools:
+ # Alert the Galaxy admin to tools that have been moved from the distribution to the tool shed.
+ from tool_shed.galaxy_install.migrate.check import verify_tools
+ verify_tools( self, install_db_url, config_file, self.config.database_engine_options )
+
+ from galaxy.model import mapping
+ self.model = mapping.init( self.config.file_path,
+ db_url,
+ self.config.database_engine_options,
+ map_install_models=combined_install_database,
+ database_query_profiling_proxy=self.config.database_query_profiling_proxy,
+ object_store=self.object_store,
+ trace_logger=getattr(self, "trace_logger", None),
+ use_pbkdf2=self.config.get_bool( 'use_pbkdf2', True ) )
+
+ if combined_install_database:
+ log.info("Install database targetting Galaxy's database configuration.")
+ self.install_model = self.model
+ else:
+ from galaxy.model.tool_shed_install import mapping as install_mapping
+ install_db_url = self.config.install_database_connection
+ log.info("Install database using its own connection %s" % install_db_url)
+ install_db_engine_options = self.config.install_database_engine_options
+ self.install_model = install_mapping.init( install_db_url,
+ install_db_engine_options )
diff -r 09533cfe154682bdfb1b8786fb827a99461022a6 -r a32dcf32dffc6dd7175092f4fda7476258fe061e lib/tool_shed/galaxy_install/migrate/common.py
--- a/lib/tool_shed/galaxy_install/migrate/common.py
+++ b/lib/tool_shed/galaxy_install/migrate/common.py
@@ -2,18 +2,10 @@
import os
import sys
import galaxy.config
-import galaxy.datatypes.registry
-from galaxy import tools
-from galaxy.tools.data import ToolDataTableManager
-from galaxy.web import security
-import galaxy.model.mapping
-import galaxy.tools.search
-from galaxy.objectstore import build_object_store_from_config
-import tool_shed.tool_shed_registry
from tool_shed.galaxy_install import install_manager
-class MigrateToolsApplication( object ):
+class MigrateToolsApplication( object, galaxy.config.ConfiguresGalaxyMixin ):
"""Encapsulates the state of a basic Galaxy Universe application in order to initiate the Install Manager"""
def __init__( self, tools_migration_config ):
@@ -33,41 +25,23 @@
for key, value in config_parser.items( "app:main" ):
galaxy_config_dict[ key ] = value
self.config = galaxy.config.Configuration( **galaxy_config_dict )
- if not self.config.database_connection:
- self.config.database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % self.config.database
+
self.config.update_integrated_tool_panel = True
- self.object_store = build_object_store_from_config( self.config )
- # Security helper
- self.security = security.SecurityHelper( id_secret=self.config.id_secret )
- # Setup the database engine and ORM
- self.model = galaxy.model.mapping.init( self.config.file_path,
- self.config.database_connection,
- engine_options={},
- create_tables=False,
- object_store=self.object_store )
- # Create an empty datatypes registry.
- self.datatypes_registry = galaxy.datatypes.registry.Registry()
- # Load the data types in the Galaxy distribution, which are defined in self.config.datatypes_config.
- self.datatypes_registry.load_datatypes( self.config.root, self.config.datatypes_config )
- # Initialize tool data tables using the config defined by self.config.tool_data_table_config_path.
- self.tool_data_tables = ToolDataTableManager( tool_data_path=self.config.tool_data_path,
- config_filename=self.config.tool_data_table_config_path )
- # Load additional entries defined by self.config.shed_tool_data_table_config into tool data tables.
- self.tool_data_tables.load_from_config_file( config_filename=self.config.shed_tool_data_table_config,
- tool_data_path=self.tool_data_tables.tool_data_path,
- from_shed_config=True )
- # Initialize the tools, making sure the list of tool configs includes the reserved migrated_tools_conf.xml file.
- tool_configs = self.config.tool_configs
- if self.config.migrated_tools_config not in tool_configs:
- tool_configs.append( self.config.migrated_tools_config )
- self.toolbox = tools.ToolBox( tool_configs, self.config.tool_path, self )
- # Search support for tools
- self.toolbox_search = galaxy.tools.search.ToolBoxSearch( self.toolbox )
- # Set up the tool sheds registry.
- if os.path.isfile( self.config.tool_sheds_config ):
- self.tool_shed_registry = tool_shed.tool_shed_registry.Registry( self.config.root, self.config.tool_sheds_config )
- else:
- self.tool_shed_registry = None
+
+ self._configure_object_store()
+
+ self._configure_security()
+
+ self._configure_models()
+
+ self._configure_datatypes_registry( )
+
+ self._configure_tool_data_tables( from_shed_config=True )
+
+ self._configure_toolbox()
+
+ self._configure_tool_shed_registry()
+
# Get the latest tool migration script number to send to the Install manager.
latest_migration_script_number = int( tools_migration_config.split( '_' )[ 0 ] )
# The value of migrated_tools_config is migrated_tools_conf.xml, and is reserved for containing only those tools that have been
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: inithello: Expose the show method anonymously.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e059c6607f34/
Changeset: e059c6607f34
Branch: stable
User: inithello
Date: 2013-12-13 21:49:28
Summary: Expose the show method anonymously.
Affected #: 1 file
diff -r 7dec267e7553c9279fc4fb4476232bedd80e3fa1 -r e059c6607f34b603e92e85cf0113b7b9b9635571 lib/galaxy/webapps/tool_shed/api/repository_revisions.py
--- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
+++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
@@ -133,7 +133,7 @@
trans.response.status = 500
return message
- @web.expose_api
+ @web.expose_api_anonymous
def show( self, trans, id, **kwd ):
"""
GET /api/repository_revisions/{encoded_repository_metadata_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: Allow storage of multiple test runs in the prep script for install and testing tool dependencies and restrict creation of new entries in the tool test results dictionary when running the prep script for install and test repositories.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/09533cfe1546/
Changeset: 09533cfe1546
User: greg
Date: 2013-12-13 21:44:39
Summary: Allow storage of multiple test runs in the prep script for install and testing tool dependencies and restrict creation of new entries in the tool test results dictionary when running the prep script for install and test repositories.
Affected #: 2 files
diff -r 6639d560b0a3333052af50773334641654d42a09 -r 09533cfe154682bdfb1b8786fb827a99461022a6 lib/tool_shed/scripts/check_repositories_for_functional_tests.py
--- a/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
+++ b/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
@@ -253,6 +253,11 @@
# a test_environment entry. If we use it we need to temporarily eliminate it from the list of tool_test_results_dicts
# since it will be re-inserted later.
tool_test_results_dict = tool_test_results_dicts.pop( 0 )
+ elif len( tool_test_results_dict ) == 2 and \
+ 'test_environment' in tool_test_results_dict and 'missing_test_components' in tool_test_results_dict:
+ # We can re-use tool_test_results_dict if its only entries are "test_environment" and "missing_test_components".
+ # In this case, some tools are missing tests components while others are not.
+ tool_test_results_dict = tool_test_results_dicts.pop( 0 )
else:
# The latest tool_test_results_dict has been populated with the results of a test run, so it cannot be used.
tool_test_results_dict = {}
diff -r 6639d560b0a3333052af50773334641654d42a09 -r 09533cfe154682bdfb1b8786fb827a99461022a6 lib/tool_shed/scripts/check_tool_dependency_definition_repositories.py
--- a/lib/tool_shed/scripts/check_tool_dependency_definition_repositories.py
+++ b/lib/tool_shed/scripts/check_tool_dependency_definition_repositories.py
@@ -41,6 +41,7 @@
class RepositoriesApplication( object ):
"""Encapsulates the state of a Universe application"""
+
def __init__( self, config ):
if config.database_connection is False:
config.database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % config.database
@@ -133,11 +134,12 @@
# Do not check metadata records that have an entry in the skip_tool_tests table, since they won't be tested anyway.
skip_metadata_ids = select( [ app.model.SkipToolTest.table.c.repository_metadata_id ] )
# Get the list of metadata records to check, restricting it to records that have not been flagged do_not_test.
- for repository_metadata in app.sa_session.query( app.model.RepositoryMetadata ) \
- .filter( and_( app.model.RepositoryMetadata.table.c.downloadable == True,
- app.model.RepositoryMetadata.table.c.do_not_test == False,
- app.model.RepositoryMetadata.table.c.repository_id.in_( tool_dependency_defintion_repository_ids ),
- not_( app.model.RepositoryMetadata.table.c.id.in_( skip_metadata_ids ) ) ) ):
+ for repository_metadata in \
+ app.sa_session.query( app.model.RepositoryMetadata ) \
+ .filter( and_( app.model.RepositoryMetadata.table.c.downloadable == True,
+ app.model.RepositoryMetadata.table.c.do_not_test == False,
+ app.model.RepositoryMetadata.table.c.repository_id.in_( tool_dependency_defintion_repository_ids ),
+ not_( app.model.RepositoryMetadata.table.c.id.in_( skip_metadata_ids ) ) ) ):
records_checked += 1
# Check the next repository revision.
changeset_revision = str( repository_metadata.changeset_revision )
@@ -161,9 +163,31 @@
invalid_metadata += 1
if not info_only:
# Create the tool_test_results_dict dictionary, using the dictionary from the previous test run if available.
- if repository_metadata.tool_test_results:
- tool_test_results_dict = repository_metadata.tool_test_results
+ if repository_metadata.tool_test_results is not None:
+ # We'll listify the column value in case it uses the old approach of storing the results of only a single test run.
+ tool_test_results_dicts = listify( repository_metadata.tool_test_results )
else:
+ tool_test_results_dicts = []
+ if tool_test_results_dicts:
+ # Inspect the tool_test_results_dict for the last test run in case it contains only a test_environment
+ # entry. This will occur with multiple runs of this script without running the associated
+ # install_and_test_tool_sed_repositories.sh script which will further populate the tool_test_results_dict.
+ tool_test_results_dict = tool_test_results_dicts[ 0 ]
+ if len( tool_test_results_dict ) <= 1:
+ # We can re-use the mostly empty tool_test_results_dict for this run because it is either empty or it contains only
+ # a test_environment entry. If we use it we need to temporarily eliminate it from the list of tool_test_results_dicts
+ # since it will be re-inserted later.
+ tool_test_results_dict = tool_test_results_dicts.pop( 0 )
+ elif len( tool_test_results_dict ) == 2 and \
+ 'test_environment' in tool_test_results_dict and 'missing_test_components' in tool_test_results_dict:
+ # We can re-use tool_test_results_dict if its only entries are "test_environment" and "missing_test_components".
+ # In this case, some tools are missing tests components while others are not.
+ tool_test_results_dict = tool_test_results_dicts.pop( 0 )
+ else:
+ # The latest tool_test_results_dict has been populated with the results of a test run, so it cannot be used.
+ tool_test_results_dict = {}
+ else:
+ # Create a new dictionary for the most recent test run.
tool_test_results_dict = {}
# Initialize the tool_test_results_dict dictionary with the information about the current test environment.
test_environment_dict = tool_test_results_dict.get( 'test_environment', {} )
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7dec267e7553/
Changeset: 7dec267e7553
Branch: stable
User: inithello
Date: 2013-12-13 20:45:42
Summary: Fix API visibility for the repository_revisions index.
Affected #: 1 file
diff -r 77b5d4888d6d957d24caccdcd5154bb8cb7574e4 -r 7dec267e7553c9279fc4fb4476232bedd80e3fa1 lib/galaxy/webapps/tool_shed/api/repository_revisions.py
--- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
+++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
@@ -66,7 +66,7 @@
trans.response.status = 500
return message
- @web.expose_api
+ @web.expose_api_anonymous
def index( self, trans, **kwd ):
"""
GET /api/repository_revisions
https://bitbucket.org/galaxy/galaxy-central/commits/6639d560b0a3/
Changeset: 6639d560b0a3
User: inithello
Date: 2013-12-13 20:48:11
Summary: Remove the forced addition of the API key to API calls, since the issue being worked around has now been fixed in -stable.
Affected #: 1 file
diff -r 67b996a66ef9f2de2381bfb66f11bba99b3552fd -r 6639d560b0a3333052af50773334641654d42a09 test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -307,12 +307,8 @@
parts.insert( 0, 'api' )
url = suc.url_join( base, *parts )
if params is not None:
- if 'key' not in params:
- params[ 'key' ] = tool_shed_api_key
query_string = urllib.urlencode( params )
url += '?%s' % query_string
- else:
- url += '?key=%s' % tool_shed_api_key
return url
def get_latest_downloadable_changeset_revision( url, name, owner ):
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8ff39b398d5f/
Changeset: 8ff39b398d5f
User: inithello
Date: 2013-12-13 20:30:19
Summary: Fix for the install and test framework failing to retrieve a list of repositories to test from a tool shed tracking stable.
Affected #: 1 file
diff -r 5fb649265c513d6efd1e9d6c93ab06e6996e2008 -r 8ff39b398d5f3f275e55c42f69f6b5038e9d621d test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -306,14 +306,19 @@
elif 'api' not in parts:
parts.insert( 0, 'api' )
url = suc.url_join( base, *parts )
- if params:
- url += '?%s' % params
+ if params is not None:
+ if 'key' not in params:
+ params[ 'key' ] = tool_shed_api_key
+ query_string = urllib.urlencode( params )
+ url += '?%s' % query_string
+ else:
+ url += '?key=%s' % tool_shed_api_key
return url
def get_latest_downloadable_changeset_revision( url, name, owner ):
error_message = ''
parts = [ 'api', 'repositories', 'get_ordered_installable_revisions' ]
- params = urllib.urlencode( dict( name=name, owner=owner ) )
+ params = dict( name=name, owner=owner )
api_url = get_api_url( base=url, parts=parts, params=params )
changeset_revisions, error_message = json_from_url( api_url )
if error_message:
@@ -336,7 +341,7 @@
def get_repository_dict( url, repository_dict ):
error_message = ''
parts = [ 'api', 'repositories', repository_dict[ 'repository_id' ] ]
- api_url = get_api_url( base=url, parts=parts, params=None )
+ api_url = get_api_url( base=url, parts=parts )
extended_dict, error_message = json_from_url( api_url )
if error_message:
return None, error_message
@@ -370,12 +375,12 @@
log.debug( 'Testing is restricted to the latest downloadable revision in this test run.' )
repository_dicts = []
parts = [ 'repository_revisions' ]
- params = urllib.urlencode( dict( do_not_test='false',
- downloadable='true',
- includes_tools='true',
- malicious='false',
- missing_test_components='false',
- skip_tool_test='false' ) )
+ params = dict( do_not_test='false',
+ downloadable='true',
+ includes_tools='true',
+ malicious='false',
+ missing_test_components='false',
+ skip_tool_test='false' )
api_url = get_api_url( base=tool_shed_url, parts=parts, params=params )
baseline_repository_dicts, error_message = json_from_url( api_url )
if error_message:
@@ -462,7 +467,7 @@
"""
error_message = ''
parts = [ 'api', 'repository_revisions', encoded_repository_metadata_id ]
- api_url = get_api_url( base=tool_shed_url, parts=parts, params=None )
+ api_url = get_api_url( base=tool_shed_url, parts=parts )
repository_metadata, error_message = json_from_url( api_url )
if error_message:
return None, error_message
https://bitbucket.org/galaxy/galaxy-central/commits/67b996a66ef9/
Changeset: 67b996a66ef9
User: inithello
Date: 2013-12-13 20:32:11
Summary: Merge with 11729:46dd06fbc774.
Affected #: 2 files
diff -r 8ff39b398d5f3f275e55c42f69f6b5038e9d621d -r 67b996a66ef9f2de2381bfb66f11bba99b3552fd lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -212,13 +212,13 @@
tmp_dir=job_wrapper.working_directory,
#we don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
kwds={ 'overwrite' : False } )
- log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
if resolve_requirements:
dependency_shell_commands = self.app.datatypes_registry.set_external_metadata_tool.build_dependency_shell_commands()
if dependency_shell_commands:
if isinstance( dependency_shell_commands, list ):
dependency_shell_commands = "&&".join( dependency_shell_commands )
external_metadata_script = "%s&&%s" % ( dependency_shell_commands, external_metadata_script )
+ log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
external_metadata_proc = subprocess.Popen( args=external_metadata_script,
shell=True,
env=os.environ,
diff -r 8ff39b398d5f3f275e55c42f69f6b5038e9d621d -r 67b996a66ef9f2de2381bfb66f11bba99b3552fd test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -643,6 +643,11 @@
# a test_environment entry. If we use it we need to temporarily eliminate it from the list of tool_test_results_dicts
# since it will be re-inserted later.
tool_test_results_dict = tool_test_results_dicts.pop( 0 )
+ elif len( tool_test_results_dict ) == 2 and \
+ 'test_environment' in tool_test_results_dict and 'missing_test_components' in tool_test_results_dict:
+ # We can re-use tool_test_results_dict if its only entries are "test_environment" and "missing_test_components".
+ # In this case, some tools are missing tests components while others are not.
+ tool_test_results_dict = tool_test_results_dicts.pop( 0 )
else:
# The latest tool_test_results_dict has been populated with the results of a test run, so it cannot be used.
tool_test_results_dict = {}
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 the latest test results dictionary in the current install and test run if it contains only test_environment and missing_test_components entries.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/46dd06fbc774/
Changeset: 46dd06fbc774
User: greg
Date: 2013-12-13 20:30:34
Summary: Use the latest test results dictionary in the current install and test run if it contains only test_environment and missing_test_components entries.
Affected #: 1 file
diff -r a46ac538684e86002e5386aefb7a6c3b921eae45 -r 46dd06fbc7744f9539e6dba7233350964a272eb5 test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -638,6 +638,11 @@
# a test_environment entry. If we use it we need to temporarily eliminate it from the list of tool_test_results_dicts
# since it will be re-inserted later.
tool_test_results_dict = tool_test_results_dicts.pop( 0 )
+ elif len( tool_test_results_dict ) == 2 and \
+ 'test_environment' in tool_test_results_dict and 'missing_test_components' in tool_test_results_dict:
+ # We can re-use tool_test_results_dict if its only entries are "test_environment" and "missing_test_components".
+ # In this case, some tools are missing tests components while others are not.
+ tool_test_results_dict = tool_test_results_dicts.pop( 0 )
else:
# The latest tool_test_results_dict has been populated with the results of a test run, so it cannot be used.
tool_test_results_dict = {}
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: dan: Move debug logging statement for external metadata command so that it includes the dependency shell commands, if any.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a46ac538684e/
Changeset: a46ac538684e
User: dan
Date: 2013-12-13 20:28:54
Summary: Move debug logging statement for external metadata command so that it includes the dependency shell commands, if any.
Affected #: 1 file
diff -r 5fb649265c513d6efd1e9d6c93ab06e6996e2008 -r a46ac538684e86002e5386aefb7a6c3b921eae45 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -212,13 +212,13 @@
tmp_dir=job_wrapper.working_directory,
#we don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
kwds={ 'overwrite' : False } )
- log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
if resolve_requirements:
dependency_shell_commands = self.app.datatypes_registry.set_external_metadata_tool.build_dependency_shell_commands()
if dependency_shell_commands:
if isinstance( dependency_shell_commands, list ):
dependency_shell_commands = "&&".join( dependency_shell_commands )
external_metadata_script = "%s&&%s" % ( dependency_shell_commands, external_metadata_script )
+ log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
external_metadata_proc = subprocess.Popen( args=external_metadata_script,
shell=True,
env=os.environ,
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: Eliminate the deprecated "orphan" designation when displaying tool dependencies in tool shed containers.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5fb649265c51/
Changeset: 5fb649265c51
User: greg
Date: 2013-12-13 20:18:38
Summary: Eliminate the deprecated "orphan" designation when displaying tool dependencies in tool shed containers.
Affected #: 1 file
diff -r 35b1a3c6e617247de50ac3f83de46a090f9ac59c -r 5fb649265c513d6efd1e9d6c93ab06e6996e2008 lib/tool_shed/util/container_util.py
--- a/lib/tool_shed/util/container_util.py
+++ b/lib/tool_shed/util/container_util.py
@@ -5,7 +5,6 @@
from galaxy.web.framework.helpers import time_ago
from tool_shed.util import common_util
from tool_shed.util import readme_util
-from tool_shed.util.tool_dependency_util import tool_dependency_is_orphan
import tool_shed.util.shed_util_common as suc
log = logging.getLogger( __name__ )
@@ -269,7 +268,7 @@
"""Tool dependency object"""
def __init__( self, id=None, name=None, version=None, type=None, readme=None, installation_status=None, repository_id=None,
- tool_dependency_id=None, is_orphan=None ):
+ tool_dependency_id=None ):
self.id = id
self.name = name
self.version = version
@@ -278,15 +277,6 @@
self.installation_status = installation_status
self.repository_id = repository_id
self.tool_dependency_id = tool_dependency_id
- # The designation of a ToolDependency into the "orphan" category has evolved over time, and is significantly restricted since the
- # introduction of the TOOL_DEPENDENCY_DEFINITION repository type. This designation is still critical, however, in that it handles
- # the case where a repository contains both tools and a tool_dependencies.xml file, but the definition in the tool_dependencies.xml
- # file is in no way related to anything defined by any of the contained tool's requirements tag sets. This is important in that it
- # is often a result of a typo (e.g., dependency name or version) that differs between the tool dependency definition within the
- # tool_dependencies.xml file and what is defined in the tool config's <requirements> tag sets. In these cases, the user should be
- # presented with a warning message, and this warning message is is in fact displayed if the following is_orphan attribute is True.
- # This is tricky because in some cases it may be intentional, and tool dependencies that are categorized as "orphan" are in fact valid.
- self.is_orphan = is_orphan
@property
def listify( self ):
@@ -318,42 +308,6 @@
self.repository_metadata_id = repository_metadata_id
self.repository_id = repository_id
-def add_orphan_settings_to_tool_dependencies( tool_dependencies, tools ):
- """Inspect all received tool dependencies and label those that are orphans within the repository."""
- #orphan_env_dependencies = orphan_tool_dependencies.get( 'set_environment', None )
- new_tool_dependencies = {}
- for td_key, requirements_dict in tool_dependencies.items():
- if td_key in [ 'set_environment' ]:
- # "set_environment": [{"name": "R_SCRIPT_PATH", "type": "set_environment"}]
- new_set_environment_dict_list = []
- for env_requirements_dict in requirements_dict:
- try:
- name = env_requirements_dict[ 'name' ]
- type = env_requirements_dict[ 'type' ]
- if tool_dependency_is_orphan( type, name, None, tools ):
- env_requirements_dict[ 'is_orphan' ] = True
- except Exception, e:
- name = str( e )
- type = 'unknown'
- is_orphan = 'unknown'
- new_set_environment_dict_list.append( env_requirements_dict )
- new_tool_dependencies[ td_key ] = new_set_environment_dict_list
- else:
- # {"R/2.15.1": {"name": "R", "readme": "some string", "type": "package", "version": "2.15.1"}
- try:
- name = requirements_dict[ 'name' ]
- type = requirements_dict[ 'type' ]
- version = requirements_dict[ 'version']
- if tool_dependency_is_orphan( type, name, version, tools ):
- requirements_dict[ 'is_orphan' ] = True
- except Exception, e:
- name = str( e )
- type = 'unknown'
- version = 'unknown'
- is_orphan = 'unknown'
- new_tool_dependencies[ td_key ] = requirements_dict
- return new_tool_dependencies
-
def build_data_managers_folder( trans, folder_id, data_managers, label=None ):
"""Return a folder hierarchy containing Data Managers."""
if data_managers:
@@ -849,8 +803,6 @@
if 'tools' not in exclude:
tools = metadata.get( 'tools', [] )
tools.extend( metadata.get( 'invalid_tools', [] ) )
- if tools:
- tool_dependencies = add_orphan_settings_to_tool_dependencies( tool_dependencies, tools )
folder_id, tool_dependencies_root_folder = build_tool_dependencies_folder( trans,
folder_id,
tool_dependencies,
@@ -1055,13 +1007,6 @@
tool_dependency_id += 1
if dependency_key in [ 'set_environment' ]:
for set_environment_dict in requirements_dict:
- if trans.webapp.name == 'tool_shed':
- is_orphan = set_environment_dict.get( 'is_orphan', False )
- else:
- # This is probably not necessary to display in Galaxy.
- is_orphan = False
- if is_orphan:
- folder.description = not_used_by_local_tools_description
try:
name = set_environment_dict.get( 'name', None )
type = set_environment_dict[ 'type' ]
@@ -1086,16 +1031,9 @@
readme=None,
installation_status=installation_status,
repository_id=repository_id,
- tool_dependency_id=td_id,
- is_orphan=is_orphan )
+ tool_dependency_id=td_id )
folder.tool_dependencies.append( tool_dependency )
else:
- if trans.webapp.name == 'tool_shed':
- is_orphan = requirements_dict.get( 'is_orphan', False )
- else:
- is_orphan = False
- if is_orphan:
- folder.description = not_used_by_local_tools_description
try:
name = requirements_dict[ 'name' ]
version = requirements_dict[ 'version' ]
@@ -1122,8 +1060,7 @@
readme=None,
installation_status=installation_status,
repository_id=repository_id,
- tool_dependency_id=td_id,
- is_orphan=is_orphan )
+ tool_dependency_id=td_id )
folder.tool_dependencies.append( tool_dependency )
else:
tool_dependencies_root_folder = None
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: jmchilton: casperjs: Enable api.tools.create and add test.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/35b1a3c6e617/
Changeset: 35b1a3c6e617
User: jmchilton
Date: 2013-12-13 17:24:09
Summary: casperjs: Enable api.tools.create and add test.
Affected #: 2 files
diff -r f92fe13caa5934d45397442dff658fc3c26cdf59 -r 35b1a3c6e617247de50ac3f83de46a090f9ac59c test/casperjs/api-tool-tests.js
--- a/test/casperjs/api-tool-tests.js
+++ b/test/casperjs/api-tool-tests.js
@@ -213,6 +213,29 @@
// ------------------------------------------------------------------------------------------- CREATE
// this is a method of running a job. Shouldn't that be in jobs.create?
+ this.test.comment( 'create should work' );
+ var upload_params = {
+ 'files_0|NAME': 'Test Dataset',
+ 'files_0|url_paste': 'Hello World',
+ 'dbkey': '?',
+ 'file_type': 'txt'
+ };
+ var payload = {
+ 'tool_id': 'upload1',
+ 'inputs': upload_params,
+ 'upload_type': 'upload_dataset',
+ };
+ var toolCreate = this.api.tools.create( payload );
+ this.test.assert( hasKeys( toolCreate, ['outputs'] ), 'Has outputs' );
+ var outputs = toolCreate['outputs'];
+ this.test.assert( utils.isArray( outputs ), 'outputs is an array' );
+ this.test.assert( outputs.length == 1, 'one dataset is created' );
+
+ var output = outputs[0]
+ this.test.assert( utils.isObject( output ), 'output0 is an array' );
+ this.test.assert( hasKeys( output, ['data_type', 'deleted', 'hid', 'history_id', 'id', 'name' ] ), 'Dataset information defined' );
+ this.test.assert( hasKeys( output, ['output_name' ] ), 'Output name labelled' );
+
// ------------------------------------------------------------------------------------------- MISC
//attemptShowOnAllTools.call( spaceghost );
});
diff -r f92fe13caa5934d45397442dff658fc3c26cdf59 -r 35b1a3c6e617247de50ac3f83de46a090f9ac59c test/casperjs/modules/api.js
--- a/test/casperjs/modules/api.js
+++ b/test/casperjs/modules/api.js
@@ -338,16 +338,16 @@
});
};
-//ToolsAPI.prototype.create = function create( payload ){
-// this.api.spaceghost.info( 'tools.create: ' + [ this.api.spaceghost.jsonStr( payload ) ] );
-//
-// // py.payload <-> ajax.data
-// payload = this.api.ensureObject( payload );
-// return this.api._ajax( utils.format( this.urlTpls.create, this.api.ensureId( historyId ) ), {
-// type : 'POST',
-// data : payload
-// });
-//};
+ToolsAPI.prototype.create = function create( payload ){
+ this.api.spaceghost.info( 'tools.create: ' + [ this.api.spaceghost.jsonStr( payload ) ] );
+
+ // py.payload <-> ajax.data
+ payload = this.api.ensureObject( payload );
+ return this.api._ajax( utils.format( this.urlTpls.create ), {
+ type : 'POST',
+ data : payload
+ });
+};
// =================================================================== WORKFLOWS
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b0869cdb78e3/
Changeset: b0869cdb78e3
User: carlfeberhard
Date: 2013-12-13 17:02:40
Summary: HiddenUntilActivated: fix state detection when element rendered hidden
Affected #: 3 files
diff -r 5648e6d15803412cf9467bafd89bfb20d7a5281a -r b0869cdb78e3c8ab9a02ae9b7589960913d91cb3 static/scripts/mvc/base-mvc.js
--- a/static/scripts/mvc/base-mvc.js
+++ b/static/scripts/mvc/base-mvc.js
@@ -204,7 +204,9 @@
/** */
toggle : function(){
// can be called manually as well with normal toggle arguments
- if( this.isHidden() ){
+ //TODO: better as a callback (when the show/hide is actually done)
+ // show
+ if( this.hidden ){
// fire the optional fns on the first/each showing - good for render()
if( !this.HUAVOptions.hasBeenShown ){
if( _.isFunction( this.HUAVOptions.onshowFirstTime ) ){
@@ -214,17 +216,18 @@
}
if( _.isFunction( this.HUAVOptions.onshow ) ){
this.HUAVOptions.onshow.call( this );
+ this.trigger( 'hiddenUntilActivated:shown', this );
}
this.hidden = false;
+ // hide
} else {
if( _.isFunction( this.HUAVOptions.onhide ) ){
this.HUAVOptions.onhide.call( this );
+ this.trigger( 'hiddenUntilActivated:hidden', this );
}
this.hidden = true;
}
- //TODO: better as a callback (when the show/hide is actually done)
- this.trigger( 'hiddenUntilActivated:' + (( this.isHidden() )?( 'shown' ):( 'hidden' )), this );
return this.HUAVOptions.showFn.apply( this.HUAVOptions.$elementShown, arguments );
}
};
diff -r 5648e6d15803412cf9467bafd89bfb20d7a5281a -r b0869cdb78e3c8ab9a02ae9b7589960913d91cb3 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -899,7 +899,7 @@
},
/** toggle the visibility of each hdaView's tagsEditor applying all the args sent to this function */
- toggleHDATagEditors : function(){
+ toggleHDATagEditors : function( showOrHide ){
var args = arguments;
_.each( this.hdaViews, function( hdaView ){
if( hdaView.tagsEditor ){
diff -r 5648e6d15803412cf9467bafd89bfb20d7a5281a -r b0869cdb78e3c8ab9a02ae9b7589960913d91cb3 templates/webapps/galaxy/history/history_panel.mako
--- a/templates/webapps/galaxy/history/history_panel.mako
+++ b/templates/webapps/galaxy/history/history_panel.mako
@@ -89,7 +89,6 @@
## ----------------------------------------------------------------------------- generic 'base' function
<%def name="history_panel_javascripts()">
-<% print 'history_panel_javascripts' %>
${h.js(
"utils/localization",
"mvc/base-mvc",
https://bitbucket.org/galaxy/galaxy-central/commits/f92fe13caa59/
Changeset: f92fe13caa59
User: carlfeberhard
Date: 2013-12-13 17:04:09
Summary: Merge
Affected #: 1 file
diff -r b0869cdb78e3c8ab9a02ae9b7589960913d91cb3 -r f92fe13caa5934d45397442dff658fc3c26cdf59 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
@@ -89,7 +89,7 @@
<ul>
%for installed_dependent_repository_tup in installed_dependent_repositories:
<%
- tool_shed, name, owner, installed_changeset_revision, status = installed_dependent_repository_tup
+ tool_shed, name, owner, installed_changeset_revision = installed_dependent_repository_tup
%><li>Revision <b>${ installed_changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li>
%endfor
@@ -100,7 +100,7 @@
<ul>
%for td_tup in installed_runtime_dependent_tool_dependencies:
<%
- tool_shed_repository_id, name, version, type, status = td_tup
+ tool_shed_repository_id, name, version, type = td_tup
containing_repository = irm.get_containing_repository_for_tool_dependency( td_tup )
repository_name = containing_repository.name
changeset_revision = containing_repository.changeset_revision
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: inithello: Don't try to fetch the nonexistent status element from the dependency tuples.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/45602721c2af/
Changeset: 45602721c2af
User: inithello
Date: 2013-12-13 17:02:33
Summary: Don't try to fetch the nonexistent status element from the dependency tuples.
Affected #: 1 file
diff -r 5648e6d15803412cf9467bafd89bfb20d7a5281a -r 45602721c2af7ed02b319110d29fd5e8dcfd20b1 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
@@ -89,7 +89,7 @@
<ul>
%for installed_dependent_repository_tup in installed_dependent_repositories:
<%
- tool_shed, name, owner, installed_changeset_revision, status = installed_dependent_repository_tup
+ tool_shed, name, owner, installed_changeset_revision = installed_dependent_repository_tup
%><li>Revision <b>${ installed_changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li>
%endfor
@@ -100,7 +100,7 @@
<ul>
%for td_tup in installed_runtime_dependent_tool_dependencies:
<%
- tool_shed_repository_id, name, version, type, status = td_tup
+ tool_shed_repository_id, name, version, type = td_tup
containing_repository = irm.get_containing_repository_for_tool_dependency( td_tup )
repository_name = containing_repository.name
changeset_revision = containing_repository.changeset_revision
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: jmchilton: casperjs: Fix api-tool-tests.js for recent changes.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5648e6d15803/
Changeset: 5648e6d15803
User: jmchilton
Date: 2013-12-13 16:53:59
Summary: casperjs: Fix api-tool-tests.js for recent changes.
Affected #: 2 files
diff -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 -r 5648e6d15803412cf9467bafd89bfb20d7a5281a test/casperjs/api-tool-tests.js
--- a/test/casperjs/api-tool-tests.js
+++ b/test/casperjs/api-tool-tests.js
@@ -63,10 +63,10 @@
// =================================================================== TESTS
var panelSectionKeys = [
- 'elems', 'id', 'name', 'type', 'version'
+ 'elems', 'id', 'name', 'version'
],
panelToolKeys = [
- 'id', 'name', 'description', 'version', 'link', 'target', 'min_width', 'type'
+ 'id', 'name', 'description', 'version', 'link', 'target', 'min_width'
],
toolSummaryKeys = [
'id', 'name', 'description', 'version'
diff -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 -r 5648e6d15803412cf9467bafd89bfb20d7a5281a test/casperjs/modules/api.js
--- a/test/casperjs/modules/api.js
+++ b/test/casperjs/modules/api.js
@@ -331,6 +331,8 @@
this.api.spaceghost.info( 'tools.show: ' + [ id ] );
var data = {};
+ data.io_details = true;
+
return this.api._ajax( utils.format( this.urlTpls.show, id ), {
data : data
});
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d6a9ae1f0dac/
Changeset: d6a9ae1f0dac
User: jgoecks
Date: 2013-12-13 16:27:00
Summary: Fix location of delete icons for postjob actions in workflows and sample management template.
Affected #: 2 files
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r d6a9ae1f0dac526531e937c23d9266c86408454b lib/galaxy/jobs/actions/post.py
--- a/lib/galaxy/jobs/actions/post.py
+++ b/lib/galaxy/jobs/actions/post.py
@@ -12,7 +12,7 @@
form = """
if (pja.action_type == "%s"){
p_str = "<div class='pjaForm toolForm'><span class='action_tag' style='display:none'>"+ pja.action_type + pja.output_name + "</span><div class='toolFormTitle'> %s <br/> on " + pja.output_name + "\
- <div style='float: right;' class='buttons'><img src='/static/images/delete_icon.png'></div></div><div class='toolFormBody'>";
+ <div style='float: right;' class='buttons'><img src='/static/images/history-buttons/delete_icon.png'></div></div><div class='toolFormBody'>";
%s
p_str += "</div><div class='toolParamHelp'>%s</div></div>";
}""" % (action_type, title, content, help)
@@ -20,7 +20,7 @@
form = """
if (pja.action_type == "%s"){
p_str = "<div class='pjaForm toolForm'><span class='action_tag' style='display:none'>"+ pja.action_type + "</span><div class='toolFormTitle'> %s \
- <div style='float: right;' class='buttons'><img src='/static/images/delete_icon.png'></div></div><div class='toolFormBody'>";
+ <div style='float: right;' class='buttons'><img src='/static/images/history-buttons/delete_icon.png'></div></div><div class='toolFormBody'>";
%s
p_str += "</div><div class='toolParamHelp'>%s</div></div>";
}""" % (action_type, title, content, help)
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r d6a9ae1f0dac526531e937c23d9266c86408454b templates/webapps/galaxy/requests/common/common.mako
--- a/templates/webapps/galaxy/requests/common/common.mako
+++ b/templates/webapps/galaxy/requests/common/common.mako
@@ -314,7 +314,7 @@
%endif
%if can_delete_samples:
## Delete button
- <td valign="top"><a class="action-button" confirm="This sample is not recoverable after deletion. Click Ok to delete." href="${h.url_for( controller='requests_common', action='delete_sample', cntrller=cntrller, request_id=trans.security.encode_id( request.id ), sample_id=sample_widget_index )}"><img src="${h.url_for('/static/images/delete_icon.png')}" style="cursor:pointer;"/></a></td>
+ <td valign="top"><a class="action-button" confirm="This sample is not recoverable after deletion. Click Ok to delete." href="${h.url_for( controller='requests_common', action='delete_sample', cntrller=cntrller, request_id=trans.security.encode_id( request.id ), sample_id=sample_widget_index )}"><img src="${h.url_for('/static/images/history-buttons/delete_icon.png')}" style="cursor:pointer;"/></a></td>
%endif
</%def>
https://bitbucket.org/galaxy/galaxy-central/commits/9a6419162a6c/
Changeset: 9a6419162a6c
User: jgoecks
Date: 2013-12-13 16:46:26
Summary: Automated merge.
Affected #: 7 files
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -66,58 +66,47 @@
# contents (i.e., tool dependencies) require it.
if self.status == self.installation_status.UNINSTALLED:
return False
+ this_repository_tup = ( str( self.tool_shed ),
+ str( self.name ),
+ str( self.owner ),
+ str( self.installed_changeset_revision ) )
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
+ # The repository dependency may have other repository dependencies, but that is not relevant here.
+ single_repository_dependency_tup = None
+ installed_repository_dependency_tups = \
+ irm.installed_repository_dependencies_of_installed_repositories.get( this_repository_tup, [] )
+ # If this repository defines a circular relationship to another repository, then the list of tuples
+ # defining installed repository dependencies will include itself.
+ if len( installed_repository_dependency_tups ) == 2:
+ if this_repository_tup in installed_repository_dependency_tups:
+ # We have a single circular dependency definition, so get the other repository.
+ for installed_repository_dependency_tup in installed_repository_dependency_tups:
+ if installed_repository_dependency_tup != this_repository_tup:
+ single_repository_dependency_tup = installed_repository_dependency_tup
+ break
+ if single_repository_dependency_tup is not None:
+ installed_repository_dependency_tups = \
+ irm.installed_repository_dependencies_of_installed_repositories.get( this_repository_tup, [] )
+ if this_repository_tup in installed_repository_dependency_tups:
+ # 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:
- 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
+ installed_dependent_repositories = \
+ irm.installed_dependent_repositories_of_installed_repositories.get( this_repository_tup, [] )
+ 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.
- 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
+ installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( this_repository_tup, [] )
+ for td_tup in installed_tool_dependencies:
+ installed_dependent_td_tups = irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( td_tup, [] )
+ if installed_dependent_td_tups:
+ # 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
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -17,13 +17,13 @@
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.
+ Among other things, keep in in-memory sets of tuples defining 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
@@ -32,32 +32,35 @@
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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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 tool_shed_repository objects (whose status is 'Installed') that require the key.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_dependency objects (whose status is 'Installed') and
+ # whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_dependency objects (whose status is 'Installed') and
+ # whose values are a list of tuples defining 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()
@@ -68,101 +71,100 @@
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.
"""
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
# 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 )
+ repository_dependency_tups = \
+ repository_dependency_util.get_repository_dependency_tups_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 ) )
+ if repository_tup not in self.installed_repository_dependencies_of_installed_repositories:
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
debug_msg += "to installed_repository_dependencies_of_installed_repositories."
log.debug( debug_msg )
- 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_repository_dependencies_of_installed_repositories[ repository_tup ] = repository_dependency_tups
+ # Use the repository_dependency_tups 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 ) )
+ for required_repository_tup in repository_dependency_tups:
+ debug_msg = "Appending revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, 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
+ if required_repository_tup in self.installed_dependent_repositories_of_installed_repositories:
+ self.installed_dependent_repositories_of_installed_repositories[ required_repository_tup ].append( repository_tup )
else:
- self.installed_dependent_repositories_of_installed_repositories[ required_repository ] = [ repository ]
+ self.installed_dependent_repositories_of_installed_repositories[ required_repository_tup ] = [ repository_tup ]
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 ) )
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup not in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Adding an entry for version %s of %s %s " % ( version, type, 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
+ installed_runtime_dependent_tool_dependency_tups = \
+ tool_dependency_util.get_runtime_dependent_tool_dependency_tuples( self.app, tool_dependency, status=status )
+ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] = \
+ installed_runtime_dependent_tool_dependency_tups
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 ) )
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup not in self.installed_tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, 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
+ installed_tool_dependency_tups = []
+ for tool_dependency in repository.tool_dependencies:
+ if tool_dependency.status == self.app.install_model.ToolDependency.installation_status.INSTALLED:
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ installed_tool_dependency_tups.append( tool_dependency_tup )
+ self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] = installed_tool_dependency_tups
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 ) )
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup not in self.repository_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, 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
+ repository_dependency_tups = \
+ repository_dependency_util.get_repository_dependency_tups_for_repository( self.app, repository, status=None )
+ self.repository_dependencies_of_installed_repositories[ repository_tup ] = repository_dependency_tups
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 ) )
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup not in self.runtime_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Adding an entry for version %s of %s %s " % ( version, type, 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
+ runtime_dependent_tool_dependency_tups = \
+ tool_dependency_util.get_runtime_dependent_tool_dependency_tuples( self.app, tool_dependency, status=None )
+ self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] = \
+ runtime_dependent_tool_dependency_tups
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 ) )
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup not in self.tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
debug_msg += "to tool_dependencies_of_installed_repositories."
log.debug( debug_msg )
- self.tool_dependencies_of_installed_repositories[ repository ] = repository.tool_dependencies
+ tool_dependency_tups = []
+ for tool_dependency in repository.tool_dependencies:
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ tool_dependency_tups.append( tool_dependency_tup )
+ self.tool_dependencies_of_installed_repositories[ repository_tup ] = tool_dependency_tups
- 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_containing_repository_for_tool_dependency( self, tool_dependency_tup ):
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ return self.app.install_model.context.query( self.app.install_model.ToolShedRepository ).get( tool_shed_repository_id )
def get_repository_install_dir( self, tool_shed_repository ):
for tool_config in self.tool_configs:
@@ -176,9 +178,9 @@
relative_path = os.path.join( tool_path,
ts,
'repos',
- tool_shed_repository.owner,
- tool_shed_repository.name,
- tool_shed_repository.installed_changeset_revision )
+ str( tool_shed_repository.owner ),
+ str( tool_shed_repository.name ),
+ str( tool_shed_repository.installed_changeset_revision ) )
if os.path.exists( relative_path ):
return relative_path
return None
@@ -202,19 +204,18 @@
def handle_repository_uninstall( self, repository ):
"""Remove the dependency relationships for a repository that was just uninstalled."""
for tool_dependency in repository.tool_dependencies:
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
# 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 \
+ for td_tup, installed_runtime_dependent_tool_dependency_tups 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 ]
+ if tool_dependency_tup in installed_runtime_dependent_tool_dependency_tups:
# Remove the tool_dependency from the list.
- del installed_runtime_dependent_tool_dependencies[ index ]
+ installed_runtime_dependent_tool_dependency_tups.remove( tool_dependency_tup )
# 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
+ altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td_tup ] = \
+ installed_runtime_dependent_tool_dependency_tups
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.
@@ -239,38 +240,12 @@
# 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_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() ]
-
- @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() ]
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if repository_tup in self.installed_tool_dependencies_of_installed_repositories:
+ self.installed_tool_dependencies_of_installed_repositories[ repository_tup ].append( tool_dependency_tup )
+ else:
+ self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] = [ tool_dependency_tup ]
def load_dependency_relationships( self ):
"""Load relationships for all installed repositories and tool dependencies into in-memnory dictionaries."""
@@ -318,82 +293,76 @@
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:
+ # Remove tuples defining this repository from value lists in self.installed_dependent_repositories_of_installed_repositories.
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ altered_installed_dependent_repositories_of_installed_repositories = {}
+ for r_tup, v_tups in self.installed_dependent_repositories_of_installed_repositories.items():
+ if repository_tup in v_tups:
debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
- ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ ( installed_changeset_revision, name, owner )
+ r_tool_shed, r_name, r_owner, r_installed_changeset_revision = r_tup
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 ) )
+ ( r_installed_changeset_revision, r_name, 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
+ log.debug( debug_msg )
+ v_tups.remove( repository_tup )
+ altered_installed_dependent_repositories_of_installed_repositories[ r_tup ] = v_tups
+ self.installed_dependent_repositories_of_installed_repositories = \
+ altered_installed_dependent_repositories_of_installed_repositories
# 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 " % \
- ( 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
+ if repository_tup in self.installed_repository_dependencies_of_installed_repositories:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
+ debug_msg += "from installed_repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.installed_repository_dependencies_of_installed_repositories[ repository_tup ]
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
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Removing entry for version %s of %s %s " % ( version, type, 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[ tool_dependency_tup ]
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
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup in self.installed_tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
+ debug_msg += "from installed_tool_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.installed_tool_dependencies_of_installed_repositories[ repository_tup ]
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
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup in self.repository_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
+ debug_msg += "from repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.repository_dependencies_of_installed_repositories[ repository_tup ]
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
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup in self.runtime_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Removing entry for version %s of %s %s from runtime_tool_dependencies_of_installed_tool_dependencies." % \
+ ( version, type, name )
+ log.debug( debug_msg )
+ del self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ]
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
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup in self.tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s from tool_dependencies_of_installed_repositories." % \
+ ( installed_changeset_revision, name, owner )
+ log.debug( debug_msg )
+ del self.tool_dependencies_of_installed_repositories[ repository_tup ]
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -71,8 +71,8 @@
def get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ):
"""
- Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated with the repository defined
- by the received repo_info_dict.
+ Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated
+ with the repository defined by the received repo_info_dict.
"""
repository = None
installed_rd = {}
@@ -102,7 +102,8 @@
# Discover all repository dependencies and retrieve information for installing them.
all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) )
has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False )
- has_repository_dependencies_only_if_compiling_contained_td = all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
+ has_repository_dependencies_only_if_compiling_contained_td = \
+ all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False )
includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False )
includes_tools = all_repo_info_dict.get( 'includes_tools', False )
@@ -138,7 +139,8 @@
# We have a single repository with (possibly) no defined repository dependencies.
all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) )
has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False )
- has_repository_dependencies_only_if_compiling_contained_td = all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
+ has_repository_dependencies_only_if_compiling_contained_td = \
+ all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False )
includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False )
includes_tools = all_repo_info_dict.get( 'includes_tools', False )
@@ -202,8 +204,8 @@
# Get the description from the metadata in case it has a value.
repository_dependencies = metadata.get( 'repository_dependencies', {} )
description = repository_dependencies.get( 'description', None )
- # We need to add a root_key entry to one or both of installed_repository_dependencies dictionary and the missing_repository_dependencies
- # dictionaries for proper display parsing.
+ # We need to add a root_key entry to one or both of installed_repository_dependencies dictionary and the
+ # missing_repository_dependencies dictionaries for proper display parsing.
root_key = container_util.generate_repository_dependencies_key_for_repository( repository.tool_shed,
repository.name,
repository.owner,
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -375,22 +375,32 @@
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 ):
+def get_repository_dependency_tups_for_repository( app, repository, dependency_tups=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.
+ Return a list of of tuples defining tool_shed_repository objects (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 ]
+ if dependency_tups is None:
+ dependency_tups = []
+ repository_tup = get_repository_tuple_for_installed_repository_manager( repository )
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
+ required_repository_tup = get_repository_tuple_for_installed_repository_manager( required_repository )
+ if required_repository_tup == repository_tup:
+ # We have a circular repository dependency relationship, skip this entry.
+ continue
+ if required_repository_tup not in dependency_tups:
+ dependency_tups.append( required_repository_tup )
+ return get_repository_dependency_tups_for_repository( app, required_repository, dependency_tups=dependency_tups )
+ return dependency_tups
+
+def get_repository_tuple_for_installed_repository_manager( repository ):
+ return ( str( repository.tool_shed ),
+ str( repository.name ),
+ str( repository.owner ),
+ str( repository.installed_changeset_revision ) )
def get_updated_changeset_revisions_for_repository_dependencies( trans, key_rd_dicts ):
updated_key_rd_dicts = []
@@ -402,9 +412,10 @@
if suc.tool_shed_is_this_tool_shed( rd_toolshed ):
repository = suc.get_repository_by_name_and_owner( trans.app, rd_name, rd_owner )
if repository:
- repository_metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
- trans.security.encode_id( repository.id ),
- rd_changeset_revision )
+ repository_metadata = \
+ metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
+ trans.security.encode_id( repository.id ),
+ rd_changeset_revision )
if repository_metadata:
# The repository changeset_revision is installable, so no updates are available.
new_key_rd_dict = {}
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -200,30 +200,6 @@
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
@@ -322,6 +298,31 @@
env_sh_file_path = os.path.join( env_sh_file_dir, 'env.sh' )
return env_sh_file_path
+def get_runtime_dependent_tool_dependency_tuples( 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_dependency_tups = []
+ 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:
+ td_tuple = get_tool_dependency_tuple_for_installed_repository_manager( td )
+ runtime_dependent_tool_dependency_tups.append( td_tuple )
+ return runtime_dependent_tool_dependency_tups
+
def get_tool_dependency( trans, id ):
"""Get a tool_dependency from the database via id"""
return trans.install_model.context.query( trans.install_model.ToolDependency ).get( trans.security.decode_id( id ) )
@@ -386,6 +387,13 @@
repository_name,
repository_changeset_revision ) )
+def get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ):
+ if tool_dependency.type is None:
+ type = None
+ else:
+ type = str( tool_dependency.type )
+ return ( tool_dependency.tool_shed_repository_id, str( tool_dependency.name ), str( tool_dependency.version ), type )
+
def handle_tool_dependency_installation_error( app, tool_dependency, error_message, remove_installation_path=False ):
# Since there was an installation error, remove the installation directory because the install_package method uses
# this: "if os.path.exists( install_dir ):". Setting remove_installation_path to True should rarely occur. It is
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -54,32 +54,27 @@
%endif
%if not can_uninstall_repository:
<%
+ from tool_shed.util.repository_dependency_util import get_repository_tuple_for_installed_repository_manager
+ from tool_shed.util.tool_dependency_util import get_tool_dependency_tuple_for_installed_repository_manager
+
irm = trans.app.installed_repository_manager
+ repository_tup = get_repository_tuple_for_installed_repository_manager( repository )
# Get installed repositories that this repository requires.
installed_dependent_repositories = []
installed_runtime_dependent_tool_dependencies = []
- for r in irm.installed_dependent_repositories_of_installed_repositories:
- if r.id == repository.id:
- installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories[ r ]
- break
+ installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories.get( repository_tup, [] )
# 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
+ installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( repository_tup, [] )
# 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 )
+ for itd_tup in installed_tool_dependencies:
+ installed_dependent_td_tups = \
+ irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( itd_tup, [] )
+ if installed_dependent_td_tups:
+ installed_runtime_dependent_tool_dependencies.extend( installed_dependent_td_tups )
%>
%if installed_dependent_repositories or installed_runtime_dependent_tool_dependencies:
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -92,29 +87,28 @@
%if installed_dependent_repositories:
<label>Dependent repositories:</label><ul>
- %for installed_dependent_repository in installed_dependent_repositories:
+ %for installed_dependent_repository_tup in installed_dependent_repositories:
<%
- changeset_revision = installed_dependent_repository.changeset_revision
- name = installed_dependent_repository.name
- owner = installed_dependent_repository.owner
+ tool_shed, name, owner, installed_changeset_revision, status = installed_dependent_repository_tup
%>
- <li>Revision <b>${ changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li>
+ <li>Revision <b>${ installed_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:
+ %for td_tup in installed_runtime_dependent_tool_dependencies:
<%
- containing_repository = irm.get_containing_repository_for_tool_dependency( td )
+ tool_shed_repository_id, name, version, type, status = td_tup
+ containing_repository = irm.get_containing_repository_for_tool_dependency( td_tup )
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>
+ Version <b>${version | h}</b> of ${type | h} <b>${name | h}</b> contained in revision
+ <b>${changeset_revision | h}</b> of repository <b>${repository_name | h}</b> owned by <b>${owner | h}</b></li>
%endfor
</ul>
diff -r d6a9ae1f0dac526531e937c23d9266c86408454b -r 9a6419162a6c31cebdc52ca030b0192c5429bb90 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
@@ -30,7 +30,6 @@
<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>
- <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a>
%if repository.can_reset_metadata:
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a>
%endif
@@ -42,6 +41,7 @@
%endif
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
%endif
+ <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a></div></ul></%def>
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 tuples to define objects in Galaxy's installed_repository_manager.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f2731f3baec8/
Changeset: f2731f3baec8
User: greg
Date: 2013-12-13 16:35:49
Summary: Use tuples to define objects in Galaxy's installed_repository_manager.
Affected #: 7 files
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -66,58 +66,47 @@
# contents (i.e., tool dependencies) require it.
if self.status == self.installation_status.UNINSTALLED:
return False
+ this_repository_tup = ( str( self.tool_shed ),
+ str( self.name ),
+ str( self.owner ),
+ str( self.installed_changeset_revision ) )
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
+ # The repository dependency may have other repository dependencies, but that is not relevant here.
+ single_repository_dependency_tup = None
+ installed_repository_dependency_tups = \
+ irm.installed_repository_dependencies_of_installed_repositories.get( this_repository_tup, [] )
+ # If this repository defines a circular relationship to another repository, then the list of tuples
+ # defining installed repository dependencies will include itself.
+ if len( installed_repository_dependency_tups ) == 2:
+ if this_repository_tup in installed_repository_dependency_tups:
+ # We have a single circular dependency definition, so get the other repository.
+ for installed_repository_dependency_tup in installed_repository_dependency_tups:
+ if installed_repository_dependency_tup != this_repository_tup:
+ single_repository_dependency_tup = installed_repository_dependency_tup
+ break
+ if single_repository_dependency_tup is not None:
+ installed_repository_dependency_tups = \
+ irm.installed_repository_dependencies_of_installed_repositories.get( this_repository_tup, [] )
+ if this_repository_tup in installed_repository_dependency_tups:
+ # 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:
- 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
+ installed_dependent_repositories = \
+ irm.installed_dependent_repositories_of_installed_repositories.get( this_repository_tup, [] )
+ 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.
- 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
+ installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( this_repository_tup, [] )
+ for td_tup in installed_tool_dependencies:
+ installed_dependent_td_tups = irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( td_tup, [] )
+ if installed_dependent_td_tups:
+ # 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
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -17,13 +17,13 @@
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.
+ Among other things, keep in in-memory sets of tuples defining 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
@@ -32,32 +32,35 @@
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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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 tool_shed_repository objects (whose status is 'Installed') that require the key.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_shed_repository objects (whose status is 'Installed')
+ # and whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_dependency objects (whose status is 'Installed') and
+ # whose values are a list of tuples defining 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.
+ # Keep an in-memory dictionary whose keys are tuples defining tool_dependency objects (whose status is 'Installed') and
+ # whose values are a list of tuples defining 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()
@@ -68,101 +71,100 @@
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.
"""
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
# 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 )
+ repository_dependency_tups = \
+ repository_dependency_util.get_repository_dependency_tups_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 ) )
+ if repository_tup not in self.installed_repository_dependencies_of_installed_repositories:
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
debug_msg += "to installed_repository_dependencies_of_installed_repositories."
log.debug( debug_msg )
- 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_repository_dependencies_of_installed_repositories[ repository_tup ] = repository_dependency_tups
+ # Use the repository_dependency_tups 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 ) )
+ for required_repository_tup in repository_dependency_tups:
+ debug_msg = "Appending revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, 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
+ if required_repository_tup in self.installed_dependent_repositories_of_installed_repositories:
+ self.installed_dependent_repositories_of_installed_repositories[ required_repository_tup ].append( repository_tup )
else:
- self.installed_dependent_repositories_of_installed_repositories[ required_repository ] = [ repository ]
+ self.installed_dependent_repositories_of_installed_repositories[ required_repository_tup ] = [ repository_tup ]
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 ) )
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup not in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Adding an entry for version %s of %s %s " % ( version, type, 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
+ installed_runtime_dependent_tool_dependency_tups = \
+ tool_dependency_util.get_runtime_dependent_tool_dependency_tuples( self.app, tool_dependency, status=status )
+ self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] = \
+ installed_runtime_dependent_tool_dependency_tups
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 ) )
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup not in self.installed_tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, 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
+ installed_tool_dependency_tups = []
+ for tool_dependency in repository.tool_dependencies:
+ if tool_dependency.status == self.app.install_model.ToolDependency.installation_status.INSTALLED:
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ installed_tool_dependency_tups.append( tool_dependency_tup )
+ self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] = installed_tool_dependency_tups
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 ) )
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup not in self.repository_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, 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
+ repository_dependency_tups = \
+ repository_dependency_util.get_repository_dependency_tups_for_repository( self.app, repository, status=None )
+ self.repository_dependencies_of_installed_repositories[ repository_tup ] = repository_dependency_tups
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 ) )
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup not in self.runtime_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Adding an entry for version %s of %s %s " % ( version, type, 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
+ runtime_dependent_tool_dependency_tups = \
+ tool_dependency_util.get_runtime_dependent_tool_dependency_tuples( self.app, tool_dependency, status=None )
+ self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ] = \
+ runtime_dependent_tool_dependency_tups
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 ) )
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup not in self.tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Adding an entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
debug_msg += "to tool_dependencies_of_installed_repositories."
log.debug( debug_msg )
- self.tool_dependencies_of_installed_repositories[ repository ] = repository.tool_dependencies
+ tool_dependency_tups = []
+ for tool_dependency in repository.tool_dependencies:
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ tool_dependency_tups.append( tool_dependency_tup )
+ self.tool_dependencies_of_installed_repositories[ repository_tup ] = tool_dependency_tups
- 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_containing_repository_for_tool_dependency( self, tool_dependency_tup ):
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ return self.app.install_model.context.query( self.app.install_model.ToolShedRepository ).get( tool_shed_repository_id )
def get_repository_install_dir( self, tool_shed_repository ):
for tool_config in self.tool_configs:
@@ -176,9 +178,9 @@
relative_path = os.path.join( tool_path,
ts,
'repos',
- tool_shed_repository.owner,
- tool_shed_repository.name,
- tool_shed_repository.installed_changeset_revision )
+ str( tool_shed_repository.owner ),
+ str( tool_shed_repository.name ),
+ str( tool_shed_repository.installed_changeset_revision ) )
if os.path.exists( relative_path ):
return relative_path
return None
@@ -202,19 +204,18 @@
def handle_repository_uninstall( self, repository ):
"""Remove the dependency relationships for a repository that was just uninstalled."""
for tool_dependency in repository.tool_dependencies:
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
# 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 \
+ for td_tup, installed_runtime_dependent_tool_dependency_tups 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 ]
+ if tool_dependency_tup in installed_runtime_dependent_tool_dependency_tups:
# Remove the tool_dependency from the list.
- del installed_runtime_dependent_tool_dependencies[ index ]
+ installed_runtime_dependent_tool_dependency_tups.remove( tool_dependency_tup )
# 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
+ altered_installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies[ td_tup ] = \
+ installed_runtime_dependent_tool_dependency_tups
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.
@@ -239,38 +240,12 @@
# 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_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() ]
-
- @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() ]
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if repository_tup in self.installed_tool_dependencies_of_installed_repositories:
+ self.installed_tool_dependencies_of_installed_repositories[ repository_tup ].append( tool_dependency_tup )
+ else:
+ self.installed_tool_dependencies_of_installed_repositories[ repository_tup ] = [ tool_dependency_tup ]
def load_dependency_relationships( self ):
"""Load relationships for all installed repositories and tool dependencies into in-memnory dictionaries."""
@@ -318,82 +293,76 @@
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:
+ # Remove tuples defining this repository from value lists in self.installed_dependent_repositories_of_installed_repositories.
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ altered_installed_dependent_repositories_of_installed_repositories = {}
+ for r_tup, v_tups in self.installed_dependent_repositories_of_installed_repositories.items():
+ if repository_tup in v_tups:
debug_msg = "Removing entry for revision %s of repository %s owned by %s " % \
- ( str( repository.changeset_revision ), str( repository.name ), str( repository.owner ) )
+ ( installed_changeset_revision, name, owner )
+ r_tool_shed, r_name, r_owner, r_installed_changeset_revision = r_tup
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 ) )
+ ( r_installed_changeset_revision, r_name, 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
+ log.debug( debug_msg )
+ v_tups.remove( repository_tup )
+ altered_installed_dependent_repositories_of_installed_repositories[ r_tup ] = v_tups
+ self.installed_dependent_repositories_of_installed_repositories = \
+ altered_installed_dependent_repositories_of_installed_repositories
# 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 " % \
- ( 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
+ if repository_tup in self.installed_repository_dependencies_of_installed_repositories:
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
+ debug_msg += "from installed_repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.installed_repository_dependencies_of_installed_repositories[ repository_tup ]
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
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup in self.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Removing entry for version %s of %s %s " % ( version, type, 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[ tool_dependency_tup ]
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
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup in self.installed_tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
+ debug_msg += "from installed_tool_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.installed_tool_dependencies_of_installed_repositories[ repository_tup ]
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
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup in self.repository_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s " % ( installed_changeset_revision, name, owner )
+ debug_msg += "from repository_dependencies_of_installed_repositories."
+ log.debug( debug_msg )
+ del self.repository_dependencies_of_installed_repositories[ repository_tup ]
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
+ tool_dependency_tup = tool_dependency_util.get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency )
+ if tool_dependency_tup in self.runtime_tool_dependencies_of_installed_tool_dependencies:
+ tool_shed_repository_id, name, version, type = tool_dependency_tup
+ debug_msg = "Removing entry for version %s of %s %s from runtime_tool_dependencies_of_installed_tool_dependencies." % \
+ ( version, type, name )
+ log.debug( debug_msg )
+ del self.runtime_tool_dependencies_of_installed_tool_dependencies[ tool_dependency_tup ]
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
+ repository_tup = repository_dependency_util.get_repository_tuple_for_installed_repository_manager( repository )
+ if repository_tup in self.tool_dependencies_of_installed_repositories:
+ tool_shed, name, owner, installed_changeset_revision = repository_tup
+ debug_msg = "Removing entry for revision %s of repository %s owned by %s from tool_dependencies_of_installed_repositories." % \
+ ( installed_changeset_revision, name, owner )
+ log.debug( debug_msg )
+ del self.tool_dependencies_of_installed_repositories[ repository_tup ]
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -71,8 +71,8 @@
def get_dependencies_for_repository( trans, tool_shed_url, repo_info_dict, includes_tool_dependencies ):
"""
- Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated with the repository defined
- by the received repo_info_dict.
+ Return dictionaries containing the sets of installed and missing tool dependencies and repository dependencies associated
+ with the repository defined by the received repo_info_dict.
"""
repository = None
installed_rd = {}
@@ -102,7 +102,8 @@
# Discover all repository dependencies and retrieve information for installing them.
all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) )
has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False )
- has_repository_dependencies_only_if_compiling_contained_td = all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
+ has_repository_dependencies_only_if_compiling_contained_td = \
+ all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False )
includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False )
includes_tools = all_repo_info_dict.get( 'includes_tools', False )
@@ -138,7 +139,8 @@
# We have a single repository with (possibly) no defined repository dependencies.
all_repo_info_dict = get_required_repo_info_dicts( trans, tool_shed_url, util.listify( repo_info_dict ) )
has_repository_dependencies = all_repo_info_dict.get( 'has_repository_dependencies', False )
- has_repository_dependencies_only_if_compiling_contained_td = all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
+ has_repository_dependencies_only_if_compiling_contained_td = \
+ all_repo_info_dict.get( 'has_repository_dependencies_only_if_compiling_contained_td', False )
includes_tools_for_display_in_tool_panel = all_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False )
includes_tool_dependencies = all_repo_info_dict.get( 'includes_tool_dependencies', False )
includes_tools = all_repo_info_dict.get( 'includes_tools', False )
@@ -202,8 +204,8 @@
# Get the description from the metadata in case it has a value.
repository_dependencies = metadata.get( 'repository_dependencies', {} )
description = repository_dependencies.get( 'description', None )
- # We need to add a root_key entry to one or both of installed_repository_dependencies dictionary and the missing_repository_dependencies
- # dictionaries for proper display parsing.
+ # We need to add a root_key entry to one or both of installed_repository_dependencies dictionary and the
+ # missing_repository_dependencies dictionaries for proper display parsing.
root_key = container_util.generate_repository_dependencies_key_for_repository( repository.tool_shed,
repository.name,
repository.owner,
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -375,22 +375,32 @@
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 ):
+def get_repository_dependency_tups_for_repository( app, repository, dependency_tups=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.
+ Return a list of of tuples defining tool_shed_repository objects (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 ]
+ if dependency_tups is None:
+ dependency_tups = []
+ repository_tup = get_repository_tuple_for_installed_repository_manager( repository )
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
+ required_repository_tup = get_repository_tuple_for_installed_repository_manager( required_repository )
+ if required_repository_tup == repository_tup:
+ # We have a circular repository dependency relationship, skip this entry.
+ continue
+ if required_repository_tup not in dependency_tups:
+ dependency_tups.append( required_repository_tup )
+ return get_repository_dependency_tups_for_repository( app, required_repository, dependency_tups=dependency_tups )
+ return dependency_tups
+
+def get_repository_tuple_for_installed_repository_manager( repository ):
+ return ( str( repository.tool_shed ),
+ str( repository.name ),
+ str( repository.owner ),
+ str( repository.installed_changeset_revision ) )
def get_updated_changeset_revisions_for_repository_dependencies( trans, key_rd_dicts ):
updated_key_rd_dicts = []
@@ -402,9 +412,10 @@
if suc.tool_shed_is_this_tool_shed( rd_toolshed ):
repository = suc.get_repository_by_name_and_owner( trans.app, rd_name, rd_owner )
if repository:
- repository_metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
- trans.security.encode_id( repository.id ),
- rd_changeset_revision )
+ repository_metadata = \
+ metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
+ trans.security.encode_id( repository.id ),
+ rd_changeset_revision )
if repository_metadata:
# The repository changeset_revision is installable, so no updates are available.
new_key_rd_dict = {}
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -200,30 +200,6 @@
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
@@ -322,6 +298,31 @@
env_sh_file_path = os.path.join( env_sh_file_dir, 'env.sh' )
return env_sh_file_path
+def get_runtime_dependent_tool_dependency_tuples( 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_dependency_tups = []
+ 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:
+ td_tuple = get_tool_dependency_tuple_for_installed_repository_manager( td )
+ runtime_dependent_tool_dependency_tups.append( td_tuple )
+ return runtime_dependent_tool_dependency_tups
+
def get_tool_dependency( trans, id ):
"""Get a tool_dependency from the database via id"""
return trans.install_model.context.query( trans.install_model.ToolDependency ).get( trans.security.decode_id( id ) )
@@ -386,6 +387,13 @@
repository_name,
repository_changeset_revision ) )
+def get_tool_dependency_tuple_for_installed_repository_manager( tool_dependency ):
+ if tool_dependency.type is None:
+ type = None
+ else:
+ type = str( tool_dependency.type )
+ return ( tool_dependency.tool_shed_repository_id, str( tool_dependency.name ), str( tool_dependency.version ), type )
+
def handle_tool_dependency_installation_error( app, tool_dependency, error_message, remove_installation_path=False ):
# Since there was an installation error, remove the installation directory because the install_package method uses
# this: "if os.path.exists( install_dir ):". Setting remove_installation_path to True should rarely occur. It is
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -54,32 +54,27 @@
%endif
%if not can_uninstall_repository:
<%
+ from tool_shed.util.repository_dependency_util import get_repository_tuple_for_installed_repository_manager
+ from tool_shed.util.tool_dependency_util import get_tool_dependency_tuple_for_installed_repository_manager
+
irm = trans.app.installed_repository_manager
+ repository_tup = get_repository_tuple_for_installed_repository_manager( repository )
# Get installed repositories that this repository requires.
installed_dependent_repositories = []
installed_runtime_dependent_tool_dependencies = []
- for r in irm.installed_dependent_repositories_of_installed_repositories:
- if r.id == repository.id:
- installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories[ r ]
- break
+ installed_dependent_repositories = irm.installed_dependent_repositories_of_installed_repositories.get( repository_tup, [] )
# 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
+ installed_tool_dependencies = irm.installed_tool_dependencies_of_installed_repositories.get( repository_tup, [] )
# 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 )
+ for itd_tup in installed_tool_dependencies:
+ installed_dependent_td_tups = \
+ irm.installed_runtime_dependent_tool_dependencies_of_installed_tool_dependencies.get( itd_tup, [] )
+ if installed_dependent_td_tups:
+ installed_runtime_dependent_tool_dependencies.extend( installed_dependent_td_tups )
%>
%if installed_dependent_repositories or installed_runtime_dependent_tool_dependencies:
<table width="100%" border="0" cellpadding="0" cellspacing="0">
@@ -92,29 +87,28 @@
%if installed_dependent_repositories:
<label>Dependent repositories:</label><ul>
- %for installed_dependent_repository in installed_dependent_repositories:
+ %for installed_dependent_repository_tup in installed_dependent_repositories:
<%
- changeset_revision = installed_dependent_repository.changeset_revision
- name = installed_dependent_repository.name
- owner = installed_dependent_repository.owner
+ tool_shed, name, owner, installed_changeset_revision, status = installed_dependent_repository_tup
%>
- <li>Revision <b>${ changeset_revision | h}</b> of repository <b>${name | h}</b> owned by <b>${owner | h}</b></li>
+ <li>Revision <b>${ installed_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:
+ %for td_tup in installed_runtime_dependent_tool_dependencies:
<%
- containing_repository = irm.get_containing_repository_for_tool_dependency( td )
+ tool_shed_repository_id, name, version, type, status = td_tup
+ containing_repository = irm.get_containing_repository_for_tool_dependency( td_tup )
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>
+ Version <b>${version | h}</b> of ${type | h} <b>${name | h}</b> contained in revision
+ <b>${changeset_revision | h}</b> of repository <b>${repository_name | h}</b> owned by <b>${owner | h}</b></li>
%endfor
</ul>
diff -r 9fa11fc0e2751d232dcf09265d778a6e221c756f -r f2731f3baec83e5ebf038ac703164b3f4ee53a72 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
@@ -30,7 +30,6 @@
<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>
- <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a>
%if repository.can_reset_metadata:
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='reset_repository_metadata', id=trans.security.encode_id( repository.id ) )}">Reset repository metadata</a>
%endif
@@ -42,6 +41,7 @@
%endif
<a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
%endif
+ <a class="action-button" target="galaxy_main" href="${h.url_for( controller='admin_toolshed', action='repair_repository', id=trans.security.encode_id( repository.id ) )}">Repair repository</a></div></ul></%def>
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: jgoecks: Improve language for workflow outputs tooltip.
by commits-noreply@bitbucket.org 13 Dec '13
by commits-noreply@bitbucket.org 13 Dec '13
13 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/9fa11fc0e275/
Changeset: 9fa11fc0e275
User: jgoecks
Date: 2013-12-13 16:00:20
Summary: Improve language for workflow outputs tooltip.
Affected #: 1 file
diff -r b3eeedb81a1e0db8d643af0cbba68f55eb49cdb0 -r 9fa11fc0e2751d232dcf09265d778a6e221c756f static/scripts/galaxy.workflow_editor.canvas.js
--- a/static/scripts/galaxy.workflow_editor.canvas.js
+++ b/static/scripts/galaxy.workflow_editor.canvas.js
@@ -360,7 +360,7 @@
workflow.has_changes = true;
canvas_manager.draw_overview();
})))
- .tooltip({delay:500, title: "Flag this as a workflow output. All non-flagged outputs will be hidden." });
+ .tooltip({delay:500, title: "Mark dataset as a workflow output. All unmarked datasets will be hidden." });
callout.css({
top: '50%',
margin:'-8px 0px 0px 0px',
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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e3fe8dd26c25/
Changeset: e3fe8dd26c25
User: jmchilton
Date: 2013-12-13 06:24:15
Summary: casperjs: PEP-8 fixes for casperjs_runner.py.
Affected #: 1 file
diff -r e307768aa1f3a05b4222900df1047bf5d1488003 -r e3fe8dd26c2541d89126a783b954727ef277f620 test/casperjs/casperjs_runner.py
--- a/test/casperjs/casperjs_runner.py
+++ b/test/casperjs/casperjs_runner.py
@@ -18,7 +18,7 @@
import sys
( major, minor, micro, releaselevel, serial ) = sys.version_info
if minor < 6:
- msg = 'casperjs requires python 2.6 or newer. Using: %s' %( sys.version )
+ msg = 'casperjs requires python 2.6 or newer. Using: %s' % ( sys.version )
try:
# if nose is installed do a skip test
from nose.plugins.skip import SkipTest
@@ -36,7 +36,6 @@
import unittest
from server_env import TestEnvironment
-import pprint
import logging
logging.basicConfig( stream=sys.stderr, name=__name__ )
log = logging.getLogger( __name__ )
@@ -50,12 +49,14 @@
better way to turn debugging on from the environment
"""
+
# ====================================================================
class HeadlessJSJavascriptError( Exception ):
"""An error that occurrs in the javascript test file.
"""
pass
+
class CasperJSTestCase( unittest.TestCase ):
"""Casper tests running in a unittest framework.
"""
@@ -76,7 +77,7 @@
casper_done_str = '# Stopping'
# convert js test results to unittest.TestResults
- results_adapter = None #CasperJsonToUnittestResultsConverter()
+ results_adapter = None # CasperJsonToUnittestResultsConverter()
# ---------------------------------------------------------------- run the js script
def run_js_script( self, rel_script_path, *args, **kwargs ):
@@ -166,14 +167,14 @@
"""Converts the headless' error from JSON into a more informative
python HeadlessJSJavascriptError.
"""
- get_error = lambda d: d[ 'errors' ][0]
- get_msg = lambda err: err[ 'msg' ]
- get_trace = lambda err: err[ 'backtrace' ]
+ get_error = lambda d: d[ 'errors' ][0]
+ get_msg = lambda err: err[ 'msg' ]
+ get_trace = lambda err: err[ 'backtrace' ]
try:
# assume it's json and located in errors (and first)
js_test_results = json.loads( stdout_output )
last_error = get_error( js_test_results )
- err_string = ( "%s\n%s" %( get_msg( last_error ),
+ err_string = ( "%s\n%s" % ( get_msg( last_error ),
self.browser_backtrace_to_string( get_trace( last_error ) ) ) )
# if we couldn't parse json from what's returned on the error, dump stdout
@@ -187,7 +188,7 @@
except Exception, exc:
log.debug( '(failed to parse error returned from %s: %s)', _PATH_TO_HEADLESS, str( exc ) )
return HeadlessJSJavascriptError(
- "ERROR in headless browser script %s" %( script_path ) )
+ "ERROR in headless browser script %s" % ( script_path ) )
# otherwise, raise with msg and backtrace
return HeadlessJSJavascriptError( err_string )
@@ -196,10 +197,10 @@
"""Converts list of trace dictionaries (as might be returned from
json results) to a string similar to a python backtrace.
"""
- template = ' File "%s", line %s, in %s'
+ template = ' File "%s", line %s, in %s'
traces = []
for trace in backtrace:
- traces.append( template %( trace[ 'file' ], trace[ 'line' ], trace[ 'function' ] ) )
+ traces.append( template % ( trace[ 'file' ], trace[ 'line' ], trace[ 'function' ] ) )
return '\n'.join( traces )
# ---------------------------------------------------------------- results
@@ -216,7 +217,7 @@
js_test_results = json.loads( results )
failures = js_test_results[ 'testResults' ][ 'failures' ]
assert len( failures ) == 0, (
- "%d assertions failed in the headless browser tests" %( len( failures ) )
+ "%d assertions failed in the headless browser tests" % ( len( failures ) )
+ " (see the log for details)" )
# ---------------------------------------------------------------- TestCase overrides
@@ -247,7 +248,7 @@
"""
results_dict = json.loads( json_results )
failures = results_dict[ 'testResults' ][ 'failures' ]
- passes = results_dict[ 'testResults' ][ 'passes' ]
+ passes = results_dict[ 'testResults' ][ 'passes' ]
self.add_json_failures_to_results( failures, test )
self.add_json_successes_to_results( passes, test )
@@ -271,11 +272,11 @@
"""
#TODO: this is all too elaborate
fail_type = casper_failure[ 'type' ]
- values = json.dumps( casper_failure[ 'values' ] )
- desc = casper_failure[ 'standard' ]
+ values = json.dumps( casper_failure[ 'values' ] )
+ desc = casper_failure[ 'standard' ]
if 'messgae' in casper_failure:
- desc = capser_failure[ 'message' ]
- failure_msg = "(%s) %s: %s" %( fail_type, desc, values )
+ desc = casper_failure[ 'message' ]
+ failure_msg = "(%s) %s: %s" % ( fail_type, desc, values )
#TODO: tb is empty ([]) - can we get file info from casper, covert to py trace?
return ( failure_class, failure_msg, [] )
@@ -295,6 +296,7 @@
def setup_module():
log.debug( '\n--------------- setting up module' )
+
def teardown_module():
log.debug( '\n--------------- tearing down module' )
@@ -304,6 +306,7 @@
'password': '123456'
}
+
# ==================================================================== TESTCASE EXAMPLE
# these could be broken out into other py files - shouldn't be necc. ATM
class Test_01_User( CasperJSTestCase ):
https://bitbucket.org/galaxy/galaxy-central/commits/4f2a368ff1ab/
Changeset: 4f2a368ff1ab
User: jmchilton
Date: 2013-12-13 06:24:15
Summary: casperjs: Fixes for admin checking.
Masthead link changed in recent commit. Tweak config file parsing to handle spaces between e-mail addresses.
Affected #: 2 files
diff -r e3fe8dd26c2541d89126a783b954727ef277f620 -r 4f2a368ff1ab2739c396f4e56e29d8664806dc0b test/casperjs/modules/user.js
--- a/test/casperjs/modules/user.js
+++ b/test/casperjs/modules/user.js
@@ -207,7 +207,7 @@
// check for the setting in sg and the universe_wsgi.ini file
var adminData = this.spaceghost.options.adminUser,
iniAdminEmails = this.spaceghost.getUniverseSetting( 'admin_users' );
- iniAdminEmails = ( iniAdminEmails )?( iniAdminEmails.split( ',' ) ):( null );
+ iniAdminEmails = ( iniAdminEmails )?( iniAdminEmails.split( ',' ).map( function( email ) { return email.trim(); } ) ):( null );
//TODO: seems like we only need the wsgi setting - that's the only thing we can't change
if( adminData ){
diff -r e3fe8dd26c2541d89126a783b954727ef277f620 -r 4f2a368ff1ab2739c396f4e56e29d8664806dc0b test/casperjs/spaceghost.js
--- a/test/casperjs/spaceghost.js
+++ b/test/casperjs/spaceghost.js
@@ -1129,7 +1129,7 @@
},
masthead : {
- adminLink : '#masthead a[href="/admin"]',
+ adminLink : '#masthead a[href="/admin/index"]',
userMenu : {
userEmail : 'a #user-email',
userEmail_xpath : '//a[contains(text(),"Logged in as")]/span["id=#user-email"]'
https://bitbucket.org/galaxy/galaxy-central/commits/b3eeedb81a1e/
Changeset: b3eeedb81a1e
User: jmchilton
Date: 2013-12-13 06:24:15
Summary: casperjs: Add some notes.
Affected #: 1 file
diff -r 4f2a368ff1ab2739c396f4e56e29d8664806dc0b -r b3eeedb81a1e0db8d643af0cbba68f55eb49cdb0 test/casperjs/casperjs_runner.py
--- a/test/casperjs/casperjs_runner.py
+++ b/test/casperjs/casperjs_runner.py
@@ -13,6 +13,16 @@
* casperjs usertests.js --url='http://localhost:8080' --verbose=true --logLevel=debug
(see casperjs.org for more information)
+
+Note: This seems to not work with CasperJS 1.1 (and PhantomJS 1.9) - Casper 1.0.xx and
+PhantomJS 1.8 work for me (John).
+
+Note: Example of specifing user and admin user credentials.
+
+casperjs api-configuration-tests.js --url="http://localhost:8080" \
+ --admin='{"email": "foo(a)example.com", "password": "123456" }' \
+ '{ "testUser": { "email": "foo(a)example.com", "password": "123456" } }'
+
"""
# -------------------------------------------------------------------- can't do 2.5
import sys
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 panel: persist open state of search, tag, and annotation UIs
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/e307768aa1f3/
Changeset: e307768aa1f3
User: carlfeberhard
Date: 2013-12-12 23:10:30
Summary: History panel: persist open state of search, tag, and annotation UIs
Affected #: 2 files
diff -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 -r e307768aa1f3a05b4222900df1047bf5d1488003 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -7,9 +7,32 @@
// ============================================================================
+/** session storage for history panel preferences (and to maintain state)
+ */
+var HistoryPanelPrefs = SessionStorageModel.extend({
+ defaults : {
+ /** is the panel currently showing the search/filter controls? */
+ searching : false,
+ /** should the tags editor be shown or hidden initially? */
+ tagsEditorShown : false,
+ /** should the annotation editor be shown or hidden initially? */
+ annotationEditorShown : false
+ },
+ toString : function(){
+ return 'HistoryPanelPrefs(' + JSON.stringify( this.toJSON() ) + ')';
+ }
+});
+
+/** key string to store panel prefs (made accessible on class so you can access sessionStorage directly) */
+HistoryPanelPrefs.storageKey = function storageKey(){
+ return ( 'history-panel' );
+};
+
+
+// ============================================================================
/** session storage for individual history preferences
*/
-var HistoryPanelPrefs = SessionStorageModel.extend({
+var HistoryPrefs = SessionStorageModel.extend({
defaults : {
//TODO:?? expandedHdas to array?
expandedHdas : {},
@@ -27,15 +50,15 @@
this.save( 'expandedHdas', _.omit( this.get( 'expandedHdas' ), id ) );
},
toString : function(){
- return 'HistoryPanelPrefs(' + this.id + ')';
+ return 'HistoryPrefs(' + this.id + ')';
}
});
/** key string to store each histories settings under */
-HistoryPanelPrefs.historyStorageKey = function historyStorageKey( historyId ){
+HistoryPrefs.historyStorageKey = function historyStorageKey( historyId ){
// class lvl for access w/o instantiation
if( !historyId ){
- throw new Error( 'HistoryPanelPrefs.historyStorageKey needs valid id: ' + historyId );
+ throw new Error( 'HistoryPrefs.historyStorageKey needs valid id: ' + historyId );
}
// single point of change
return ( 'history:' + historyId );
@@ -109,28 +132,30 @@
this.log( this + '.initialize:', attributes );
// ---- set up instance vars
+ // control contents/behavior based on where (and in what context) the panel is being used
/** which backbone view class to use when displaying the hda list */
this.HDAViewClass = attributes.HDAViewClass || this.defaultHDAViewClass;
/** where should pages from links be displayed? (default to new tab/window) */
this.linkTarget = attributes.linkTarget || '_blank';
+ // ---- sub views and saved elements
/** map of hda model ids to hda views */
this.hdaViews = {};
/** loading indicator */
this.indicator = new LoadingIndicator( this.$el );
+ // ---- persistent state and preferences
+ /** maintain state / preferences over page loads */
+ this.preferences = new HistoryPanelPrefs( _.extend({
+ id : HistoryPanelPrefs.storageKey()
+ }, _.pick( attributes, _.keys( HistoryPanelPrefs.prototype.defaults ) )));
+
/** filters for displaying hdas */
this.filters = [];
-//TODO: move to storage and persist
- /** is the panel currently showing the search/filter controls? */
- this.searching = attributes.searching || false;
+ // states/modes the panel can be in
/** is the panel currently showing the dataset selection controls? */
this.selecting = attributes.selecting || false;
-
- /** should the tags editor be shown or hidden initially? */
- this.tagsEditorShown = attributes.tagsShown || false;
- /** should the tags editor be shown or hidden initially? */
this.annotationEditorShown = attributes.annotationEditorShown || false;
this._setUpListeners();
@@ -397,8 +422,8 @@
*/
_setUpWebStorage : function( initiallyExpanded, show_deleted, show_hidden ){
//console.debug( '_setUpWebStorage', initiallyExpanded, show_deleted, show_hidden );
- this.storage = new HistoryPanelPrefs({
- id: HistoryPanelPrefs.historyStorageKey( this.model.get( 'id' ) )
+ this.storage = new HistoryPrefs({
+ id: HistoryPrefs.historyStorageKey( this.model.get( 'id' ) )
});
// expanded Hdas is a map of hda.ids -> a boolean repr'ing whether this hda's body is already expanded
@@ -436,7 +461,7 @@
return ( this.storage )?( this.storage.get() ):( {} );
}
//TODO: make storage engine generic
- var item = sessionStorage.getItem( HistoryPanelPrefs.historyStorageKey( historyId ) );
+ var item = sessionStorage.getItem( HistoryPrefs.historyStorageKey( historyId ) );
return ( item === null )?( {} ):( JSON.parse( item ) );
},
@@ -525,6 +550,7 @@
panel.$el.empty();
if( $newRender ){
panel.$el.append( $newRender.children() );
+ panel.renderBasedOnPrefs();
}
next();
},
@@ -581,6 +607,12 @@
return $newRender;
},
+ renderBasedOnPrefs : function(){
+ if( this.preferences.get( 'searching' ) ){
+ this.showSearchControls( 0 );
+ }
+ },
+
_renderTags : function( $where ){
var panel = this;
this.tagsEditor = new TagsEditor({
@@ -589,11 +621,11 @@
onshowFirstTime : function(){ this.render(); },
// show hide hda view tag editors when this is shown/hidden
onshow : function(){
- panel.tagsEditorShown = true;
+ panel.preferences.set( 'tagsEditorShown', true );
panel.toggleHDATagEditors( true, panel.fxSpeed );
},
onhide : function(){
- panel.tagsEditorShown = false;
+ panel.preferences.set( 'tagsEditorShown', false );
panel.toggleHDATagEditors( false, panel.fxSpeed );
},
$activator : faIconButton({
@@ -602,6 +634,9 @@
faIcon : 'fa-tags'
}).appendTo( $where.find( '.history-secondary-actions' ) )
});
+ if( this.preferences.get( 'tagsEditorShown' ) ){
+ this.tagsEditor.toggle( true );
+ }
},
_renderAnnotation : function( $where ){
var panel = this;
@@ -611,11 +646,11 @@
onshowFirstTime : function(){ this.render(); },
// show hide hda view annotation editors when this is shown/hidden
onshow : function(){
- panel.annotationEditorShown = true;
+ panel.preferences.set( 'annotationEditorShown', true );
panel.toggleHDAAnnotationEditors( true, panel.fxSpeed );
},
onhide : function(){
- panel.annotationEditorShown = false;
+ panel.preferences.set( 'annotationEditorShown', false );
panel.toggleHDAAnnotationEditors( false, panel.fxSpeed );
},
$activator : faIconButton({
@@ -624,6 +659,9 @@
faIcon : 'fa-comment'
}).appendTo( $where.find( '.history-secondary-actions' ) )
});
+ if( this.preferences.get( 'annotationEditorShown' ) ){
+ this.annotationEditor.toggle( true );
+ }
},
/** button for opening search */
_renderSearchButton : function( $where ){
@@ -759,8 +797,8 @@
linkTarget : this.linkTarget,
expanded : expanded,
//draggable : true,
- tagsEditorShown : this.tagsEditorShown,
- annotationEditorShown : this.annotationEditorShown,
+ tagsEditorShown : this.preferences.get( 'tagsEditorShown' ),
+ annotationEditorShown : this.preferences.get( 'annotationEditorShown' ),
selectable : this.selecting,
hasUser : this.model.ownedByCurrUser(),
logger : this.logger
@@ -979,22 +1017,38 @@
onclear : onSearchClear
});
},
-
- /** toggle showing/hiding the search controls (rendering first on the initial show) */
- toggleSearchControls : function(){
- var $searchControls = this.$el.find( '.history-search-controls' );
+//TODO: to hidden/shown plugin
+ showSearchControls : function( speed ){
+ speed = ( speed === undefined )?( this.fxSpeed ):( speed );
+ var panel = this,
+ $searchControls = this.$el.find( '.history-search-controls' );
+ // if it hasn't been rendered - do it now
if( !$searchControls.children().size() ){
$searchControls = this.renderSearchControls( $searchControls ).hide();
}
- $searchControls.slideToggle( this.fxSpeed, function(){
- if( $( this ).is( ':visible' ) ){
- this.searching = true;
- $( this ).find( 'input' ).focus();
- } else {
- this.searching = false;
- }
+ // then slide open, focusing on the input, and persisting the setting when it's done
+ $searchControls.show( speed, function(){
+ $( this ).find( 'input' ).focus();
+ panel.preferences.set( 'searching', true );
});
},
+ hideSearchControls : function(){
+ speed = ( speed === undefined )?( this.fxSpeed ):( speed );
+ var panel = this;
+ this.$el.find( '.history-search-controls' ).hide( speed, function(){
+ panel.preferences.set( 'searching', false );
+ });
+ },
+
+ /** toggle showing/hiding the search controls (rendering first on the initial show) */
+ toggleSearchControls : function( eventOrSpeed ){
+ speed = ( jQuery.type( eventOrSpeed ) === 'number' )?( eventOrSpeed ):( this.fxSpeed );
+ if( this.$el.find( '.history-search-controls' ).is( ':visible' ) ){
+ this.hideSearchControls( speed );
+ } else {
+ this.showSearchControls( speed );
+ }
+ },
// ........................................................................ multi-select of hdas
showSelectors : function( speed ){
diff -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 -r e307768aa1f3a05b4222900df1047bf5d1488003 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(g,d,b,a){var c=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(h){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([h],[true])))},removeExpandedHda:function(h){this.save("expandedHdas",_.omit(this.get("expandedHdas"),h))},toString:function(){return"HistoryPanelPrefs("+this.id+")"}});c.historyStorageKey=function f(h){if(!h){throw new Error("HistoryPanelPrefs.historyStorageKey needs valid id: "+h)}return("history:"+h)};var e=Backbone.View.extend(LoggableMixin).extend({defaultHDAViewClass:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(h){h=h||{};if(h.logger){this.logger=h.logger}this.log(this+".initialize:",h);this.HDAViewClass=h.HDAViewClass||this.defaultHDAViewClass;this.linkTarget=h.linkTarget||"_blank";this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];this.searching=h.searching||false;this.selecting=h.selecting||false;this.tagsEditorShown=h.tagsShown||false;this.annotationEditorShown=h.annotationEditorShown||false;this._setUpListeners();if(this.model){this._setUpWebStorage(h.initiallyExpanded,h.show_deleted,h.show_hidden);this._setUpModelEventHandlers()}if(h.onready){h.onready.call(this)}},_setUpListeners:function(){this.on("error",function(i,l,h,k,j){this.errorHandler(i,l,h,k,j)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(h){this.log(this+"",arguments)},this)}},errorHandler:function(j,m,i,l,k){var h=this._parseErrorMessage(j,m,i,l,k);if(m&&m.status===0&&m.readyState===0){}else{if(m&&m.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",h.message,h.details)})}else{this.displayMessage("error",h.message,h.details)}}}},_parseErrorMessage:function(k,o,j,n,m){var i=Galaxy.currUser,h={message:this._bePolite(n),details:{user:(i instanceof User)?(i.toJSON()):(i+""),source:(k instanceof Backbone.Model)?(k.toJSON()):(k+""),xhr:o,options:(o)?(_.omit(j,"xhr")):(j)}};_.extend(h.details,m||{});if(o&&_.isFunction(o.getAllResponseHeaders)){var l=o.getAllResponseHeaders();l=_.compact(l.split("\n"));l=_.map(l,function(p){return p.split(": ")});h.details.xhr.responseHeaders=_.object(l)}return h},_bePolite:function(h){h=h||_l("An error occurred while getting updates from the server");return h+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(i){var h=this;return this.loadHistoryWithHDADetails("current",i).then(function(k,j){h.trigger("current-history",h)})},switchToHistory:function(k,j){var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories/"+k+"/set_as_current")};return this.loadHistoryWithHDADetails(k,j,i).then(function(m,l){h.trigger("switched-history",h)})},createNewHistory:function(j){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,j,i).then(function(l,k){h.trigger("new-history",h)})},loadHistoryWithHDADetails:function(k,j,i,m){var h=this,l=function(n){return h.getExpandedHdaIds(n.id)};return this.loadHistory(k,j,i,m,l)},loadHistory:function(k,j,i,n,l){this.trigger("loading-history",this);j=j||{};var h=this;var m=g.History.getHistoryData(k,{historyFn:i,hdaFn:n,hdaDetailIds:j.initiallyExpanded||l});return this._loadHistoryFromXHR(m,j).fail(function(q,o,p){h.trigger("error",h,q,j,_l("An error was encountered while "+o),{historyId:k,history:p||{}})}).always(function(){h.trigger("loading-done",h)})},_loadHistoryFromXHR:function(j,i){var h=this;j.then(function(k,l){h.setModel(k,l,i)});j.fail(function(l,k){h.render()});return j},setModel:function(j,h,i){i=i||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){j.user=Galaxy.currUser.toJSON()}this.model=new g.History(j,h,i);this._setUpWebStorage(i.initiallyExpanded,i.show_deleted,i.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(i,h,j){this.storage=new c({id:c.historyStorageKey(this.model.get("id"))});if(_.isObject(i)){this.storage.set("exandedHdas",i)}if(_.isBoolean(h)){this.storage.set("show_deleted",h)}if(_.isBoolean(j)){this.storage.set("show_hidden",j)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var h in sessionStorage){if(h.indexOf("history:")===0){sessionStorage.removeItem(h)}}},getStoredOptions:function(i){if(!i||i==="current"){return(this.storage)?(this.storage.get()):({})}var h=sessionStorage.getItem(c.historyStorageKey(i));return(h===null)?({}):(JSON.parse(h))},getExpandedHdaIds:function(h){var i=this.getStoredOptions(h).expandedHdas;return((_.isEmpty(i))?([]):(_.keys(i)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(i,k,h,j){this.errorHandler(i,k,h,j)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(h){this.model.fetch()},this);this.model.hdas.on("state:ready",function(i,j,h){if((!i.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[i.id])}},this)},render:function(j,k){j=(j===undefined)?(this.fxSpeed):(j);var h=this,i;if(this.model){i=this.renderModel()}else{i=this.renderWithoutModel()}$(h).queue("fx",[function(l){if(j&&h.$el.is(":visible")){h.$el.fadeOut(j,l)}else{l()}},function(l){h.$el.empty();if(i){h.$el.append(i.children())}l()},function(l){if(j&&!h.$el.is(":visible")){h.$el.fadeIn(j,l)}else{l()}},function(l){if(k){k.call(this)}h.trigger("rendered",this);l()}]);return this},renderWithoutModel:function(){var h=$("<div/>"),i=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return h.append(i)},renderModel:function(){var h=$("<div/>");if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){h.append(e.templates.anonHistoryPanel(this.model.toJSON()))}else{h.append(e.templates.historyPanel(this.model.toJSON()));if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(h);this._renderAnnotation(h)}}h.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(h);this.renderHdas(h);return h},_renderTags:function(h){var i=this;this.tagsEditor=new TagsEditor({model:this.model,el:h.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.tagsEditorShown=true;i.toggleHDATagEditors(true,i.fxSpeed)},onhide:function(){i.tagsEditorShown=false;i.toggleHDATagEditors(false,i.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".history-secondary-actions"))})},_renderAnnotation:function(h){var i=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:h.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.annotationEditorShown=true;i.toggleHDAAnnotationEditors(true,i.fxSpeed)},onhide:function(){i.annotationEditorShown=false;i.toggleHDAAnnotationEditors(false,i.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".history-secondary-actions"))})},_renderSearchButton:function(h){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_renderSelectButton:function(h){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(h){h=h||this.$el;h.find("[title]").tooltip({placement:"bottom"});if((!this.model)||(!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var i=this;h.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(j){h.find(".history-name").text(j);i.model.save({name:j}).fail(function(){h.find(".history-name").text(i.model.previous("name"))})}});this._setUpDatasetActionsPopup(h)},_setUpDatasetActionsPopup:function(h){var i=this;(new PopupMenu(h.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.hide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Unhide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.unhide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Delete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype["delete"];i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Undelete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.undelete;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var j=d.HistoryDatasetAssociation.prototype.purge;i.getSelectedHdaCollection().ajaxQueue(j)}}}]))},refreshHdas:function(i,h){if(this.model){return this.model.refresh(i,h)}return $.when()},addHdaView:function(k){this.log("add."+this,k);var i=this;if(!k.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function j(m){var l=i.$el.find(i.emptyMsgSelector);if(l.is(":visible")){l.fadeOut(i.fxSpeed,m)}else{m()}},function h(m){i.scrollToTop();var l=i.$el.find(i.datasetsSelector);i.createHdaView(k).$el.hide().prependTo(l).slideDown(i.fxSpeed)}])},createHdaView:function(j){var i=j.get("id"),h=this.storage.get("expandedHdas")[i],k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:h,tagsEditorShown:this.tagsEditorShown,annotationEditorShown:this.annotationEditorShown,selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(k);this.hdaViews[i]=k;return k.render()},_setUpHdaListeners:function(i){var h=this;i.on("body-expanded",function(j){h.storage.addExpandedHda(j)});i.on("body-collapsed",function(j){h.storage.removeExpandedHda(j)});i.on("error",function(k,m,j,l){h.errorHandler(k,m,j,l)})},handleHdaDeletionChange:function(h){if(h.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[h.id])}},handleHdaVisibleChange:function(h){if(h.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[h.id])}},removeHdaView:function(i){if(!i){return}var h=this;i.$el.fadeOut(h.fxSpeed,function(){i.off();i.remove();delete h.hdaViews[i.model.id];if(_.isEmpty(h.hdaViews)){h.$el.find(h.emptyMsgSelector).fadeIn(h.fxSpeed,function(){h.trigger("empty-history",h)})}})},renderHdas:function(j){j=j||this.$el;this.hdaViews={};var i=this,h=j.find(this.datasetsSelector),k=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);h.empty();if(k.length){k.each(function(l){h.prepend(i.createHdaView(l).$el)});j.find(this.emptyMsgSelector).hide()}else{j.find(this.emptyMsgSelector).show()}return this.hdaViews},toggleHDATagEditors:function(){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(h){var i=arguments;_.each(this.hdaViews,function(j){if(j.annotationEditor){j.annotationEditor.toggle.apply(j.annotationEditor,i)}})},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls","click .history-select-btn":function(h){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(h){h.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},renderSearchControls:function(i){var j=this;function l(m){j.searchFor=m;j.filters=[function(n){return n.matchesAll(j.searchFor)}];j.trigger("search:searching",m,j);j.renderHdas()}function h(m){if(j.model.hdas.haveDetails()){l(m);return}j.$el.find(".history-search-controls").searchInput("toggle-loading");j.model.hdas.fetchAllDetails({silent:true}).always(function(){j.$el.find(".history-search-controls").searchInput("toggle-loading")}).done(function(){l(m)})}function k(){j.searchFor="";j.filters=[];j.trigger("search:clear",j);j.renderHdas()}return i.searchInput({initialVal:j.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:h,onsearch:l,onclear:k})},toggleSearchControls:function(){var h=this.$el.find(".history-search-controls");if(!h.children().size()){h=this.renderSearchControls(h).hide()}h.slideToggle(this.fxSpeed,function(){if($(this).is(":visible")){this.searching=true;$(this).find("input").focus()}else{this.searching=false}})},showSelectors:function(h){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(h);_.each(this.hdaViews,function(i){i.showSelector(h)})},hideSelectors:function(h){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(h);_.each(this.hdaViews,function(i){i.hideSelector(h)})},toggleSelectors:function(h){if(!this.selecting){this.showSelectors(h)}else{this.hideSelectors(h)}},selectAllDatasets:function(i){var h=this.$el.find(".history-select-all-datasets-btn");currMode=h.data("mode");if(currMode==="select"){_.each(this.hdaViews,function(j){j.select(i)});h.data("mode","deselect");h.text(_l("De-select all"))}else{if(currMode==="deselect"){_.each(this.hdaViews,function(j){j.deselect(i)});h.data("mode","select");h.text(_l("Select all"))}}},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(h){return h.selected})},getSelectedHdaCollection:function(){return new d.HDACollection(_.map(this.getSelectedHdaViews(),function(h){return h.model}),{historyId:this.model.id})},showLoadingIndicator:function(i,h,j){h=(h!==undefined)?(h):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,j)}else{this.$el.fadeOut(h);this.indicator.show(i,h,j)}},hideLoadingIndicator:function(h,i){h=(h!==undefined)?(h):(this.fxSpeed);if(this.indicator){this.indicator.hide(h,i)}},displayMessage:function(m,n,l){var j=this;this.scrollToTop();var k=this.$el.find(this.msgsSelector),h=$("<div/>").addClass(m+"message").html(n);if(!_.isEmpty(l)){var i=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(j.messageToModalOptions(m,n,l));return false});h.append(" ",i)}return k.html(h)},messageToModalOptions:function(l,n,k){var h=this,m=$("<div/>"),j={title:"Details"};function i(o){o=_.omit(o,_.functions(o));return["<table>",_.map(o,function(q,p){q=(_.isObject(q))?(i(q)):(q);return'<tr><td style="vertical-align: top; color: grey">'+p+'</td><td style="padding-left: 8px">'+q+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(k)){j.body=m.append(i(k))}else{j.body=m.html(k)}j.buttons={Ok:function(){Galaxy.modal.hide();h.clearMessages()}};return j},clearMessages:function(){var h=this.$el.find(this.msgsSelector);h.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(h){this.$el.parent().scrollTop(h)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(i,j){if(!j){this.$el.parent().parent().scrollTop(i);return this}var h=window,k=this.$el.parent().parent(),m=$(h).innerHeight(),l=(m/2)-(j/2);$(k).scrollTop(i-l);return this},scrollToId:function(i){if((!i)||(!this.hdaViews[i])){return this}var h=this.hdaViews[i].$el;this.scrollIntoView(h.offset().top,h.outerHeight());return this},scrollToHid:function(h){var i=this.model.hdas.getByHid(h);if(!i){return this}return this.scrollToId(i.id)},connectToQuotaMeter:function(h){if(!h){return this}this.listenTo(h,"quota:over",this.showQuotaMessage);this.listenTo(h,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(h&&h.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var h=this.$el.find(".quota-message");if(h.is(":hidden")){h.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var h=this.$el.find(".quota-message");if(!h.is(":hidden")){h.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(h){if(!h){return this}this.on("new-storage",function(j,i){if(h&&j){h.findItemByHtml(_l("Include Deleted Datasets")).checked=j.get("show_deleted");h.findItemByHtml(_l("Include Hidden Datasets")).checked=j.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});e.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:e}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(c,f,a,i){var g=SessionStorageModel.extend({defaults:{searching:false,tagsEditorShown:false,annotationEditorShown:false},toString:function(){return"HistoryPanelPrefs("+JSON.stringify(this.toJSON())+")"}});g.storageKey=function h(){return("history-panel")};var d=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(j){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([j],[true])))},removeExpandedHda:function(j){this.save("expandedHdas",_.omit(this.get("expandedHdas"),j))},toString:function(){return"HistoryPrefs("+this.id+")"}});d.historyStorageKey=function b(j){if(!j){throw new Error("HistoryPrefs.historyStorageKey needs valid id: "+j)}return("history:"+j)};var e=Backbone.View.extend(LoggableMixin).extend({defaultHDAViewClass:i.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(j){j=j||{};if(j.logger){this.logger=j.logger}this.log(this+".initialize:",j);this.HDAViewClass=j.HDAViewClass||this.defaultHDAViewClass;this.linkTarget=j.linkTarget||"_blank";this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.preferences=new g(_.extend({id:g.storageKey()},_.pick(j,_.keys(g.prototype.defaults))));this.filters=[];this.selecting=j.selecting||false;this.annotationEditorShown=j.annotationEditorShown||false;this._setUpListeners();if(this.model){this._setUpWebStorage(j.initiallyExpanded,j.show_deleted,j.show_hidden);this._setUpModelEventHandlers()}if(j.onready){j.onready.call(this)}},_setUpListeners:function(){this.on("error",function(k,n,j,m,l){this.errorHandler(k,n,j,m,l)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(j){this.log(this+"",arguments)},this)}},errorHandler:function(l,o,k,n,m){var j=this._parseErrorMessage(l,o,k,n,m);if(o&&o.status===0&&o.readyState===0){}else{if(o&&o.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",j.message,j.details)})}else{this.displayMessage("error",j.message,j.details)}}}},_parseErrorMessage:function(m,q,l,p,o){var k=Galaxy.currUser,j={message:this._bePolite(p),details:{user:(k instanceof User)?(k.toJSON()):(k+""),source:(m instanceof Backbone.Model)?(m.toJSON()):(m+""),xhr:q,options:(q)?(_.omit(l,"xhr")):(l)}};_.extend(j.details,o||{});if(q&&_.isFunction(q.getAllResponseHeaders)){var n=q.getAllResponseHeaders();n=_.compact(n.split("\n"));n=_.map(n,function(r){return r.split(": ")});j.details.xhr.responseHeaders=_.object(n)}return j},_bePolite:function(j){j=j||_l("An error occurred while getting updates from the server");return j+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(k){var j=this;return this.loadHistoryWithHDADetails("current",k).then(function(m,l){j.trigger("current-history",j)})},switchToHistory:function(m,l){var j=this,k=function(){return jQuery.post(galaxy_config.root+"api/histories/"+m+"/set_as_current")};return this.loadHistoryWithHDADetails(m,l,k).then(function(o,n){j.trigger("switched-history",j)})},createNewHistory:function(l){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var j=this,k=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,l,k).then(function(n,m){j.trigger("new-history",j)})},loadHistoryWithHDADetails:function(m,l,k,o){var j=this,n=function(p){return j.getExpandedHdaIds(p.id)};return this.loadHistory(m,l,k,o,n)},loadHistory:function(m,l,k,p,n){this.trigger("loading-history",this);l=l||{};var j=this;var o=c.History.getHistoryData(m,{historyFn:k,hdaFn:p,hdaDetailIds:l.initiallyExpanded||n});return this._loadHistoryFromXHR(o,l).fail(function(s,q,r){j.trigger("error",j,s,l,_l("An error was encountered while "+q),{historyId:m,history:r||{}})}).always(function(){j.trigger("loading-done",j)})},_loadHistoryFromXHR:function(l,k){var j=this;l.then(function(m,n){j.setModel(m,n,k)});l.fail(function(n,m){j.render()});return l},setModel:function(l,j,k){k=k||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){l.user=Galaxy.currUser.toJSON()}this.model=new c.History(l,j,k);this._setUpWebStorage(k.initiallyExpanded,k.show_deleted,k.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(k,j,l){this.storage=new d({id:d.historyStorageKey(this.model.get("id"))});if(_.isObject(k)){this.storage.set("exandedHdas",k)}if(_.isBoolean(j)){this.storage.set("show_deleted",j)}if(_.isBoolean(l)){this.storage.set("show_hidden",l)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var j in sessionStorage){if(j.indexOf("history:")===0){sessionStorage.removeItem(j)}}},getStoredOptions:function(k){if(!k||k==="current"){return(this.storage)?(this.storage.get()):({})}var j=sessionStorage.getItem(d.historyStorageKey(k));return(j===null)?({}):(JSON.parse(j))},getExpandedHdaIds:function(j){var k=this.getStoredOptions(j).expandedHdas;return((_.isEmpty(k))?([]):(_.keys(k)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(k,m,j,l){this.errorHandler(k,m,j,l)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(j){this.model.fetch()},this);this.model.hdas.on("state:ready",function(k,l,j){if((!k.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[k.id])}},this)},render:function(l,m){l=(l===undefined)?(this.fxSpeed):(l);var j=this,k;if(this.model){k=this.renderModel()}else{k=this.renderWithoutModel()}$(j).queue("fx",[function(n){if(l&&j.$el.is(":visible")){j.$el.fadeOut(l,n)}else{n()}},function(n){j.$el.empty();if(k){j.$el.append(k.children());j.renderBasedOnPrefs()}n()},function(n){if(l&&!j.$el.is(":visible")){j.$el.fadeIn(l,n)}else{n()}},function(n){if(m){m.call(this)}j.trigger("rendered",this);n()}]);return this},renderWithoutModel:function(){var j=$("<div/>"),k=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return j.append(k)},renderModel:function(){var j=$("<div/>");if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){j.append(e.templates.anonHistoryPanel(this.model.toJSON()))}else{j.append(e.templates.historyPanel(this.model.toJSON()));if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(j);this._renderAnnotation(j)}}j.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(j);this.renderHdas(j);return j},renderBasedOnPrefs:function(){if(this.preferences.get("searching")){this.showSearchControls(0)}},_renderTags:function(j){var k=this;this.tagsEditor=new TagsEditor({model:this.model,el:j.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){k.preferences.set("tagsEditorShown",true);k.toggleHDATagEditors(true,k.fxSpeed)},onhide:function(){k.preferences.set("tagsEditorShown",false);k.toggleHDATagEditors(false,k.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(j.find(".history-secondary-actions"))});if(this.preferences.get("tagsEditorShown")){this.tagsEditor.toggle(true)}},_renderAnnotation:function(j){var k=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:j.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){k.preferences.set("annotationEditorShown",true);k.toggleHDAAnnotationEditors(true,k.fxSpeed)},onhide:function(){k.preferences.set("annotationEditorShown",false);k.toggleHDAAnnotationEditors(false,k.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(j.find(".history-secondary-actions"))});if(this.preferences.get("annotationEditorShown")){this.annotationEditor.toggle(true)}},_renderSearchButton:function(j){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_renderSelectButton:function(j){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(j){j=j||this.$el;j.find("[title]").tooltip({placement:"bottom"});if((!this.model)||(!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var k=this;j.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(l){j.find(".history-name").text(l);k.model.save({name:l}).fail(function(){j.find(".history-name").text(k.model.previous("name"))})}});this._setUpDatasetActionsPopup(j)},_setUpDatasetActionsPopup:function(j){var k=this;(new PopupMenu(j.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.hide;k.getSelectedHdaCollection().ajaxQueue(l)}},{html:_l("Unhide datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.unhide;k.getSelectedHdaCollection().ajaxQueue(l)}},{html:_l("Delete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype["delete"];k.getSelectedHdaCollection().ajaxQueue(l)}},{html:_l("Undelete datasets"),func:function(){var l=f.HistoryDatasetAssociation.prototype.undelete;k.getSelectedHdaCollection().ajaxQueue(l)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var l=f.HistoryDatasetAssociation.prototype.purge;k.getSelectedHdaCollection().ajaxQueue(l)}}}]))},refreshHdas:function(k,j){if(this.model){return this.model.refresh(k,j)}return $.when()},addHdaView:function(m){this.log("add."+this,m);var k=this;if(!m.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function l(o){var n=k.$el.find(k.emptyMsgSelector);if(n.is(":visible")){n.fadeOut(k.fxSpeed,o)}else{o()}},function j(o){k.scrollToTop();var n=k.$el.find(k.datasetsSelector);k.createHdaView(m).$el.hide().prependTo(n).slideDown(k.fxSpeed)}])},createHdaView:function(l){var k=l.get("id"),j=this.storage.get("expandedHdas")[k],m=new this.HDAViewClass({model:l,linkTarget:this.linkTarget,expanded:j,tagsEditorShown:this.preferences.get("tagsEditorShown"),annotationEditorShown:this.preferences.get("annotationEditorShown"),selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(m);this.hdaViews[k]=m;return m.render()},_setUpHdaListeners:function(k){var j=this;k.on("body-expanded",function(l){j.storage.addExpandedHda(l)});k.on("body-collapsed",function(l){j.storage.removeExpandedHda(l)});k.on("error",function(m,o,l,n){j.errorHandler(m,o,l,n)})},handleHdaDeletionChange:function(j){if(j.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[j.id])}},handleHdaVisibleChange:function(j){if(j.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[j.id])}},removeHdaView:function(k){if(!k){return}var j=this;k.$el.fadeOut(j.fxSpeed,function(){k.off();k.remove();delete j.hdaViews[k.model.id];if(_.isEmpty(j.hdaViews)){j.$el.find(j.emptyMsgSelector).fadeIn(j.fxSpeed,function(){j.trigger("empty-history",j)})}})},renderHdas:function(l){l=l||this.$el;this.hdaViews={};var k=this,j=l.find(this.datasetsSelector),m=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);j.empty();if(m.length){m.each(function(n){j.prepend(k.createHdaView(n).$el)});l.find(this.emptyMsgSelector).hide()}else{l.find(this.emptyMsgSelector).show()}return this.hdaViews},toggleHDATagEditors:function(){var j=arguments;_.each(this.hdaViews,function(k){if(k.tagsEditor){k.tagsEditor.toggle.apply(k.tagsEditor,j)}})},toggleHDAAnnotationEditors:function(j){var k=arguments;_.each(this.hdaViews,function(l){if(l.annotationEditor){l.annotationEditor.toggle.apply(l.annotationEditor,k)}})},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls","click .history-select-btn":function(j){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(j){j.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},renderSearchControls:function(k){var l=this;function n(o){l.searchFor=o;l.filters=[function(p){return p.matchesAll(l.searchFor)}];l.trigger("search:searching",o,l);l.renderHdas()}function j(o){if(l.model.hdas.haveDetails()){n(o);return}l.$el.find(".history-search-controls").searchInput("toggle-loading");l.model.hdas.fetchAllDetails({silent:true}).always(function(){l.$el.find(".history-search-controls").searchInput("toggle-loading")}).done(function(){n(o)})}function m(){l.searchFor="";l.filters=[];l.trigger("search:clear",l);l.renderHdas()}return k.searchInput({initialVal:l.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:j,onsearch:n,onclear:m})},showSearchControls:function(l){l=(l===undefined)?(this.fxSpeed):(l);var j=this,k=this.$el.find(".history-search-controls");if(!k.children().size()){k=this.renderSearchControls(k).hide()}k.show(l,function(){$(this).find("input").focus();j.preferences.set("searching",true)})},hideSearchControls:function(){speed=(speed===undefined)?(this.fxSpeed):(speed);var j=this;this.$el.find(".history-search-controls").hide(speed,function(){j.preferences.set("searching",false)})},toggleSearchControls:function(j){speed=(jQuery.type(j)==="number")?(j):(this.fxSpeed);if(this.$el.find(".history-search-controls").is(":visible")){this.hideSearchControls(speed)}else{this.showSearchControls(speed)}},showSelectors:function(j){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(j);_.each(this.hdaViews,function(k){k.showSelector(j)})},hideSelectors:function(j){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(j);_.each(this.hdaViews,function(k){k.hideSelector(j)})},toggleSelectors:function(j){if(!this.selecting){this.showSelectors(j)}else{this.hideSelectors(j)}},selectAllDatasets:function(k){var j=this.$el.find(".history-select-all-datasets-btn");currMode=j.data("mode");if(currMode==="select"){_.each(this.hdaViews,function(l){l.select(k)});j.data("mode","deselect");j.text(_l("De-select all"))}else{if(currMode==="deselect"){_.each(this.hdaViews,function(l){l.deselect(k)});j.data("mode","select");j.text(_l("Select all"))}}},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(j){return j.selected})},getSelectedHdaCollection:function(){return new f.HDACollection(_.map(this.getSelectedHdaViews(),function(j){return j.model}),{historyId:this.model.id})},showLoadingIndicator:function(k,j,l){j=(j!==undefined)?(j):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,l)}else{this.$el.fadeOut(j);this.indicator.show(k,j,l)}},hideLoadingIndicator:function(j,k){j=(j!==undefined)?(j):(this.fxSpeed);if(this.indicator){this.indicator.hide(j,k)}},displayMessage:function(o,p,n){var l=this;this.scrollToTop();var m=this.$el.find(this.msgsSelector),j=$("<div/>").addClass(o+"message").html(p);if(!_.isEmpty(n)){var k=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(l.messageToModalOptions(o,p,n));return false});j.append(" ",k)}return m.html(j)},messageToModalOptions:function(n,p,m){var j=this,o=$("<div/>"),l={title:"Details"};function k(q){q=_.omit(q,_.functions(q));return["<table>",_.map(q,function(s,r){s=(_.isObject(s))?(k(s)):(s);return'<tr><td style="vertical-align: top; color: grey">'+r+'</td><td style="padding-left: 8px">'+s+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(m)){l.body=o.append(k(m))}else{l.body=o.html(m)}l.buttons={Ok:function(){Galaxy.modal.hide();j.clearMessages()}};return l},clearMessages:function(){var j=this.$el.find(this.msgsSelector);j.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(j){this.$el.parent().scrollTop(j)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(k,l){if(!l){this.$el.parent().parent().scrollTop(k);return this}var j=window,m=this.$el.parent().parent(),o=$(j).innerHeight(),n=(o/2)-(l/2);$(m).scrollTop(k-n);return this},scrollToId:function(k){if((!k)||(!this.hdaViews[k])){return this}var j=this.hdaViews[k].$el;this.scrollIntoView(j.offset().top,j.outerHeight());return this},scrollToHid:function(j){var k=this.model.hdas.getByHid(j);if(!k){return this}return this.scrollToId(k.id)},connectToQuotaMeter:function(j){if(!j){return this}this.listenTo(j,"quota:over",this.showQuotaMessage);this.listenTo(j,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(j&&j.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var j=this.$el.find(".quota-message");if(j.is(":hidden")){j.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var j=this.$el.find(".quota-message");if(!j.is(":hidden")){j.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(j){if(!j){return this}this.on("new-storage",function(l,k){if(j&&l){j.findItemByHtml(_l("Include Deleted Datasets")).checked=l.get("show_deleted");j.findItemByHtml(_l("Include Hidden Datasets")).checked=l.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});e.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:e}});
\ 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: dan: When setting external metadata using _handle_metadata_externally (e.g. local and lwr runners) use the requirments of the set metadata tool to determine dependencies. Resolves issue seen with missing samtools command when samtools is not in the path, but has been installed with the dependency system.
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/4241eff3f67c/
Changeset: 4241eff3f67c
User: dan
Date: 2013-12-12 23:09:29
Summary: When setting external metadata using _handle_metadata_externally (e.g. local and lwr runners) use the requirments of the set metadata tool to determine dependencies. Resolves issue seen with missing samtools command when samtools is not in the path, but has been installed with the dependency system.
Affected #: 4 files
diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/datatypes/registry.py
--- a/lib/galaxy/datatypes/registry.py
+++ b/lib/galaxy/datatypes/registry.py
@@ -598,6 +598,9 @@
tool_xml_text = """
<tool id="__SET_METADATA__" name="Set External Metadata" version="1.0.1" tool_type="set_metadata"><type class="SetMetadataTool" module="galaxy.tools"/>
+ <requirements>
+ <requirement type="package">samtools</requirement>
+ </requirements><action module="galaxy.tools.actions.metadata" class="SetMetadataToolAction"/><command>$__SET_EXTERNAL_METADATA_COMMAND_LINE__</command><inputs>
diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/jobs/runners/__init__.py
--- a/lib/galaxy/jobs/runners/__init__.py
+++ b/lib/galaxy/jobs/runners/__init__.py
@@ -198,7 +198,7 @@
log.exception( "from_work_dir specified a location not in the working directory: %s, %s" % ( source_file, job_wrapper.working_directory ) )
return output_pairs
- def _handle_metadata_externally(self, job_wrapper):
+ def _handle_metadata_externally( self, job_wrapper, resolve_requirements=False ):
"""
Set metadata externally. Used by the local and lwr job runners where this
shouldn't be attached to command-line to execute.
@@ -213,6 +213,12 @@
#we don't want to overwrite metadata that was copied over in init_meta(), as per established behavior
kwds={ 'overwrite' : False } )
log.debug( 'executing external set_meta script for job %d: %s' % ( job_wrapper.job_id, external_metadata_script ) )
+ if resolve_requirements:
+ dependency_shell_commands = self.app.datatypes_registry.set_external_metadata_tool.build_dependency_shell_commands()
+ if dependency_shell_commands:
+ if isinstance( dependency_shell_commands, list ):
+ dependency_shell_commands = "&&".join( dependency_shell_commands )
+ external_metadata_script = "%s&&%s" % ( dependency_shell_commands, external_metadata_script )
external_metadata_proc = subprocess.Popen( args=external_metadata_script,
shell=True,
env=os.environ,
diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/jobs/runners/local.py
--- a/lib/galaxy/jobs/runners/local.py
+++ b/lib/galaxy/jobs/runners/local.py
@@ -110,7 +110,7 @@
job_wrapper.fail( "failure running job", exception=True )
log.exception("failure running job %d" % job_wrapper.job_id)
return
- self._handle_metadata_externally( job_wrapper )
+ self._handle_metadata_externally( job_wrapper, resolve_requirements=True )
# Finish the job!
try:
job_wrapper.finish( stdout, stderr, exit_code )
diff -r db9256a668eb13072231de605ca74e6c9372a467 -r 4241eff3f67c3d42fe51564c52aafabf65cc6130 lib/galaxy/jobs/runners/lwr.py
--- a/lib/galaxy/jobs/runners/lwr.py
+++ b/lib/galaxy/jobs/runners/lwr.py
@@ -204,7 +204,7 @@
log.exception("failure running job %d" % job_wrapper.job_id)
return
if not LwrJobRunner.__remote_metadata( client ):
- self._handle_metadata_externally( job_wrapper )
+ self._handle_metadata_externally( job_wrapper, resolve_requirements=True )
# Finish the job
try:
job_wrapper.finish( stdout, stderr )
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 options menu: fix 'collapse expanded datasets' when no event
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/db9256a668eb/
Changeset: db9256a668eb
User: carlfeberhard
Date: 2013-12-12 22:55:48
Summary: History options menu: fix 'collapse expanded datasets' when no event
Affected #: 2 files
diff -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 -r db9256a668eb13072231de605ca74e6c9372a467 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -423,7 +423,7 @@
toggleBodyVisibility : function( event, expand ){
// bail (with propagation) if keydown and not space or enter
var KEYCODE_SPACE = 32, KEYCODE_RETURN = 13;
- if( ( event.type === 'keydown' )
+ if( event && ( event.type === 'keydown' )
&& !( event.keyCode === KEYCODE_SPACE || event.keyCode === KEYCODE_RETURN ) ){
return true;
}
diff -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 -r db9256a668eb13072231de605ca74e6c9372a467 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=c.linkTarget||"_blank";this.selectable=c.selectable||false;this.selected=c.selected||false;this.expanded=c.expanded||false;this.draggable=c.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());if(this.selectable){this.showSelector(0)}f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}if(this.draggable){this.draggableOn()}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",content:c.urls.display})}}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}this._setUpBehaviors(d);if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect",},toggleBodyVisibility:function(f,d){var c=32,e=13;if((f.type==="keydown")&&!(f.keyCode===c||f.keyCode===e)){return true}var g=this.$el.find(".dataset-body");d=(d===undefined)?(!g.is(":visible")):(d);if(d){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var c=this;function d(){c.$el.children(".dataset-body").replaceWith(c._render_body());c.$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},showSelector:function(e){if(this.$el.find(".dataset-selector").css("display")!=="none"){return}e=(e!==undefined)?(e):(this.fxSpeed);if(this.selected){this.select(null,true)}var d=this,c=32;if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeOut(e,f)});this.$el.queue("fx",function(f){$(this).find(".dataset-selector").show().animate({width:c},e,f);$(this).find(".dataset-title-bar").animate({"margin-left":c},e,f);d.selectable=true;d.trigger("selectable",true,d)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:c});this.$el.find(".dataset-title-bar").show().css({"margin-left":c});d.selectable=true;d.trigger("selectable",true,d)}},hideSelector:function(c){c=(c!==undefined)?(c):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(c){this.$el.queue("fx",function(d){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},c,function(){$(this).hide();d()})});this.$el.queue("fx",function(d){$(this).find(".dataset-primary-actions").fadeIn(c,d)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(c){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(c)}else{this.hideSelector(c)}},select:function(c){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(c){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(c){if(this.selected){this.deselect(c)}else{this.select(c)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var c=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);c.addEventListener("dragstart",this.dragStartHandler,false);c.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var c=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);c.removeEventListener("dragstart",this.dragStartHandler,false);c.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(c){this.trigger("dragstart",this);c.dataTransfer.effectAllowed="move";c.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(c){this.trigger("dragend",this);return false},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.linkTarget=c.linkTarget||"_blank";this.selectable=c.selectable||false;this.selected=c.selected||false;this.expanded=c.expanded||false;this.draggable=c.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());if(this.selectable){this.showSelector(0)}f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}if(this.draggable){this.draggableOn()}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:this.linkTarget,classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){if(Galaxy.frame&&Galaxy.frame.active){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",content:c.urls.display})}}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:this.linkTarget,faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}this._setUpBehaviors(d);if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect",},toggleBodyVisibility:function(f,d){var c=32,e=13;if(f&&(f.type==="keydown")&&!(f.keyCode===c||f.keyCode===e)){return true}var g=this.$el.find(".dataset-body");d=(d===undefined)?(!g.is(":visible")):(d);if(d){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var c=this;function d(){c.$el.children(".dataset-body").replaceWith(c._render_body());c.$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},showSelector:function(e){if(this.$el.find(".dataset-selector").css("display")!=="none"){return}e=(e!==undefined)?(e):(this.fxSpeed);if(this.selected){this.select(null,true)}var d=this,c=32;if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeOut(e,f)});this.$el.queue("fx",function(f){$(this).find(".dataset-selector").show().animate({width:c},e,f);$(this).find(".dataset-title-bar").animate({"margin-left":c},e,f);d.selectable=true;d.trigger("selectable",true,d)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:c});this.$el.find(".dataset-title-bar").show().css({"margin-left":c});d.selectable=true;d.trigger("selectable",true,d)}},hideSelector:function(c){c=(c!==undefined)?(c):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(c){this.$el.queue("fx",function(d){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},c,function(){$(this).hide();d()})});this.$el.queue("fx",function(d){$(this).find(".dataset-primary-actions").fadeIn(c,d)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(c){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(c)}else{this.hideSelector(c)}},select:function(c){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(c){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(c){if(this.selected){this.deselect(c)}else{this.select(c)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var c=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);c.addEventListener("dragstart",this.dragStartHandler,false);c.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var c=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);c.removeEventListener("dragstart",this.dragStartHandler,false);c.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(c){this.trigger("dragstart",this);c.dataTransfer.effectAllowed="move";c.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(c){this.trigger("dragend",this);return false},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ 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 panel: when clicking either annotation or tag button in history (top) open/close annotation or tag displays in history's hdas as well
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/bfccf1f3269e/
Changeset: bfccf1f3269e
User: carlfeberhard
Date: 2013-12-12 21:21:15
Summary: History panel: when clicking either annotation or tag button in history (top) open/close annotation or tag displays in history's hdas as well
Affected #: 9 files
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/mvc/base-mvc.js
--- a/static/scripts/mvc/base-mvc.js
+++ b/static/scripts/mvc/base-mvc.js
@@ -173,6 +173,7 @@
//==============================================================================
var HiddenUntilActivatedViewMixin = /** @lends hiddenUntilActivatedMixin# */{
+//TODO: since this is a mixin, consider moving toggle, hidden into HUAVOptions
/** */
hiddenUntilActivated : function( $activator, options ){
@@ -184,7 +185,9 @@
showSpeed : 'fast'
};
_.extend( this.HUAVOptions, options || {});
+ /** has this been shown already (and onshowFirstTime called)? */
this.HUAVOptions.hasBeenShown = this.HUAVOptions.$elementShown.is( ':visible' );
+ this.hidden = this.isHidden();
if( $activator ){
var mixin = this;
@@ -194,22 +197,34 @@
}
},
+ isHidden : function(){
+ return ( this.HUAVOptions.$elementShown.is( ':hidden' ) );
+ },
+
/** */
toggle : function(){
// can be called manually as well with normal toggle arguments
- if( this.HUAVOptions.$elementShown.is( ':hidden' ) ){
+ if( this.isHidden() ){
// fire the optional fns on the first/each showing - good for render()
if( !this.HUAVOptions.hasBeenShown ){
if( _.isFunction( this.HUAVOptions.onshowFirstTime ) ){
this.HUAVOptions.hasBeenShown = true;
this.HUAVOptions.onshowFirstTime.call( this );
}
- } else {
- if( _.isFunction( this.HUAVOptions.onshow ) ){
- this.HUAVOptions.onshow.call( this );
- }
}
+ if( _.isFunction( this.HUAVOptions.onshow ) ){
+ this.HUAVOptions.onshow.call( this );
+ }
+ this.hidden = false;
+
+ } else {
+ if( _.isFunction( this.HUAVOptions.onhide ) ){
+ this.HUAVOptions.onhide.call( this );
+ }
+ this.hidden = true;
}
+ //TODO: better as a callback (when the show/hide is actually done)
+ this.trigger( 'hiddenUntilActivated:' + (( this.isHidden() )?( 'shown' ):( 'hidden' )), this );
return this.HUAVOptions.showFn.apply( this.HUAVOptions.$elementShown, arguments );
}
};
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -46,11 +46,11 @@
/** is the view currently in selection mode? */
this.selectable = attributes.selectable || false;
/** is the view currently selected? */
- this.selected = attributes.selected || false;
- /** is the body of this hda view expanded/not. */
- this.expanded = attributes.expanded || false;
- /** is the body of this hda view expanded/not. */
- this.draggable = attributes.draggable || false;
+ this.selected = attributes.selected || false;
+ /** is the body of this hda view expanded/not? */
+ this.expanded = attributes.expanded || false;
+ /** is the body of this hda view expanded/not? */
+ this.draggable = attributes.draggable || false;
this._setUpListeners();
},
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -33,6 +33,11 @@
this._render_rerunButton
];
+ //TODO: move to HiddenUntilActivatedViewMixin
+ /** should the tags editor be shown or hidden initially? */
+ this.tagsEditorShown = attributes.tagsEditorShown || false;
+ /** should the tags editor be shown or hidden initially? */
+ this.annotationEditorShown = attributes.annotationEditorShown || false;
},
// ......................................................................... edit attr, delete
@@ -298,6 +303,7 @@
// more actions/buttons
if( this.hasUser ){
$body.find( '.dataset-actions .left' ).append( this._render_visualizationsButton() );
+ //TODO: might be better to move these into the render() and call setElement here
this._renderTags( $body );
this._renderAnnotation( $body );
}
@@ -305,28 +311,38 @@
},
_renderTags : function( $where ){
+ var view = this;
this.tagsEditor = new TagsEditor({
model : this.model,
el : $where.find( '.tags-display' ),
onshowFirstTime : function(){ this.render(); },
+ // persist state on the hda view (and not the editor) since these are currently re-created each time
+ onshow : function(){ view.tagsEditorShown = true; },
+ onhide : function(){ view.tagsEditorShown = false; },
$activator : faIconButton({
title : _l( 'Edit dataset tags' ),
classes : 'dataset-tag-btn',
faIcon : 'fa-tags'
}).appendTo( $where.find( '.dataset-actions .right' ) )
});
+ if( this.tagsEditorShown ){ this.tagsEditor.toggle( true ); }
},
_renderAnnotation : function( $where ){
+ var view = this;
this.annotationEditor = new AnnotationEditor({
model : this.model,
el : $where.find( '.annotation-display' ),
onshowFirstTime : function(){ this.render(); },
+ // persist state on the hda view (and not the editor) since these are currently re-created each time
+ onshow : function(){ view.annotationEditorShown = true; },
+ onhide : function(){ view.annotationEditorShown = false; },
$activator : faIconButton({
title : _l( 'Edit dataset annotation' ),
classes : 'dataset-annotate-btn',
faIcon : 'fa-comment'
}).appendTo( $where.find( '.dataset-actions .right' ) )
});
+ if( this.annotationEditorShown ){ this.annotationEditor.toggle( true ); }
},
makeDbkeyEditLink : function( $body ){
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/mvc/history/history-model.js
--- a/static/scripts/mvc/history/history-model.js
+++ b/static/scripts/mvc/history/history-model.js
@@ -116,11 +116,27 @@
// ........................................................................ common queries
/** is this model already associated with a user? */
+//TODO: remove
hasUser : function(){
var user = this.get( 'user' );
return !!( user && user.id );
},
+ /** T/F is this history owned by the current user (Galaxy.currUser)
+ * Note: that this will return false for an anon user even if the history is theirs.
+ */
+ ownedByCurrUser : function(){
+ // no currUser
+ if( !Galaxy || !Galaxy.currUser ){
+ return false;
+ }
+ // user is anon or history isn't owned
+ if( Galaxy.currUser.isAnonymous() || Galaxy.currUser.id !== this.get( 'user_id' ) ){
+ return false;
+ }
+ return true;
+ },
+
hdaCount : function(){
return _.reduce( _.values( this.get( 'state_details' ) ), function( memo, num ){ return memo + num; }, 0 );
},
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/mvc/history/history-panel.js
--- a/static/scripts/mvc/history/history-panel.js
+++ b/static/scripts/mvc/history/history-panel.js
@@ -109,6 +109,7 @@
this.log( this + '.initialize:', attributes );
// ---- set up instance vars
+ /** which backbone view class to use when displaying the hda list */
this.HDAViewClass = attributes.HDAViewClass || this.defaultHDAViewClass;
/** where should pages from links be displayed? (default to new tab/window) */
this.linkTarget = attributes.linkTarget || '_blank';
@@ -127,6 +128,11 @@
/** is the panel currently showing the dataset selection controls? */
this.selecting = attributes.selecting || false;
+ /** should the tags editor be shown or hidden initially? */
+ this.tagsEditorShown = attributes.tagsShown || false;
+ /** should the tags editor be shown or hidden initially? */
+ this.annotationEditorShown = attributes.annotationEditorShown || false;
+
this._setUpListeners();
// ---- handle models passed on init
@@ -576,10 +582,20 @@
},
_renderTags : function( $where ){
+ var panel = this;
this.tagsEditor = new TagsEditor({
model : this.model,
el : $where.find( '.history-controls .tags-display' ),
onshowFirstTime : function(){ this.render(); },
+ // show hide hda view tag editors when this is shown/hidden
+ onshow : function(){
+ panel.tagsEditorShown = true;
+ panel.toggleHDATagEditors( true, panel.fxSpeed );
+ },
+ onhide : function(){
+ panel.tagsEditorShown = false;
+ panel.toggleHDATagEditors( false, panel.fxSpeed );
+ },
$activator : faIconButton({
title : _l( 'Edit history tags' ),
classes : 'history-tag-btn',
@@ -588,12 +604,22 @@
});
},
_renderAnnotation : function( $where ){
+ var panel = this;
this.annotationEditor = new AnnotationEditor({
model : this.model,
el : $where.find( '.history-controls .annotation-display' ),
onshowFirstTime : function(){ this.render(); },
+ // show hide hda view annotation editors when this is shown/hidden
+ onshow : function(){
+ panel.annotationEditorShown = true;
+ panel.toggleHDAAnnotationEditors( true, panel.fxSpeed );
+ },
+ onhide : function(){
+ panel.annotationEditorShown = false;
+ panel.toggleHDAAnnotationEditors( false, panel.fxSpeed );
+ },
$activator : faIconButton({
- title : _l( 'Edit history tags' ),
+ title : _l( 'Edit history Annotation' ),
classes : 'history-annotate-btn',
faIcon : 'fa-comment'
}).appendTo( $where.find( '.history-secondary-actions' ) )
@@ -733,8 +759,10 @@
linkTarget : this.linkTarget,
expanded : expanded,
//draggable : true,
+ tagsEditorShown : this.tagsEditorShown,
+ annotationEditorShown : this.annotationEditorShown,
selectable : this.selecting,
- hasUser : this.model.hasUser(),
+ hasUser : this.model.ownedByCurrUser(),
logger : this.logger
});
this._setUpHdaListeners( hdaView );
@@ -832,6 +860,26 @@
return this.hdaViews;
},
+ /** toggle the visibility of each hdaView's tagsEditor applying all the args sent to this function */
+ toggleHDATagEditors : function(){
+ var args = arguments;
+ _.each( this.hdaViews, function( hdaView ){
+ if( hdaView.tagsEditor ){
+ hdaView.tagsEditor.toggle.apply( hdaView.tagsEditor, args );
+ }
+ });
+ },
+
+ /** toggle the visibility of each hdaView's annotationEditor applying all the args sent to this function */
+ toggleHDAAnnotationEditors : function( showOrHide ){
+ var args = arguments;
+ _.each( this.hdaViews, function( hdaView ){
+ if( hdaView.annotationEditor ){
+ hdaView.annotationEditor.toggle.apply( hdaView.annotationEditor, args );
+ }
+ });
+ },
+
// ------------------------------------------------------------------------ panel events
/** event map */
events : {
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/packed/mvc/base-mvc.js
--- a/static/scripts/packed/mvc/base-mvc.js
+++ b/static/scripts/packed/mvc/base-mvc.js
@@ -1,1 +1,1 @@
-var BaseModel=Backbone.Model.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var BaseView=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){if(this.model.attributes.hidden){this.$el.hide()}else{this.$el.show()}}});var LoggableMixin={logger:null,log:function(){if(this.logger){var a=this.logger.log;if(typeof this.logger.log==="object"){a=Function.prototype.bind.call(this.logger.log,this.logger)}return a.apply(this.logger,arguments)}return undefined}};var SessionStorageModel=Backbone.Model.extend({initialize:function(b){b.id=(!_.isString(b.id))?(_.uniqueId()):(b.id);this.id=b.id;var a=(!this.isNew())?(this._read(this)):({});this.clear({silent:true});this.save(_.extend({},this.defaults,a,b),{silent:true});this.on("change",function(){this.save()})},sync:function(d,b,a){if(!a.silent){b.trigger("request",b,{},a)}var c;switch(d){case"create":c=this._create(b);break;case"read":c=this._read(b);break;case"update":c=this._update(b);break;case"delete":c=this._delete(b);break}if(c!==undefined||c!==null){if(a.success){a.success()}}else{if(a.error){a.error()}}return c},_create:function(a){var b=a.toJSON(),c=sessionStorage.setItem(a.id,JSON.stringify(b));return(c===null)?(c):(b)},_read:function(a){return JSON.parse(sessionStorage.getItem(a.id))},_update:function(a){return a._create(a)},_delete:function(a){return sessionStorage.removeItem(a.id)},isNew:function(){return !sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});(function(){SessionStorageModel.prototype=_.omit(SessionStorageModel.prototype,"url","urlRoot")}());var HiddenUntilActivatedViewMixin={hiddenUntilActivated:function(a,c){c=c||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,c||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");if(a){var b=this;a.on("click",function(d){b.toggle(b.HUAVOptions.showSpeed)})}},toggle:function(){if(this.HUAVOptions.$elementShown.is(":hidden")){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}else{if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this)}}}return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};
\ No newline at end of file
+var BaseModel=Backbone.Model.extend({defaults:{name:null,hidden:false},show:function(){this.set("hidden",false)},hide:function(){this.set("hidden",true)},is_visible:function(){return !this.attributes.hidden}});var BaseView=Backbone.View.extend({initialize:function(){this.model.on("change:hidden",this.update_visible,this);this.update_visible()},update_visible:function(){if(this.model.attributes.hidden){this.$el.hide()}else{this.$el.show()}}});var LoggableMixin={logger:null,log:function(){if(this.logger){var a=this.logger.log;if(typeof this.logger.log==="object"){a=Function.prototype.bind.call(this.logger.log,this.logger)}return a.apply(this.logger,arguments)}return undefined}};var SessionStorageModel=Backbone.Model.extend({initialize:function(b){b.id=(!_.isString(b.id))?(_.uniqueId()):(b.id);this.id=b.id;var a=(!this.isNew())?(this._read(this)):({});this.clear({silent:true});this.save(_.extend({},this.defaults,a,b),{silent:true});this.on("change",function(){this.save()})},sync:function(d,b,a){if(!a.silent){b.trigger("request",b,{},a)}var c;switch(d){case"create":c=this._create(b);break;case"read":c=this._read(b);break;case"update":c=this._update(b);break;case"delete":c=this._delete(b);break}if(c!==undefined||c!==null){if(a.success){a.success()}}else{if(a.error){a.error()}}return c},_create:function(a){var b=a.toJSON(),c=sessionStorage.setItem(a.id,JSON.stringify(b));return(c===null)?(c):(b)},_read:function(a){return JSON.parse(sessionStorage.getItem(a.id))},_update:function(a){return a._create(a)},_delete:function(a){return sessionStorage.removeItem(a.id)},isNew:function(){return !sessionStorage.hasOwnProperty(this.id)},_log:function(){return JSON.stringify(this.toJSON(),null," ")},toString:function(){return"SessionStorageModel("+this.id+")"}});(function(){SessionStorageModel.prototype=_.omit(SessionStorageModel.prototype,"url","urlRoot")}());var HiddenUntilActivatedViewMixin={hiddenUntilActivated:function(a,c){c=c||{};this.HUAVOptions={$elementShown:this.$el,showFn:jQuery.prototype.toggle,showSpeed:"fast"};_.extend(this.HUAVOptions,c||{});this.HUAVOptions.hasBeenShown=this.HUAVOptions.$elementShown.is(":visible");this.hidden=this.isHidden();if(a){var b=this;a.on("click",function(d){b.toggle(b.HUAVOptions.showSpeed)})}},isHidden:function(){return(this.HUAVOptions.$elementShown.is(":hidden"))},toggle:function(){if(this.isHidden()){if(!this.HUAVOptions.hasBeenShown){if(_.isFunction(this.HUAVOptions.onshowFirstTime)){this.HUAVOptions.hasBeenShown=true;this.HUAVOptions.onshowFirstTime.call(this)}}if(_.isFunction(this.HUAVOptions.onshow)){this.HUAVOptions.onshow.call(this)}this.hidden=false}else{if(_.isFunction(this.HUAVOptions.onhide)){this.HUAVOptions.onhide.call(this)}this.hidden=true}this.trigger("hiddenUntilActivated:"+((this.isHidden())?("shown"):("hidden")),this);return this.HUAVOptions.showFn.apply(this.HUAVOptions.$elementShown,arguments)}};
\ No newline at end of file
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var n=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(n))){return null}if(_.isObject(n[0])){return this._render_visualizationsFrameworkButton(n)}if(!this.urls.visualization){return null}var k=this.model.get("dbkey"),g=this.urls.visualization,j={},h={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(k){h.dbkey=k}var l=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});var m=this;function i(p){switch(p){case"trackster":return b(g,h,k);case"scatterplot":return e(g,h,m.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:g+"/"+p+"?"+$.param(h)})}}}function o(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(n.length===1){l.attr("data-original-title",_l("Visualize in ")+_l(o(n[0])));l.click(i(n[0]))}else{_.each(n,function(p){j[_l(o(p))]=i(p)});make_popupmenu(l,j)}return l},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))})},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="'+this.linkTarget+'">?</a>').attr("href",this.urls.edit))}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton];this.tagsEditorShown=g.tagsEditorShown||false;this.annotationEditorShown=g.annotationEditorShown||false},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var n=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(n))){return null}if(_.isObject(n[0])){return this._render_visualizationsFrameworkButton(n)}if(!this.urls.visualization){return null}var k=this.model.get("dbkey"),g=this.urls.visualization,j={},h={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(k){h.dbkey=k}var l=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});var m=this;function i(p){switch(p){case"trackster":return b(g,h,k);case"scatterplot":return e(g,h,m.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:g+"/"+p+"?"+$.param(h)})}}}function o(p){return p.charAt(0).toUpperCase()+p.slice(1)}if(n.length===1){l.attr("data-original-title",_l("Visualize in ")+_l(o(n[0])));l.click(i(n[0]))}else{_.each(n,function(p){j[_l(o(p))]=i(p)});make_popupmenu(l,j)}return l},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){var h=this;this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.tagsEditorShown=true},onhide:function(){h.tagsEditorShown=false},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))});if(this.tagsEditorShown){this.tagsEditor.toggle(true)}},_renderAnnotation:function(g){var h=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){h.annotationEditorShown=true},onhide:function(){h.annotationEditorShown=false},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))});if(this.annotationEditorShown){this.annotationEditor.toggle(true)}},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="'+this.linkTarget+'">?</a>').attr("href",this.urls.edit))}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/packed/mvc/history/history-model.js
--- a/static/scripts/packed/mvc/history/history-model.js
+++ b/static/scripts/packed/mvc/history/history-model.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(a){var c=Backbone.Model.extend(LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",renameUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"history/rename_async?id="+this.get("id")},annotateUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"history/annotate_async?id="+this.get("id")},tagUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"tag/get_tagging_elt_async?item_id="+this.get("id")+"&item_class=History"},initialize:function(f,g,e){e=e||{};this.logger=e.logger||null;this.log(this+".initialize:",f,g,e);this.hdas=new a.HDACollection(g||[],{historyId:this.get("id")});if(g&&_.isArray(g)){this.hdas.reset(g)}this._setUpListeners();this.updateTimeoutId=null;this.checkForUpdates()},_setUpListeners:function(){this.on("error",function(f,i,e,h,g){this.errorHandler(f,i,e,h,g)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(f,e){if(this.hdas){this.hdas.historyId=e}},this)},errorHandler:function(f,i,e,h,g){this.clearUpdateTimeout()},hasUser:function(){var e=this.get("user");return !!(e&&e.id)},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(e,f){return e+f},0)},checkForUpdates:function(e){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(e)){e.call(this)}}return this},setUpdateTimeout:function(e){e=e||c.UPDATE_DELAY;var f=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){f.refresh()},e);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(f,e){f=f||[];e=e||{};var g=this;e.data=e.data||{};if(f.length){e.data.details=f.join(",")}var h=this.hdas.fetch(e);h.done(function(i){g.checkForUpdates(function(){this.fetch()})});return h},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});c.UPDATE_DELAY=4000;c.getHistoryData=function d(f,p){p=p||{};var j=p.hdaDetailIds||[];var l=jQuery.Deferred(),k=null;function g(q){return jQuery.ajax(galaxy_config.root+"api/histories/"+f)}function e(q){if(!q||!q.state_ids){return 0}return _.reduce(q.state_ids,function(r,t,s){return r+t.length},0)}function o(r){if(!e(r)){return[]}if(_.isFunction(j)){j=j(r)}var q=(j.length)?({details:j.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+r.id+"/contents",{data:q})}var n=p.historyFn||g,m=p.hdaFn||o;var i=n(f);i.done(function(q){k=q;l.notify({status:"history data retrieved",historyJSON:k})});i.fail(function(s,q,r){l.reject(s,"loading the history")});var h=i.then(m);h.then(function(q){l.notify({status:"dataset data retrieved",historyJSON:k,hdaJSON:q});l.resolve(k,q)});h.fail(function(s,q,r){l.reject(s,"loading the datasets",{history:k})});return l};var b=Backbone.Collection.extend(LoggableMixin).extend({model:c,urlRoot:galaxy_config.root+"api/histories"});return{History:c,HistoryCollection:b}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(a){var c=Backbone.Model.extend(LoggableMixin).extend({defaults:{model_class:"History",id:null,name:"Unnamed History",state:"new",diskSize:0,deleted:false},urlRoot:galaxy_config.root+"api/histories",renameUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"history/rename_async?id="+this.get("id")},annotateUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"history/annotate_async?id="+this.get("id")},tagUrl:function(){var e=this.get("id");if(!e){return undefined}return galaxy_config.root+"tag/get_tagging_elt_async?item_id="+this.get("id")+"&item_class=History"},initialize:function(f,g,e){e=e||{};this.logger=e.logger||null;this.log(this+".initialize:",f,g,e);this.hdas=new a.HDACollection(g||[],{historyId:this.get("id")});if(g&&_.isArray(g)){this.hdas.reset(g)}this._setUpListeners();this.updateTimeoutId=null;this.checkForUpdates()},_setUpListeners:function(){this.on("error",function(f,i,e,h,g){this.errorHandler(f,i,e,h,g)});if(this.hdas){this.listenTo(this.hdas,"error",function(){this.trigger.apply(this,["error:hdas"].concat(jQuery.makeArray(arguments)))})}this.on("change:id",function(f,e){if(this.hdas){this.hdas.historyId=e}},this)},errorHandler:function(f,i,e,h,g){this.clearUpdateTimeout()},hasUser:function(){var e=this.get("user");return !!(e&&e.id)},ownedByCurrUser:function(){if(!Galaxy||!Galaxy.currUser){return false}if(Galaxy.currUser.isAnonymous()||Galaxy.currUser.id!==this.get("user_id")){return false}return true},hdaCount:function(){return _.reduce(_.values(this.get("state_details")),function(e,f){return e+f},0)},checkForUpdates:function(e){if(this.hdas.running().length){this.setUpdateTimeout()}else{this.trigger("ready");if(_.isFunction(e)){e.call(this)}}return this},setUpdateTimeout:function(e){e=e||c.UPDATE_DELAY;var f=this;this.clearUpdateTimeout();this.updateTimeoutId=setTimeout(function(){f.refresh()},e);return this.updateTimeoutId},clearUpdateTimeout:function(){if(this.updateTimeoutId){clearTimeout(this.updateTimeoutId);this.updateTimeoutId=null}},refresh:function(f,e){f=f||[];e=e||{};var g=this;e.data=e.data||{};if(f.length){e.data.details=f.join(",")}var h=this.hdas.fetch(e);h.done(function(i){g.checkForUpdates(function(){this.fetch()})});return h},toString:function(){return"History("+this.get("id")+","+this.get("name")+")"}});c.UPDATE_DELAY=4000;c.getHistoryData=function d(f,p){p=p||{};var j=p.hdaDetailIds||[];var l=jQuery.Deferred(),k=null;function g(q){return jQuery.ajax(galaxy_config.root+"api/histories/"+f)}function e(q){if(!q||!q.state_ids){return 0}return _.reduce(q.state_ids,function(r,t,s){return r+t.length},0)}function o(r){if(!e(r)){return[]}if(_.isFunction(j)){j=j(r)}var q=(j.length)?({details:j.join(",")}):({});return jQuery.ajax(galaxy_config.root+"api/histories/"+r.id+"/contents",{data:q})}var n=p.historyFn||g,m=p.hdaFn||o;var i=n(f);i.done(function(q){k=q;l.notify({status:"history data retrieved",historyJSON:k})});i.fail(function(s,q,r){l.reject(s,"loading the history")});var h=i.then(m);h.then(function(q){l.notify({status:"dataset data retrieved",historyJSON:k,hdaJSON:q});l.resolve(k,q)});h.fail(function(s,q,r){l.reject(s,"loading the datasets",{history:k})});return l};var b=Backbone.Collection.extend(LoggableMixin).extend({model:c,urlRoot:galaxy_config.root+"api/histories"});return{History:c,HistoryCollection:b}});
\ No newline at end of file
diff -r 8946e734862f662715142fb333f385caa0dda6ea -r bfccf1f3269e0f71d2a07a0dda9b6c64734f1c58 static/scripts/packed/mvc/history/history-panel.js
--- a/static/scripts/packed/mvc/history/history-panel.js
+++ b/static/scripts/packed/mvc/history/history-panel.js
@@ -1,1 +1,1 @@
-define(["mvc/history/history-model","mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(g,d,b,a){var c=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(h){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([h],[true])))},removeExpandedHda:function(h){this.save("expandedHdas",_.omit(this.get("expandedHdas"),h))},toString:function(){return"HistoryPanelPrefs("+this.id+")"}});c.historyStorageKey=function f(h){if(!h){throw new Error("HistoryPanelPrefs.historyStorageKey needs valid id: "+h)}return("history:"+h)};var e=Backbone.View.extend(LoggableMixin).extend({defaultHDAViewClass:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(h){h=h||{};if(h.logger){this.logger=h.logger}this.log(this+".initialize:",h);this.HDAViewClass=h.HDAViewClass||this.defaultHDAViewClass;this.linkTarget=h.linkTarget||"_blank";this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];this.searching=h.searching||false;this.selecting=h.selecting||false;this._setUpListeners();if(this.model){this._setUpWebStorage(h.initiallyExpanded,h.show_deleted,h.show_hidden);this._setUpModelEventHandlers()}if(h.onready){h.onready.call(this)}},_setUpListeners:function(){this.on("error",function(i,l,h,k,j){this.errorHandler(i,l,h,k,j)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(h){this.log(this+"",arguments)},this)}},errorHandler:function(j,m,i,l,k){var h=this._parseErrorMessage(j,m,i,l,k);if(m&&m.status===0&&m.readyState===0){}else{if(m&&m.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",h.message,h.details)})}else{this.displayMessage("error",h.message,h.details)}}}},_parseErrorMessage:function(k,o,j,n,m){var i=Galaxy.currUser,h={message:this._bePolite(n),details:{user:(i instanceof User)?(i.toJSON()):(i+""),source:(k instanceof Backbone.Model)?(k.toJSON()):(k+""),xhr:o,options:(o)?(_.omit(j,"xhr")):(j)}};_.extend(h.details,m||{});if(o&&_.isFunction(o.getAllResponseHeaders)){var l=o.getAllResponseHeaders();l=_.compact(l.split("\n"));l=_.map(l,function(p){return p.split(": ")});h.details.xhr.responseHeaders=_.object(l)}return h},_bePolite:function(h){h=h||_l("An error occurred while getting updates from the server");return h+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(i){var h=this;return this.loadHistoryWithHDADetails("current",i).then(function(k,j){h.trigger("current-history",h)})},switchToHistory:function(k,j){var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories/"+k+"/set_as_current")};return this.loadHistoryWithHDADetails(k,j,i).then(function(m,l){h.trigger("switched-history",h)})},createNewHistory:function(j){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,j,i).then(function(l,k){h.trigger("new-history",h)})},loadHistoryWithHDADetails:function(k,j,i,m){var h=this,l=function(n){return h.getExpandedHdaIds(n.id)};return this.loadHistory(k,j,i,m,l)},loadHistory:function(k,j,i,n,l){this.trigger("loading-history",this);j=j||{};var h=this;var m=g.History.getHistoryData(k,{historyFn:i,hdaFn:n,hdaDetailIds:j.initiallyExpanded||l});return this._loadHistoryFromXHR(m,j).fail(function(q,o,p){h.trigger("error",h,q,j,_l("An error was encountered while "+o),{historyId:k,history:p||{}})}).always(function(){h.trigger("loading-done",h)})},_loadHistoryFromXHR:function(j,i){var h=this;j.then(function(k,l){h.setModel(k,l,i)});j.fail(function(l,k){h.render()});return j},setModel:function(j,h,i){i=i||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){j.user=Galaxy.currUser.toJSON()}this.model=new g.History(j,h,i);this._setUpWebStorage(i.initiallyExpanded,i.show_deleted,i.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(i,h,j){this.storage=new c({id:c.historyStorageKey(this.model.get("id"))});if(_.isObject(i)){this.storage.set("exandedHdas",i)}if(_.isBoolean(h)){this.storage.set("show_deleted",h)}if(_.isBoolean(j)){this.storage.set("show_hidden",j)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var h in sessionStorage){if(h.indexOf("history:")===0){sessionStorage.removeItem(h)}}},getStoredOptions:function(i){if(!i||i==="current"){return(this.storage)?(this.storage.get()):({})}var h=sessionStorage.getItem(c.historyStorageKey(i));return(h===null)?({}):(JSON.parse(h))},getExpandedHdaIds:function(h){var i=this.getStoredOptions(h).expandedHdas;return((_.isEmpty(i))?([]):(_.keys(i)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(i,k,h,j){this.errorHandler(i,k,h,j)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(h){this.model.fetch()},this);this.model.hdas.on("state:ready",function(i,j,h){if((!i.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[i.id])}},this)},render:function(j,k){j=(j===undefined)?(this.fxSpeed):(j);var h=this,i;if(this.model){i=this.renderModel()}else{i=this.renderWithoutModel()}$(h).queue("fx",[function(l){if(j&&h.$el.is(":visible")){h.$el.fadeOut(j,l)}else{l()}},function(l){h.$el.empty();if(i){h.$el.append(i.children())}l()},function(l){if(j&&!h.$el.is(":visible")){h.$el.fadeIn(j,l)}else{l()}},function(l){if(k){k.call(this)}h.trigger("rendered",this);l()}]);return this},renderWithoutModel:function(){var h=$("<div/>"),i=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return h.append(i)},renderModel:function(){var h=$("<div/>");if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){h.append(e.templates.anonHistoryPanel(this.model.toJSON()))}else{h.append(e.templates.historyPanel(this.model.toJSON()));if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(h);this._renderAnnotation(h)}}h.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(h);this.renderHdas(h);return h},_renderTags:function(h){this.tagsEditor=new TagsEditor({model:this.model,el:h.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".history-secondary-actions"))})},_renderAnnotation:function(h){this.annotationEditor=new AnnotationEditor({model:this.model,el:h.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".history-secondary-actions"))})},_renderSearchButton:function(h){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_renderSelectButton:function(h){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(h){h=h||this.$el;h.find("[title]").tooltip({placement:"bottom"});if((!this.model)||(!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var i=this;h.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(j){h.find(".history-name").text(j);i.model.save({name:j}).fail(function(){h.find(".history-name").text(i.model.previous("name"))})}});this._setUpDatasetActionsPopup(h)},_setUpDatasetActionsPopup:function(h){var i=this;(new PopupMenu(h.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.hide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Unhide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.unhide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Delete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype["delete"];i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Undelete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.undelete;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var j=d.HistoryDatasetAssociation.prototype.purge;i.getSelectedHdaCollection().ajaxQueue(j)}}}]))},refreshHdas:function(i,h){if(this.model){return this.model.refresh(i,h)}return $.when()},addHdaView:function(k){this.log("add."+this,k);var i=this;if(!k.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function j(m){var l=i.$el.find(i.emptyMsgSelector);if(l.is(":visible")){l.fadeOut(i.fxSpeed,m)}else{m()}},function h(m){i.scrollToTop();var l=i.$el.find(i.datasetsSelector);i.createHdaView(k).$el.hide().prependTo(l).slideDown(i.fxSpeed)}])},createHdaView:function(j){var i=j.get("id"),h=this.storage.get("expandedHdas")[i],k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:h,selectable:this.selecting,hasUser:this.model.hasUser(),logger:this.logger});this._setUpHdaListeners(k);this.hdaViews[i]=k;return k.render()},_setUpHdaListeners:function(i){var h=this;i.on("body-expanded",function(j){h.storage.addExpandedHda(j)});i.on("body-collapsed",function(j){h.storage.removeExpandedHda(j)});i.on("error",function(k,m,j,l){h.errorHandler(k,m,j,l)})},handleHdaDeletionChange:function(h){if(h.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[h.id])}},handleHdaVisibleChange:function(h){if(h.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[h.id])}},removeHdaView:function(i){if(!i){return}var h=this;i.$el.fadeOut(h.fxSpeed,function(){i.off();i.remove();delete h.hdaViews[i.model.id];if(_.isEmpty(h.hdaViews)){h.$el.find(h.emptyMsgSelector).fadeIn(h.fxSpeed,function(){h.trigger("empty-history",h)})}})},renderHdas:function(j){j=j||this.$el;this.hdaViews={};var i=this,h=j.find(this.datasetsSelector),k=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);h.empty();if(k.length){k.each(function(l){h.prepend(i.createHdaView(l).$el)});j.find(this.emptyMsgSelector).hide()}else{j.find(this.emptyMsgSelector).show()}return this.hdaViews},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls","click .history-select-btn":function(h){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(h){h.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},renderSearchControls:function(i){var j=this;function l(m){j.searchFor=m;j.filters=[function(n){return n.matchesAll(j.searchFor)}];j.trigger("search:searching",m,j);j.renderHdas()}function h(m){if(j.model.hdas.haveDetails()){l(m);return}j.$el.find(".history-search-controls").searchInput("toggle-loading");j.model.hdas.fetchAllDetails({silent:true}).always(function(){j.$el.find(".history-search-controls").searchInput("toggle-loading")}).done(function(){l(m)})}function k(){j.searchFor="";j.filters=[];j.trigger("search:clear",j);j.renderHdas()}return i.searchInput({initialVal:j.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:h,onsearch:l,onclear:k})},toggleSearchControls:function(){var h=this.$el.find(".history-search-controls");if(!h.children().size()){h=this.renderSearchControls(h).hide()}h.slideToggle(this.fxSpeed,function(){if($(this).is(":visible")){this.searching=true;$(this).find("input").focus()}else{this.searching=false}})},showSelectors:function(h){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(h);_.each(this.hdaViews,function(i){i.showSelector(h)})},hideSelectors:function(h){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(h);_.each(this.hdaViews,function(i){i.hideSelector(h)})},toggleSelectors:function(h){if(!this.selecting){this.showSelectors(h)}else{this.hideSelectors(h)}},selectAllDatasets:function(i){var h=this.$el.find(".history-select-all-datasets-btn");currMode=h.data("mode");if(currMode==="select"){_.each(this.hdaViews,function(j){j.select(i)});h.data("mode","deselect");h.text(_l("De-select all"))}else{if(currMode==="deselect"){_.each(this.hdaViews,function(j){j.deselect(i)});h.data("mode","select");h.text(_l("Select all"))}}},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(h){return h.selected})},getSelectedHdaCollection:function(){return new d.HDACollection(_.map(this.getSelectedHdaViews(),function(h){return h.model}),{historyId:this.model.id})},showLoadingIndicator:function(i,h,j){h=(h!==undefined)?(h):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,j)}else{this.$el.fadeOut(h);this.indicator.show(i,h,j)}},hideLoadingIndicator:function(h,i){h=(h!==undefined)?(h):(this.fxSpeed);if(this.indicator){this.indicator.hide(h,i)}},displayMessage:function(m,n,l){var j=this;this.scrollToTop();var k=this.$el.find(this.msgsSelector),h=$("<div/>").addClass(m+"message").html(n);if(!_.isEmpty(l)){var i=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(j.messageToModalOptions(m,n,l));return false});h.append(" ",i)}return k.html(h)},messageToModalOptions:function(l,n,k){var h=this,m=$("<div/>"),j={title:"Details"};function i(o){o=_.omit(o,_.functions(o));return["<table>",_.map(o,function(q,p){q=(_.isObject(q))?(i(q)):(q);return'<tr><td style="vertical-align: top; color: grey">'+p+'</td><td style="padding-left: 8px">'+q+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(k)){j.body=m.append(i(k))}else{j.body=m.html(k)}j.buttons={Ok:function(){Galaxy.modal.hide();h.clearMessages()}};return j},clearMessages:function(){var h=this.$el.find(this.msgsSelector);h.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(h){this.$el.parent().scrollTop(h)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(i,j){if(!j){this.$el.parent().parent().scrollTop(i);return this}var h=window,k=this.$el.parent().parent(),m=$(h).innerHeight(),l=(m/2)-(j/2);$(k).scrollTop(i-l);return this},scrollToId:function(i){if((!i)||(!this.hdaViews[i])){return this}var h=this.hdaViews[i].$el;this.scrollIntoView(h.offset().top,h.outerHeight());return this},scrollToHid:function(h){var i=this.model.hdas.getByHid(h);if(!i){return this}return this.scrollToId(i.id)},connectToQuotaMeter:function(h){if(!h){return this}this.listenTo(h,"quota:over",this.showQuotaMessage);this.listenTo(h,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(h&&h.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var h=this.$el.find(".quota-message");if(h.is(":hidden")){h.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var h=this.$el.find(".quota-message");if(!h.is(":hidden")){h.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(h){if(!h){return this}this.on("new-storage",function(j,i){if(h&&j){h.findItemByHtml(_l("Include Deleted Datasets")).checked=j.get("show_deleted");h.findItemByHtml(_l("Include Hidden Datasets")).checked=j.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});e.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:e}});
\ No newline at end of file
+define(["mvc/history/history-model","mvc/dataset/hda-model","mvc/dataset/hda-base","mvc/dataset/hda-edit"],function(g,d,b,a){var c=SessionStorageModel.extend({defaults:{expandedHdas:{},show_deleted:false,show_hidden:false},addExpandedHda:function(h){this.save("expandedHdas",_.extend(this.get("expandedHdas"),_.object([h],[true])))},removeExpandedHda:function(h){this.save("expandedHdas",_.omit(this.get("expandedHdas"),h))},toString:function(){return"HistoryPanelPrefs("+this.id+")"}});c.historyStorageKey=function f(h){if(!h){throw new Error("HistoryPanelPrefs.historyStorageKey needs valid id: "+h)}return("history:"+h)};var e=Backbone.View.extend(LoggableMixin).extend({defaultHDAViewClass:a.HDAEditView,tagName:"div",className:"history-panel",fxSpeed:"fast",datasetsSelector:".datasets-list",emptyMsgSelector:".empty-history-message",msgsSelector:".message-container",initialize:function(h){h=h||{};if(h.logger){this.logger=h.logger}this.log(this+".initialize:",h);this.HDAViewClass=h.HDAViewClass||this.defaultHDAViewClass;this.linkTarget=h.linkTarget||"_blank";this.hdaViews={};this.indicator=new LoadingIndicator(this.$el);this.filters=[];this.searching=h.searching||false;this.selecting=h.selecting||false;this.tagsEditorShown=h.tagsShown||false;this.annotationEditorShown=h.annotationEditorShown||false;this._setUpListeners();if(this.model){this._setUpWebStorage(h.initiallyExpanded,h.show_deleted,h.show_hidden);this._setUpModelEventHandlers()}if(h.onready){h.onready.call(this)}},_setUpListeners:function(){this.on("error",function(i,l,h,k,j){this.errorHandler(i,l,h,k,j)});this.on("loading-history",function(){this.showLoadingIndicator("loading history...")});this.on("loading-done",function(){this.hideLoadingIndicator()});this.once("rendered",function(){this.trigger("rendered:initial",this);return false});this.on("switched-history current-history new-history",function(){if(_.isEmpty(this.hdaViews)){this.trigger("empty-history",this)}});if(this.logger){this.on("all",function(h){this.log(this+"",arguments)},this)}},errorHandler:function(j,m,i,l,k){var h=this._parseErrorMessage(j,m,i,l,k);if(m&&m.status===0&&m.readyState===0){}else{if(m&&m.status===502){}else{if(!this.$el.find(this.msgsSelector).is(":visible")){this.once("rendered",function(){this.displayMessage("error",h.message,h.details)})}else{this.displayMessage("error",h.message,h.details)}}}},_parseErrorMessage:function(k,o,j,n,m){var i=Galaxy.currUser,h={message:this._bePolite(n),details:{user:(i instanceof User)?(i.toJSON()):(i+""),source:(k instanceof Backbone.Model)?(k.toJSON()):(k+""),xhr:o,options:(o)?(_.omit(j,"xhr")):(j)}};_.extend(h.details,m||{});if(o&&_.isFunction(o.getAllResponseHeaders)){var l=o.getAllResponseHeaders();l=_.compact(l.split("\n"));l=_.map(l,function(p){return p.split(": ")});h.details.xhr.responseHeaders=_.object(l)}return h},_bePolite:function(h){h=h||_l("An error occurred while getting updates from the server");return h+". "+_l("Please contact a Galaxy administrator if the problem persists.")},loadCurrentHistory:function(i){var h=this;return this.loadHistoryWithHDADetails("current",i).then(function(k,j){h.trigger("current-history",h)})},switchToHistory:function(k,j){var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories/"+k+"/set_as_current")};return this.loadHistoryWithHDADetails(k,j,i).then(function(m,l){h.trigger("switched-history",h)})},createNewHistory:function(j){if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){this.displayMessage("error",_l("You must be logged in to create histories"));return $.when()}var h=this,i=function(){return jQuery.post(galaxy_config.root+"api/histories",{current:true})};return this.loadHistory(undefined,j,i).then(function(l,k){h.trigger("new-history",h)})},loadHistoryWithHDADetails:function(k,j,i,m){var h=this,l=function(n){return h.getExpandedHdaIds(n.id)};return this.loadHistory(k,j,i,m,l)},loadHistory:function(k,j,i,n,l){this.trigger("loading-history",this);j=j||{};var h=this;var m=g.History.getHistoryData(k,{historyFn:i,hdaFn:n,hdaDetailIds:j.initiallyExpanded||l});return this._loadHistoryFromXHR(m,j).fail(function(q,o,p){h.trigger("error",h,q,j,_l("An error was encountered while "+o),{historyId:k,history:p||{}})}).always(function(){h.trigger("loading-done",h)})},_loadHistoryFromXHR:function(j,i){var h=this;j.then(function(k,l){h.setModel(k,l,i)});j.fail(function(l,k){h.render()});return j},setModel:function(j,h,i){i=i||{};if(this.model){this.model.clearUpdateTimeout();this.stopListening(this.model);this.stopListening(this.model.hdas)}this.hdaViews={};if(Galaxy&&Galaxy.currUser){j.user=Galaxy.currUser.toJSON()}this.model=new g.History(j,h,i);this._setUpWebStorage(i.initiallyExpanded,i.show_deleted,i.show_hidden);this._setUpModelEventHandlers();this.trigger("new-model",this);this.render();return this},_setUpWebStorage:function(i,h,j){this.storage=new c({id:c.historyStorageKey(this.model.get("id"))});if(_.isObject(i)){this.storage.set("exandedHdas",i)}if(_.isBoolean(h)){this.storage.set("show_deleted",h)}if(_.isBoolean(j)){this.storage.set("show_hidden",j)}this.trigger("new-storage",this.storage,this);this.log(this+" (init'd) storage:",this.storage.get())},clearWebStorage:function(){for(var h in sessionStorage){if(h.indexOf("history:")===0){sessionStorage.removeItem(h)}}},getStoredOptions:function(i){if(!i||i==="current"){return(this.storage)?(this.storage.get()):({})}var h=sessionStorage.getItem(c.historyStorageKey(i));return(h===null)?({}):(JSON.parse(h))},getExpandedHdaIds:function(h){var i=this.getStoredOptions(h).expandedHdas;return((_.isEmpty(i))?([]):(_.keys(i)))},_setUpModelEventHandlers:function(){this.model.on("error error:hdas",function(i,k,h,j){this.errorHandler(i,k,h,j)},this);this.model.on("change:nice_size",this.updateHistoryDiskSize,this);if(Galaxy&&Galaxy.quotaMeter){this.listenTo(this.model,"change:nice_size",function(){Galaxy.quotaMeter.update()})}this.model.hdas.on("add",this.addHdaView,this);this.model.hdas.on("change:deleted",this.handleHdaDeletionChange,this);this.model.hdas.on("change:visible",this.handleHdaVisibleChange,this);this.model.hdas.on("change:purged",function(h){this.model.fetch()},this);this.model.hdas.on("state:ready",function(i,j,h){if((!i.get("visible"))&&(!this.storage.get("show_hidden"))){this.removeHdaView(this.hdaViews[i.id])}},this)},render:function(j,k){j=(j===undefined)?(this.fxSpeed):(j);var h=this,i;if(this.model){i=this.renderModel()}else{i=this.renderWithoutModel()}$(h).queue("fx",[function(l){if(j&&h.$el.is(":visible")){h.$el.fadeOut(j,l)}else{l()}},function(l){h.$el.empty();if(i){h.$el.append(i.children())}l()},function(l){if(j&&!h.$el.is(":visible")){h.$el.fadeIn(j,l)}else{l()}},function(l){if(k){k.call(this)}h.trigger("rendered",this);l()}]);return this},renderWithoutModel:function(){var h=$("<div/>"),i=$("<div/>").addClass("message-container").css({"margin-left":"4px","margin-right":"4px"});return h.append(i)},renderModel:function(){var h=$("<div/>");if(!Galaxy||!Galaxy.currUser||Galaxy.currUser.isAnonymous()){h.append(e.templates.anonHistoryPanel(this.model.toJSON()))}else{h.append(e.templates.historyPanel(this.model.toJSON()));if(Galaxy.currUser.id&&Galaxy.currUser.id===this.model.get("user_id")){this._renderTags(h);this._renderAnnotation(h)}}h.find(".history-secondary-actions").prepend(this._renderSearchButton());this._setUpBehaviours(h);this.renderHdas(h);return h},_renderTags:function(h){var i=this;this.tagsEditor=new TagsEditor({model:this.model,el:h.find(".history-controls .tags-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.tagsEditorShown=true;i.toggleHDATagEditors(true,i.fxSpeed)},onhide:function(){i.tagsEditorShown=false;i.toggleHDATagEditors(false,i.fxSpeed)},$activator:faIconButton({title:_l("Edit history tags"),classes:"history-tag-btn",faIcon:"fa-tags"}).appendTo(h.find(".history-secondary-actions"))})},_renderAnnotation:function(h){var i=this;this.annotationEditor=new AnnotationEditor({model:this.model,el:h.find(".history-controls .annotation-display"),onshowFirstTime:function(){this.render()},onshow:function(){i.annotationEditorShown=true;i.toggleHDAAnnotationEditors(true,i.fxSpeed)},onhide:function(){i.annotationEditorShown=false;i.toggleHDAAnnotationEditors(false,i.fxSpeed)},$activator:faIconButton({title:_l("Edit history Annotation"),classes:"history-annotate-btn",faIcon:"fa-comment"}).appendTo(h.find(".history-secondary-actions"))})},_renderSearchButton:function(h){return faIconButton({title:_l("Search datasets"),classes:"history-search-btn",faIcon:"fa-search"})},_renderSelectButton:function(h){return faIconButton({title:_l("Operations on multiple datasets"),classes:"history-select-btn",faIcon:"fa-check-square-o"})},_setUpBehaviours:function(h){h=h||this.$el;h.find("[title]").tooltip({placement:"bottom"});if((!this.model)||(!Galaxy.currUser||Galaxy.currUser.isAnonymous())||(Galaxy.currUser.id!==this.model.get("user_id"))){return}var i=this;h.find(".history-name").attr("title",_l("Click to rename history")).tooltip({placement:"bottom"}).make_text_editable({on_finish:function(j){h.find(".history-name").text(j);i.model.save({name:j}).fail(function(){h.find(".history-name").text(i.model.previous("name"))})}});this._setUpDatasetActionsPopup(h)},_setUpDatasetActionsPopup:function(h){var i=this;(new PopupMenu(h.find(".history-dataset-action-popup-btn"),[{html:_l("Hide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.hide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Unhide datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.unhide;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Delete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype["delete"];i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Undelete datasets"),func:function(){var j=d.HistoryDatasetAssociation.prototype.undelete;i.getSelectedHdaCollection().ajaxQueue(j)}},{html:_l("Permanently delete datasets"),func:function(){if(confirm(_l("This will permanently remove the data in your datasets. Are you sure?"))){var j=d.HistoryDatasetAssociation.prototype.purge;i.getSelectedHdaCollection().ajaxQueue(j)}}}]))},refreshHdas:function(i,h){if(this.model){return this.model.refresh(i,h)}return $.when()},addHdaView:function(k){this.log("add."+this,k);var i=this;if(!k.isVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"))){return}$({}).queue([function j(m){var l=i.$el.find(i.emptyMsgSelector);if(l.is(":visible")){l.fadeOut(i.fxSpeed,m)}else{m()}},function h(m){i.scrollToTop();var l=i.$el.find(i.datasetsSelector);i.createHdaView(k).$el.hide().prependTo(l).slideDown(i.fxSpeed)}])},createHdaView:function(j){var i=j.get("id"),h=this.storage.get("expandedHdas")[i],k=new this.HDAViewClass({model:j,linkTarget:this.linkTarget,expanded:h,tagsEditorShown:this.tagsEditorShown,annotationEditorShown:this.annotationEditorShown,selectable:this.selecting,hasUser:this.model.ownedByCurrUser(),logger:this.logger});this._setUpHdaListeners(k);this.hdaViews[i]=k;return k.render()},_setUpHdaListeners:function(i){var h=this;i.on("body-expanded",function(j){h.storage.addExpandedHda(j)});i.on("body-collapsed",function(j){h.storage.removeExpandedHda(j)});i.on("error",function(k,m,j,l){h.errorHandler(k,m,j,l)})},handleHdaDeletionChange:function(h){if(h.get("deleted")&&!this.storage.get("show_deleted")){this.removeHdaView(this.hdaViews[h.id])}},handleHdaVisibleChange:function(h){if(h.hidden()&&!this.storage.get("show_hidden")){this.removeHdaView(this.hdaViews[h.id])}},removeHdaView:function(i){if(!i){return}var h=this;i.$el.fadeOut(h.fxSpeed,function(){i.off();i.remove();delete h.hdaViews[i.model.id];if(_.isEmpty(h.hdaViews)){h.$el.find(h.emptyMsgSelector).fadeIn(h.fxSpeed,function(){h.trigger("empty-history",h)})}})},renderHdas:function(j){j=j||this.$el;this.hdaViews={};var i=this,h=j.find(this.datasetsSelector),k=this.model.hdas.getVisible(this.storage.get("show_deleted"),this.storage.get("show_hidden"),this.filters);h.empty();if(k.length){k.each(function(l){h.prepend(i.createHdaView(l).$el)});j.find(this.emptyMsgSelector).hide()}else{j.find(this.emptyMsgSelector).show()}return this.hdaViews},toggleHDATagEditors:function(){var h=arguments;_.each(this.hdaViews,function(i){if(i.tagsEditor){i.tagsEditor.toggle.apply(i.tagsEditor,h)}})},toggleHDAAnnotationEditors:function(h){var i=arguments;_.each(this.hdaViews,function(j){if(j.annotationEditor){j.annotationEditor.toggle.apply(j.annotationEditor,i)}})},events:{"click .message-container":"clearMessages","click .history-search-btn":"toggleSearchControls","click .history-select-btn":function(h){this.toggleSelectors(this.fxSpeed)},"click .history-select-all-datasets-btn":"selectAllDatasets"},updateHistoryDiskSize:function(){this.$el.find(".history-size").text(this.model.get("nice_size"))},collapseAllHdaBodies:function(){_.each(this.hdaViews,function(h){h.toggleBodyVisibility(null,false)});this.storage.set("expandedHdas",{})},toggleShowDeleted:function(){this.storage.set("show_deleted",!this.storage.get("show_deleted"));this.renderHdas();return this.storage.get("show_deleted")},toggleShowHidden:function(){this.storage.set("show_hidden",!this.storage.get("show_hidden"));this.renderHdas();return this.storage.get("show_hidden")},renderSearchControls:function(i){var j=this;function l(m){j.searchFor=m;j.filters=[function(n){return n.matchesAll(j.searchFor)}];j.trigger("search:searching",m,j);j.renderHdas()}function h(m){if(j.model.hdas.haveDetails()){l(m);return}j.$el.find(".history-search-controls").searchInput("toggle-loading");j.model.hdas.fetchAllDetails({silent:true}).always(function(){j.$el.find(".history-search-controls").searchInput("toggle-loading")}).done(function(){l(m)})}function k(){j.searchFor="";j.filters=[];j.trigger("search:clear",j);j.renderHdas()}return i.searchInput({initialVal:j.searchFor,name:"history-search",placeholder:"search datasets",classes:"history-search",onfirstsearch:h,onsearch:l,onclear:k})},toggleSearchControls:function(){var h=this.$el.find(".history-search-controls");if(!h.children().size()){h=this.renderSearchControls(h).hide()}h.slideToggle(this.fxSpeed,function(){if($(this).is(":visible")){this.searching=true;$(this).find("input").focus()}else{this.searching=false}})},showSelectors:function(h){this.selecting=true;this.$el.find(".history-dataset-actions").slideDown(h);_.each(this.hdaViews,function(i){i.showSelector(h)})},hideSelectors:function(h){this.selecting=false;this.$el.find(".history-dataset-actions").slideUp(h);_.each(this.hdaViews,function(i){i.hideSelector(h)})},toggleSelectors:function(h){if(!this.selecting){this.showSelectors(h)}else{this.hideSelectors(h)}},selectAllDatasets:function(i){var h=this.$el.find(".history-select-all-datasets-btn");currMode=h.data("mode");if(currMode==="select"){_.each(this.hdaViews,function(j){j.select(i)});h.data("mode","deselect");h.text(_l("De-select all"))}else{if(currMode==="deselect"){_.each(this.hdaViews,function(j){j.deselect(i)});h.data("mode","select");h.text(_l("Select all"))}}},getSelectedHdaViews:function(){return _.filter(this.hdaViews,function(h){return h.selected})},getSelectedHdaCollection:function(){return new d.HDACollection(_.map(this.getSelectedHdaViews(),function(h){return h.model}),{historyId:this.model.id})},showLoadingIndicator:function(i,h,j){h=(h!==undefined)?(h):(this.fxSpeed);if(!this.indicator){this.indicator=new LoadingIndicator(this.$el,this.$el.parent())}if(!this.$el.is(":visible")){this.indicator.show(0,j)}else{this.$el.fadeOut(h);this.indicator.show(i,h,j)}},hideLoadingIndicator:function(h,i){h=(h!==undefined)?(h):(this.fxSpeed);if(this.indicator){this.indicator.hide(h,i)}},displayMessage:function(m,n,l){var j=this;this.scrollToTop();var k=this.$el.find(this.msgsSelector),h=$("<div/>").addClass(m+"message").html(n);if(!_.isEmpty(l)){var i=$('<a href="javascript:void(0)">Details</a>').click(function(){Galaxy.modal.show(j.messageToModalOptions(m,n,l));return false});h.append(" ",i)}return k.html(h)},messageToModalOptions:function(l,n,k){var h=this,m=$("<div/>"),j={title:"Details"};function i(o){o=_.omit(o,_.functions(o));return["<table>",_.map(o,function(q,p){q=(_.isObject(q))?(i(q)):(q);return'<tr><td style="vertical-align: top; color: grey">'+p+'</td><td style="padding-left: 8px">'+q+"</td></tr>"}).join(""),"</table>"].join("")}if(_.isObject(k)){j.body=m.append(i(k))}else{j.body=m.html(k)}j.buttons={Ok:function(){Galaxy.modal.hide();h.clearMessages()}};return j},clearMessages:function(){var h=this.$el.find(this.msgsSelector);h.empty()},scrollPosition:function(){return this.$el.parent().scrollTop()},scrollTo:function(h){this.$el.parent().scrollTop(h)},scrollToTop:function(){this.$el.parent().scrollTop(0);return this},scrollIntoView:function(i,j){if(!j){this.$el.parent().parent().scrollTop(i);return this}var h=window,k=this.$el.parent().parent(),m=$(h).innerHeight(),l=(m/2)-(j/2);$(k).scrollTop(i-l);return this},scrollToId:function(i){if((!i)||(!this.hdaViews[i])){return this}var h=this.hdaViews[i].$el;this.scrollIntoView(h.offset().top,h.outerHeight());return this},scrollToHid:function(h){var i=this.model.hdas.getByHid(h);if(!i){return this}return this.scrollToId(i.id)},connectToQuotaMeter:function(h){if(!h){return this}this.listenTo(h,"quota:over",this.showQuotaMessage);this.listenTo(h,"quota:under",this.hideQuotaMessage);this.on("rendered rendered:initial",function(){if(h&&h.isOverQuota()){this.showQuotaMessage()}});return this},showQuotaMessage:function(){var h=this.$el.find(".quota-message");if(h.is(":hidden")){h.slideDown(this.fxSpeed)}},hideQuotaMessage:function(){var h=this.$el.find(".quota-message");if(!h.is(":hidden")){h.slideUp(this.fxSpeed)}},connectToOptionsMenu:function(h){if(!h){return this}this.on("new-storage",function(j,i){if(h&&j){h.findItemByHtml(_l("Include Deleted Datasets")).checked=j.get("show_deleted");h.findItemByHtml(_l("Include Hidden Datasets")).checked=j.get("show_hidden")}});return this},toString:function(){return"HistoryPanel("+((this.model)?(this.model.get("name")):(""))+")"}});e.templates={historyPanel:Handlebars.templates["template-history-historyPanel"],anonHistoryPanel:Handlebars.templates["template-history-historyPanel-anon"]};return{HistoryPanel:e}});
\ 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: 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 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/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