mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-30 18:13:23 +08:00
Merge pull request #2055 from davebx/url_join
Replace common_util.url_join with util.build_url.
This commit is contained in:
@@ -205,11 +205,11 @@ class AdminToolshed( AdminGalaxy ):
|
||||
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,
|
||||
@@ -221,21 +221,20 @@ class AdminToolshed( AdminGalaxy ):
|
||||
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,
|
||||
@@ -1277,8 +1276,8 @@ class AdminToolshed( AdminGalaxy ):
|
||||
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',
|
||||
|
||||
Reference in New Issue
Block a user