Skip to content

Commit

Permalink
Even more cleanup.
Browse files Browse the repository at this point in the history
- Removed dangling code.
- Restored Marius' changes.
- Fixed the repository-wide tool panel selection.
  • Loading branch information
davebx committed Aug 4, 2016
1 parent 8e83d31 commit c52b046
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 689 deletions.
2 changes: 2 additions & 0 deletions lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
Expand Up @@ -402,6 +402,7 @@ def install( self, trans, **kwd ):
includes_tools_for_display_in_tool_panel = False
has_repository_dependencies = False
includes_tool_dependencies = False
install_resolver_dependencies = util.asbool( kwd.get( 'install_resolver_dependencies', False ) )
for encoded_repo_info_dict in repo_info_dict.get( 'repo_info_dicts', [] ):
decoded_repo_info_dict = encoding_util.tool_shed_decode( encoded_repo_info_dict )
if not includes_tools:
Expand Down Expand Up @@ -442,6 +443,7 @@ def install( self, trans, **kwd ):
message='',
new_tool_panel_section_label=new_tool_panel_section_label,
tool_panel_section_mapping=tool_panel_section_mapping,
install_resolver_dependencies=install_resolver_dependencies,
shed_tool_conf=shed_tool_conf,
status='ok',
tool_panel_section_id=tool_panel_section_id,
Expand Down
56 changes: 0 additions & 56 deletions lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
Expand Up @@ -200,47 +200,6 @@ def browse_toolsheds( self, trans, **kwd ):
message=message,
status='error' )

@web.expose
@web.require_admin
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 = util.build_url( tool_shed_url, pathspec=[ 'api', 'categories' ] )
categories = json.loads( util.url_get( url ) )
repositories = []
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,
categories=categories,
repositories=json.dumps( repositories ) )

@web.expose
@web.require_admin
def browse_tool_shed_category( self, trans, **kwd ):
tool_shed_url = kwd.get( 'tool_shed_url', '' )
category_id = kwd.get( 'category_id', '' )
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( 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 = 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,
category=json_data,
repositories=json.dumps( repositories ) )

@web.expose
@web.require_admin
def browse_tool_sheds( self, trans, **kwd ):
Expand Down Expand Up @@ -1295,21 +1254,6 @@ def prepare_for_install( self, trans, **kwd ):
message=message,
status=status )

@web.expose
@web.require_admin
def preview_repository( self, trans, **kwd ):
tool_shed_url = kwd.get( 'tool_shed_url', '' )
tsr_id = kwd.get( 'tsr_id', '' )
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',
tool_shed_url=tool_shed_url,
toolshed_data=toolshed_data,
tool_panel_section_select_field=tool_panel_section_select_field,
shed_tool_conf_select_field=shed_tool_conf_select_field )

@web.expose
@web.require_admin
def purge_repository( self, trans, **kwd ):
Expand Down
72 changes: 0 additions & 72 deletions templates/admin/tool_shed_repository/browse_categories.mako

This file was deleted.

6 changes: 4 additions & 2 deletions templates/admin/tool_shed_repository/browse_toolsheds.mako
Expand Up @@ -490,12 +490,12 @@ function select_tps(params) {
}
function show_global_tps_select() {
$('#tool_panel_section').empty();
$('#tool_panel_section').append(tps_selection_template());
$('#tool_panel_section').append(tps_selection_template(repository_data.panel_section_dict));
$('#create_new').click(show_global_tps_create);
}
function show_global_tps_create() {
$('#tool_panel_section').empty();
$('#tool_panel_section').append(tps_creation_template());
$('#tool_panel_section').append(tps_creation_template(repository_data.panel_section_dict));
$('#select_existing').click(show_global_tps_select);
}
function initiate_repository_installation(data) {
Expand Down Expand Up @@ -662,6 +662,8 @@ function bind_repository_events() {
console.log(localStorage.repositories);
check_queue();
});
console.log('Binding TPS.');
$('#create_new').click(show_global_tps_create);
console.log('Binding submit.');
$('#repository_installation').submit(function(form) {
console.log('Installing');
Expand Down

0 comments on commit c52b046

Please sign in to comment.