1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8c7c4af96ecc/ Changeset: 8c7c4af96ecc User: greg Date: 2013-12-21 14:07:11 Summary: Refactor and fix prep scripts for the tool shed's install and test frameowrk. Affected #: 3 files
diff -r b83064c6c323217a6072e869afafec19ce965b0f -r 8c7c4af96ecc11f44ca71b997774b621ad5295eb 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 @@ -23,6 +23,7 @@
from install_and_test_tool_shed_repositories.base.util import get_database_version from install_and_test_tool_shed_repositories.base.util import get_repository_current_revision +from install_and_test_tool_shed_repositories.base.util import RepositoryMetadataApplication from galaxy.model.orm import and_ from galaxy.model.orm import not_ from galaxy.model.orm import select @@ -36,32 +37,6 @@ log = logging.getLogger( 'check_repositories_for_functional_tests' ) assert sys.version_info[ :2 ] >= ( 2, 6 )
- -class RepositoryMetadataApplication( object ): - """Application that enables updating repository_metadata table records in the Tool Shed.""" - - def __init__( self, config ): - self.config = config - if self.config.database_connection is False: - self.config.database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % str( config.database ) - log.debug( 'Using database connection: %s' % str( self.config.database_connection ) ) - # Setup the database engine and ORM - self.model = galaxy.webapps.tool_shed.model.mapping.init( self.config.file_path, - self.config.database_connection, - engine_options={}, - create_tables=False ) - self.hgweb_config_manager = self.model.hgweb_config_manager - self.hgweb_config_manager.hgweb_config_dir = self.config.hgweb_config_dir - log.debug( 'Using hgweb.config file: %s' % str( self.hgweb_config_manager.hgweb_config ) ) - - @property - def sa_session( self ): - """Returns a SQLAlchemy session.""" - return self.model.context.current - - def shutdown( self ): - pass - def check_and_update_repository_metadata( app, info_only=False, verbosity=1 ): """ This method will iterate through all records in the repository_metadata table, checking each one for tool metadata,
diff -r b83064c6c323217a6072e869afafec19ce965b0f -r 8c7c4af96ecc11f44ca71b997774b621ad5295eb 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 @@ -27,6 +27,7 @@
from install_and_test_tool_shed_repositories.base.util import get_database_version from install_and_test_tool_shed_repositories.base.util import get_repository_current_revision +from install_and_test_tool_shed_repositories.base.util import RepositoryMetadataApplication from galaxy.model.orm import and_ from galaxy.model.orm import not_ from galaxy.model.orm import select @@ -40,30 +41,6 @@
assert sys.version_info[ :2 ] >= ( 2, 6 )
-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 - # Setup the database engine and ORM - self.model = galaxy.webapps.tool_shed.model.mapping.init( config.file_path, config.database_connection, engine_options={}, create_tables=False ) - self.hgweb_config_manager = self.model.hgweb_config_manager - self.hgweb_config_manager.hgweb_config_dir = config.hgweb_config_dir - print "# Using configured hgweb.config file: ", self.hgweb_config_manager.hgweb_config - - @property - def sa_session( self ): - """ - Returns a SQLAlchemy session -- currently just gets the current - session from the threadlocal session context, but this is provided - to allow migration toward a more SQLAlchemy 0.4 style of use. - """ - return self.model.context.current - - def shutdown( self ): - pass - def main(): '''Script that validates all repositories of type tool_dependency_definition.''' parser = OptionParser() @@ -93,8 +70,7 @@ print "# This tool shed is configured to listen on %s:%s" % ( config_parser.get( config_section, 'host' ), config_parser.get( config_section, 'port' ) )
- app = RepositoriesApplication( config ) - + app = RepositoryMetadataApplication( config ) if options.info_only: print "# Displaying info only ( --info_only )" if options.verbosity:
diff -r b83064c6c323217a6072e869afafec19ce965b0f -r 8c7c4af96ecc11f44ca71b997774b621ad5295eb test/install_and_test_tool_shed_repositories/base/util.py --- a/test/install_and_test_tool_shed_repositories/base/util.py +++ b/test/install_and_test_tool_shed_repositories/base/util.py @@ -181,6 +181,32 @@ return passed_tests return []
+ +class RepositoryMetadataApplication( object ): + """Application that enables updating repository_metadata table records in the Tool Shed.""" + + def __init__( self, config ): + self.config = config + if self.config.database_connection is False: + self.config.database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % str( config.database ) + log.debug( 'Using database connection: %s' % str( self.config.database_connection ) ) + # Setup the database engine and ORM + self.model = galaxy.webapps.tool_shed.model.mapping.init( self.config.file_path, + self.config.database_connection, + engine_options={}, + create_tables=False ) + self.hgweb_config_manager = self.model.hgweb_config_manager + self.hgweb_config_manager.hgweb_config_dir = self.config.hgweb_config_dir + log.debug( 'Using hgweb.config file: %s' % str( self.hgweb_config_manager.hgweb_config ) ) + + @property + def sa_session( self ): + """Returns a SQLAlchemy session.""" + return self.model.context.current + + def shutdown( self ): + pass + def display_repositories_by_owner( repository_dicts ): # Group summary display by repository owner. repository_dicts_by_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.
galaxy-commits@lists.galaxyproject.org