commit/galaxy-central: greg: Import fixes, code cleanup and white space changes to follow Galaxy dev team standards related to pull request # 155.
1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/6e91867769ea/ Changeset: 6e91867769ea User: greg Date: 2013-04-16 20:27:09 Summary: Import fixes, code cleanup and white space changes to follow Galaxy dev team standards related to pull request # 155. Affected #: 14 files diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py --- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py +++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py @@ -1,5 +1,4 @@ import logging -import urllib2 from paste.httpexceptions import HTTPBadRequest, HTTPForbidden diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/galaxy/webapps/galaxy/controllers/admin.py --- a/lib/galaxy/webapps/galaxy/controllers/admin.py +++ b/lib/galaxy/webapps/galaxy/controllers/admin.py @@ -712,7 +712,7 @@ tool_dependencies_dict = {} repository_name = elem.get( 'name' ) changeset_revision = elem.get( 'changeset_revision' ) - url = '%s/repository/get_tool_dependencies?name=%s&owner=devteam&changeset_revision=%s&from_install_manager=True' % \ + url = '%s/repository/get_tool_dependencies?name=%s&owner=devteam&changeset_revision=%s&from_install_manager=True' % \ ( tool_shed_url, repository_name, changeset_revision ) text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) if text: diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc 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 @@ -1010,7 +1010,11 @@ tool_shed_repository.installed_changeset_revision, tool_shed_repository.owner, tool_shed_repository.dist_to_shed ) - ctx_rev = suc.get_ctx_rev( trans.app, tool_shed_url, tool_shed_repository.name, tool_shed_repository.owner, tool_shed_repository.installed_changeset_revision ) + ctx_rev = suc.get_ctx_rev( trans.app, + tool_shed_url, + tool_shed_repository.name, + tool_shed_repository.owner, + tool_shed_repository.installed_changeset_revision ) repo_info_dicts = [] repo_info_dict = kwd.get( 'repo_info_dict', None ) if repo_info_dict: @@ -1372,7 +1376,7 @@ message ++ "from the installed repository's <b>Repository Actions</b> menu. " status = 'error' shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository ) - repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) ) + repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) ) containers_dict = metadata_util.populate_containers_dict_from_repository_metadata( trans=trans, tool_shed_url=tool_shed_url, tool_path=tool_path, diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/galaxy/webapps/galaxy/controllers/workflow.py --- a/lib/galaxy/webapps/galaxy/controllers/workflow.py +++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py @@ -12,7 +12,8 @@ import urllib2 from sqlalchemy import and_ -from tool_shed.util import encoding_util, common_util +from tool_shed.util import common_util +from tool_shed.util import encoding_util from galaxy import model from galaxy import util @@ -1070,7 +1071,7 @@ import_button = True if tool_shed_url and not import_button: # Use urllib (send another request to the tool shed) to retrieve the workflow. - workflow_url = '%s/workflow/import_workflow?repository_metadata_id=%s&workflow_name=%s&open_for_url=true' % \ + workflow_url = '%s/workflow/import_workflow?repository_metadata_id=%s&workflow_name=%s&open_for_url=true' % \ ( tool_shed_url, repository_metadata_id, encoding_util.tool_shed_encode( workflow_name ) ) workflow_text = common_util.tool_shed_get( trans.app, tool_shed_url, workflow_url ) import_button = True diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/galaxy_install/install_manager.py --- a/lib/tool_shed/galaxy_install/install_manager.py +++ b/lib/tool_shed/galaxy_install/install_manager.py @@ -2,15 +2,24 @@ Manage automatic installation of tools configured in the xxx.xml files in ~/scripts/migrate_tools (e.g., 0002_tools.xml). All of the tools were at some point included in the Galaxy distribution, but are now hosted in the main Galaxy tool shed. """ -import os, tempfile +import os +import tempfile from galaxy import util from galaxy.tools import ToolSection -from galaxy.util.json import from_json_string, to_json_string +from galaxy.util.json import from_json_string +from galaxy.util.json import to_json_string import tool_shed.util.shed_util_common as suc -from tool_shed.util import common_install_util, common_util, datatype_util, metadata_util, tool_dependency_util, tool_util +from tool_shed.util import common_install_util +from tool_shed.util import common_util +from tool_shed.util import datatype_util +from tool_shed.util import metadata_util +from tool_shed.util import tool_dependency_util +from tool_shed.util import tool_util from galaxy.util.odict import odict + class InstallManager( object ): + def __init__( self, app, latest_migration_script_number, tool_shed_install_config, migrated_tools_config, install_dependencies ): """ Check tool settings in tool_shed_install_config and install all repositories that are not already installed. The tool @@ -72,6 +81,7 @@ message = "\nThe main Galaxy tool shed is not currently available, so skipped migration stage %s.\n" % str( latest_migration_script_number ) message += "Try again later.\n" print message + def get_guid( self, repository_clone_url, relative_install_dir, tool_config ): if self.shed_config_dict.get( 'tool_path' ): relative_install_dir = os.path.join( self.shed_config_dict['tool_path'], relative_install_dir ) @@ -89,6 +99,7 @@ full_path = str( os.path.abspath( os.path.join( root, name ) ) ) tool = self.toolbox.load_tool( full_path ) return suc.generate_tool_guid( repository_clone_url, tool ) + def get_proprietary_tool_panel_elems( self, latest_tool_migration_script_number ): # Parse each config in self.proprietary_tool_confs (the default is tool_conf.xml) and generate a list of Elements that are # either ToolSection elements or Tool elements. These will be used to generate new entries in the migrated_tools_conf.xml @@ -128,6 +139,7 @@ if elem not in tool_panel_elems: tool_panel_elems.append( elem ) return tool_panel_elems + def get_containing_tool_sections( self, tool_config ): """ If tool_config is defined somewhere in self.proprietary_tool_panel_elems, return True and a list of ToolSections in which the @@ -158,6 +170,7 @@ if not is_displayed: is_displayed = True return is_displayed, tool_sections + def handle_repository_contents( self, tool_shed_repository, repository_clone_url, relative_install_dir, repository_elem, install_dependencies ): """Generate the metadata for the installed tool shed repository, among other things.""" tool_panel_dict_for_display = odict() @@ -268,6 +281,7 @@ shutil.rmtree( work_dir ) except: pass + def install_repository( self, repository_elem, install_dependencies ): # Install a single repository, loading contained tools into the tool panel. name = repository_elem.get( 'name' ) @@ -310,7 +324,7 @@ tool_shed_repository, self.app.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS ) # Get the tool_versions from the tool shed for each tool in the installed change set. - url = '%s/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % \ + url = '%s/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s' % \ ( tool_shed_url, tool_shed_repository.name, self.repository_owner, installed_changeset_revision ) text = common_util.tool_shed_get( self.app, tool_shed_url, url ) if text: @@ -346,9 +360,11 @@ self.app.sa_session.add( tool_version_association ) self.app.sa_session.flush() suc.update_tool_shed_repository_status( self.app, tool_shed_repository, self.app.model.ToolShedRepository.installation_status.INSTALLED ) + @property def non_shed_tool_panel_configs( self ): return common_util.get_non_shed_tool_panel_configs( self.app ) + def __isinstalled( self, clone_dir ): full_path = os.path.abspath( clone_dir ) if os.path.exists( full_path ): diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/galaxy_install/tool_dependencies/common_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/common_util.py @@ -28,6 +28,7 @@ # </environment_variable> return dict( name=env_var_name, action=env_var_action, value=elem.text) return None + def create_or_update_env_shell_file( install_dir, env_var_dict ): env_var_name = env_var_dict[ 'name' ] env_var_action = env_var_dict[ 'action' ] @@ -50,6 +51,7 @@ env_shell_file_path, env_shell_file_path ) return cmd + def extract_tar( file_name, file_path ): if isgzip( file_name ) or isbz2( file_name ): # Open for reading with transparent compression. @@ -58,6 +60,7 @@ tar = tarfile.open( file_name ) tar.extractall( path=file_path ) tar.close() + def extract_zip( archive_path, extraction_path ): # TODO: change this method to use zipfile.Zipfile.extractall() when we stop supporting Python 2.5. if not zipfile_ok( archive_path ): @@ -72,17 +75,23 @@ file( uncompressed_path, 'wb' ).write( zip_archive.read( name ) ) zip_archive.close() return True + def isbz2( file_path ): return checkers.is_bz2( file_path ) + def isgzip( file_path ): return checkers.is_gzip( file_path ) + def istar( file_path ): return tarfile.is_tarfile( file_path ) + def iszip( file_path ): return checkers.check_zip( file_path ) + def make_directory( full_path ): if not os.path.exists( full_path ): os.makedirs( full_path ) + def move_directory_files( current_dir, source_dir, destination_dir ): source_directory = os.path.abspath( os.path.join( current_dir, source_dir ) ) destination_directory = os.path.join( destination_dir ) @@ -92,12 +101,14 @@ source_file = os.path.join( source_directory, file_name ) destination_file = os.path.join( destination_directory, file_name ) shutil.move( source_file, destination_file ) + def move_file( current_dir, source, destination_dir ): source_file = os.path.abspath( os.path.join( current_dir, source ) ) destination_directory = os.path.join( destination_dir ) if not os.path.isdir( destination_directory ): os.makedirs( destination_directory ) shutil.move( source_file, destination_directory ) + def tar_extraction_directory( file_path, file_name ): """Try to return the correct extraction directory.""" file_name = file_name.strip() @@ -110,6 +121,7 @@ if os.path.exists( os.path.abspath( os.path.join( file_path, file_name ) ) ): return os.path.abspath( file_path ) raise ValueError( 'Could not find path to file %s' % os.path.abspath( os.path.join( file_path, file_name ) ) ) + def url_download( install_dir, downloaded_file_name, download_url ): file_path = os.path.join( install_dir, downloaded_file_name ) src = None @@ -125,6 +137,7 @@ if dst: dst.close() return os.path.abspath( file_path ) + def zip_extraction_directory( file_path, file_name ): """Try to return the correct extraction directory.""" files = [ filename for filename in os.listdir( file_path ) if not filename.endswith( '.zip' ) ] @@ -135,6 +148,7 @@ if os.path.isdir( os.path.join( file_path, files[ 0 ] ) ): return os.path.abspath( os.path.join( file_path, files[ 0 ] ) ) raise ValueError( 'Could not find directory for the extracted file %s' % os.path.abspath( os.path.join( file_path, file_name ) ) ) + def zipfile_ok( path_to_archive ): """ This function is a bit pedantic and not functionally necessary. It checks whether there is no file pointing outside of the extraction, diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/galaxy_install/tool_dependencies/install_util.py --- a/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py +++ b/lib/tool_shed/galaxy_install/tool_dependencies/install_util.py @@ -1,7 +1,13 @@ -import sys, os, subprocess, tempfile +import os +import sys +import subprocess +import tempfile import common_util import fabric_util -from tool_shed.util import encoding_util, tool_dependency_util, common_util +import tool_shed.util.shed_util_common as suc +import tool_shed.util.common_util as cu +from tool_shed.util import encoding_util +from tool_shed.util import tool_dependency_util from galaxy.model.orm import and_ from galaxy.web import url_for @@ -9,21 +15,20 @@ import pkg_resources pkg_resources.require( 'elementtree' ) -from elementtree import ElementTree, ElementInclude -from elementtree.ElementTree import Element, SubElement +from elementtree import ElementTree +from elementtree import ElementInclude +from elementtree.ElementTree import Element +from elementtree.ElementTree import SubElement def clean_tool_shed_url( base_url ): protocol, base = base_url.split( '://' ) return base.rstrip( '/' ) def create_temporary_tool_dependencies_config( app, tool_shed_url, name, owner, changeset_revision ): - """ - Make a call to the tool shed to get the required repository's tool_dependencies.xml file. - """ - url = url_join( tool_shed_url, - 'repository/get_tool_dependencies_config_contents?name=%s&owner=%s&changeset_revision=%s' % \ - ( name, owner, changeset_revision ) ) - text = common_util.tool_shed_get( app, tool_shed_url, url ) + """Make a call to the tool shed to get the required repository's tool_dependencies.xml file.""" + url = url_join( tool_shed_url, + 'repository/get_tool_dependencies_config_contents?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) ) + text = cu.tool_shed_get( app, tool_shed_url, url ) if text: # Write the contents to a temporary file on disk so it can be reloaded and parsed. fh = tempfile.NamedTemporaryFile( 'wb' ) @@ -102,13 +107,11 @@ Get all appropriate newer changeset revisions for the repository defined by the received tool_shed_url / name / owner combination. """ - url = suc.url_join( tool_shed_url, - 'repository/updated_changeset_revisions?name=%s&owner=%s&changeset_revision=%s' % - ( name, owner, changeset_revision ) ) - text = common_util.tool_shed_get( app, tool_shed_url, url ) + url = suc.url_join( tool_shed_url, + 'repository/updated_changeset_revisions?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) ) + text = cu.tool_shed_get( app, tool_shed_url, url ) return text - def handle_set_environment_entry_for_package( app, install_dir, tool_shed_repository, package_name, package_version, elem ): action_dict = {} actions = [] @@ -220,7 +223,8 @@ else: # Make a call to the tool shed to get the changeset revision to which the current value of required_repository_changeset_revision # should be updated if it's not current. - text = get_updated_changeset_revisions_from_tool_shed( app, tool_shed_url=tool_shed, + text = get_updated_changeset_revisions_from_tool_shed( app=app, + tool_shed_url=tool_shed, name=required_repository_name, owner=required_repository_owner, changeset_revision=required_repository_changeset_revision ) @@ -238,7 +242,8 @@ tool_dependency_name=package_name, tool_dependency_version=package_version ) # Make a call to the tool shed to get the required repository's tool_dependencies.xml file. - tmp_filename = create_temporary_tool_dependencies_config( app, tool_shed, + tmp_filename = create_temporary_tool_dependencies_config( app, + tool_shed, required_repository_name, required_repository_owner, required_repository_changeset_revision ) diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/galaxy_install/update_manager.py --- a/lib/tool_shed/galaxy_install/update_manager.py +++ b/lib/tool_shed/galaxy_install/update_manager.py @@ -1,15 +1,18 @@ """ Determine if installed tool shed repositories have updates available in their respective tool sheds. """ -import threading, logging +import logging +import threading from galaxy.util import string_as_bool import tool_shed.util.shed_util_common as suc +from tool_shed.util import common_util from galaxy.model.orm import and_ -from tool_shed.util import common_util log = logging.getLogger( __name__ ) + class UpdateManager( object ): + def __init__( self, app ): self.app = app self.sa_session = self.app.model.context.current @@ -19,6 +22,7 @@ self.restarter = threading.Thread( target=self.__restarter ) self.restarter.start() self.seconds_to_sleep = int( app.config.hours_between_check * 3600 ) + def __restarter( self ): log.info( 'Update manager restarter starting up...' ) while self.running: @@ -34,6 +38,7 @@ self.sa_session.flush() self.sleeper.sleep( self.seconds_to_sleep ) log.info( 'Transfer job restarter shutting down...' ) + def check_for_update( self, repository ): tool_shed_url = suc.get_url_from_tool_shed( self.app, repository.tool_shed ) url = '%s/repository/check_for_updates?name=%s&owner=%s&changeset_revision=%s&from_update_manager=True' % \ @@ -44,21 +49,23 @@ # The required tool shed may be unavailable. text = 'False' return string_as_bool( text ) + def shutdown( self ): self.running = False self.sleeper.wake() + class Sleeper( object ): - """ - Provides a 'sleep' method that sleeps for a number of seconds *unless* - the notify method is called (from a different thread). - """ + """Provides a 'sleep' method that sleeps for a number of seconds *unless* the notify method is called (from a different thread).""" + def __init__( self ): self.condition = threading.Condition() + def sleep( self, seconds ): self.condition.acquire() self.condition.wait( seconds ) self.condition.release() + def wake( self ): self.condition.acquire() self.condition.notify() diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/tool_shed_registry.py --- a/lib/tool_shed/tool_shed_registry.py +++ b/lib/tool_shed/tool_shed_registry.py @@ -1,13 +1,15 @@ +import logging +import sys import urllib2 -import sys, logging from galaxy.util import parse_xml from galaxy.util.odict import odict +from xml.etree import ElementTree log = logging.getLogger( __name__ ) -from xml.etree import ElementTree class Registry( object ): + def __init__( self, root_dir=None, config=None ): self.tool_sheds = odict() self.tool_sheds_auth = odict() @@ -33,34 +35,16 @@ except Exception, e: log.warning( 'Error loading reference to tool shed "%s", problem: %s' % ( name, str( e ) ) ) - def url_from_tool_shed( self, tool_shed ): + def password_manager_for_url( self, url ): """ - The value of tool_shed is something like: toolshed.g2.bx.psu.edu - We need the URL to this tool shed, which is something like: - http://toolshed.g2.bx.psu.edu/ - """ - for shed_name, shed_url in self.tool_sheds.items(): - if shed_url.find( tool_shed ) >= 0: - if shed_url.endswith( '/' ): - shed_url = shed_url.rstrip( '/' ) - return shed_url - # The tool shed from which the repository was originally installed - # must no longer be configured in tool_sheds_conf.xml. - return None - - def password_manager_for_url(self, url): - """ - If the tool shed is using external auth, the client to the toolshed must - authenticate to that as well. This provides access to the + If the tool shed is using external auth, the client to the tool shed must authenticate to that as well. This provides access to the urllib2.HTTPPasswordMgrWithdefaultRealm() object for the url passed in. - Following more what galaxy.demo_sequencer.controllers.common does might - be more appropriate at some stage... + Following more what galaxy.demo_sequencer.controllers.common does might be more appropriate at some stage... """ log.debug( 'Looking for url %s' % url ) - for shed_name, shed_url in self.tool_sheds.items(): if shed_url.find( url ) >= 0: - log.debug( 'Found %s -> %s' % (shed_name, shed_url) ) + log.debug( 'Found %s -> %s' % ( shed_name, shed_url ) ) return self.tool_sheds_auth[ shed_name ] return None diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc 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 @@ -282,7 +282,7 @@ url = suc.url_join( tool_shed_url, '/repository/get_required_repo_info_dict?encoded_str=%s' % encoded_required_repository_str ) text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) if text: - required_repo_info_dict = json.from_json_string( text ) + required_repo_info_dict = json.from_json_string( text ) required_repo_info_dicts = [] encoded_dict_strings = required_repo_info_dict[ 'repo_info_dicts' ] for encoded_dict_str in encoded_dict_strings: diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/util/common_util.py --- a/lib/tool_shed/util/common_util.py +++ b/lib/tool_shed/util/common_util.py @@ -94,17 +94,15 @@ return shed_url return None -def tool_shed_get(app, tool_shed_url, uri): - """ - Make contact with the tool shed via the uri provided. - """ - registry = app.tool_shed_registry - urlopener = urllib2.build_opener() +def tool_shed_get( app, tool_shed_url, uri ): + """Make contact with the tool shed via the uri provided.""" + registry = app.tool_shed_registry + urlopener = urllib2.build_opener() password_mgr = registry.password_manager_for_url( tool_shed_url ) if ( password_mgr is not None ): auth_handler = urllib2.HTTPBasicAuthHandler( password_mgr ) urlopener.add_handler( auth_handler ) - response = urlopener.open( uri ) - content = response.read() + response = urlopener.open( uri ) + content = response.read() response.close() return content diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/util/metadata_util.py --- a/lib/tool_shed/util/metadata_util.py +++ b/lib/tool_shed/util/metadata_util.py @@ -1010,8 +1010,7 @@ def get_updated_changeset_revisions_from_tool_shed( app, tool_shed_url, name, owner, changeset_revision ): """ - Get all appropriate newer changeset revisions for the repository defined by - the received tool_shed_url / name / owner combination. + Get all appropriate newer changeset revisions for the repository defined by the received tool_shed_url / name / owner combination. """ url = suc.url_join( tool_shed_url, 'repository/updated_changeset_revisions?name=%s&owner=%s&changeset_revision=%s' % diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/util/readme_util.py --- a/lib/tool_shed/util/readme_util.py +++ b/lib/tool_shed/util/readme_util.py @@ -2,7 +2,7 @@ import os from galaxy.util import json import tool_shed.util.shed_util_common as suc -from tool_shed.util import common_util +from tool_shed.util import common_util log = logging.getLogger( __name__ ) @@ -28,17 +28,16 @@ def get_readme_files_dict_for_display( trans, tool_shed_url, repo_info_dict ): """ - Return a dictionary of README files contained in the single repository - being installed so they can be displayed on the tool panel section + Return a dictionary of README files contained in the single repository being installed so they can be displayed on the tool panel section selection page. """ name = repo_info_dict.keys()[ 0 ] repo_info_tuple = repo_info_dict[ name ] - description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td = suc.get_repo_info_tuple_contents( repo_info_tuple ) + description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, repository_dependencies, installed_td = \ + suc.get_repo_info_tuple_contents( repo_info_tuple ) # Handle README files. url = suc.url_join( tool_shed_url, - 'repository/get_readme_files?name=%s&owner=%s&changeset_revision=%s' % \ - ( name, repository_owner, changeset_revision ) ) - raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) + 'repository/get_readme_files?name=%s&owner=%s&changeset_revision=%s' % ( name, repository_owner, changeset_revision ) ) + raw_text = common_util.tool_shed_get( trans.app, tool_shed_url, url ) readme_files_dict = json.from_json_string( raw_text ) return readme_files_dict diff -r 494837c4fe5b6554a4c8cb1e93547ec45413f2df -r 6e91867769eab9e97353cd0e6363393c8077aadc lib/tool_shed/util/shed_util_common.py --- a/lib/tool_shed/util/shed_util_common.py +++ b/lib/tool_shed/util/shed_util_common.py @@ -445,13 +445,12 @@ def get_ctx_rev( app, tool_shed_url, name, owner, changeset_revision ): """ - Send a request to the tool shed to retrieve the ctx_rev for a repository - defined by the combination of a name, owner and changeset revision. + Send a request to the tool shed to retrieve the ctx_rev for a repository defined by the combination of a name, owner and changeset + revision. """ - url = url_join( tool_shed_url, - 'repository/get_ctx_rev?name=%s&owner=%s&changeset_revision=%s' % - ( name, owner, changeset_revision ) ) - ctx_rev = common_util.tool_shed_get( app, tool_shed_url, url) + url = url_join( tool_shed_url, + 'repository/get_ctx_rev?name=%s&owner=%s&changeset_revision=%s' % ( name, owner, changeset_revision ) ) + ctx_rev = common_util.tool_shed_get( app, tool_shed_url, url ) return ctx_rev def get_ctx_file_path_from_manifest( filename, repo, changeset_revision ): @@ -546,8 +545,7 @@ if not repository: tool_shed_url = get_url_from_tool_shed( trans.app, tool_shed ) repository_clone_url = os.path.join( tool_shed_url, 'repos', owner, name ) - ctx_rev = get_ctx_rev( trans.app, - tool_shed_url, name, owner, changeset_revision ) + ctx_rev = get_ctx_rev( trans.app, tool_shed_url, name, owner, changeset_revision ) repository = create_or_update_tool_shed_repository( app=trans.app, name=name, description=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.
participants (1)
-
commits-noreply@bitbucket.org