Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace common_util.url_join with util.build_url. #2055

Merged
merged 3 commits into from
Apr 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
27 changes: 13 additions & 14 deletions lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,11 @@ def browse_toolsheds( self, trans, **kwd ):
def browse_toolshed( self, trans, **kwd ):
tool_shed_url = kwd.get( 'tool_shed_url', '' )
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( trans.app, tool_shed_url )
url = common_util.url_join( tool_shed_url, pathspec=[ 'api', 'categories' ] )
categories = json.loads( common_util.tool_shed_get( trans.app, url ) )
url = util.build_url( tool_shed_url, pathspec=[ 'api', 'categories' ] )
categories = json.loads( util.url_get( url ) )
repositories = []
url = common_util.url_join( tool_shed_url, pathspec=[ 'api', 'repositories' ] )
for repo in json.loads( common_util.tool_shed_get( trans.app, url ) ):
url = util.build_url( tool_shed_url, pathspec=[ 'api', 'repositories' ] )
for repo in json.loads( util.url_get( url ) ):
repositories.append( dict( value=repo[ 'id' ], label='%s/%s' % ( repo[ 'owner' ], repo[ 'name' ] ) ) )
return trans.fill_template( '/admin/tool_shed_repository/browse_categories.mako',
tool_shed_url=tool_shed_url,
Expand All @@ -221,21 +221,20 @@ def browse_toolshed( self, trans, **kwd ):
def browse_tool_shed_category( self, trans, **kwd ):
tool_shed_url = kwd.get( 'tool_shed_url', '' )
category_id = kwd.get( 'category_id', '' )
url = common_util.url_join( tool_shed_url )
json_data = json.loads( common_util.tool_shed_get( trans.app, url, pathspec=[ 'api', 'categories', category_id, 'repositories' ] ) )
url = util.build_url( tool_shed_url )
json_data = json.loads( util.url_get( url, pathspec=[ 'api', 'categories', category_id, 'repositories' ] ) )
for idx, repository in enumerate( json_data[ 'repositories' ] ):
try:
metadata = json.loads( common_util.tool_shed_get( trans.app,
url,
pathspec=[ 'api', 'repositories', repository[ 'id' ], 'metadata' ],
params=dict( recursive=False ) ) )
metadata = json.loads( util.url_get( url,
pathspec=[ 'api', 'repositories', repository[ 'id' ], 'metadata' ],
params=dict( recursive=False ) ) )
json_data[ 'repositories' ][ idx ][ 'metadata' ] = metadata
except:
json_data[ 'repositories' ][ idx ][ 'metadata' ] = { 'tools_functionally_correct': True }

repositories = []
url = common_util.url_join( tool_shed_url, pathspec=[ 'api', 'repositories' ] )
for repo in json.loads( common_util.tool_shed_get( trans.app, url ) ):
url = util.build_url( tool_shed_url, pathspec=[ 'api', 'repositories' ] )
for repo in json.loads( util.url_get( url ) ):
repositories.append( dict( value=repo[ 'id' ], label='%s/%s' % ( repo[ 'owner' ], repo[ 'name' ] ) ) )
return trans.fill_template( '/admin/tool_shed_repository/browse_category.mako',
tool_shed_url=tool_shed_url,
Expand Down Expand Up @@ -1277,8 +1276,8 @@ def prepare_for_install( self, trans, **kwd ):
def preview_repository( self, trans, **kwd ):
tool_shed_url = kwd.get( 'tool_shed_url', '' )
tsr_id = kwd.get( 'tsr_id', '' )
toolshed_data = json.loads( common_util.tool_shed_get( trans.app, tool_shed_url, pathspec=[ 'api', 'repositories', tsr_id ] ) )
toolshed_data[ 'metadata' ] = json.loads( common_util.tool_shed_get( trans.app, tool_shed_url, pathspec=[ 'api', 'repositories', tsr_id, 'metadata' ] ) )
toolshed_data = json.loads( util.url_get( tool_shed_url, pathspec=[ 'api', 'repositories', tsr_id ] ) )
toolshed_data[ 'metadata' ] = json.loads( util.url_get( tool_shed_url, pathspec=[ 'api', 'repositories', tsr_id, 'metadata' ] ) )
shed_tool_conf_select_field = tool_util.build_shed_tool_conf_select_field( trans.app )
tool_panel_section_select_field = tool_util.build_tool_panel_section_select_field( trans.app )
return trans.fill_template( '/admin/tool_shed_repository/preview_repository.mako',
Expand Down