galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
July 2012
- 1 participants
- 99 discussions
commit/galaxy-central: greg: Get all necessary information for installing a tool shed repository via a request from Galaxy rather than sending it from the tool shed.
by Bitbucket 06 Jul '12
by Bitbucket 06 Jul '12
06 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/ee9cd81ccce2/
changeset: ee9cd81ccce2
user: greg
date: 2012-07-06 20:12:38
summary: Get all necessary information for installing a tool shed repository via a request from Galaxy rather than sending it from the tool shed.
affected #: 3 files
diff -r c04a803228753159987fbed332398aff5df17c15 -r ee9cd81ccce258a973c53f62489e54630d5d3fad lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -545,194 +545,6 @@
status=status ) )
@web.expose
@web.require_admin
- def install_repository( self, trans, **kwd ):
- if not trans.app.toolbox.shed_tool_confs:
- message = 'The <b>tool_config_file</b> setting in <b>universe_wsgi.ini</b> must include at least one shed tool configuration file name with a '
- message += '<b><toolbox></b> tag that includes a <b>tool_path</b> attribute value which is a directory relative to the Galaxy installation '
- message += 'directory in order to automatically install tools from a Galaxy tool shed (e.g., the file name <b>shed_tool_conf.xml</b> whose '
- message += '<b><toolbox></b> tag is <b><toolbox tool_path="../shed_tools"></b>).<p/>See the '
- message += '<a href="http://wiki.g2.bx.psu.edu/Tool%20Shed#Automatic_installation_of_Galaxy_tool…" '
- message += 'target="_blank">Automatic installation of Galaxy tool shed repository tools into a local Galaxy instance</a> section of the '
- message += '<a href="http://wiki.g2.bx.psu.edu/Tool%20Shed" target="_blank">Galaxy tool shed wiki</a> for all of the details.'
- return trans.show_error_message( message )
- message = kwd.get( 'message', '' )
- status = kwd.get( 'status', 'done' )
- tool_shed_url = kwd[ 'tool_shed_url' ]
- # The value of repo_info_dicts is a list of one or more dictionaries, each associated with a tool shed repository that will be installed.
- encoded_repo_info_dicts = util.listify( kwd[ 'repo_info_dicts' ] )
- repo_info_dicts = [ tool_shed_decode( repo_info_dict ) for repo_info_dict in encoded_repo_info_dicts ]
- # Every repository will be installed into the same tool panel section or all will be installed outside of any sections.
- new_tool_panel_section = kwd.get( 'new_tool_panel_section', '' )
- tool_panel_section = kwd.get( 'tool_panel_section', '' )
- # One or more repositories may include tools, but not necessarily all of them.
- includes_tools = util.string_as_bool( kwd.get( 'includes_tools', False ) )
- includes_tool_dependencies = util.string_as_bool( kwd.get( 'includes_tool_dependencies', False ) )
- install_tool_dependencies = kwd.get( 'install_tool_dependencies', '' )
- tool_section = None
- if not includes_tools or ( includes_tools and kwd.get( 'select_tool_panel_section_button', False ) ):
- if includes_tools:
- install_tool_dependencies = CheckboxField.is_checked( install_tool_dependencies )
- shed_tool_conf = kwd[ 'shed_tool_conf' ]
- else:
- install_tool_dependencies = False
- # If installing a repository that includes no tools, get the relative tool_path from the file to which the
- # migrated_tools_config setting points.
- shed_tool_conf = trans.app.config.migrated_tools_config
- # Get the tool path by searching the list of shed_tool_confs for the dictionary that contains the information about shed_tool_conf.
- for shed_tool_conf_dict in trans.app.toolbox.shed_tool_confs:
- config_filename = shed_tool_conf_dict[ 'config_filename' ]
- if config_filename == shed_tool_conf:
- tool_path = shed_tool_conf_dict[ 'tool_path' ]
- break
- else:
- file_name = strip_path( config_filename )
- if file_name == shed_tool_conf:
- tool_path = shed_tool_conf_dict[ 'tool_path' ]
- break
- # Make sure all tool_shed_repository records exist.
- created_or_updated_tool_shed_repositories = []
- for repo_info_dict in repo_info_dicts:
- for name, repo_info_tuple in repo_info_dict.items():
- description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
- clone_dir = os.path.join( tool_path, self.generate_tool_path( repository_clone_url, changeset_revision ) )
- relative_install_dir = os.path.join( clone_dir, name )
- owner = get_repository_owner( clean_repository_clone_url( repository_clone_url ) )
- # Make sure the repository was not already installed.
- installed_tool_shed_repository, installed_changeset_revision = self.repository_was_previously_installed( trans,
- tool_shed_url,
- name,
- repo_info_tuple,
- clone_dir )
- if installed_tool_shed_repository:
- message += "The tool shed repository <b>%s</b> with owner <b>%s</b> and changeset revision <b>%s</b> " % ( name, owner, changeset_revision )
- if installed_changeset_revision != changeset_revision:
- message += "was previously installed using changeset revision <b>%s</b>. " % installed_changeset_revision
- else:
- message += "was previously installed. "
- if installed_tool_shed_repository.uninstalled:
- message += "The repository has been uninstalled, however, so reinstall the original repository instead of installing it again. "
- elif installed_tool_shed_repository.deleted:
- message += "The repository has been deactivated, however, so activate the original repository instead of installing it again. "
- if installed_changeset_revision != changeset_revision:
- message += "You can get the latest updates for the repository using the <b>Get updates</b> option from the repository's "
- message += "<b>Repository Actions</b> pop-up menu. "
- status = 'error'
- if len( repo_info_dicts ) == 1:
- new_kwd = dict( message=message, status=status )
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='browse_repositories',
- **new_kwd ) )
- else:
- print "Adding new row (or updating an existing row) for repository '%s' in the tool_shed_repository table." % name
- tool_shed_repository = create_or_update_tool_shed_repository( app=trans.app,
- name=name,
- description=description,
- installed_changeset_revision=changeset_revision,
- ctx_rev=ctx_rev,
- repository_clone_url=repository_clone_url,
- metadata_dict={},
- status=trans.model.ToolShedRepository.installation_status.NEW,
- current_changeset_revision=changeset_revision,
- owner=owner,
- dist_to_shed=False )
- created_or_updated_tool_shed_repositories.append( tool_shed_repository )
- if created_or_updated_tool_shed_repositories:
- if includes_tools and ( new_tool_panel_section or tool_panel_section ):
- if new_tool_panel_section:
- section_id = new_tool_panel_section.lower().replace( ' ', '_' )
- tool_panel_section_key = 'section_%s' % str( section_id )
- if tool_panel_section_key in trans.app.toolbox.tool_panel:
- # Appending a tool to an existing section in trans.app.toolbox.tool_panel
- log.debug( "Appending to tool panel section: %s" % new_tool_panel_section )
- tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
- else:
- # Appending a new section to trans.app.toolbox.tool_panel
- log.debug( "Loading new tool panel section: %s" % new_tool_panel_section )
- elem = Element( 'section' )
- elem.attrib[ 'name' ] = new_tool_panel_section
- elem.attrib[ 'id' ] = section_id
- elem.attrib[ 'version' ] = ''
- tool_section = tools.ToolSection( elem )
- trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section
- else:
- tool_panel_section_key = 'section_%s' % tool_panel_section
- tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
- else:
- tool_panel_section_key = None
- tool_section = None
- tsrids_list = [ trans.security.encode_id( tsr.id ) for tsr in created_or_updated_tool_shed_repositories ]
- new_kwd = dict( includes_tool_dependencies=kwd.get( 'includes_tool_dependencies', False ),
- includes_tools=kwd.get( 'includes_tools', False ),
- install_tool_dependencies=install_tool_dependencies,
- repo_info_dicts=kwd[ 'repo_info_dicts' ],
- message=message,
- new_tool_panel_section=kwd.get( 'new_tool_panel_section', '' ),
- shed_tool_conf=kwd[ 'shed_tool_conf' ],
- status=status,
- tool_panel_section=kwd.get( 'tool_panel_section', '' ),
- tool_path=tool_path,
- tool_panel_section_key=tool_panel_section_key,
- tool_shed_repository_ids=tsrids_list,
- tool_shed_url=kwd[ 'tool_shed_url' ] )
- encoded_kwd = tool_shed_encode( new_kwd )
- tsrids_str = ','.join( tsrids_list )
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='initiate_repository_installation',
- shed_repository_ids=tsrids_str,
- encoded_kwd=encoded_kwd,
- reinstalling=False ) )
- else:
- kwd[ 'message' ] = message
- kwd[ 'status' ] = status
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='manage_repositories',
- **kwd ) )
- if len( trans.app.toolbox.shed_tool_confs ) > 1:
- shed_tool_conf_select_field = build_shed_tool_conf_select_field( trans )
- shed_tool_conf = None
- else:
- shed_tool_conf_dict = trans.app.toolbox.shed_tool_confs[0]
- shed_tool_conf = shed_tool_conf_dict[ 'config_filename' ]
- shed_tool_conf = shed_tool_conf.replace( './', '', 1 )
- shed_tool_conf_select_field = None
- tool_panel_section_select_field = build_tool_panel_section_select_field( trans )
- if includes_tools and len( repo_info_dicts ) == 1:
- # If we're installing a single repository that contains a readme file, get it's contents to display.
- repo_info_dict = repo_info_dicts[ 0 ]
- name = repo_info_dict.keys()[ 0 ]
- repo_info_tuple = repo_info_dict[ name ]
- description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
- url = '%srepository/get_readme?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy&no_reset=true' % \
- ( tool_shed_url, name, repository_owner, changeset_revision )
- response = urllib2.urlopen( url )
- raw_text = response.read()
- response.close()
- readme_text = ''
- for i, line in enumerate( raw_text ):
- readme_text = '%s%s' % ( readme_text, to_html_str( line ) )
- if len( readme_text ) > MAX_CONTENT_SIZE:
- large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % util.nice_size( MAX_CONTENT_SIZE )
- readme_text = '%s%s' % ( readme_text, to_html_str( large_str ) )
- break
- else:
- readme_text = ''
- install_tool_dependencies_check_box = CheckboxField( 'install_tool_dependencies', checked=True )
- return trans.fill_template( '/admin/tool_shed_repository/select_tool_panel_section.mako',
- tool_shed_url=tool_shed_url,
- encoded_repo_info_dicts=kwd[ 'repo_info_dicts' ],
- repo_info_dicts=repo_info_dicts,
- shed_tool_conf=shed_tool_conf,
- includes_tools=includes_tools,
- includes_tool_dependencies=includes_tool_dependencies,
- install_tool_dependencies_check_box=install_tool_dependencies_check_box,
- shed_tool_conf_select_field=shed_tool_conf_select_field,
- tool_panel_section_select_field=tool_panel_section_select_field,
- new_tool_panel_section=new_tool_panel_section,
- readme_text=readme_text,
- message=message,
- status=status )
- @web.expose
- @web.require_admin
def install_tool_dependencies( self, trans, **kwd ):
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
@@ -776,8 +588,7 @@
@web.require_admin
def install_tool_shed_repositories( self, trans, tool_shed_repositories, reinstalling=False, **kwd ):
"""Install specified tool shed repositories."""
- encoded_repo_info_dicts = util.listify( kwd[ 'repo_info_dicts' ] )
- repo_info_dicts = [ tool_shed_decode( repo_info_dict ) for repo_info_dict in encoded_repo_info_dicts ]
+ repo_info_dicts = util.listify( kwd[ 'repo_info_dicts' ] )
tool_path = kwd[ 'tool_path' ]
includes_tool_dependencies = util.string_as_bool( kwd[ 'includes_tool_dependencies' ] )
install_tool_dependencies = CheckboxField.is_checked( kwd.get( 'install_tool_dependencies', '' ) )
@@ -1151,6 +962,207 @@
return open_repository_files_folder( trans, folder_path )
@web.expose
@web.require_admin
+ def prepare_for_install( self, trans, **kwd ):
+ if not trans.app.toolbox.shed_tool_confs:
+ message = 'The <b>tool_config_file</b> setting in <b>universe_wsgi.ini</b> must include at least one shed tool configuration file name with a '
+ message += '<b><toolbox></b> tag that includes a <b>tool_path</b> attribute value which is a directory relative to the Galaxy installation '
+ message += 'directory in order to automatically install tools from a Galaxy tool shed (e.g., the file name <b>shed_tool_conf.xml</b> whose '
+ message += '<b><toolbox></b> tag is <b><toolbox tool_path="../shed_tools"></b>).<p/>See the '
+ message += '<a href="http://wiki.g2.bx.psu.edu/Tool%20Shed#Automatic_installation_of_Galaxy_tool…" '
+ message += 'target="_blank">Automatic installation of Galaxy tool shed repository tools into a local Galaxy instance</a> section of the '
+ message += '<a href="http://wiki.g2.bx.psu.edu/Tool%20Shed" target="_blank">Galaxy tool shed wiki</a> for all of the details.'
+ return trans.show_error_message( message )
+ message = kwd.get( 'message', '' )
+ status = kwd.get( 'status', 'done' )
+ includes_tools = util.string_as_bool( kwd.get( 'includes_tools', False ) )
+ tool_shed_url = kwd[ 'tool_shed_url' ]
+ # Every repository will be installed into the same tool panel section or all will be installed outside of any sections.
+ new_tool_panel_section = kwd.get( 'new_tool_panel_section', '' )
+ tool_panel_section = kwd.get( 'tool_panel_section', '' )
+ # One or more repositories may include tools, but not necessarily all of them.
+ includes_tools = util.string_as_bool( kwd.get( 'includes_tools', False ) )
+ includes_tool_dependencies = util.string_as_bool( kwd.get( 'includes_tool_dependencies', False ) )
+ install_tool_dependencies = kwd.get( 'install_tool_dependencies', '' )
+ encoded_repo_info_dicts = util.listify( kwd.get( 'encoded_repo_info_dicts', None ) )
+ if not encoded_repo_info_dicts:
+ # The request originated in the tool shed.
+ repository_ids = kwd.get( 'repository_ids', None )
+ changeset_revisions = kwd.get( 'changeset_revisions', None )
+ # Get the information necessary to install each repository.
+ url = '%srepository/get_repository_information?repository_ids=%s&changeset_revisions=%s&webapp=galaxy' % ( tool_shed_url, repository_ids, changeset_revisions )
+ response = urllib2.urlopen( url )
+ raw_text = response.read()
+ response.close()
+ repo_information_dict = from_json_string( raw_text )
+ includes_tools = util.string_as_bool( repo_information_dict[ 'includes_tools' ] )
+ includes_tool_dependencies = util.string_as_bool( repo_information_dict[ 'includes_tool_dependencies' ] )
+ encoded_repo_info_dicts = util.listify( repo_information_dict[ 'repo_info_dicts' ] )
+ repo_info_dicts = [ tool_shed_decode( encoded_repo_info_dict ) for encoded_repo_info_dict in encoded_repo_info_dicts ]
+ if not includes_tools or ( includes_tools and kwd.get( 'select_tool_panel_section_button', False ) ):
+ if includes_tools:
+ install_tool_dependencies = CheckboxField.is_checked( install_tool_dependencies )
+ shed_tool_conf = kwd[ 'shed_tool_conf' ]
+ else:
+ install_tool_dependencies = False
+ # If installing a repository that includes no tools, get the relative tool_path from the file to which the
+ # migrated_tools_config setting points.
+ shed_tool_conf = trans.app.config.migrated_tools_config
+ # Get the tool path by searching the list of shed_tool_confs for the dictionary that contains the information about shed_tool_conf.
+ for shed_tool_conf_dict in trans.app.toolbox.shed_tool_confs:
+ config_filename = shed_tool_conf_dict[ 'config_filename' ]
+ if config_filename == shed_tool_conf:
+ tool_path = shed_tool_conf_dict[ 'tool_path' ]
+ break
+ else:
+ file_name = strip_path( config_filename )
+ if file_name == shed_tool_conf:
+ tool_path = shed_tool_conf_dict[ 'tool_path' ]
+ break
+ # Make sure all tool_shed_repository records exist.
+ created_or_updated_tool_shed_repositories = []
+ # Repositories will be filtered (e.g., if already installed, etc), so filter the associated repo_info_dicts accordingly.
+ filtered_repo_info_dicts = []
+ for repo_info_dict in repo_info_dicts:
+ for name, repo_info_tuple in repo_info_dict.items():
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
+ clone_dir = os.path.join( tool_path, self.generate_tool_path( repository_clone_url, changeset_revision ) )
+ relative_install_dir = os.path.join( clone_dir, name )
+ owner = get_repository_owner( clean_repository_clone_url( repository_clone_url ) )
+ # Make sure the repository was not already installed.
+ installed_tool_shed_repository, installed_changeset_revision = self.repository_was_previously_installed( trans,
+ tool_shed_url,
+ name,
+ repo_info_tuple,
+ clone_dir )
+ if installed_tool_shed_repository:
+ message += "The tool shed repository <b>%s</b> with owner <b>%s</b> and changeset revision <b>%s</b> " % ( name, owner, changeset_revision )
+ if installed_changeset_revision != changeset_revision:
+ message += "was previously installed using changeset revision <b>%s</b>. " % installed_changeset_revision
+ else:
+ message += "was previously installed. "
+ if installed_tool_shed_repository.uninstalled:
+ message += "The repository has been uninstalled, however, so reinstall the original repository instead of installing it again. "
+ elif installed_tool_shed_repository.deleted:
+ message += "The repository has been deactivated, however, so activate the original repository instead of installing it again. "
+ if installed_changeset_revision != changeset_revision:
+ message += "You can get the latest updates for the repository using the <b>Get updates</b> option from the repository's "
+ message += "<b>Repository Actions</b> pop-up menu. "
+ status = 'error'
+ if len( repo_info_dicts ) == 1:
+ new_kwd = dict( message=message, status=status )
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ **new_kwd ) )
+ else:
+ print "Adding new row (or updating an existing row) for repository '%s' in the tool_shed_repository table." % name
+ tool_shed_repository = create_or_update_tool_shed_repository( app=trans.app,
+ name=name,
+ description=description,
+ installed_changeset_revision=changeset_revision,
+ ctx_rev=ctx_rev,
+ repository_clone_url=repository_clone_url,
+ metadata_dict={},
+ status=trans.model.ToolShedRepository.installation_status.NEW,
+ current_changeset_revision=changeset_revision,
+ owner=owner,
+ dist_to_shed=False )
+ created_or_updated_tool_shed_repositories.append( tool_shed_repository )
+ filtered_repo_info_dicts.append( repo_info_dict )
+ if created_or_updated_tool_shed_repositories:
+ if includes_tools and ( new_tool_panel_section or tool_panel_section ):
+ if new_tool_panel_section:
+ section_id = new_tool_panel_section.lower().replace( ' ', '_' )
+ tool_panel_section_key = 'section_%s' % str( section_id )
+ if tool_panel_section_key in trans.app.toolbox.tool_panel:
+ # Appending a tool to an existing section in trans.app.toolbox.tool_panel
+ log.debug( "Appending to tool panel section: %s" % new_tool_panel_section )
+ tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
+ else:
+ # Appending a new section to trans.app.toolbox.tool_panel
+ log.debug( "Loading new tool panel section: %s" % new_tool_panel_section )
+ elem = Element( 'section' )
+ elem.attrib[ 'name' ] = new_tool_panel_section
+ elem.attrib[ 'id' ] = section_id
+ elem.attrib[ 'version' ] = ''
+ tool_section = tools.ToolSection( elem )
+ trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section
+ else:
+ tool_panel_section_key = 'section_%s' % tool_panel_section
+ tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
+ else:
+ tool_panel_section_key = None
+ tool_section = None
+ tsrids_list = [ trans.security.encode_id( tsr.id ) for tsr in created_or_updated_tool_shed_repositories ]
+ new_kwd = dict( includes_tools=includes_tools,
+ includes_tool_dependencies=includes_tool_dependencies,
+ install_tool_dependencies=install_tool_dependencies,
+ message=message,
+ repo_info_dicts=filtered_repo_info_dicts,
+ shed_tool_conf=shed_tool_conf,
+ status=status,
+ tool_path=tool_path,
+ tool_panel_section_key=tool_panel_section_key,
+ tool_shed_repository_ids=tsrids_list,
+ tool_shed_url=tool_shed_url )
+ encoded_kwd = tool_shed_encode( new_kwd )
+ tsrids_str = ','.join( tsrids_list )
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='initiate_repository_installation',
+ shed_repository_ids=tsrids_str,
+ encoded_kwd=encoded_kwd,
+ reinstalling=False ) )
+ else:
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = status
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='manage_repositories',
+ **kwd ) )
+ if len( trans.app.toolbox.shed_tool_confs ) > 1:
+ shed_tool_conf_select_field = build_shed_tool_conf_select_field( trans )
+ shed_tool_conf = None
+ else:
+ shed_tool_conf_dict = trans.app.toolbox.shed_tool_confs[0]
+ shed_tool_conf = shed_tool_conf_dict[ 'config_filename' ]
+ shed_tool_conf = shed_tool_conf.replace( './', '', 1 )
+ shed_tool_conf_select_field = None
+ tool_panel_section_select_field = build_tool_panel_section_select_field( trans )
+ if includes_tools and len( repo_info_dicts ) == 1:
+ # If we're installing a single repository, see if it contains a readme file tha twe can display.
+ repo_info_dict = repo_info_dicts[ 0 ]
+ name = repo_info_dict.keys()[ 0 ]
+ repo_info_tuple = repo_info_dict[ name ]
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
+ url = '%srepository/get_readme?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy&no_reset=true' % \
+ ( tool_shed_url, name, repository_owner, changeset_revision )
+ response = urllib2.urlopen( url )
+ raw_text = response.read()
+ response.close()
+ readme_text = ''
+ for i, line in enumerate( raw_text ):
+ readme_text = '%s%s' % ( readme_text, to_html_str( line ) )
+ if len( readme_text ) > MAX_CONTENT_SIZE:
+ large_str = '\nFile contents truncated because file size is larger than maximum viewing size of %s\n' % util.nice_size( MAX_CONTENT_SIZE )
+ readme_text = '%s%s' % ( readme_text, to_html_str( large_str ) )
+ break
+ else:
+ readme_text = ''
+ install_tool_dependencies_check_box = CheckboxField( 'install_tool_dependencies', checked=True )
+ return trans.fill_template( '/admin/tool_shed_repository/select_tool_panel_section.mako',
+ encoded_repo_info_dicts=encoded_repo_info_dicts,
+ includes_tools=includes_tools,
+ includes_tool_dependencies=includes_tool_dependencies,
+ install_tool_dependencies_check_box=install_tool_dependencies_check_box,
+ new_tool_panel_section=new_tool_panel_section,
+ repo_info_dicts=repo_info_dicts,
+ shed_tool_conf=shed_tool_conf,
+ shed_tool_conf_select_field=shed_tool_conf_select_field,
+ tool_panel_section_select_field=tool_panel_section_select_field,
+ tool_shed_url=kwd[ 'tool_shed_url' ],
+ readme_text=readme_text,
+ message=message,
+ status=status )
+ @web.expose
+ @web.require_admin
def reinstall_repository( self, trans, **kwd ):
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
diff -r c04a803228753159987fbed332398aff5df17c15 -r ee9cd81ccce258a973c53f62489e54630d5d3fad lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -1035,6 +1035,37 @@
trans.response.headers['Pragma'] = 'no-cache'
trans.response.headers['Expires'] = '0'
return get_repository_file_contents( file_path )
+ @web.json
+ def get_repository_information( self, trans, repository_ids, changeset_revisions, **kwd ):
+ """
+ Generate a list of dictionaries, each of which contains the information about a repository that will be necessary for installing
+ it into a local Galaxy instance.
+ """
+ includes_tools = False
+ includes_tool_dependencies = False
+ repo_info_dicts = []
+ for repository_id, changeset_revision in zip( util.listify( repository_ids ), util.listify( changeset_revisions ) ):
+ repository_clone_url = generate_clone_url( trans, repository_id )
+ repository = get_repository( trans, repository_id )
+ repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
+ metadata = repository_metadata.metadata
+ if not includes_tools and 'tools' in metadata:
+ includes_tools = True
+ if not includes_tool_dependencies and 'tool_dependencies' in metadata:
+ includes_tool_dependencies = True
+ repo_dir = repository.repo_path
+ repo = hg.repository( get_configured_ui(), repo_dir )
+ ctx = get_changectx_for_changeset( repo, changeset_revision )
+ repo_info_dict = {}
+ repo_info_dict[ repository.name ] = ( repository.description,
+ repository_clone_url,
+ changeset_revision,
+ str( ctx.rev() ),
+ repository.user.username,
+ metadata.get( 'tool_dependencies', None ) )
+ encoded_repo_info_dict = tool_shed_encode( repo_info_dict )
+ repo_info_dicts.append( encoded_repo_info_dict )
+ return dict( includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies, repo_info_dicts=repo_info_dicts )
@web.expose
def get_readme( self, trans, **kwd ):
"""If the received changeset_revision includes a file named readme (case ignored), return it's contents."""
@@ -1218,45 +1249,13 @@
status=status )
@web.expose
def install_repositories_by_revision( self, trans, repository_ids, changeset_revisions, **kwd ):
- """Install a list of repositories into a local Galaxy instance by a specified changeset revision for each."""
- params = util.Params( kwd )
- message = util.restore_text( params.get( 'message', '' ) )
- status = params.get( 'status', 'done' )
- webapp = get_webapp( trans, **kwd )
+ """Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation process."""
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
- repo_info_dicts = []
- includes_tools = False
- includes_tool_dependencies = False
- for repository_id, changeset_revision in zip( util.listify( repository_ids ), util.listify( changeset_revisions ) ):
- repository_clone_url = generate_clone_url( trans, repository_id )
- repository = get_repository( trans, repository_id )
- #changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) )
- repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
- metadata = repository_metadata.metadata
- # Tell the caller if the repository includes Galaxy tools so the page enabling selection of the tool panel section can be displayed.
- if not includes_tools and 'tools' in metadata:
- includes_tools = True
- if not includes_tool_dependencies and 'tool_dependencies' in metadata:
- includes_tool_dependencies = True
- # Get the changelog rev for this changeset_revision.
- repo_dir = repository.repo_path
- repo = hg.repository( get_configured_ui(), repo_dir )
- ctx = get_changectx_for_changeset( repo, changeset_revision )
- repo_info_dict = {}
- repo_info_dict[ repository.name ] = ( repository.description,
- repository_clone_url,
- changeset_revision,
- str( ctx.rev() ),
- repository.user.username,
- metadata.get( 'tool_dependencies', None ) )
- repo_info_dicts.append( tool_shed_encode( repo_info_dict ) )
- encoded_repo_info_dicts = ','.join( repo_info_dicts )
# Redirect back to local Galaxy to perform install.
- url = '%sadmin_toolshed/install_repository' % galaxy_url
+ url = '%sadmin_toolshed/prepare_for_install' % galaxy_url
url += '?tool_shed_url=%s' % url_for( '/', qualified=True )
- url += '&repo_info_dicts=%s' % encoded_repo_info_dicts
- url += '&includes_tools=%s' % includes_tools
- url += '&includes_tool_dependencies=%s' % includes_tool_dependencies
+ url += '&repository_ids=%s' % ','.join( repository_ids )
+ url += '&changeset_revisions=%s' % ','.join( changeset_revisions )
return trans.response.send_redirect( url )
@web.expose
def load_invalid_tool( self, trans, repository_id, tool_config, changeset_revision, **kwd ):
diff -r c04a803228753159987fbed332398aff5df17c15 -r ee9cd81ccce258a973c53f62489e54630d5d3fad templates/admin/tool_shed_repository/select_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/select_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/select_tool_panel_section.mako
@@ -29,7 +29,7 @@
<div class="toolFormTitle">Choose the tool panel section to contain the installed tools (optional)</div>
%endif
<div class="toolFormBody">
- <form name="select_tool_panel_section" id="select_tool_panel_section" action="${h.url_for( controller='admin_toolshed', action='install_repository', tool_shed_url=tool_shed_url, repo_info_dicts=encoded_repo_info_dicts, includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies )}" method="post" >
+ <form name="select_tool_panel_section" id="select_tool_panel_section" action="${h.url_for( controller='admin_toolshed', action='prepare_for_install', tool_shed_url=tool_shed_url, encoded_repo_info_dicts=encoded_repo_info_dicts, includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies )}" method="post" ><div style="clear: both"></div>
%if includes_tool_dependencies:
${render_tool_dependency_section( install_tool_dependencies_check_box, repo_info_dicts )}
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.
1
0
commit/galaxy-central: greg: Fix for rendering workflows icontained in repositories n the tool shed.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/c04a80322875/
changeset: c04a80322875
user: greg
date: 2012-07-06 03:31:52
summary: Fix for rendering workflows icontained in repositories n the tool shed.
affected #: 1 file
diff -r b9804f980783c4a014a66f7cf45979ae290e71f0 -r c04a803228753159987fbed332398aff5df17c15 templates/webapps/community/repository/common.mako
--- a/templates/webapps/community/repository/common.mako
+++ b/templates/webapps/community/repository/common.mako
@@ -84,7 +84,7 @@
</%def><%def name="render_repository_items( repository_metadata_id, metadata, can_set_metadata=False, webapp='community' )">
- <% from galaxy.tool_shed.encoding_util import tool_shed_decode %>
+ <% from galaxy.tool_shed.encoding_util import tool_shed_encode %>
%if metadata or can_set_metadata:
<p/><div class="toolForm">
@@ -236,7 +236,7 @@
%><tr><td>
- <a href="${h.url_for( controller='workflow', action='view_workflow', repository_metadata_id=repository_metadata_id, workflow_name=tool_shed_decode( workflow_name ), webapp=webapp )}">${workflow_name}</a>
+ <a href="${h.url_for( controller='workflow', action='view_workflow', repository_metadata_id=repository_metadata_id, workflow_name=tool_shed_encode( workflow_name ), webapp=webapp )}">${workflow_name}</a></td><td>
%if steps:
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.
1
0
commit/galaxy-central: greg: Fixes for simultaneously installing multiple tool shed repositories into a local Galaxy instance, and fixes for installing repositories retrieved from searches in the tool shed.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/b9804f980783/
changeset: b9804f980783
user: greg
date: 2012-07-05 23:44:01
summary: Fixes for simultaneously installing multiple tool shed repositories into a local Galaxy instance, and fixes for installing repositories retrieved from searches in the tool shed.
affected #: 13 files
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -558,21 +558,15 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
tool_shed_url = kwd[ 'tool_shed_url' ]
+ # The value of repo_info_dicts is a list of one or more dictionaries, each associated with a tool shed repository that will be installed.
+ encoded_repo_info_dicts = util.listify( kwd[ 'repo_info_dicts' ] )
+ repo_info_dicts = [ tool_shed_decode( repo_info_dict ) for repo_info_dict in encoded_repo_info_dicts ]
+ # Every repository will be installed into the same tool panel section or all will be installed outside of any sections.
new_tool_panel_section = kwd.get( 'new_tool_panel_section', '' )
tool_panel_section = kwd.get( 'tool_panel_section', '' )
+ # One or more repositories may include tools, but not necessarily all of them.
includes_tools = util.string_as_bool( kwd.get( 'includes_tools', False ) )
includes_tool_dependencies = util.string_as_bool( kwd.get( 'includes_tool_dependencies', False ) )
- if includes_tool_dependencies:
- dict_with_tool_dependencies = tool_shed_decode( kwd[ 'repo_info_dict' ] )
- # The repo_info_dict includes tool dependencies which we need to display so the user knows what will be installed.
- repo_info_dict = {}
- for name, repo_info_tuple in dict_with_tool_dependencies.items():
- description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
- # Create a new repo_info_dict by eliminating tool_dependencies from the repo_info_tuple.
- repo_info_dict[ name ] = ( description, repository_clone_url, changeset_revision, ctx_rev )
- else:
- dict_with_tool_dependencies = {}
- repo_info_dict = tool_shed_decode( kwd[ 'repo_info_dict' ] )
install_tool_dependencies = kwd.get( 'install_tool_dependencies', '' )
tool_section = None
if not includes_tools or ( includes_tools and kwd.get( 'select_tool_panel_section_button', False ) ):
@@ -597,50 +591,51 @@
break
# Make sure all tool_shed_repository records exist.
created_or_updated_tool_shed_repositories = []
- for name, repo_info_tuple in repo_info_dict.items():
- description, repository_clone_url, changeset_revision, ctx_rev = repo_info_tuple
- clone_dir = os.path.join( tool_path, self.generate_tool_path( repository_clone_url, changeset_revision ) )
- relative_install_dir = os.path.join( clone_dir, name )
- owner = get_repository_owner( clean_repository_clone_url( repository_clone_url ) )
- # Make sure the repository was not already installed.
- installed_tool_shed_repository, installed_changeset_revision = self.repository_was_previously_installed( trans,
- tool_shed_url,
- name,
- repo_info_tuple,
- clone_dir )
- if installed_tool_shed_repository:
- message = "The tool shed repository <b>%s</b> with owner <b>%s</b> and changeset revision <b>%s</b> " % ( name, owner, changeset_revision )
- if installed_changeset_revision != changeset_revision:
- message += "was previously installed using changeset revision <b>%s</b>. " % installed_changeset_revision
+ for repo_info_dict in repo_info_dicts:
+ for name, repo_info_tuple in repo_info_dict.items():
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
+ clone_dir = os.path.join( tool_path, self.generate_tool_path( repository_clone_url, changeset_revision ) )
+ relative_install_dir = os.path.join( clone_dir, name )
+ owner = get_repository_owner( clean_repository_clone_url( repository_clone_url ) )
+ # Make sure the repository was not already installed.
+ installed_tool_shed_repository, installed_changeset_revision = self.repository_was_previously_installed( trans,
+ tool_shed_url,
+ name,
+ repo_info_tuple,
+ clone_dir )
+ if installed_tool_shed_repository:
+ message += "The tool shed repository <b>%s</b> with owner <b>%s</b> and changeset revision <b>%s</b> " % ( name, owner, changeset_revision )
+ if installed_changeset_revision != changeset_revision:
+ message += "was previously installed using changeset revision <b>%s</b>. " % installed_changeset_revision
+ else:
+ message += "was previously installed. "
+ if installed_tool_shed_repository.uninstalled:
+ message += "The repository has been uninstalled, however, so reinstall the original repository instead of installing it again. "
+ elif installed_tool_shed_repository.deleted:
+ message += "The repository has been deactivated, however, so activate the original repository instead of installing it again. "
+ if installed_changeset_revision != changeset_revision:
+ message += "You can get the latest updates for the repository using the <b>Get updates</b> option from the repository's "
+ message += "<b>Repository Actions</b> pop-up menu. "
+ status = 'error'
+ if len( repo_info_dicts ) == 1:
+ new_kwd = dict( message=message, status=status )
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ **new_kwd ) )
else:
- message += "was previously installed. "
- if installed_tool_shed_repository.uninstalled:
- message += "The repository has been uninstalled, however, so reinstall the original repository instead of installing it again. "
- elif installed_tool_shed_repository.deleted:
- message += "The repository has been deactivated, however, so activate the original repository instead of installing it again. "
- if installed_changeset_revision != changeset_revision:
- message += "You can get the latest updates for the repository using the <b>Get updates</b> option from the repository's "
- message += "<b>Repository Actions</b> pop-up menu. "
- status = 'error'
- if len( repo_info_dict ) == 1:
- new_kwd = dict( message=message, status=status )
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='browse_repositories',
- **new_kwd ) )
- else:
- print "Adding new row (or updating an existing row) for repository '%s' in the tool_shed_repository table." % name
- tool_shed_repository = create_or_update_tool_shed_repository( app=trans.app,
- name=name,
- description=description,
- installed_changeset_revision=changeset_revision,
- ctx_rev=ctx_rev,
- repository_clone_url=repository_clone_url,
- metadata_dict={},
- status=trans.model.ToolShedRepository.installation_status.NEW,
- current_changeset_revision=changeset_revision,
- owner=owner,
- dist_to_shed=False )
- created_or_updated_tool_shed_repositories.append( tool_shed_repository )
+ print "Adding new row (or updating an existing row) for repository '%s' in the tool_shed_repository table." % name
+ tool_shed_repository = create_or_update_tool_shed_repository( app=trans.app,
+ name=name,
+ description=description,
+ installed_changeset_revision=changeset_revision,
+ ctx_rev=ctx_rev,
+ repository_clone_url=repository_clone_url,
+ metadata_dict={},
+ status=trans.model.ToolShedRepository.installation_status.NEW,
+ current_changeset_revision=changeset_revision,
+ owner=owner,
+ dist_to_shed=False )
+ created_or_updated_tool_shed_repositories.append( tool_shed_repository )
if created_or_updated_tool_shed_repositories:
if includes_tools and ( new_tool_panel_section or tool_panel_section ):
if new_tool_panel_section:
@@ -669,7 +664,7 @@
new_kwd = dict( includes_tool_dependencies=kwd.get( 'includes_tool_dependencies', False ),
includes_tools=kwd.get( 'includes_tools', False ),
install_tool_dependencies=install_tool_dependencies,
- repo_info_dict=kwd[ 'repo_info_dict' ],
+ repo_info_dicts=kwd[ 'repo_info_dicts' ],
message=message,
new_tool_panel_section=kwd.get( 'new_tool_panel_section', '' ),
shed_tool_conf=kwd[ 'shed_tool_conf' ],
@@ -701,12 +696,12 @@
shed_tool_conf = shed_tool_conf.replace( './', '', 1 )
shed_tool_conf_select_field = None
tool_panel_section_select_field = build_tool_panel_section_select_field( trans )
- if includes_tools and len( repo_info_dict ) == 1:
+ if includes_tools and len( repo_info_dicts ) == 1:
# If we're installing a single repository that contains a readme file, get it's contents to display.
+ repo_info_dict = repo_info_dicts[ 0 ]
name = repo_info_dict.keys()[ 0 ]
repo_info_tuple = repo_info_dict[ name ]
- description, repository_clone_url, changeset_revision, ctx_rev = repo_info_tuple
- repository_owner = get_repository_owner( clean_repository_clone_url( repository_clone_url ) )
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
url = '%srepository/get_readme?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy&no_reset=true' % \
( tool_shed_url, name, repository_owner, changeset_revision )
response = urllib2.urlopen( url )
@@ -724,8 +719,8 @@
install_tool_dependencies_check_box = CheckboxField( 'install_tool_dependencies', checked=True )
return trans.fill_template( '/admin/tool_shed_repository/select_tool_panel_section.mako',
tool_shed_url=tool_shed_url,
- repo_info_dict=kwd[ 'repo_info_dict' ],
- dict_with_tool_dependencies=dict_with_tool_dependencies,
+ encoded_repo_info_dicts=kwd[ 'repo_info_dicts' ],
+ repo_info_dicts=repo_info_dicts,
shed_tool_conf=shed_tool_conf,
includes_tools=includes_tools,
includes_tool_dependencies=includes_tool_dependencies,
@@ -781,7 +776,8 @@
@web.require_admin
def install_tool_shed_repositories( self, trans, tool_shed_repositories, reinstalling=False, **kwd ):
"""Install specified tool shed repositories."""
- repo_info_dict = tool_shed_decode( kwd[ 'repo_info_dict' ] )
+ encoded_repo_info_dicts = util.listify( kwd[ 'repo_info_dicts' ] )
+ repo_info_dicts = [ tool_shed_decode( repo_info_dict ) for repo_info_dict in encoded_repo_info_dicts ]
tool_path = kwd[ 'tool_path' ]
includes_tool_dependencies = util.string_as_bool( kwd[ 'includes_tool_dependencies' ] )
install_tool_dependencies = CheckboxField.is_checked( kwd.get( 'install_tool_dependencies', '' ) )
@@ -790,14 +786,11 @@
tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
else:
tool_section = None
- for tool_shed_repository in tool_shed_repositories:
+ for tool_shed_repository, repo_info_dict in zip( tool_shed_repositories, repo_info_dicts ):
# Clone each repository to the configured location.
update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.CLONING )
repo_info_tuple = repo_info_dict[ tool_shed_repository.name ]
- if includes_tool_dependencies and not reinstalling:
- description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
- else:
- description, repository_clone_url, changeset_revision, ctx_rev = repo_info_tuple
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
clone_dir = os.path.join( tool_path, self.generate_tool_path( repository_clone_url, tool_shed_repository.installed_changeset_revision ) )
relative_install_dir = os.path.join( clone_dir, tool_shed_repository.name )
clone_repository( repository_clone_url, os.path.abspath( relative_install_dir ), ctx_rev )
@@ -858,38 +851,38 @@
shutil.rmtree( work_dir )
except:
pass
- if 'datatypes' in metadata:
- update_tool_shed_repository_status( trans.app,
- tool_shed_repository,
- trans.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES )
- work_dir = make_tmp_directory()
- datatypes_config = get_config_from_repository( trans.app,
- 'datatypes_conf.xml',
- tool_shed_repository,
- tool_shed_repository.installed_changeset_revision,
- work_dir )
- # Load proprietary data types required by tools.
- converter_path, display_path = alter_config_and_load_prorietary_datatypes( trans.app, datatypes_config, relative_install_dir, override=False )
- if converter_path or display_path:
- # Create a dictionary of tool shed repository related information.
- repository_dict = create_repository_dict_for_proprietary_datatypes( tool_shed=self.tool_shed,
- name=tool_shed_repository.name,
- owner=tool_shed_repository.owner,
- installed_changeset_revision=tool_shed_repository.installed_changeset_revision,
- tool_dicts=metadata.get( 'tools', [] ),
- converter_path=converter_path,
- display_path=display_path )
- if converter_path:
- # Load proprietary datatype converters
- trans.app.datatypes_registry.load_datatype_converters( trans.app.toolbox, installed_repository_dict=repository_dict )
- if display_path:
- # Load proprietary datatype display applications
- trans.app.datatypes_registry.load_display_applications( installed_repository_dict=repository_dict )
- try:
- shutil.rmtree( work_dir )
- except:
- pass
- update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.INSTALLED )
+ if 'datatypes' in metadata:
+ update_tool_shed_repository_status( trans.app,
+ tool_shed_repository,
+ trans.model.ToolShedRepository.installation_status.LOADING_PROPRIETARY_DATATYPES )
+ work_dir = make_tmp_directory()
+ datatypes_config = get_config_from_repository( trans.app,
+ 'datatypes_conf.xml',
+ tool_shed_repository,
+ tool_shed_repository.installed_changeset_revision,
+ work_dir )
+ # Load proprietary data types required by tools.
+ converter_path, display_path = alter_config_and_load_prorietary_datatypes( trans.app, datatypes_config, relative_install_dir, override=False )
+ if converter_path or display_path:
+ # Create a dictionary of tool shed repository related information.
+ repository_dict = create_repository_dict_for_proprietary_datatypes( tool_shed=self.tool_shed,
+ name=tool_shed_repository.name,
+ owner=tool_shed_repository.owner,
+ installed_changeset_revision=tool_shed_repository.installed_changeset_revision,
+ tool_dicts=metadata.get( 'tools', [] ),
+ converter_path=converter_path,
+ display_path=display_path )
+ if converter_path:
+ # Load proprietary datatype converters
+ trans.app.datatypes_registry.load_datatype_converters( trans.app.toolbox, installed_repository_dict=repository_dict )
+ if display_path:
+ # Load proprietary datatype display applications
+ trans.app.datatypes_registry.load_display_applications( installed_repository_dict=repository_dict )
+ try:
+ shutil.rmtree( work_dir )
+ except:
+ pass
+ update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.INSTALLED )
tsr_ids_for_monitoring = [ trans.security.encode_id( tsr.id ) for tsr in tool_shed_repositories ]
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='monitor_repository_installation',
@@ -1241,7 +1234,7 @@
new_kwd = dict( includes_tool_dependencies=tool_shed_repository.includes_tool_dependencies,
includes_tools=tool_shed_repository.includes_tools,
install_tool_dependencies=install_tool_dependencies,
- repo_info_dict=kwd[ 'repo_info_dict' ],
+ repo_info_dicts=kwd[ 'repo_info_dict' ],
message=message,
new_tool_panel_section=new_tool_panel_section,
shed_tool_conf=shed_tool_conf,
@@ -1282,8 +1275,7 @@
# Handle case where the repository was previously installed using an older changeset_revsion, but later the repository was updated
# in the tool shed and now we're trying to install the latest changeset revision of the same repository instead of updating the one
# that was previously installed. We'll look in the database instead of on disk since the repository may be uninstalled.
- description, repository_clone_url, changeset_revision, ctx_rev = repo_info_tuple
- repository_owner = get_repository_owner( clean_repository_clone_url( repository_clone_url ) )
+ description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
tool_shed = get_tool_shed_from_clone_url( repository_clone_url )
# Get all previous change set revisions from the tool shed for the repository back to, but excluding, the previous valid changeset
# revision to see if it was previously installed using one of them.
@@ -1309,22 +1301,16 @@
def reselect_tool_panel_section( self, trans, **kwd ):
repository = get_repository( trans, kwd[ 'id' ] )
metadata = repository.metadata
- # Populate repo_info_dict.
tool_shed_url = get_url_from_repository_tool_shed( trans.app, repository )
ctx_rev = get_ctx_rev( tool_shed_url, repository.name, repository.owner, repository.installed_changeset_revision )
repository_clone_url = generate_clone_url( trans, repository )
repo_info_dict = {}
- repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, repository.installed_changeset_revision, ctx_rev )
- dict_with_tool_dependencies = {}
- includes_tool_dependencies = repository.includes_tool_dependencies
- if includes_tool_dependencies:
- # Populate dict_with_tool_dependencies.
- dict_with_tool_dependencies[ repository.name ] = ( repository.description,
- repository_clone_url,
- repository.installed_changeset_revision,
- ctx_rev,
- repository.owner,
- metadata[ 'tool_dependencies' ] )
+ repo_info_dict[ repository.name ] = ( repository.description,
+ repository_clone_url,
+ repository.installed_changeset_revision,
+ ctx_rev,
+ repository.owner,
+ metadata.get( 'tool_dependencies', None ) )
# Get the location in the tool panel in which the tool was originally loaded.
if 'tool_panel_section' in metadata:
tool_panel_dict = metadata[ 'tool_panel_section' ]
@@ -1360,7 +1346,6 @@
install_tool_dependencies_check_box=install_tool_dependencies_check_box,
tool_panel_section_select_field=tool_panel_section_select_field,
repo_info_dict=tool_shed_encode( repo_info_dict ),
- dict_with_tool_dependencies=dict_with_tool_dependencies,
includes_tool_dependencies=includes_tool_dependencies,
message=message,
status=status )
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -381,27 +381,6 @@
repository_metadata.downloadable = changeset_is_downloadable( metadata_dict )
trans.sa_session.add( repository_metadata )
trans.sa_session.flush()
-def decode( value ):
- # Extract and verify hash
- a, b = value.split( ":" )
- value = binascii.unhexlify( b )
- test = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value )
- assert a == test
- # Restore from string
- try:
- values = json_fix( simplejson.loads( value ) )
- except Exception, e:
- # We do not have a json string
- values = value
- return values
-def encode( val ):
- if isinstance( val, dict ):
- value = simplejson.dumps( val )
- else:
- value = val
- a = hmac_new( 'ToolShedAndGalaxyMustHaveThisSameKey', value )
- b = binascii.hexlify( value )
- return "%s:%s" % ( a, b )
def generate_clone_url( trans, repository_id ):
"""Generate the URL for cloning a repository."""
repository = get_repository( trans, repository_id )
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -819,13 +819,16 @@
trans.sa_session.flush()
download_url = '/repos/%s/%s/archive/%s' % ( repository.user.username, repository.name, file_type_str )
return trans.response.send_redirect( download_url )
- def __encode_repo_info_dict( self, trans, webapp, repository_metadata_ids ):
+ def __encode_repo_info_dict( self, trans, repository_metadata_ids ):
repo_info_dict = {}
includes_tools = False
- for repository_metadata_id in repository_metadata_ids:
+ includes_tool_dependencies = False
+ for repository_metadata_id in util.listify( repository_metadata_ids ):
repository_metadata = get_repository_metadata_by_id( trans, repository_metadata_id )
if not includes_tools and 'tools' in repository_metadata.metadata:
includes_tools = True
+ if not includes_tool_dependencies and 'tool_dependencies' in repository_metadata.metadata:
+ includes_tool_dependencies = True
repository = get_repository( trans, trans.security.encode_id( repository_metadata.repository_id ) )
# Get the changelog rev for this changeset_revision.
repo_dir = repository.repo_path
@@ -834,8 +837,11 @@
ctx = get_changectx_for_changeset( repo, changeset_revision )
repository_id = trans.security.encode_id( repository.id )
repository_clone_url = generate_clone_url( trans, repository_id )
- repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, changeset_revision, str( ctx.rev() ) )
- return encode( repo_info_dict ), includes_tools
+ if includes_tool_dependencies:
+ repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, changeset_revision, str( ctx.rev() ) )
+ else:
+ repo_info_dict[ repository.name ] = ( repository.description, repository_clone_url, changeset_revision, str( ctx.rev() ) )
+ return tool_shed_encode( repo_info_dict ), includes_tools, includes_tool_dependencies
@web.expose
def find_tools( self, trans, **kwd ):
params = util.Params( kwd )
@@ -865,11 +871,17 @@
action=a,
**kwd ) )
if operation == "install":
- galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
- encoded_repo_info_dict, includes_tools = self.__encode_repo_info_dict( trans, webapp, util.listify( item_id ) )
- url = '%sadmin_toolshed/install_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s&includes_tools=%s' % \
- ( galaxy_url, url_for( '/', qualified=True ), webapp, encoded_repo_info_dict, str( includes_tools ) )
- return trans.response.send_redirect( url )
+ # We've received a list of RepositoryMetadata ids, so we need to build a list of associated Repository ids.
+ encoded_repository_ids = []
+ changeset_revisions = []
+ for repository_metadata_id in util.listify( item_id ):
+ repository_metadata = get_repository_metadata_by_id( trans, repository_metadata_id )
+ encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) )
+ changeset_revisions.append( repository_metadata.changeset_revision )
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='install_repositories_by_revision',
+ repository_ids=encoded_repository_ids,
+ changeset_revisions=changeset_revisions ) )
else:
# This can only occur when there is a multi-select grid with check boxes and an operation,
# and the user clicked the operation button without checking any of the check boxes.
@@ -945,11 +957,17 @@
action=a,
**kwd ) )
if operation == "install":
- galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
- encoded_repo_info_dict, includes_tools = self.__encode_repo_info_dict( trans, webapp, util.listify( item_id ) )
- url = '%sadmin_toolshed/install_repository?tool_shed_url=%s&webapp=%s&repo_info_dict=%s&includes_tools=%s' % \
- ( galaxy_url, url_for( '/', qualified=True ), webapp, encoded_repo_info_dict, str( includes_tools ) )
- return trans.response.send_redirect( url )
+ # We've received a list of RepositoryMetadata ids, so we need to build a list of associated Repository ids.
+ encoded_repository_ids = []
+ changeset_revisions = []
+ for repository_metadata_id in util.listify( item_id ):
+ repository_metadata = get_repository_metadata_by_id( trans, item_id )
+ encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) )
+ changeset_revisions.append( repository_metadata.changeset_revision )
+ return trans.response.send_redirect( web.url_for( controller='repository',
+ action='install_repositories_by_revision',
+ repository_ids=encoded_repository_ids,
+ changeset_revisions=changeset_revisions ) )
else:
# This can only occur when there is a multi-select grid with check boxes and an operation,
# and the user clicked the operation button without checking any of the check boxes.
@@ -1199,41 +1217,46 @@
message=message,
status=status )
@web.expose
- def install_repository_revision( self, trans, repository_id, **kwd ):
+ def install_repositories_by_revision( self, trans, repository_ids, changeset_revisions, **kwd ):
+ """Install a list of repositories into a local Galaxy instance by a specified changeset revision for each."""
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
webapp = get_webapp( trans, **kwd )
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
- repository_clone_url = generate_clone_url( trans, repository_id )
- repository = get_repository( trans, repository_id )
- changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) )
- repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
- metadata = repository_metadata.metadata
- # Tell the caller if the repository includes Galaxy tools so the page enabling selection of the tool panel section can be displayed.
- includes_tools = 'tools' in metadata
- includes_tool_dependencies = 'tool_dependencies' in metadata
- # Get the changelog rev for this changeset_revision.
- repo_dir = repository.repo_path
- repo = hg.repository( get_configured_ui(), repo_dir )
- ctx = get_changectx_for_changeset( repo, changeset_revision )
- repo_info_dict = {}
- if includes_tool_dependencies:
+ repo_info_dicts = []
+ includes_tools = False
+ includes_tool_dependencies = False
+ for repository_id, changeset_revision in zip( util.listify( repository_ids ), util.listify( changeset_revisions ) ):
+ repository_clone_url = generate_clone_url( trans, repository_id )
+ repository = get_repository( trans, repository_id )
+ #changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) )
+ repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
+ metadata = repository_metadata.metadata
+ # Tell the caller if the repository includes Galaxy tools so the page enabling selection of the tool panel section can be displayed.
+ if not includes_tools and 'tools' in metadata:
+ includes_tools = True
+ if not includes_tool_dependencies and 'tool_dependencies' in metadata:
+ includes_tool_dependencies = True
+ # Get the changelog rev for this changeset_revision.
+ repo_dir = repository.repo_path
+ repo = hg.repository( get_configured_ui(), repo_dir )
+ ctx = get_changectx_for_changeset( repo, changeset_revision )
+ repo_info_dict = {}
repo_info_dict[ repository.name ] = ( repository.description,
repository_clone_url,
changeset_revision,
str( ctx.rev() ),
repository.user.username,
- metadata[ 'tool_dependencies' ] )
- else:
- repo_info_dict[ repository.name ] = ( repository.description,
- repository_clone_url,
- changeset_revision,
- str( ctx.rev() ) )
- encoded_repo_info_dict = encode( repo_info_dict )
+ metadata.get( 'tool_dependencies', None ) )
+ repo_info_dicts.append( tool_shed_encode( repo_info_dict ) )
+ encoded_repo_info_dicts = ','.join( repo_info_dicts )
# Redirect back to local Galaxy to perform install.
- url = '%sadmin_toolshed/install_repository?tool_shed_url=%s&repo_info_dict=%s&includes_tools=%s&includes_tool_dependencies=%s' % \
- ( galaxy_url, url_for( '/', qualified=True ), encoded_repo_info_dict, str( includes_tools ), str( includes_tool_dependencies ) )
+ url = '%sadmin_toolshed/install_repository' % galaxy_url
+ url += '?tool_shed_url=%s' % url_for( '/', qualified=True )
+ url += '&repo_info_dicts=%s' % encoded_repo_info_dicts
+ url += '&includes_tools=%s' % includes_tools
+ url += '&includes_tool_dependencies=%s' % includes_tool_dependencies
return trans.response.send_redirect( url )
@web.expose
def load_invalid_tool( self, trans, repository_id, tool_config, changeset_revision, **kwd ):
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 lib/galaxy/webapps/community/controllers/workflow.py
--- a/lib/galaxy/webapps/community/controllers/workflow.py
+++ b/lib/galaxy/webapps/community/controllers/workflow.py
@@ -10,6 +10,7 @@
from galaxy.web.controllers.workflow import attach_ordered_steps
from galaxy.model.orm import *
from common import *
+from galaxy.tool_shed.encoding_util import *
class RepoInputDataModule( InputDataModule ):
@@ -139,7 +140,7 @@
repository_metadata_id = kwd.get( 'repository_metadata_id', '' )
workflow_name = kwd.get( 'workflow_name', '' )
if workflow_name:
- workflow_name = decode( workflow_name )
+ workflow_name = tool_shed_decode( workflow_name )
webapp = kwd.get( 'webapp', 'community' )
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
@@ -159,7 +160,7 @@
repository_id = trans.security.encode_id( repository_metadata.repository_id )
changeset_revision = repository_metadata.changeset_revision
metadata = repository_metadata.metadata
- workflow_name = decode( workflow_name )
+ workflow_name = tool_shed_decode( workflow_name )
# metadata[ 'workflows' ] is a list of tuples where each contained tuple is
# [ <relative path to the .ga file in the repository>, <exported workflow dict> ]
for workflow_tup in metadata[ 'workflows' ]:
@@ -385,7 +386,7 @@
repository_metadata_id = kwd.get( 'repository_metadata_id', '' )
workflow_name = kwd.get( 'workflow_name', '' )
if workflow_name:
- workflow_name = decode( workflow_name )
+ workflow_name = tool_shed_decode( workflow_name )
webapp = kwd.get( 'webapp', 'community' )
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
@@ -403,7 +404,7 @@
return open( tmp_fname )
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
url = '%sworkflow/import_workflow?tool_shed_url=%s&repository_metadata_id=%s&workflow_name=%s&webapp=%s' % \
- ( galaxy_url, url_for( '/', qualified=True ), repository_metadata_id, encode( workflow_name ), webapp )
+ ( galaxy_url, url_for( '/', qualified=True ), repository_metadata_id, tool_shed_encode( workflow_name ), webapp )
return trans.response.send_redirect( url )
return trans.response.send_redirect( web.url_for( controller='workflow',
action='view_workflow',
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/admin/tool_shed_repository/common.mako
--- a/templates/admin/tool_shed_repository/common.mako
+++ b/templates/admin/tool_shed_repository/common.mako
@@ -67,7 +67,7 @@
</script></%def>
-<%def name="render_tool_dependency_section( install_tool_dependencies_check_box, dict_with_tool_dependencies )">
+<%def name="render_tool_dependency_section( install_tool_dependencies_check_box, repo_info_dicts )"><% import os %><div class="form-row"><div class="toolParamHelp" style="clear: both;">
@@ -100,32 +100,36 @@
<th>Type</th><th>Install directory</th></tr>
- %for repository_name, repo_info_tuple in dict_with_tool_dependencies.items():
- <% description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple %>
- %for dependency_key, requirements_dict in tool_dependencies.items():
- <%
- name = requirements_dict[ 'name' ]
- version = requirements_dict[ 'version' ]
- type = requirements_dict[ 'type' ]
- install_dir = os.path.join( trans.app.config.tool_dependency_dir,
- name,
- version,
- repository_owner,
- repository_name,
- changeset_revision )
- tool_dependency_readme_text = requirements_dict.get( 'readme', None )
- %>
- %if not os.path.exists( install_dir ):
- <tr>
- <td>${name}</td>
- <td>${version}</td>
- <td>${type}</td>
- <td>${install_dir}</td>
- </tr>
- %if tool_dependency_readme_text:
- <tr><td colspan="4" bgcolor="#FFFFCC">${name} ${version} requirements and installation information</td></tr>
- <tr><td colspan="4"><pre>${tool_dependency_readme_text}</pre></td></tr>
- %endif
+ %for repo_info_dict in repo_info_dicts:
+ %for repository_name, repo_info_tuple in repo_info_dict.items():
+ <% description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple %>
+ %if tool_dependencies:
+ %for dependency_key, requirements_dict in tool_dependencies.items():
+ <%
+ name = requirements_dict[ 'name' ]
+ version = requirements_dict[ 'version' ]
+ type = requirements_dict[ 'type' ]
+ install_dir = os.path.join( trans.app.config.tool_dependency_dir,
+ name,
+ version,
+ repository_owner,
+ repository_name,
+ changeset_revision )
+ tool_dependency_readme_text = requirements_dict.get( 'readme', None )
+ %>
+ %if not os.path.exists( install_dir ):
+ <tr>
+ <td>${name}</td>
+ <td>${version}</td>
+ <td>${type}</td>
+ <td>${install_dir}</td>
+ </tr>
+ %if tool_dependency_readme_text:
+ <tr><td colspan="4" bgcolor="#FFFFCC">${name} ${version} requirements and installation information</td></tr>
+ <tr><td colspan="4"><pre>${tool_dependency_readme_text}</pre></td></tr>
+ %endif
+ %endif
+ %endfor
%endif
%endfor
%endfor
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
@@ -12,7 +12,7 @@
<form name="reselect_tool_panel_section" id="reselect_tool_panel_section" action="${h.url_for( controller='admin_toolshed', action='reinstall_repository', id=trans.security.encode_id( repository.id ), repo_info_dict=repo_info_dict )}" method="post" ><div style="clear: both"></div>
%if includes_tool_dependencies:
- ${render_tool_dependency_section( install_tool_dependencies_check_box, dict_with_tool_dependencies )}
+ ${render_tool_dependency_section( install_tool_dependencies_check_box, [ repo_info_dict ] )}
%endif
<div style="clear: both"></div><div class="form-row">
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/admin/tool_shed_repository/select_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/select_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/select_tool_panel_section.mako
@@ -23,19 +23,23 @@
<br/><div class="toolForm">
- <div class="toolFormTitle">Confirm tool dependency installation</div>
+ %if includes_tool_dependencies:
+ <div class="toolFormTitle">Confirm tool dependency installation</div>
+ %else:
+ <div class="toolFormTitle">Choose the tool panel section to contain the installed tools (optional)</div>
+ %endif
<div class="toolFormBody">
- <form name="select_tool_panel_section" id="select_tool_panel_section" action="${h.url_for( controller='admin_toolshed', action='install_repository', tool_shed_url=tool_shed_url, repo_info_dict=repo_info_dict, includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies )}" method="post" >
+ <form name="select_tool_panel_section" id="select_tool_panel_section" action="${h.url_for( controller='admin_toolshed', action='install_repository', tool_shed_url=tool_shed_url, repo_info_dicts=encoded_repo_info_dicts, includes_tools=includes_tools, includes_tool_dependencies=includes_tool_dependencies )}" method="post" ><div style="clear: both"></div>
%if includes_tool_dependencies:
- ${render_tool_dependency_section( install_tool_dependencies_check_box, dict_with_tool_dependencies )}
+ ${render_tool_dependency_section( install_tool_dependencies_check_box, repo_info_dicts )}
+ <div style="clear: both"></div>
+ <div class="form-row">
+ <table class="colored" width="100%">
+ <th bgcolor="#EBD9B2">Choose the tool panel section to contain the installed tools (optional)</th>
+ </table>
+ </div>
%endif
- <div style="clear: both"></div>
- <div class="form-row">
- <table class="colored" width="100%">
- <th bgcolor="#EBD9B2">Choose the tool panel section to contain the installed tools (optional)</th>
- </table>
- </div>
%if shed_tool_conf_select_field:
<div class="form-row"><label>Shed tool configuration file:</label>
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/webapps/community/repository/common.mako
--- a/templates/webapps/community/repository/common.mako
+++ b/templates/webapps/community/repository/common.mako
@@ -84,7 +84,7 @@
</%def><%def name="render_repository_items( repository_metadata_id, metadata, can_set_metadata=False, webapp='community' )">
- <% from galaxy.webapps.community.controllers.common import encode, decode %>
+ <% from galaxy.tool_shed.encoding_util import tool_shed_decode %>
%if metadata or can_set_metadata:
<p/><div class="toolForm">
@@ -236,7 +236,7 @@
%><tr><td>
- <a href="${h.url_for( controller='workflow', action='view_workflow', repository_metadata_id=repository_metadata_id, workflow_name=encode( workflow_name ), webapp=webapp )}">${workflow_name}</a>
+ <a href="${h.url_for( controller='workflow', action='view_workflow', repository_metadata_id=repository_metadata_id, workflow_name=tool_shed_decode( workflow_name ), webapp=webapp )}">${workflow_name}</a></td><td>
%if steps:
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/webapps/community/repository/preview_tools_in_changeset.mako
--- a/templates/webapps/community/repository/preview_tools_in_changeset.mako
+++ b/templates/webapps/community/repository/preview_tools_in_changeset.mako
@@ -64,7 +64,7 @@
<br/><br/><ul class="manage-table-actions">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_repositories', webapp=webapp )}">Browse valid repositories</a>
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/webapps/community/repository/tool_form.mako
--- a/templates/webapps/community/repository/tool_form.mako
+++ b/templates/webapps/community/repository/tool_form.mako
@@ -123,7 +123,7 @@
%if webapp == 'galaxy':
<li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li><li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Browse repository</a></li></div><li><a class="action-button" id="tool_shed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/webapps/community/repository/view_repository.mako
--- a/templates/webapps/community/repository/view_repository.mako
+++ b/templates/webapps/community/repository/view_repository.mako
@@ -94,7 +94,7 @@
</div>
%endif
%else:
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='repository', action='browse_valid_repositories', webapp=webapp )}">Browse valid repositories</a>
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/webapps/community/repository/view_tool_metadata.mako
--- a/templates/webapps/community/repository/view_tool_metadata.mako
+++ b/templates/webapps/community/repository/view_tool_metadata.mako
@@ -36,7 +36,7 @@
%if webapp == 'galaxy':
<li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup">
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install to local Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revisions=changeset_revision )}">Install to local Galaxy</a></li><li><a class="action-button" href="${h.url_for( controller='repository', action='preview_tools_in_changeset', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Browse repository</a></li></div><li><a class="action-button" id="tool_shed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li>
diff -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 -r b9804f980783c4a014a66f7cf45979ae290e71f0 templates/webapps/community/repository/view_workflow.mako
--- a/templates/webapps/community/repository/view_workflow.mako
+++ b/templates/webapps/community/repository/view_workflow.mako
@@ -5,7 +5,7 @@
<%
from galaxy.web.framework.helpers import time_ago
- from galaxy.webapps.community.controllers.common import encode
+ from galaxy.tool_shed.encoding_util import tool_shed_encode
in_tool_shed = webapp == 'community'
is_admin = trans.user_is_admin()
@@ -34,7 +34,7 @@
<%inherit file="${inherit(context)}"/><%def name="render_workflow( repository_metadata_id, workflow_name, webapp )">
- <% center_url = h.url_for( controller='workflow', action='generate_workflow_image', repository_metadata_id=repository_metadata_id, workflow_name=encode( workflow_name ), webapp=webapp ) %>
+ <% center_url = h.url_for( controller='workflow', action='generate_workflow_image', repository_metadata_id=repository_metadata_id, workflow_name=tool_shed_encode( workflow_name ), webapp=webapp ) %><iframe name="galaxy_main" id="galaxy_main" frameborder="0" style="position: absolute; width: 100%; height: 100%;" src="${center_url}"></iframe></%def>
@@ -76,8 +76,8 @@
%else:
<li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup">
- <li><a class="action-button" href="${h.url_for( controller='workflow', action='import_workflow', repository_metadata_id=repository_metadata_id, workflow_name=encode( workflow_name ), webapp=webapp )}">Import workflow to local Galaxy</a></li>
- <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repository_revision', repository_id=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revision=changeset_revision )}">Install repository to local Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='workflow', action='import_workflow', repository_metadata_id=repository_metadata_id, workflow_name=tool_shed_encode( workflow_name ), webapp=webapp )}">Import workflow to local Galaxy</a></li>
+ <li><a class="action-button" href="${h.url_for( controller='repository', action='install_repositories_by_revision', repository_ids=trans.security.encode_id( repository.id ), webapp=webapp, changeset_revisions=changeset_revision )}">Install repository to local Galaxy</a></li></div><li><a class="action-button" id="toolshed-${repository.id}-popup" class="menubutton">Tool Shed Actions</a></li><div popupmenu="toolshed-${repository.id}-popup">
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.
1
0
commit/galaxy-central: greg: Look for the webapp setting in the request's environ if it is not included in the request's parameters.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/98204b9f4f80/
changeset: 98204b9f4f80
user: greg
date: 2012-07-05 19:54:31
summary: Look for the webapp setting in the request's environ if it is not included in the request's parameters.
affected #: 11 files
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -1552,7 +1552,7 @@
@web.expose
@web.require_admin
def index( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
if webapp == 'galaxy':
@@ -1572,7 +1572,7 @@
@web.expose
@web.require_admin
def center( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
if webapp == 'galaxy':
@@ -1629,7 +1629,7 @@
@web.require_admin
def create_role( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
name = util.restore_text( params.get( 'name', '' ) )
@@ -1706,7 +1706,7 @@
@web.require_admin
def rename_role( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
id = params.get( 'id', None )
@@ -1751,7 +1751,7 @@
@web.require_admin
def manage_users_and_groups_for_role( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
id = params.get( 'id', None )
@@ -1846,7 +1846,7 @@
@web.require_admin
def mark_role_deleted( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No role ids received for deleting"
@@ -1872,7 +1872,7 @@
@web.require_admin
def undelete_role( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No role ids received for undeleting"
@@ -1915,7 +1915,7 @@
# - GroupRoleAssociations where role_id == Role.id
# - DatasetPermissionss where role_id == Role.id
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No role ids received for purging"
@@ -1988,7 +1988,7 @@
@web.require_admin
def rename_group( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
id = params.get( 'id', None )
@@ -2031,7 +2031,7 @@
@web.require_admin
def manage_users_and_roles_for_group( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
group = get_group( trans, params.id )
@@ -2078,7 +2078,7 @@
@web.require_admin
def create_group( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
name = util.restore_text( params.get( 'name', '' ) )
@@ -2156,7 +2156,7 @@
@web.require_admin
def mark_group_deleted( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = params.get( 'id', None )
if not id:
message = "No group ids received for marking deleted"
@@ -2182,7 +2182,7 @@
@web.require_admin
def undelete_group( self, trans, **kwd ):
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No group ids received for undeleting"
@@ -2220,7 +2220,7 @@
# This method should only be called for a Group that has previously been deleted.
# Purging a deleted Group simply deletes all UserGroupAssociations and GroupRoleAssociations.
params = util.Params( kwd )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No group ids received for purging"
@@ -2259,7 +2259,7 @@
@web.expose
@web.require_admin
def create_new_user( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
return trans.response.send_redirect( web.url_for( controller='user',
action='create',
cntrller='admin',
@@ -2267,7 +2267,7 @@
@web.expose
@web.require_admin
def reset_user_password( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
user_id = kwd.get( 'id', None )
if not user_id:
message = "No users received for resetting passwords."
@@ -2316,7 +2316,7 @@
@web.expose
@web.require_admin
def mark_user_deleted( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No user ids received for deleting"
@@ -2341,7 +2341,7 @@
@web.expose
@web.require_admin
def undelete_user( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No user ids received for undeleting"
@@ -2388,7 +2388,7 @@
# - UserRoleAssociation where user_id == User.id EXCEPT FOR THE PRIVATE ROLE
# - UserAddress where user_id == User.id
# Purging Histories and Datasets must be handled via the cleanup_datasets.py script
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
id = kwd.get( 'id', None )
if not id:
message = "No user ids received for purging"
@@ -2493,7 +2493,7 @@
@web.expose
@web.require_admin
def manage_roles_and_groups_for_user( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
user_id = kwd.get( 'id', None )
message = ''
status = ''
@@ -2714,3 +2714,11 @@
id = trans.security.decode_id( id )
quota = trans.sa_session.query( trans.model.Quota ).get( id )
return quota
+def get_webapp( trans, **kwd ):
+ """Get the value of the webapp, can be one of 'community', 'galaxy', 'reports', 'demo_sequencer'."""
+ if 'webapp' in kwd:
+ return kwd[ 'webapp' ]
+ if 'webapp' in trans.environ:
+ return trans.environ[ 'webapp' ]
+ # The default is galaxy.
+ return 'galaxy'
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/admin.py
--- a/lib/galaxy/web/controllers/admin.py
+++ b/lib/galaxy/web/controllers/admin.py
@@ -51,7 +51,6 @@
return 'never'
# Grid definition
- webapp = "galaxy"
title = "Users"
model_class = model.User
template='/admin/user/grid.mako'
@@ -136,7 +135,6 @@
return 0
# Grid definition
- webapp = "galaxy"
title = "Roles"
model_class = model.Role
template='/admin/dataset_security/role/grid.mako'
@@ -220,7 +218,6 @@
return 0
# Grid definition
- webapp = "galaxy"
title = "Groups"
model_class = model.Group
template='/admin/dataset_security/group/grid.mako'
@@ -302,7 +299,6 @@
return 0
# Grid definition
- webapp = "galaxy"
title = "Quotas"
model_class = model.Quota
template='/admin/quota/grid.mako'
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -147,7 +147,6 @@
( bgcolor, trans.security.encode_id( tool_shed_repository.id ), status_label )
return rval
- webapp = "galaxy"
title = "Monitor installing tool shed repositories"
template = "admin/tool_shed_repository/repository_installation_grid.mako"
model_class = model.ToolShedRepository
@@ -230,7 +229,6 @@
( bgcolor, trans.security.encode_id( tool_dependency.id ), tool_dependency.status )
return rval
- webapp = "galaxy"
title = "Tool Dependencies"
template = "admin/tool_shed_repository/tool_dependencies_grid.mako"
model_class = model.ToolDependency
@@ -1516,7 +1514,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository( trans, repository_id )
metadata = {}
tool = None
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/external_service.py
--- a/lib/galaxy/web/controllers/external_service.py
+++ b/lib/galaxy/web/controllers/external_service.py
@@ -21,7 +21,6 @@
return 'Error in loading external_service type: %s' % external_service.external_service_type_id
# Grid definition
- webapp = "galaxy"
title = "External Services"
template = "admin/external_service/grid.mako"
model_class = model.ExternalService
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/request_type.py
--- a/lib/galaxy/web/controllers/request_type.py
+++ b/lib/galaxy/web/controllers/request_type.py
@@ -28,7 +28,6 @@
return len( request_type.external_services )
return 'No external service assigned'
# Grid definition
- webapp = "galaxy"
title = "Request Types"
template = "admin/request_type/grid.mako"
model_class = model.RequestType
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/requests_admin.py
--- a/lib/galaxy/web/controllers/requests_admin.py
+++ b/lib/galaxy/web/controllers/requests_admin.py
@@ -47,7 +47,6 @@
except:
return 'None'
# Grid definition
- webapp = "galaxy"
title = "Sample Datasets"
template = "admin/requests/sample_datasets_grid.mako"
model_class = model.SampleDataset
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/user.py
--- a/lib/galaxy/web/controllers/user.py
+++ b/lib/galaxy/web/controllers/user.py
@@ -514,7 +514,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
use_panels = util.string_as_bool( kwd.get( 'use_panels', True ) )
email = util.restore_text( params.get( 'email', '' ) )
# Do not sanitize passwords, so take from kwd
@@ -597,7 +597,7 @@
email = util.restore_text( kwd.get( 'email', '' ) )
password = kwd.get( 'password', '' )
username = util.restore_text( kwd.get( 'username', '' ) )
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
status = kwd.get( 'status', 'done' )
is_admin = cntrller == 'admin' and trans.user_is_admin()
user = trans.app.model.User( email=email )
@@ -694,7 +694,7 @@
user = trans.user
if not user:
raise AssertionError, "The user id (%s) is not valid" % str( user_id )
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
email = util.restore_text( params.get( 'email', user.email ) )
# Do not sanitize passwords, so take from kwd
# instead of params ( which were sanitized )
@@ -759,7 +759,7 @@
def edit_username( self, trans, cntrller, **kwd ):
params = util.Params( kwd )
is_admin = cntrller == 'admin' and trans.user_is_admin()
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
user_id = params.get( 'user_id', None )
@@ -789,7 +789,7 @@
def edit_info( self, trans, cntrller, **kwd ):
params = util.Params( kwd )
is_admin = cntrller == 'admin' and trans.user_is_admin()
- webapp = params.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
user_id = params.get( 'user_id', None )
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py
+++ b/lib/galaxy/web/controllers/workflow.py
@@ -1033,7 +1033,7 @@
"""
url = kwd.get( 'url', '' )
workflow_text = kwd.get( 'workflow_text', '' )
- webapp = kwd.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwd )
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
import_button = kwd.get( 'import_button', False )
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py
+++ b/lib/galaxy/web/framework/helpers/grids.py
@@ -53,7 +53,7 @@
def __call__( self, trans, **kwargs ):
# Get basics.
- webapp = kwargs.get( 'webapp', 'galaxy' )
+ webapp = get_webapp( trans, **kwargs )
status = kwargs.get( 'status', None )
message = kwargs.get( 'message', None )
# Build a base filter and sort key that is the combination of the saved state and defaults.
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/webapps/community/controllers/admin.py
--- a/lib/galaxy/webapps/community/controllers/admin.py
+++ b/lib/galaxy/webapps/community/controllers/admin.py
@@ -60,7 +60,6 @@
return query.filter( and_( model.Tool.table.c.user_id == model.User.table.c.id,
model.User.table.c.email == column_filter ) )
# Grid definition
- webapp = "community"
title = "Users"
model_class = model.User
template='/admin/user/grid.mako'
@@ -148,7 +147,6 @@
return 0
# Grid definition
- webapp = "community"
title = "Roles"
model_class = model.Role
template='/admin/dataset_security/role/grid.mako'
@@ -235,7 +233,6 @@
return 0
# Grid definition
- webapp = "community"
title = "Groups"
model_class = model.Group
template='/admin/dataset_security/group/grid.mako'
diff -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 -r 98204b9f4f806c15fa52fd728b5dacbc64f5eeb1 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -40,7 +40,6 @@
return 0
# Grid definition
- webapp = "community"
title = "Categories"
model_class = model.Category
template='/webapps/community/category/grid.mako'
@@ -377,7 +376,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
cntrller = params.get( 'cntrller', 'repository' )
is_admin = trans.user_is_admin()
invalid_tools_dict = odict()
@@ -495,7 +494,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
commit_message = util.restore_text( params.get( 'commit_message', 'Deleted selected files' ) )
repository = get_repository( trans, id )
repo = hg.repository( get_configured_ui(), repository.repo_path )
@@ -511,7 +510,7 @@
status=status )
@web.expose
def browse_valid_repositories( self, trans, **kwd ):
- webapp = kwd.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
galaxy_url = kwd.get( 'galaxy_url', None )
if galaxy_url:
trans.set_cookie( galaxy_url, name='toolshedgalaxyurl' )
@@ -596,7 +595,7 @@
name = params.get( 'name', None )
owner = params.get( 'owner', None )
changeset_revision = params.get( 'changeset_revision', None )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository_by_name_and_owner( trans, name, owner )
repo_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_dir )
@@ -769,7 +768,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository( trans, repository_id )
tool, message = load_tool_from_changeset_revision( trans, repository_id, changeset_revision, tool_config )
tool_state = self.__new_state( trans )
@@ -842,7 +841,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
galaxy_url = kwd.get( 'galaxy_url', None )
if galaxy_url:
trans.set_cookie( galaxy_url, name='toolshedgalaxyurl' )
@@ -922,7 +921,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
galaxy_url = kwd.get( 'galaxy_url', None )
if galaxy_url:
trans.set_cookie( galaxy_url, name='toolshedgalaxyurl' )
@@ -1050,7 +1049,7 @@
name = params.get( 'name', None )
owner = params.get( 'owner', None )
changeset_revision = params.get( 'changeset_revision', None )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository_by_name_and_owner( trans, name, owner )
for downloadable_revision in repository.downloadable_revisions:
if downloadable_revision.changeset_revision == changeset_revision:
@@ -1204,7 +1203,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
repository_clone_url = generate_clone_url( trans, repository_id )
repository = get_repository( trans, repository_id )
@@ -1241,7 +1240,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'error' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository( trans, repository_id )
repo_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_dir )
@@ -1537,7 +1536,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository( trans, repository_id )
changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) )
repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
@@ -1999,7 +1998,7 @@
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
repository = get_repository( trans, id )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repo = hg.repository( get_configured_ui(), repository.repo_path )
avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model )
changeset_revision = util.restore_text( params.get( 'changeset_revision', repository.tip ) )
@@ -2068,7 +2067,7 @@
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
- webapp = params.get( 'webapp', 'community' )
+ webapp = get_webapp( trans, **kwd )
repository = get_repository( trans, repository_id )
metadata = {}
tool = 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.
1
0
commit/galaxy-central: jgoecks: Hacks to get trackster navigation controls to display in embedded visualizations.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/e7e59c068d70/
changeset: e7e59c068d70
user: jgoecks
date: 2012-07-05 18:03:32
summary: Hacks to get trackster navigation controls to display in embedded visualizations.
affected #: 1 file
diff -r 0ffcc91708233cc087d9996235f0917b377cfe8a -r e7e59c068d7002e48eebb9dc6f34721fb7456fb5 templates/page/display.mako
--- a/templates/page/display.mako
+++ b/templates/page/display.mako
@@ -112,6 +112,13 @@
width: 25%;
padding: 0.2em 0.8em;
}
+ ## HACKs to get Trackster navigation controls to display.
+ .embedded-item .trackster-nav-container {
+ height: inherit;
+ }
+ .embedded-item .trackster-nav {
+ position: inherit;
+ }
</style></%def>
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.
1
0
commit/galaxy-central: greg: Refine the definition of changeset revisions that can be automatically installed into a local Galaxy instance.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/0ffcc9170823/
changeset: 0ffcc9170823
user: greg
date: 2012-07-05 17:55:10
summary: Refine the definition of changeset revisions that can be automatically installed into a local Galaxy instance.
affected #: 7 files
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -76,8 +76,9 @@
processed_invalid_tool_configs = []
processed_relative_workflow_paths = []
processed_datatypes = []
- for downloadable_revision in repository.downloadable_revisions:
- metadata = downloadable_revision.metadata
+ # A repository's metadata_revisions are those that ignore the value of the repository_metadata.downloadable column.
+ for metadata_revision in repository.metadata_revisions:
+ metadata = metadata_revision.metadata
if 'tools' in metadata:
tool_dicts = metadata[ 'tools' ]
for tool_dict in tool_dicts:
@@ -1461,7 +1462,7 @@
"""
# To set excluded_lower_bounds_changeset_revision, calling methods should do the following, where the value of changeset_revision
# is a downloadable changeset_revision.
- # excluded_lower_bounds_changeset_revision = get_previous_valid_changset_revision( repository, repo, changeset_revision )
+ # excluded_lower_bounds_changeset_revision = get_previous_downloadable_changset_revision( repository, repo, changeset_revision )
if excluded_lower_bounds_changeset_revision == INITIAL_CHANGELOG_HASH:
appending_started = True
else:
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -134,10 +134,7 @@
trans.sa_session.add( repository_metadata )
trans.sa_session.flush()
def build_changeset_revision_select_field( trans, repository, selected_value=None, add_id_to_name=True ):
- """
- Build a SelectField whose options are the changeset_revision
- strings of all downloadable_revisions of the received repository.
- """
+ """Build a SelectField whose options are the changeset_rev strings of all downloadable revisions of the received repository."""
repo = hg.repository( get_configured_ui(), repository.repo_path )
options = []
changeset_tups = []
@@ -169,6 +166,10 @@
selected = selected_value and option_tup[1] == selected_value
select_field.add_option( option_tup[0], option_tup[1], selected=selected )
return select_field
+def changeset_is_downloadable( metadata_dict ):
+ # A RepositoryMetadata record will be created if metadata_dict includes only invalid stuff like 'invalid_tools', but in this case
+ # it won't be downloadable.
+ return 'datatypes' in metadata_dict or 'tools' in metadata_dict or 'workflows' in metadata_dict
def changeset_is_malicious( trans, id, changeset_revision, **kwd ):
"""Check the malicious flag in repository metadata for a specified change set"""
repository_metadata = get_repository_metadata_by_changeset_revision( trans, id, changeset_revision )
@@ -374,15 +375,12 @@
def create_or_update_repository_metadata( trans, id, repository, changeset_revision, metadata_dict ):
repository_metadata = get_repository_metadata_by_changeset_revision( trans, id, changeset_revision )
if repository_metadata:
- # Update RepositoryMetadata.metadata.
repository_metadata.metadata = metadata_dict
- trans.sa_session.add( repository_metadata )
- trans.sa_session.flush()
else:
- # Create a new repository_metadata table row.
repository_metadata = trans.model.RepositoryMetadata( repository.id, changeset_revision, metadata_dict )
- trans.sa_session.add( repository_metadata )
- trans.sa_session.flush()
+ repository_metadata.downloadable = changeset_is_downloadable( metadata_dict )
+ trans.sa_session.add( repository_metadata )
+ trans.sa_session.flush()
def decode( value ):
# Extract and verify hash
a, b = value.split( ":" )
@@ -605,7 +603,7 @@
if parent_id is None:
# The tool did not change through all of the changeset revisions.
return old_id
-def get_previous_valid_changset_revision( repository, repo, before_changeset_revision ):
+def get_previous_downloadable_changset_revision( repository, repo, before_changeset_revision ):
"""
Return the downloadable changeset_revision in the repository changelog just prior to the changeset to which before_changeset_revision
refers. If there isn't one, return the hash value of an empty repository changlog, INITIAL_CHANGELOG_HASH.
@@ -1087,12 +1085,9 @@
# Update the last saved repository_metadata table row.
repository_metadata.changeset_revision = changeset_revision
repository_metadata.metadata = metadata_dict
+ repository_metadata.downloadable = changeset_is_downloadable( metadata_dict )
trans.sa_session.add( repository_metadata )
- try:
- trans.sa_session.flush()
- except TypeError, e:
- message = "Unable to save metadata for this repository probably due to a tool config file that doesn't conform to the Cheetah template syntax."
- status = 'error'
+ trans.sa_session.flush()
else:
# There are no tools in the repository, and we're setting metadata on the repository tip.
repository_metadata = trans.model.RepositoryMetadata( repository.id, changeset_revision, metadata_dict )
@@ -1102,6 +1097,7 @@
# We're re-generating metadata for an old repository revision.
repository_metadata = get_repository_metadata_by_changeset_revision( trans, id, changeset_revision )
repository_metadata.metadata = metadata_dict
+ repository_metadata.downloadable = changeset_is_downloadable( metadata_dict )
trans.sa_session.add( repository_metadata )
trans.sa_session.flush()
elif updating_tip and len( repo ) == 1 and not invalid_files:
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -75,10 +75,7 @@
def __init__( self, col_name ):
grids.GridColumn.__init__( self, col_name )
def get_value( self, trans, grid, repository ):
- """
- Display a SelectField whose options are the changeset_revision
- strings of all downloadable_revisions of this repository.
- """
+ """Display a SelectField whose options are the changeset_revision strings of all downloadable_revisions of this repository."""
select_field = build_changeset_revision_select_field( trans, repository )
if len( select_field.options ) > 1:
return select_field.get_html()
@@ -245,22 +242,10 @@
filterable="standard" ) )
operations = []
def build_initial_query( self, trans, **kwd ):
- # The clause_list approach is to filter out those repositories that include metadata, but only because they contain 'invalid_tools' in
- # the metadata (i.e., they don't have valid tools, datatypes or workflows). Is there a better approach?
- clause_list = []
- for repository_metadata in trans.sa_session.query( trans.model.RepositoryMetadata ) \
- .filter( trans.model.RepositoryMetadata.table.c.malicious == False ):
- metadata = repository_metadata.metadata
- if 'datatypes' in metadata or'tools' in metadata or 'workflows' in metadata:
- clause_list.append( trans.model.RepositoryMetadata.table.c.id == repository_metadata.id )
- if clause_list:
- return trans.sa_session.query( self.model_class ) \
- .join( model.RepositoryMetadata.table ) \
- .join( model.User.table ) \
- .filter( or_( *clause_list ) )
return trans.sa_session.query( self.model_class ) \
.join( model.RepositoryMetadata.table ) \
- .join( model.User.table )
+ .join( model.User.table ) \
+ .filter( model.RepositoryMetadata.table.c.downloadable == True )
class MatchedRepositoryListGrid( grids.Grid ):
class NameColumn( grids.TextColumn ):
@@ -400,7 +385,8 @@
for repository in trans.sa_session.query( trans.model.Repository ) \
.filter( trans.model.Repository.table.c.deleted == False ) \
.order_by( trans.model.Repository.table.c.name ):
- for downloadable_revision in repository.downloadable_revisions:
+ # A repository's metadata_revisions are those that ignore the value of the repository_metadata.downloadable column.
+ for downloadable_revision in repository.metadata_revisions:
metadata = downloadable_revision.metadata
invalid_tools = metadata.get( 'invalid_tools', [] )
for invalid_tool_config in invalid_tools:
@@ -410,7 +396,7 @@
.filter( and_( trans.model.Repository.table.c.deleted == False,
trans.model.Repository.table.c.user_id == trans.user.id ) ) \
.order_by( trans.model.Repository.table.c.name ):
- for downloadable_revision in repository.downloadable_revisions:
+ for downloadable_revision in repository.metadata_revisions:
metadata = downloadable_revision.metadata
invalid_tools = metadata.get( 'invalid_tools', [] )
for invalid_tool_config in invalid_tools:
@@ -1595,7 +1581,7 @@
repo_dir = repository.repo_path
repo = hg.repository( get_configured_ui(), repo_dir )
# Get the lower bound changeset revision
- lower_bound_changeset_revision = get_previous_valid_changset_revision( repository, repo, changeset_revision )
+ lower_bound_changeset_revision = get_previous_downloadable_changset_revision( repository, repo, changeset_revision )
# Build the list of changeset revision hashes.
changeset_hashes = []
for changeset in reversed_lower_upper_bounded_changelog( repo, lower_bound_changeset_revision, changeset_revision ):
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/webapps/community/controllers/upload.py
--- a/lib/galaxy/webapps/community/controllers/upload.py
+++ b/lib/galaxy/webapps/community/controllers/upload.py
@@ -130,9 +130,6 @@
error, error_message = handle_sample_tool_data_table_conf_file( trans.app, full_path )
if error:
message = '%s<br/>%s' % ( message, error_message )
- #if full_path.endswith( '.loc.sample' ):
- # # Handle the special case where a xxx.loc.sample file is being uploaded by copying it to ~/tool-data/xxx.loc.
- # copy_sample_file( trans.app, full_path )
# See if the content of the change set was valid.
admin_only = len( repository.downloadable_revisions ) != 1
handle_email_alerts( trans, repository, content_alert_str=content_alert_str, new_repo_alert=new_repo_alert, admin_only=admin_only )
@@ -272,7 +269,6 @@
if error:
return False, message, files_to_remove, content_alert_str, undesirable_dirs_removed, undesirable_files_removed
commands.commit( repo.ui, repo, full_path, user=trans.user.username, message=commit_message )
- # See if the content of the change set was valid.
admin_only = len( repository.downloadable_revisions ) != 1
handle_email_alerts( trans, repository, content_alert_str=content_alert_str, new_repo_alert=new_repo_alert, admin_only=admin_only )
return True, '', files_to_remove, content_alert_str, undesirable_dirs_removed, undesirable_files_removed
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/webapps/community/model/mapping.py
--- a/lib/galaxy/webapps/community/model/mapping.py
+++ b/lib/galaxy/webapps/community/model/mapping.py
@@ -121,7 +121,8 @@
Column( "changeset_revision", TrimmedString( 255 ), index=True ),
Column( "metadata", JSONType, nullable=True ),
Column( "tool_versions", JSONType, nullable=True ),
- Column( "malicious", Boolean, default=False ) )
+ Column( "malicious", Boolean, default=False ),
+ Column( "downloadable", Boolean, default=True ) )
RepositoryRatingAssociation.table = Table( "repository_rating_association", metadata,
Column( "id", Integer, primary_key=True ),
@@ -196,7 +197,11 @@
categories=relation( RepositoryCategoryAssociation ),
ratings=relation( RepositoryRatingAssociation, order_by=desc( RepositoryRatingAssociation.table.c.update_time ), backref="repositories" ),
user=relation( User.mapper ),
- downloadable_revisions=relation( RepositoryMetadata, order_by=desc( RepositoryMetadata.table.c.update_time ) ) ) )
+ downloadable_revisions=relation( RepositoryMetadata,
+ primaryjoin=( ( Repository.table.c.id == RepositoryMetadata.table.c.repository_id ) & ( RepositoryMetadata.table.c.downloadable == True ) ),
+ order_by=desc( RepositoryMetadata.table.c.update_time ) ),
+ metadata_revisions=relation( RepositoryMetadata,
+ order_by=desc( RepositoryMetadata.table.c.update_time ) ) ) )
assign_mapper( context, RepositoryMetadata, RepositoryMetadata.table,
properties=dict( repository=relation( Repository ) ) )
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/webapps/community/model/migrate/check.py
--- a/lib/galaxy/webapps/community/model/migrate/check.py
+++ b/lib/galaxy/webapps/community/model/migrate/check.py
@@ -77,8 +77,10 @@
# Verify that the code and the DB are in sync
db_schema = schema.ControlledSchema( engine, migrate_repository )
if migrate_repository.versions.latest != db_schema.version:
- raise Exception( "Your database has version '%d' but this code expects version '%d'. Please backup your database and then migrate the schema by running 'sh manage_db.sh upgrade'."
- % ( db_schema.version, migrate_repository.versions.latest ) )
+ exception_msg = "Your database has version '%d' but this code expects version '%d'. " % ( db_schema.version, migrate_repository.versions.latest )
+ exception_msg += "Back up your database and then migrate the schema by running the following from your Galaxy installation directory:"
+ exception_msg += "\n\nsh manage_db.sh upgrade community\n"
+ raise Exception( exception_msg )
else:
log.info( "At database version %d" % db_schema.version )
diff -r eff8b196858c1ff5a6227bd750a06ea924f8530c -r 0ffcc91708233cc087d9996235f0917b377cfe8a lib/galaxy/webapps/community/model/migrate/versions/0012_add_downloadable_column.py
--- /dev/null
+++ b/lib/galaxy/webapps/community/model/migrate/versions/0012_add_downloadable_column.py
@@ -0,0 +1,48 @@
+"""
+Migration script to add the downloadable column to the repository_metadata table.
+"""
+
+from sqlalchemy import *
+from sqlalchemy.orm import *
+from migrate import *
+from migrate.changeset import *
+
+import sys, logging
+log = logging.getLogger( __name__ )
+log.setLevel(logging.DEBUG)
+handler = logging.StreamHandler( sys.stdout )
+format = "%(name)s %(levelname)s %(asctime)s %(message)s"
+formatter = logging.Formatter( format )
+handler.setFormatter( formatter )
+log.addHandler( handler )
+
+metadata = MetaData( migrate_engine )
+db_session = scoped_session( sessionmaker( bind=migrate_engine, autoflush=False, autocommit=True ) )
+
+def upgrade():
+ print __doc__
+ metadata.reflect()
+ # Create and initialize imported column in job table.
+ RepositoryMetadata_table = Table( "repository_metadata", metadata, autoload=True )
+ c = Column( "downloadable", Boolean, default=True )
+ try:
+ # Create
+ c.create( RepositoryMetadata_table )
+ assert c is RepositoryMetadata_table.c.downloadable
+ # Initialize.
+ if migrate_engine.name == 'mysql' or migrate_engine.name == 'sqlite':
+ default_true = "1"
+ elif migrate_engine.name == 'postgres':
+ default_true = "true"
+ db_session.execute( "UPDATE repository_metadata SET downloadable=%s" % default_true )
+ except Exception, e:
+ print "Adding downloadable column to the repository_metadata table failed: %s" % str( e )
+
+def downgrade():
+ metadata.reflect()
+ # Drop downloadable column from repository_metadata table.
+ RepositoryMetadata_table = Table( "repository_metadata", metadata, autoload=True )
+ try:
+ RepositoryMetadata_table.c.downloadable.drop()
+ except Exception, e:
+ print "Dropping column downloadable from the repository_metadata table failed: %s" % str( e )
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.
1
0
commit/galaxy-central: jgoecks: Add introductory help text for paramamonster.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/eff8b196858c/
changeset: eff8b196858c
user: jgoecks
date: 2012-07-05 17:26:24
summary: Add introductory help text for paramamonster.
affected #: 3 files
diff -r 202c6a7dae95450eb9781c8df6fdc0c2795b6968 -r eff8b196858c1ff5a6227bd750a06ea924f8530c static/scripts/packed/viz/paramamonster.js
--- a/static/scripts/packed/viz/paramamonster.js
+++ b/static/scripts/packed/viz/paramamonster.js
@@ -1,1 +1,1 @@
-var ToolInputsSettings=Backbone.Model.extend({defaults:{inputs:null,values:null}});var ToolParameterTree=Backbone.RelationalModel.extend({defaults:{tool:null,tree_data:null},initialize:function(b){var a=this;this.get("tool").get("inputs").each(function(c){if(!c.get_samples()){return}c.on("change:min change:max change:num_samples",function(d){if(d.get("in_ptree")){a.set_tree_data()}},a);c.on("change:in_ptree",function(d){if(d.get("in_ptree")){a.add_param(d)}else{a.remove_param(d)}a.set_tree_data()},a)});if(b.config){_.each(b.config,function(d){var c=a.get("tool").get("inputs").find(function(e){return e.get("name")===d.name});a.add_param(c);c.set(d)})}},add_param:function(a){if(a.get("ptree_index")){return}a.set("in_ptree",true);a.set("ptree_index",this.get_tree_params().length)},remove_param:function(a){a.set("in_ptree",false);a.set("ptree_index",null);_(this.get_tree_params()).each(function(b,c){b.set("ptree_index",c+1)})},set_tree_data:function(){var b=_.map(this.get_tree_params(),function(d){return{param:d,samples:d.get_samples()}});var a=0,c=function(g,d){var i=g[d],h=i.param,f=h.get("label"),e=i.samples;if(g.length-1===d){return _.map(e,function(j){return{id:a++,name:j,param:h,value:j}})}return _.map(e,function(j){return{id:a++,name:j,param:h,value:j,children:c(g,d+1)}})};this.set("tree_data",{name:"Root",id:a++,children:(b.length!==0?c(b,0):null)})},get_tree_params:function(){return _(this.get("tool").get("inputs").where({in_ptree:true})).sortBy(function(a){return a.get("ptree_index")})},get_num_leaves:function(){return this.get_tree_params().reduce(function(a,b){return a*b.get_samples().length},1)},get_node_settings:function(e){var c=this.get("tool").get_inputs_dict();var f=e.parent;if(f){while(f.depth!==0){c[f.param.get("name")]=f.value;f=f.parent}}var a=this,b=function(h,g){if(h.param){g[h.param.get("name")]=h.value}if(!h.children){return new ToolInputsSettings({inputs:a.get("tool").get("inputs"),values:g})}else{return _.flatten(_.map(h.children,function(i){return b(i,_.clone(g))}))}},d=b(e,c);if(!_.isArray(d)){d=[d]}return d},get_connected_nodes:function(c){var d=function(e){if(!e.children){return e}else{return _.flatten([e,_.map(e.children,function(f){return d(f)})])}};var b=[],a=c.parent;while(a){b.push(a);a=a.parent}return _.flatten([b,d(c)])},get_leaf:function(b){var c=this.get("tree_data"),a=function(d){return _.find(d,function(e){return b[e.param.get("name")]===e.value})};while(c.children){c=a(c.children)}return c},toJSON:function(){return this.get_tree_params().map(function(a){return{name:a.get("name"),min:a.get("min"),max:a.get("max"),num_samples:a.get("num_samples")}})}});var ParamaMonsterTrack=Backbone.RelationalModel.extend({defaults:{track:null,settings:null,regions:null},relations:[{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"}],initialize:function(a){if(a.track){var b=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},a.track);delete b.mode;this.set("track",object_from_template(b,{},null))}},same_settings:function(a){var b=this.get("settings"),c=a.get("settings");for(var d in b){if(!c[d]||b[d]!==c[d]){return false}}return true},toJSON:function(){return{track:this.get("track").to_dict(),settings:this.get("settings"),regions:this.get("regions")}}});var TrackCollection=Backbone.Collection.extend({model:ParamaMonsterTrack});var ParamaMonsterVisualization=Visualization.extend({defaults:_.extend({},Visualization.prototype.defaults,{dataset:null,tool:null,parameter_tree:null,regions:null,tracks:null}),relations:[{type:Backbone.HasOne,key:"dataset",relatedModel:"Dataset"},{type:Backbone.HasOne,key:"tool",relatedModel:"Tool"},{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"},{type:Backbone.HasMany,key:"tracks",relatedModel:"ParamaMonsterTrack"}],initialize:function(a){var b=this.get("tool").copy(true);this.set("tool_with_samplable_inputs",b);this.set("parameter_tree",new ToolParameterTree({tool:b,config:a.tree_config}))},add_placeholder:function(a){this.get("tracks").add(new PlaceholderTrack(a))},add_track:function(a){this.get("tracks").add(a)},toJSON:function(){return{id:this.get("id"),title:"Parameter exploration for dataset '"+this.get("dataset").get("name")+"'",type:"paramamonster",dataset_id:this.get("dataset").id,tool_id:this.get("tool").id,regions:this.get("regions").toJSON(),tree_config:this.get("parameter_tree").toJSON(),tracks:this.get("tracks").toJSON()}}});var ParamaMonsterTrackView=Backbone.View.extend({tagName:"tr",TILE_LEN:250,initialize:function(a){this.canvas_manager=a.canvas_manager;this.render();this.model.on("change:track",this.draw_tiles,this)},render:function(){var f=this.model.get("settings"),b=f.get("values"),d=$("<td/>").addClass("settings").appendTo(this.$el),c=$("<div/>").addClass("track-info").hide().appendTo(d);c.append($("<div/>").css("font-weight","bold").text("Track Settings"));f.get("inputs").each(function(h){c.append(h.get("label")+": "+b[h.get("name")]+"<br/>")});var a=this,g=$("<button/>").appendTo(c).text("Run on complete dataset").click(function(){c.toggle();a.trigger("run_on_dataset",f)});var e=create_icon_buttons_menu([{title:"Settings",icon_class:"gear track-settings",on_click:function(){c.toggle()},tipsy_config:{gravity:"s"}},{title:"Remove",icon_class:"cross-circle",on_click:function(){a.$el.remove();$(".tipsy").remove()}}]);d.prepend(e.$el);this.model.get("regions").each(function(){a.$el.append($("<td/>").addClass("tile").html($("<img/>").attr("src",galaxy_paths.get("image_path")+"/loading_large_white_bg.gif")))});if(this.model.get("track")){this.draw_tiles()}},draw_tiles:function(){var b=this,a=this.model.get("track"),d=this.model.get("regions"),c=this.$el.find("td.tile");$.when(a.data_manager.data_is_ready()).then(function(e){d.each(function(h,g){var f=h.length()/b.TILE_LEN,j=1/f,i="Pack";$.when(a.data_manager.get_data(h,i,f,{})).then(function(l){var k=b.canvas_manager.new_canvas();k.width=b.TILE_LEN;k.height=a.get_canvas_height(l,i,j,k.width);a.draw_tile(l,k.getContext("2d"),i,f,h,j);$(c[g]).empty().append(k)})})})}});var ToolInputValOrSweepView=Backbone.View.extend({number_input_template:'<div class="form-row-input sweep"><input class="min" type="text" size="6" value="<%= min %>"> - <input class="max" type="text" size="6" value="<%= max %>"> samples: <input class="num_samples" type="text" size="1" value="<%= num_samples %>"></div>',select_input_template:'<div class="form-row-input sweep"><%= options %></div>',initialize:function(a){this.$el=a.tool_row;this.render()},render:function(){var b=this.model,f=b.get("type"),h=this.$el.find(".form-row-input"),d=null;h.find(":input").change(function(){b.set("value",$(this).val())});if(f==="number"){d=$(_.template(this.number_input_template,this.model.toJSON()))}else{if(f==="select"){var c=_.map(this.$el.find("select option"),function(i){return $(i).val()}),e=c.join(", ");d=$(_.template(this.select_input_template,{options:e}))}}d.insertAfter(h);var a=this,g=create_icon_buttons_menu([{title:"Add parameter to tree",icon_class:"plus-button",on_click:function(){b.set("in_ptree",true);h.hide();d.show();$(this).hide();a.$el.find(".icon-button.toggle").show()}},{title:"Remove parameter from tree",icon_class:"toggle",on_click:function(){b.set("in_ptree",false);d.hide();h.show();$(this).hide();a.$el.find(".icon-button.plus-button").show()}}],{tipsy_config:{gravity:"s"}});this.$el.prepend(g.$el);if(b.get("in_ptree")){h.hide();a.$el.find(".icon-button.plus-button").hide()}else{a.$el.find(".icon-button.toggle").hide();d.hide()}_.each(["min","max","num_samples"],function(i){d.find("."+i).change(function(){b.set(i,parseFloat($(this).val()))})})}});var ToolParameterTreeDesignView=Backbone.View.extend({className:"tree-design",initialize:function(a){this.render()},render:function(){var c=new ToolFormView({model:this.model.get("tool")});c.render();this.$el.append(c.$el);var b=this,a=b.model.get("tool").get("inputs");this.$el.find(".form-row").not(".form-actions").each(function(d){var e=new ToolInputValOrSweepView({model:a.at(d),tool_row:$(this)})})}});var ToolParameterTreeView=Backbone.View.extend({className:"tool-parameter-tree",initialize:function(a){this.model.on("change:tree_data",this.render,this)},render:function(){this.$el.children().remove();var i=this.model.get_tree_params();if(!i.length){return}this.width=100*(2+i.length);this.height=15*this.model.get_num_leaves();var h=this;var g=d3.layout.cluster().size([this.height,this.width-160]);var c=d3.svg.diagonal().projection(function(j){return[j.y,j.x]});var a=g.nodes(this.model.get("tree_data"));var d=_.uniq(_.pluck(a,"y"));_.each(i,function(l,k){var j=d[k+1];h.$el.append($("<div>").addClass("label").text(l.get("label")).css("left",j+250))});var b=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height+20).append("g").attr("transform","translate(40, 10)");var f=b.selectAll("path.link").data(g.links(a)).enter().append("path").attr("class","link").attr("d",c);var e=b.selectAll("g.node").data(a).enter().append("g").attr("class","node").attr("transform",function(j){return"translate("+j.y+","+j.x+")"}).on("mouseover",function(k){var j=_.pluck(h.model.get_connected_nodes(k),"id");e.filter(function(l){return _.find(j,function(m){return m===l.id})!==undefined}).style("fill","#f00")}).on("mouseout",function(){e.style("fill","#000")});e.append("circle").attr("r",9);e.append("text").attr("dx",function(j){return j.children?-12:12}).attr("dy",3).attr("text-anchor",function(j){return j.children?"end":"start"}).text(function(j){return j.name})}});var ParamaMonsterVisualizationView=Backbone.View.extend({className:"paramamonster",initialize:function(b){this.canvas_manager=new CanvasManager(this.$el.parents("body"));this.tool_param_tree_view=new ToolParameterTreeView({model:this.model.get("parameter_tree")});this.track_collection_container=$("<table/>").addClass("tracks");this.model.get("parameter_tree").on("change:tree_data",this.handle_node_clicks,this);var a=this;this.model.get("tracks").each(function(c){c.get("track").view=a})},render:function(){var d=new ToolParameterTreeDesignView({model:this.model.get("parameter_tree")});$("#left").append(d.$el);var a=this,e=a.model.get("regions"),b=$("<tr/>").appendTo(this.track_collection_container);e.each(function(f){b.append($("<th>").text(f.toString()))});b.children().first().attr("colspan",2);var c=$("<div>").addClass("tiles");$("#right").append(c.append(this.track_collection_container));a.model.get("tracks").each(function(f){a.add_track(f)});this.tool_param_tree_view.render();$("#center").append(this.tool_param_tree_view.$el);this.handle_node_clicks()},run_tool_on_dataset:function(b){var a=this.model.get("tool"),d=a.get("name"),c=this.model.get("dataset");a.set_input_values(b.get("values"));$.when(a.rerun(c)).then(function(e){});show_modal("Running "+d+" on complete dataset",d+" is running on dataset '"+c.get("name")+"'. Outputs are in the dataset's history.",{Ok:function(){hide_modal()}})},add_track:function(d){var b=this,c=this.model.get("parameter_tree");b.model.add_track(d);var a=new ParamaMonsterTrackView({model:d,canvas_manager:b.canvas_manager});a.on("run_on_dataset",b.run_tool_on_dataset,b);b.track_collection_container.append(a.$el);a.$el.hover(function(){var f=c.get_leaf(d.get("settings").get("values"));var e=_.pluck(c.get_connected_nodes(f),"id");d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").filter(function(g){return _.find(e,function(h){return h===g.id})!==undefined}).style("fill","#f00")},function(){d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").style("fill","#000")});return d},handle_node_clicks:function(){var a=this,b=this.model.get("parameter_tree"),d=this.model.get("regions"),c=d3.select(this.tool_param_tree_view.$el[0]).selectAll("g.node");c.on("click",function(k,g){var f=a.model.get("tool"),j=a.model.get("dataset"),h=b.get_node_settings(k),e=$.Deferred();if(h.length>=10){show_modal("Whoa there cowboy!","You clicked on a node to try "+a.model.get("tool").get("name")+" with "+h.length+" different combinations of settings. You can only run 10 jobs at a time.",{Ok:function(){hide_modal();e.resolve(false)}})}else{e.resolve(true)}$.when(e).then(function(i){if(!i){return}var l=_.map(h,function(m){var n=new ParamaMonsterTrack({settings:m,regions:d});a.add_track(n);return n});_.each(l,function(n,m){setTimeout(function(){f.set_input_values(n.get("settings").get("values"));$.when(f.rerun(j,d)).then(function(p){var q=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},p.first().get("track_config")),o=object_from_template(q,a,null);n.set("track",o)})},m*10000)})})})}});
\ No newline at end of file
+var ToolInputsSettings=Backbone.Model.extend({defaults:{inputs:null,values:null}});var ToolParameterTree=Backbone.RelationalModel.extend({defaults:{tool:null,tree_data:null},initialize:function(b){var a=this;this.get("tool").get("inputs").each(function(c){if(!c.get_samples()){return}c.on("change:min change:max change:num_samples",function(d){if(d.get("in_ptree")){a.set_tree_data()}},a);c.on("change:in_ptree",function(d){if(d.get("in_ptree")){a.add_param(d)}else{a.remove_param(d)}a.set_tree_data()},a)});if(b.config){_.each(b.config,function(d){var c=a.get("tool").get("inputs").find(function(e){return e.get("name")===d.name});a.add_param(c);c.set(d)})}},add_param:function(a){if(a.get("ptree_index")){return}a.set("in_ptree",true);a.set("ptree_index",this.get_tree_params().length)},remove_param:function(a){a.set("in_ptree",false);a.set("ptree_index",null);_(this.get_tree_params()).each(function(b,c){b.set("ptree_index",c+1)})},set_tree_data:function(){var b=_.map(this.get_tree_params(),function(d){return{param:d,samples:d.get_samples()}});var a=0,c=function(g,d){var i=g[d],h=i.param,f=h.get("label"),e=i.samples;if(g.length-1===d){return _.map(e,function(j){return{id:a++,name:j,param:h,value:j}})}return _.map(e,function(j){return{id:a++,name:j,param:h,value:j,children:c(g,d+1)}})};this.set("tree_data",{name:"Root",id:a++,children:(b.length!==0?c(b,0):null)})},get_tree_params:function(){return _(this.get("tool").get("inputs").where({in_ptree:true})).sortBy(function(a){return a.get("ptree_index")})},get_num_leaves:function(){return this.get_tree_params().reduce(function(a,b){return a*b.get_samples().length},1)},get_node_settings:function(e){var c=this.get("tool").get_inputs_dict();var f=e.parent;if(f){while(f.depth!==0){c[f.param.get("name")]=f.value;f=f.parent}}var a=this,b=function(h,g){if(h.param){g[h.param.get("name")]=h.value}if(!h.children){return new ToolInputsSettings({inputs:a.get("tool").get("inputs"),values:g})}else{return _.flatten(_.map(h.children,function(i){return b(i,_.clone(g))}))}},d=b(e,c);if(!_.isArray(d)){d=[d]}return d},get_connected_nodes:function(c){var d=function(e){if(!e.children){return e}else{return _.flatten([e,_.map(e.children,function(f){return d(f)})])}};var b=[],a=c.parent;while(a){b.push(a);a=a.parent}return _.flatten([b,d(c)])},get_leaf:function(b){var c=this.get("tree_data"),a=function(d){return _.find(d,function(e){return b[e.param.get("name")]===e.value})};while(c.children){c=a(c.children)}return c},toJSON:function(){return this.get_tree_params().map(function(a){return{name:a.get("name"),min:a.get("min"),max:a.get("max"),num_samples:a.get("num_samples")}})}});var ParamaMonsterTrack=Backbone.RelationalModel.extend({defaults:{track:null,settings:null,regions:null},relations:[{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"}],initialize:function(a){if(a.track){var b=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},a.track);delete b.mode;this.set("track",object_from_template(b,{},null))}},same_settings:function(a){var b=this.get("settings"),c=a.get("settings");for(var d in b){if(!c[d]||b[d]!==c[d]){return false}}return true},toJSON:function(){return{track:this.get("track").to_dict(),settings:this.get("settings"),regions:this.get("regions")}}});var TrackCollection=Backbone.Collection.extend({model:ParamaMonsterTrack});var ParamaMonsterVisualization=Visualization.extend({defaults:_.extend({},Visualization.prototype.defaults,{dataset:null,tool:null,parameter_tree:null,regions:null,tracks:null}),relations:[{type:Backbone.HasOne,key:"dataset",relatedModel:"Dataset"},{type:Backbone.HasOne,key:"tool",relatedModel:"Tool"},{type:Backbone.HasMany,key:"regions",relatedModel:"GenomeRegion"},{type:Backbone.HasMany,key:"tracks",relatedModel:"ParamaMonsterTrack"}],initialize:function(a){var b=this.get("tool").copy(true);this.set("tool_with_samplable_inputs",b);this.set("parameter_tree",new ToolParameterTree({tool:b,config:a.tree_config}))},add_placeholder:function(a){this.get("tracks").add(new PlaceholderTrack(a))},add_track:function(a){this.get("tracks").add(a)},toJSON:function(){return{id:this.get("id"),title:"Parameter exploration for dataset '"+this.get("dataset").get("name")+"'",type:"paramamonster",dataset_id:this.get("dataset").id,tool_id:this.get("tool").id,regions:this.get("regions").toJSON(),tree_config:this.get("parameter_tree").toJSON(),tracks:this.get("tracks").toJSON()}}});var ParamaMonsterTrackView=Backbone.View.extend({tagName:"tr",TILE_LEN:250,initialize:function(a){this.canvas_manager=a.canvas_manager;this.render();this.model.on("change:track",this.draw_tiles,this)},render:function(){var f=this.model.get("settings"),b=f.get("values"),d=$("<td/>").addClass("settings").appendTo(this.$el),c=$("<div/>").addClass("track-info").hide().appendTo(d);c.append($("<div/>").css("font-weight","bold").text("Track Settings"));f.get("inputs").each(function(h){c.append(h.get("label")+": "+b[h.get("name")]+"<br/>")});var a=this,g=$("<button/>").appendTo(c).text("Run on complete dataset").click(function(){c.toggle();a.trigger("run_on_dataset",f)});var e=create_icon_buttons_menu([{title:"Settings",icon_class:"gear track-settings",on_click:function(){c.toggle()},tipsy_config:{gravity:"s"}},{title:"Remove",icon_class:"cross-circle",on_click:function(){a.$el.remove();$(".tipsy").remove()}}]);d.prepend(e.$el);this.model.get("regions").each(function(){a.$el.append($("<td/>").addClass("tile").html($("<img/>").attr("src",galaxy_paths.get("image_path")+"/loading_large_white_bg.gif")))});if(this.model.get("track")){this.draw_tiles()}},draw_tiles:function(){var b=this,a=this.model.get("track"),d=this.model.get("regions"),c=this.$el.find("td.tile");$.when(a.data_manager.data_is_ready()).then(function(e){d.each(function(h,g){var f=h.length()/b.TILE_LEN,j=1/f,i="Pack";$.when(a.data_manager.get_data(h,i,f,{})).then(function(l){var k=b.canvas_manager.new_canvas();k.width=b.TILE_LEN;k.height=a.get_canvas_height(l,i,j,k.width);a.draw_tile(l,k.getContext("2d"),i,f,h,j);$(c[g]).empty().append(k)})})})}});var ToolInputValOrSweepView=Backbone.View.extend({number_input_template:'<div class="form-row-input sweep"><input class="min" type="text" size="6" value="<%= min %>"> - <input class="max" type="text" size="6" value="<%= max %>"> samples: <input class="num_samples" type="text" size="1" value="<%= num_samples %>"></div>',select_input_template:'<div class="form-row-input sweep"><%= options %></div>',initialize:function(a){this.$el=a.tool_row;this.render()},render:function(){var b=this.model,f=b.get("type"),h=this.$el.find(".form-row-input"),d=null;h.find(":input").change(function(){b.set("value",$(this).val())});if(f==="number"){d=$(_.template(this.number_input_template,this.model.toJSON()))}else{if(f==="select"){var c=_.map(this.$el.find("select option"),function(i){return $(i).val()}),e=c.join(", ");d=$(_.template(this.select_input_template,{options:e}))}}d.insertAfter(h);var a=this,g=create_icon_buttons_menu([{title:"Add parameter to tree",icon_class:"plus-button",on_click:function(){b.set("in_ptree",true);h.hide();d.show();$(this).hide();a.$el.find(".icon-button.toggle").show()}},{title:"Remove parameter from tree",icon_class:"toggle",on_click:function(){b.set("in_ptree",false);d.hide();h.show();$(this).hide();a.$el.find(".icon-button.plus-button").show()}}],{tipsy_config:{gravity:"s"}});this.$el.prepend(g.$el);if(b.get("in_ptree")){h.hide();a.$el.find(".icon-button.plus-button").hide()}else{a.$el.find(".icon-button.toggle").hide();d.hide()}_.each(["min","max","num_samples"],function(i){d.find("."+i).change(function(){b.set(i,parseFloat($(this).val()))})})}});var ToolParameterTreeDesignView=Backbone.View.extend({className:"tree-design",initialize:function(a){this.render()},render:function(){var c=new ToolFormView({model:this.model.get("tool")});c.render();this.$el.append(c.$el);var b=this,a=b.model.get("tool").get("inputs");this.$el.find(".form-row").not(".form-actions").each(function(d){var e=new ToolInputValOrSweepView({model:a.at(d),tool_row:$(this)})})}});var ToolParameterTreeView=Backbone.View.extend({className:"tool-parameter-tree",initialize:function(a){this.model.on("change:tree_data",this.render,this)},render:function(){this.$el.children().remove();var i=this.model.get_tree_params();if(!i.length){return}this.width=100*(2+i.length);this.height=15*this.model.get_num_leaves();var h=this;var g=d3.layout.cluster().size([this.height,this.width-160]);var c=d3.svg.diagonal().projection(function(j){return[j.y,j.x]});var a=g.nodes(this.model.get("tree_data"));var d=_.uniq(_.pluck(a,"y"));_.each(i,function(l,k){var j=d[k+1],m=$("#center").position().left;h.$el.append($("<div>").addClass("label").text(l.get("label")).css("left",j+m))});var b=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height+20).append("g").attr("transform","translate(40, 10)");var f=b.selectAll("path.link").data(g.links(a)).enter().append("path").attr("class","link").attr("d",c);var e=b.selectAll("g.node").data(a).enter().append("g").attr("class","node").attr("transform",function(j){return"translate("+j.y+","+j.x+")"}).on("mouseover",function(k){var j=_.pluck(h.model.get_connected_nodes(k),"id");e.filter(function(l){return _.find(j,function(m){return m===l.id})!==undefined}).style("fill","#f00")}).on("mouseout",function(){e.style("fill","#000")});e.append("circle").attr("r",9);e.append("text").attr("dx",function(j){return j.children?-12:12}).attr("dy",3).attr("text-anchor",function(j){return j.children?"end":"start"}).text(function(j){return j.name})}});var ParamaMonsterVisualizationView=Backbone.View.extend({className:"paramamonster",helpText:"<div><h4>Getting Started</h4><ol><li>Create a parameter tree by using the icons next to the tool's parameter names to add or remove parameters.<li>Adjust the tree by using parameter inputs to select min, max, and number of samples<li>Run the tool with different settings by clicking on tree nodes</ol></div>",initialize:function(b){this.canvas_manager=new CanvasManager(this.$el.parents("body"));this.tool_param_tree_view=new ToolParameterTreeView({model:this.model.get("parameter_tree")});this.track_collection_container=$("<table/>").addClass("tracks");this.model.get("parameter_tree").on("change:tree_data",this.handle_node_clicks,this);var a=this;this.model.get("tracks").each(function(c){c.get("track").view=a})},render:function(){var f=new ToolParameterTreeDesignView({model:this.model.get("parameter_tree")});$("#left").append(f.$el);var b=this,g=b.model.get("regions"),c=$("<tr/>").appendTo(this.track_collection_container);g.each(function(h){c.append($("<th>").text(h.toString()))});c.children().first().attr("colspan",2);var e=$("<div>").addClass("tiles");$("#right").append(e.append(this.track_collection_container));b.model.get("tracks").each(function(h){b.add_track(h)});var d=$(this.helpText).addClass("help"),a=create_icon_buttons_menu([{title:"Close",icon_class:"cross-circle",on_click:function(){$(".tipsy").remove();d.remove()},tipsy_config:{gravity:"s"}}]);d.prepend(a.$el.css("float","right"));$("#center").append(d);this.tool_param_tree_view.render();$("#center").append(this.tool_param_tree_view.$el);this.handle_node_clicks()},run_tool_on_dataset:function(b){var a=this.model.get("tool"),d=a.get("name"),c=this.model.get("dataset");a.set_input_values(b.get("values"));$.when(a.rerun(c)).then(function(e){});show_modal("Running "+d+" on complete dataset",d+" is running on dataset '"+c.get("name")+"'. Outputs are in the dataset's history.",{Ok:function(){hide_modal()}})},add_track:function(d){var b=this,c=this.model.get("parameter_tree");b.model.add_track(d);var a=new ParamaMonsterTrackView({model:d,canvas_manager:b.canvas_manager});a.on("run_on_dataset",b.run_tool_on_dataset,b);b.track_collection_container.append(a.$el);a.$el.hover(function(){var f=c.get_leaf(d.get("settings").get("values"));var e=_.pluck(c.get_connected_nodes(f),"id");d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").filter(function(g){return _.find(e,function(h){return h===g.id})!==undefined}).style("fill","#f00")},function(){d3.select(b.tool_param_tree_view.$el[0]).selectAll("g.node").style("fill","#000")});return d},handle_node_clicks:function(){var a=this,b=this.model.get("parameter_tree"),d=this.model.get("regions"),c=d3.select(this.tool_param_tree_view.$el[0]).selectAll("g.node");c.on("click",function(k,g){var f=a.model.get("tool"),j=a.model.get("dataset"),h=b.get_node_settings(k),e=$.Deferred();if(h.length>=10){show_modal("Whoa there cowboy!","You clicked on a node to try "+a.model.get("tool").get("name")+" with "+h.length+" different combinations of settings. You can only run 10 jobs at a time.",{Ok:function(){hide_modal();e.resolve(false)}})}else{e.resolve(true)}$.when(e).then(function(i){if(!i){return}var l=_.map(h,function(m){var n=new ParamaMonsterTrack({settings:m,regions:d});a.add_track(n);return n});_.each(l,function(n,m){setTimeout(function(){f.set_input_values(n.get("settings").get("values"));$.when(f.rerun(j,d)).then(function(p){var q=_.extend({data_url:galaxy_paths.get("raw_data_url"),converted_datasets_state_url:galaxy_paths.get("dataset_state_url")},p.first().get("track_config")),o=object_from_template(q,a,null);n.set("track",o)})},m*10000)})})})}});
\ No newline at end of file
diff -r 202c6a7dae95450eb9781c8df6fdc0c2795b6968 -r eff8b196858c1ff5a6227bd750a06ea924f8530c static/scripts/viz/paramamonster.js
--- a/static/scripts/viz/paramamonster.js
+++ b/static/scripts/viz/paramamonster.js
@@ -626,11 +626,11 @@
// Setup and add labels for tree levels.
var param_depths = _.uniq(_.pluck(nodes, "y"));
_.each(tree_params, function(param, index) {
- var x = param_depths[index+1];
+ var x = param_depths[index+1],
+ center_left = $('#center').position().left;
self.$el.append( $('<div>').addClass('label')
.text(param.get('label'))
- // HACK: add 250 b/c in center panel.
- .css('left', x + 250) );
+ .css('left', x + center_left) );
});
// Set up vis element.
@@ -681,6 +681,13 @@
*/
var ParamaMonsterVisualizationView = Backbone.View.extend({
className: 'paramamonster',
+
+ helpText:
+ '<div><h4>Getting Started</h4>' +
+ '<ol><li>Create a parameter tree by using the icons next to the tool\'s parameter names to add or remove parameters.' +
+ '<li>Adjust the tree by using parameter inputs to select min, max, and number of samples' +
+ '<li>Run the tool with different settings by clicking on tree nodes' +
+ '</ol></div>',
initialize: function(options) {
this.canvas_manager = new CanvasManager(this.$el.parents('body'));
@@ -722,7 +729,26 @@
self.add_track(track);
});
- // Render tool parameter tree in center panel.
+ // -- Render help and tool parameter tree in center panel. --
+
+ // Help includes text and a close button.
+ var help_div = $(this.helpText).addClass('help'),
+ close_button = create_icon_buttons_menu([
+ {
+ title: 'Close',
+ icon_class: 'cross-circle',
+ on_click: function() {
+ $('.tipsy').remove();
+ help_div.remove();
+ },
+ tipsy_config: { gravity: 's' }
+ }
+ ]);
+
+ help_div.prepend(close_button.$el.css('float', 'right'));
+ $('#center').append(help_div);
+
+ // Parameter tree:
this.tool_param_tree_view.render();
$('#center').append(this.tool_param_tree_view.$el);
diff -r 202c6a7dae95450eb9781c8df6fdc0c2795b6968 -r eff8b196858c1ff5a6227bd750a06ea924f8530c templates/visualization/paramamonster.mako
--- a/templates/visualization/paramamonster.mako
+++ b/templates/visualization/paramamonster.mako
@@ -12,9 +12,6 @@
<%def name="stylesheets()">
${parent.stylesheets()}
<style>
- div#center {
- overflow: auto;
- }
.link {
fill: none;
stroke: #ccc;
@@ -84,6 +81,7 @@
#center {
left: 300px;
right: 600px;
+ overflow: auto;
}
#right {
width: 600px;
@@ -96,6 +94,12 @@
left: 0;
right: 0;
}
+ .help {
+ border-radius: 15px;
+ border: solid 1px #CCC;
+ padding: 0px 2px;
+ margin: 10px;
+ }
</style></%def>
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.
1
0
commit/galaxy-central: inithello: Cleaned up code, added searchable list of NCBI builds.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/202c6a7dae95/
changeset: 202c6a7dae95
user: inithello
date: 2012-07-05 15:56:54
summary: Cleaned up code, added searchable list of NCBI builds.
affected #: 12 files
Diff too large to display.
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.
1
0
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/d9c384f7a754/
changeset: d9c384f7a754
user: greg
date: 2012-07-05 15:42:11
summary: Make sure there is an entry for the main public Galaxy tool shed in the tool_sheds_conf.xml file when attempting to determine if tools migrated from the distribution to the tool shed are missing and need to be installed.
affected #: 1 file
diff -r 456f11df0b53897086257b952457d615b3942539 -r d9c384f7a75435173817754300f8e7bef12d8840 lib/galaxy/tool_shed/migrate/common.py
--- a/lib/galaxy/tool_shed/migrate/common.py
+++ b/lib/galaxy/tool_shed/migrate/common.py
@@ -21,39 +21,44 @@
root = tree.getroot()
tool_shed = root.get( 'name' )
tool_shed_url = get_tool_shed_url_from_tools_xml_file_path( app, tool_shed )
- for elem in root:
- if elem.tag == 'repository':
- tool_dependencies = []
- tool_dependencies_dict = {}
- repository_name = elem.get( 'name' )
- changeset_revision = elem.get( 'changeset_revision' )
- url = '%s/repository/get_tool_dependencies?name=%s&owner=%s&changeset_revision=%s&webapp=install_manager&no_reset=true' % \
- ( tool_shed_url, repository_name, REPOSITORY_OWNER, changeset_revision )
- response = urllib2.urlopen( url )
- text = response.read()
- response.close()
- if text:
- tool_dependencies_dict = tool_shed_decode( text )
- for dependency_key, requirements_dict in tool_dependencies_dict.items():
- tool_dependency_name = requirements_dict[ 'name' ]
- tool_dependency_version = requirements_dict[ 'version' ]
- tool_dependency_type = requirements_dict[ 'type' ]
- tool_dependency_readme = requirements_dict.get( 'readme', '' )
- tool_dependencies.append( ( tool_dependency_name, tool_dependency_version, tool_dependency_type, tool_dependency_readme ) )
- for tool_elem in elem.findall( 'tool' ):
- migrated_tool_configs_dict[ tool_elem.get( 'file' ) ] = tool_dependencies
- # Parse the proprietary tool_panel_configs (the default is tool_conf.xml) and generate the list of missing tool config file names.
- missing_tool_configs_dict = odict()
- for tool_panel_config in tool_panel_configs:
- tree = util.parse_xml( tool_panel_config )
- root = tree.getroot()
+ if tool_shed_url:
for elem in root:
- if elem.tag == 'tool':
- missing_tool_configs_dict = check_tool_tag_set( elem, migrated_tool_configs_dict, missing_tool_configs_dict )
- elif elem.tag == 'section':
- for section_elem in elem:
- if section_elem.tag == 'tool':
- missing_tool_configs_dict = check_tool_tag_set( section_elem, migrated_tool_configs_dict, missing_tool_configs_dict )
+ if elem.tag == 'repository':
+ tool_dependencies = []
+ tool_dependencies_dict = {}
+ repository_name = elem.get( 'name' )
+ changeset_revision = elem.get( 'changeset_revision' )
+ url = '%s/repository/get_tool_dependencies?name=%s&owner=%s&changeset_revision=%s&webapp=install_manager&no_reset=true' % \
+ ( tool_shed_url, repository_name, REPOSITORY_OWNER, changeset_revision )
+ response = urllib2.urlopen( url )
+ text = response.read()
+ response.close()
+ if text:
+ tool_dependencies_dict = tool_shed_decode( text )
+ for dependency_key, requirements_dict in tool_dependencies_dict.items():
+ tool_dependency_name = requirements_dict[ 'name' ]
+ tool_dependency_version = requirements_dict[ 'version' ]
+ tool_dependency_type = requirements_dict[ 'type' ]
+ tool_dependency_readme = requirements_dict.get( 'readme', '' )
+ tool_dependencies.append( ( tool_dependency_name, tool_dependency_version, tool_dependency_type, tool_dependency_readme ) )
+ for tool_elem in elem.findall( 'tool' ):
+ migrated_tool_configs_dict[ tool_elem.get( 'file' ) ] = tool_dependencies
+ # Parse the proprietary tool_panel_configs (the default is tool_conf.xml) and generate the list of missing tool config file names.
+ missing_tool_configs_dict = odict()
+ for tool_panel_config in tool_panel_configs:
+ tree = util.parse_xml( tool_panel_config )
+ root = tree.getroot()
+ for elem in root:
+ if elem.tag == 'tool':
+ missing_tool_configs_dict = check_tool_tag_set( elem, migrated_tool_configs_dict, missing_tool_configs_dict )
+ elif elem.tag == 'section':
+ for section_elem in elem:
+ if section_elem.tag == 'tool':
+ missing_tool_configs_dict = check_tool_tag_set( section_elem, migrated_tool_configs_dict, missing_tool_configs_dict )
+ else:
+ exception_msg = '\n\nThe entry for the main Galaxy tool shed at %s is missing from the %s file. ' % ( tool_shed, app.config.tool_sheds_config )
+ exception_msg += 'The entry for this tool shed must always be available in this file, so re-add it before attempting to start your Galaxy server.\n'
+ raise Exception( exception_msg )
return missing_tool_configs_dict
def check_tool_tag_set( elem, migrated_tool_configs_dict, missing_tool_configs_dict ):
file_path = elem.get( 'file', None )
@@ -76,8 +81,9 @@
config_filenames.append( config_filename )
return config_filenames
def get_tool_shed_url_from_tools_xml_file_path( app, tool_shed ):
+ search_str = '://%s' % tool_shed
for shed_name, shed_url in app.tool_shed_registry.tool_sheds.items():
- if shed_url.find( tool_shed ) >= 0:
+ if shed_url.find( search_str ) >= 0:
if shed_url.endswith( '/' ):
shed_url = shed_url.rstrip( '/' )
return shed_url
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.
1
0
commit/galaxy-central: jgoecks: Make bookmarks available in shared Trackster visualizations.
by Bitbucket 05 Jul '12
by Bitbucket 05 Jul '12
05 Jul '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/456f11df0b53/
changeset: 456f11df0b53
user: jgoecks
date: 2012-07-05 15:31:19
summary: Make bookmarks available in shared Trackster visualizations.
affected #: 6 files
diff -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 -r 456f11df0b53897086257b952457d615b3942539 static/scripts/packed/viz/trackster_ui.js
--- a/static/scripts/packed/viz/trackster_ui.js
+++ b/static/scripts/packed/viz/trackster_ui.js
@@ -1,1 +1,1 @@
-var add_bookmark=function(d,b){var f=$("#bookmarks-container"),h=$("<div/>").addClass("bookmark").appendTo(f),g=$("<div/>").addClass("delete-icon-container").appendTo(h).click(function(){h.slideUp("fast");h.remove();view.has_changes=true;return false}),a=$("<a href=''/>").addClass("icon-button delete").appendTo(g),i=$("<div/>").addClass("position").appendTo(h),e=$("<a href=''/>").text(d).appendTo(i).click(function(){view.go_to(d);return false}),c=$("<div/>").text(b).make_text_editable({num_rows:3,use_textarea:true,help_text:"Set bookmark note"}).addClass("annotation").appendTo(h);view.has_changes=true;return h};var object_from_template=function(c,b,a){if("copy" in c){return c.copy(a)}else{var d=c.obj_type;if(!d){d=c.track_type}return new addable_objects[d](b,a,c)}};var addable_objects={LineTrack:LineTrack,FeatureTrack:FeatureTrack,VcfTrack:VcfTrack,ReadTrack:ReadTrack,CompositeTrack:CompositeTrack,DrawableGroup:DrawableGroup};var create_visualization=function(c,a,b,d){view=new View(c);view.editor=true;$.when(view.load_chroms_deferred).then(function(){if(a){var n=a.chrom,e=a.start,k=a.end,g=a.overview;if(n&&(e!==undefined)&&k){view.change_chrom(n,e,k)}}if(b){var h,f,j;for(var l=0;l<b.length;l++){view.add_drawable(object_from_template(b[l],view,view))}}view.update_intro_div();var o;for(var l=0;l<view.drawables.length;l++){if(view.drawables[l].name===g){view.set_overview(view.drawables[l]);break}}if(d){var m;for(var l=0;l<d.length;l++){m=d[l];add_bookmark(m.position,m.annotation)}}view.has_changes=false});return view};var init_keyboard_nav=function(a){$(document).keydown(function(b){if($(b.srcElement).is(":input")){return}switch(b.which){case 37:a.move_fraction(0.25);break;case 38:var c=Math.round(a.viewport_container.height()/15);a.viewport_container.scrollTop(a.viewport_container.scrollTop()-20);break;case 39:a.move_fraction(-0.25);break;case 40:var c=Math.round(a.viewport_container.height()/15);a.viewport_container.scrollTop(a.viewport_container.scrollTop()+20);break}})};
\ No newline at end of file
+var add_bookmark=function(e,c,a){var g=$("#bookmarks-container"),i=$("<div/>").addClass("bookmark").appendTo(g);var j=$("<div/>").addClass("position").appendTo(i),f=$("<a href=''/>").text(e).appendTo(j).click(function(){view.go_to(e);return false}),d=$("<div/>").text(c).appendTo(i);if(a){var h=$("<div/>").addClass("delete-icon-container").prependTo(i).click(function(){i.slideUp("fast");i.remove();view.has_changes=true;return false}),b=$("<a href=''/>").addClass("icon-button delete").appendTo(h);d.make_text_editable({num_rows:3,use_textarea:true,help_text:"Edit bookmark note"}).addClass("annotation")}view.has_changes=true;return i};var object_from_template=function(c,b,a){if("copy" in c){return c.copy(a)}else{var d=c.obj_type;if(!d){d=c.track_type}return new addable_objects[d](b,a,c)}};var addable_objects={LineTrack:LineTrack,FeatureTrack:FeatureTrack,VcfTrack:VcfTrack,ReadTrack:ReadTrack,CompositeTrack:CompositeTrack,DrawableGroup:DrawableGroup};var create_visualization=function(d,a,c,e,b){view=new View(d);view.editor=true;$.when(view.load_chroms_deferred).then(function(){if(a){var o=a.chrom,f=a.start,l=a.end,h=a.overview;if(o&&(f!==undefined)&&l){view.change_chrom(o,f,l)}}if(c){var j,g,k;for(var m=0;m<c.length;m++){view.add_drawable(object_from_template(c[m],view,view))}}view.update_intro_div();var p;for(var m=0;m<view.drawables.length;m++){if(view.drawables[m].name===h){view.set_overview(view.drawables[m]);break}}if(e){var n;for(var m=0;m<e.length;m++){n=e[m];add_bookmark(n.position,n.annotation,b)}}view.has_changes=false});return view};var init_keyboard_nav=function(a){$(document).keydown(function(b){if($(b.srcElement).is(":input")){return}switch(b.which){case 37:a.move_fraction(0.25);break;case 38:var c=Math.round(a.viewport_container.height()/15);a.viewport_container.scrollTop(a.viewport_container.scrollTop()-20);break;case 39:a.move_fraction(-0.25);break;case 40:var c=Math.round(a.viewport_container.height()/15);a.viewport_container.scrollTop(a.viewport_container.scrollTop()+20);break}})};
\ No newline at end of file
diff -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 -r 456f11df0b53897086257b952457d615b3942539 static/scripts/packed/viz/visualization.js
--- a/static/scripts/packed/viz/visualization.js
+++ b/static/scripts/packed/viz/visualization.js
@@ -1,1 +1,1 @@
-var ServerStateDeferred=Backbone.Model.extend({defaults:{ajax_settings:{},interval:1000,success_fn:function(a){return true}},go:function(){var d=$.Deferred(),c=this,f=c.get("ajax_settings"),e=c.get("success_fn"),b=c.get("interval"),a=function(){$.ajax(f).success(function(g){if(e(g)){d.resolve(g)}else{setTimeout(a,b)}})};a();return d}});var CanvasManager=function(a){this.default_font=a!==undefined?a:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=this.new_canvas();this.dummy_context=this.dummy_canvas.getContext("2d");this.dummy_context.font=this.default_font;this.char_width_px=this.dummy_context.measureText("A").width;this.patterns={};this.load_pattern("right_strand","/visualization/strand_right.png");this.load_pattern("left_strand","/visualization/strand_left.png");this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};_.extend(CanvasManager.prototype,{load_pattern:function(a,e){var b=this.patterns,c=this.dummy_context,d=new Image();d.src=galaxy_paths.attributes.image_path+e;d.onload=function(){b[a]=c.createPattern(d,"repeat")}},get_pattern:function(a){return this.patterns[a]},new_canvas:function(){var a=$("<canvas/>")[0];if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(a)}a.manager=this;return a}});var Cache=Backbone.Model.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initialize:function(a){this.clear()},get_elt:function(b){var c=this.attributes.obj_cache,d=this.attributes.key_ary,a=d.indexOf(b);if(a!==-1){if(c[b].stale){d.splice(a,1);delete c[b]}else{this.move_key_to_end(b,a)}}return c[b]},set_elt:function(b,d){var e=this.attributes.obj_cache,f=this.attributes.key_ary,c=this.attributes.num_elements;if(!e[b]){if(f.length>=c){var a=f.shift();delete e[a]}f.push(b)}e[b]=d;return d},move_key_to_end:function(b,a){this.attributes.key_ary.splice(a,1);this.attributes.key_ary.push(b)},clear:function(){this.attributes.obj_cache={};this.attributes.key_ary=[]},size:function(){return this.attributes.key_ary.length}});var GenomeDataManager=Cache.extend({defaults:_.extend({},Cache.prototype.defaults,{dataset:null,filters_manager:null,data_url:null,dataset_state_url:null,data_mode_compatible:function(a,b){return true},can_subset:function(a){return false}}),data_is_ready:function(){var c=this.get("dataset"),b=$.Deferred(),a=new ServerStateDeferred({ajax_settings:{url:this.get("dataset_state_url"),data:{dataset_id:c.id,hda_ldda:c.get("hda_ldda")},dataType:"json"},interval:5000,success_fn:function(d){return d!=="pending"}});$.when(a.go()).then(function(d){b.resolve(d==="ok"||d==="data")});return b},load_data:function(h,g,b,f){var d={chrom:h.get("chrom"),low:h.get("start"),high:h.get("end"),mode:g,resolution:b};dataset=this.get("dataset");if(dataset){d.dataset_id=dataset.id;d.hda_ldda=dataset.get("hda_ldda")}$.extend(d,f);var j=this.get("filters_manager");if(j){var k=[];var a=j.filters;for(var e=0;e<a.length;e++){k.push(a[e].name)}d.filter_cols=JSON.stringify(k)}var c=this;return $.getJSON(this.get("data_url"),d,function(i){c.set_data(h,i)})},get_data:function(g,f,c,e){var h=this.get_elt(g);if(h&&(is_deferred(h)||this.get("data_mode_compatible")(h,f))){return h}var j=this.get("key_ary"),b=this.get("obj_cache"),k,a;for(var d=0;d<j.length;d++){k=j[d];a=new GenomeRegion({from_str:k});if(a.contains(g)){h=b[k];if(is_deferred(h)||(this.get("data_mode_compatible")(h,f)&&this.get("can_subset")(h))){this.move_key_to_end(k,d);return h}}}h=this.load_data(g,f,c,e);this.set_data(g,h);return h},set_data:function(b,a){this.set_elt(b,a)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(i,h,d,g,e){var k=this.get_elt(i);if(!(k&&this.get("data_mode_compatible")(k,h))){console.log("ERROR: no current data for: ",dataset,i.toString(),h,d,g);return}k.stale=true;var c=i.get("start");if(e===this.DEEP_DATA_REQ){$.extend(g,{start_val:k.data.length+1})}else{if(e===this.BROAD_DATA_REQ){c=(k.max_high?k.max_high:k.data[k.data.length-1][2])+1}}var j=i.copy().set("start",c);var b=this,f=this.load_data(j,h,d,g),a=$.Deferred();this.set_data(i,a);$.when(f).then(function(l){if(l.data){l.data=k.data.concat(l.data);if(l.max_low){l.max_low=k.max_low}if(l.message){l.message=l.message.replace(/[0-9]+/,l.data.length)}}b.set_data(i,l);a.resolve(l)});return a},get_elt:function(a){return Cache.prototype.get_elt.call(this,a.toString())},set_elt:function(b,a){return Cache.prototype.set_elt.call(this,b.toString(),a)}});var ReferenceTrackDataManager=GenomeDataManager.extend({load_data:function(a,d,e,b,c){if(b>1){return{data:null}}return GenomeDataManager.prototype.load_data.call(this,a,d,e,b,c)}});var Genome=Backbone.Model.extend({defaults:{name:null,key:null,chroms_info:null},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info}});var GenomeRegion=Backbone.RelationalModel.extend({defaults:{chrom:null,start:0,end:0,DIF_CHROMS:1000,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006},initialize:function(b){if(b.from_str){var d=b.from_str.split(":"),c=d[0],a=d[1].split("-");this.set({chrom:c,start:parseInt(a[0],10),end:parseInt(a[1],10)})}},copy:function(){return new GenomeRegion({chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:function(){return this.get("end")-this.get("start")},toString:function(){return this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},toJSON:function(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")}},compute_overlap:function(h){var b=this.get("chrom"),g=h.get("chrom"),f=this.get("start"),d=h.get("start"),e=this.get("end"),c=h.get("end"),a;if(b&&g&&b!==g){return this.get("DIF_CHROMS")}if(f<d){if(e<d){a=this.get("BEFORE")}else{if(e<=c){a=this.get("OVERLAP_START")}else{a=this.get("CONTAINS")}}}else{if(f>c){a=this.get("AFTER")}else{if(e<=c){a=this.get("CONTAINED_BY")}else{a=this.get("OVERLAP_END")}}}return a},contains:function(a){return this.compute_overlap(a)===this.get("CONTAINS")},overlaps:function(a){return _.intersection([this.compute_overlap(a)],[this.get("DIF_CHROMS"),this.get("BEFORE"),this.get("AFTER")]).length===0}});var GenomeRegionCollection=Backbone.Collection.extend({model:GenomeRegion});var BrowserBookmark=Backbone.Model.extend({defaults:{region:null,note:""}});var BrowserBookmarks=Backbone.Collection.extend({model:BrowserBookmark});var Visualization=Backbone.RelationalModel.extend({defaults:{id:"",title:"",type:"",dbkey:"",datasets:[]},url:function(){return galaxy_paths.get("visualization_url")},save:function(){return $.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}});var TracksterVisualization=Visualization.extend({defaults:{bookmarks:[],viewport:{}}});var CircsterVisualization=Visualization.extend({});var HistogramDataset=Backbone.Model.extend({initialize:function(a){this.attributes.data=a;this.attributes.max=_.max(a,function(b){if(!b||typeof b==="string"){return 0}return b[1]})[1]}});var TrackConfig=Backbone.Model.extend({});var CircsterHistogramDatasetLayout=Backbone.Model.extend({chroms_layout:function(){var b=this.attributes.genome.get_chroms_info(),d=d3.layout.pie().value(function(f){return f.len}).sort(null),e=d(b),a=this.attributes.total_gap/b.length,c=_.map(e,function(h,g){var f=h.endAngle-a;h.endAngle=(f>h.startAngle?f:h.startAngle);return h});return c},chrom_data_layout:function(j,b,g,f,h){if(!b||typeof b==="string"){return null}var d=b[0],i=b[3],c=d3.scale.linear().domain([0,h]).range([g,f]),e=d3.layout.pie().value(function(k){return i}).startAngle(j.startAngle).endAngle(j.endAngle),a=e(d);_.each(d,function(k,l){a[l].outerRadius=c(k[1])});return a}});var CircsterView=Backbone.View.extend({className:"circster",initialize:function(a){this.width=a.width;this.height=a.height;this.total_gap=a.total_gap;this.genome=a.genome;this.dataset=a.dataset;this.radius_start=a.radius_start;this.dataset_arc_height=a.dataset_arc_height},render:function(){var d=this.radius_start,e=this.dataset_arc_height,j=new CircsterHistogramDatasetLayout({genome:this.genome,total_gap:this.total_gap}),i=j.chroms_layout(),g=_.zip(i,this.dataset.attributes.data),h=this.dataset.attributes.max,b=_.map(g,function(m){var n=m[0],l=m[1];return j.chrom_data_layout(n,l,d,d+e,h)});var c=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height).append("g").attr("transform","translate("+this.width/2+","+this.height/2+")");var k=c.append("g").attr("id","inner-arc"),f=d3.svg.arc().innerRadius(d).outerRadius(d+e),a=k.selectAll("#inner-arc>path").data(i).enter().append("path").attr("d",f).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(l){return l.data.chrom});_.each(b,function(l){if(!l){return}var o=c.append("g"),n=d3.svg.arc().innerRadius(d),m=o.selectAll("path").data(l).enter().append("path").attr("d",n).style("stroke","red").style("fill","red")})}});var TrackBrowserRouter=Backbone.Router.extend({initialize:function(b){this.view=b.view;this.route(/([\w]+)$/,"change_location");this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var a=this;a.view.on("navigate",function(c){a.navigate(c)})},change_location:function(a){this.view.go_to(a)}});var add_datasets=function(a,c,b){$.ajax({url:a,data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(d){show_modal("Select datasets for new tracks",d,{Cancel:function(){hide_modal()},Add:function(){var e=[];$("input[name=id]:checked,input[name=ldda_ids]:checked").each(function(){var f,g=$(this).val();if($(this).attr("name")==="id"){f={hda_id:g}}else{f={ldda_id:g}}e[e.length]=$.ajax({url:c,data:f,dataType:"json"})});$.when.apply($,e).then(function(){var f=(arguments[0] instanceof Array?$.map(arguments,function(g){return g[0]}):[arguments[0]]);b(f)});hide_modal()}})}})};
\ No newline at end of file
+var ServerStateDeferred=Backbone.Model.extend({defaults:{ajax_settings:{},interval:1000,success_fn:function(a){return true}},go:function(){var d=$.Deferred(),c=this,f=c.get("ajax_settings"),e=c.get("success_fn"),b=c.get("interval"),a=function(){$.ajax(f).success(function(g){if(e(g)){d.resolve(g)}else{setTimeout(a,b)}})};a();return d}});var CanvasManager=function(a){this.default_font=a!==undefined?a:"9px Monaco, Lucida Console, monospace";this.dummy_canvas=this.new_canvas();this.dummy_context=this.dummy_canvas.getContext("2d");this.dummy_context.font=this.default_font;this.char_width_px=this.dummy_context.measureText("A").width;this.patterns={};this.load_pattern("right_strand","/visualization/strand_right.png");this.load_pattern("left_strand","/visualization/strand_left.png");this.load_pattern("right_strand_inv","/visualization/strand_right_inv.png");this.load_pattern("left_strand_inv","/visualization/strand_left_inv.png")};_.extend(CanvasManager.prototype,{load_pattern:function(a,e){var b=this.patterns,c=this.dummy_context,d=new Image();d.src=galaxy_paths.attributes.image_path+e;d.onload=function(){b[a]=c.createPattern(d,"repeat")}},get_pattern:function(a){return this.patterns[a]},new_canvas:function(){var a=$("<canvas/>")[0];if(window.G_vmlCanvasManager){G_vmlCanvasManager.initElement(a)}a.manager=this;return a}});var Cache=Backbone.Model.extend({defaults:{num_elements:20,obj_cache:null,key_ary:null},initialize:function(a){this.clear()},get_elt:function(b){var c=this.attributes.obj_cache,d=this.attributes.key_ary,a=d.indexOf(b);if(a!==-1){if(c[b].stale){d.splice(a,1);delete c[b]}else{this.move_key_to_end(b,a)}}return c[b]},set_elt:function(b,d){var e=this.attributes.obj_cache,f=this.attributes.key_ary,c=this.attributes.num_elements;if(!e[b]){if(f.length>=c){var a=f.shift();delete e[a]}f.push(b)}e[b]=d;return d},move_key_to_end:function(b,a){this.attributes.key_ary.splice(a,1);this.attributes.key_ary.push(b)},clear:function(){this.attributes.obj_cache={};this.attributes.key_ary=[]},size:function(){return this.attributes.key_ary.length}});var GenomeDataManager=Cache.extend({defaults:_.extend({},Cache.prototype.defaults,{dataset:null,filters_manager:null,data_url:null,dataset_state_url:null,data_mode_compatible:function(a,b){return true},can_subset:function(a){return false}}),data_is_ready:function(){var c=this.get("dataset"),b=$.Deferred(),a=new ServerStateDeferred({ajax_settings:{url:this.get("dataset_state_url"),data:{dataset_id:c.id,hda_ldda:c.get("hda_ldda")},dataType:"json"},interval:5000,success_fn:function(d){return d!=="pending"}});$.when(a.go()).then(function(d){b.resolve(d==="ok"||d==="data")});return b},load_data:function(h,g,b,f){var d={chrom:h.get("chrom"),low:h.get("start"),high:h.get("end"),mode:g,resolution:b};dataset=this.get("dataset");if(dataset){d.dataset_id=dataset.id;d.hda_ldda=dataset.get("hda_ldda")}$.extend(d,f);var j=this.get("filters_manager");if(j){var k=[];var a=j.filters;for(var e=0;e<a.length;e++){k.push(a[e].name)}d.filter_cols=JSON.stringify(k)}var c=this;return $.getJSON(this.get("data_url"),d,function(i){c.set_data(h,i)})},get_data:function(g,f,c,e){var h=this.get_elt(g);if(h&&(is_deferred(h)||this.get("data_mode_compatible")(h,f))){return h}var j=this.get("key_ary"),b=this.get("obj_cache"),k,a;for(var d=0;d<j.length;d++){k=j[d];a=new GenomeRegion({from_str:k});if(a.contains(g)){h=b[k];if(is_deferred(h)||(this.get("data_mode_compatible")(h,f)&&this.get("can_subset")(h))){this.move_key_to_end(k,d);return h}}}h=this.load_data(g,f,c,e);this.set_data(g,h);return h},set_data:function(b,a){this.set_elt(b,a)},DEEP_DATA_REQ:"deep",BROAD_DATA_REQ:"breadth",get_more_data:function(i,h,d,g,e){var k=this.get_elt(i);if(!(k&&this.get("data_mode_compatible")(k,h))){console.log("ERROR: no current data for: ",dataset,i.toString(),h,d,g);return}k.stale=true;var c=i.get("start");if(e===this.DEEP_DATA_REQ){$.extend(g,{start_val:k.data.length+1})}else{if(e===this.BROAD_DATA_REQ){c=(k.max_high?k.max_high:k.data[k.data.length-1][2])+1}}var j=i.copy().set("start",c);var b=this,f=this.load_data(j,h,d,g),a=$.Deferred();this.set_data(i,a);$.when(f).then(function(l){if(l.data){l.data=k.data.concat(l.data);if(l.max_low){l.max_low=k.max_low}if(l.message){l.message=l.message.replace(/[0-9]+/,l.data.length)}}b.set_data(i,l);a.resolve(l)});return a},get_elt:function(a){return Cache.prototype.get_elt.call(this,a.toString())},set_elt:function(b,a){return Cache.prototype.set_elt.call(this,b.toString(),a)}});var ReferenceTrackDataManager=GenomeDataManager.extend({load_data:function(a,d,e,b,c){if(b>1){return{data:null}}return GenomeDataManager.prototype.load_data.call(this,a,d,e,b,c)}});var Genome=Backbone.Model.extend({defaults:{name:null,key:null,chroms_info:null},get_chroms_info:function(){return this.attributes.chroms_info.chrom_info}});var GenomeRegion=Backbone.RelationalModel.extend({defaults:{chrom:null,start:0,end:0,DIF_CHROMS:1000,BEFORE:1001,CONTAINS:1002,OVERLAP_START:1003,OVERLAP_END:1004,CONTAINED_BY:1005,AFTER:1006},initialize:function(b){if(b.from_str){var d=b.from_str.split(":"),c=d[0],a=d[1].split("-");this.set({chrom:c,start:parseInt(a[0],10),end:parseInt(a[1],10)})}},copy:function(){return new GenomeRegion({chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")})},length:function(){return this.get("end")-this.get("start")},toString:function(){return this.get("chrom")+":"+this.get("start")+"-"+this.get("end")},toJSON:function(){return{chrom:this.get("chrom"),start:this.get("start"),end:this.get("end")}},compute_overlap:function(h){var b=this.get("chrom"),g=h.get("chrom"),f=this.get("start"),d=h.get("start"),e=this.get("end"),c=h.get("end"),a;if(b&&g&&b!==g){return this.get("DIF_CHROMS")}if(f<d){if(e<d){a=this.get("BEFORE")}else{if(e<=c){a=this.get("OVERLAP_START")}else{a=this.get("CONTAINS")}}}else{if(f>c){a=this.get("AFTER")}else{if(e<=c){a=this.get("CONTAINED_BY")}else{a=this.get("OVERLAP_END")}}}return a},contains:function(a){return this.compute_overlap(a)===this.get("CONTAINS")},overlaps:function(a){return _.intersection([this.compute_overlap(a)],[this.get("DIF_CHROMS"),this.get("BEFORE"),this.get("AFTER")]).length===0}});var GenomeRegionCollection=Backbone.Collection.extend({model:GenomeRegion});var BrowserBookmark=Backbone.RelationalModel.extend({defaults:{region:null,note:""},relations:[{type:Backbone.HasOne,key:"region",relatedModel:"GenomeRegion"}]});var BrowserBookmarkCollection=Backbone.Collection.extend({model:BrowserBookmark});var Visualization=Backbone.RelationalModel.extend({defaults:{id:"",title:"",type:"",dbkey:"",datasets:[]},url:function(){return galaxy_paths.get("visualization_url")},save:function(){return $.ajax({url:this.url(),type:"POST",dataType:"json",data:{vis_json:JSON.stringify(this)}})}});var TracksterVisualization=Visualization.extend({defaults:{bookmarks:[],viewport:{}}});var CircsterVisualization=Visualization.extend({});var HistogramDataset=Backbone.Model.extend({initialize:function(a){this.attributes.data=a;this.attributes.max=_.max(a,function(b){if(!b||typeof b==="string"){return 0}return b[1]})[1]}});var TrackConfig=Backbone.Model.extend({});var CircsterHistogramDatasetLayout=Backbone.Model.extend({chroms_layout:function(){var b=this.attributes.genome.get_chroms_info(),d=d3.layout.pie().value(function(f){return f.len}).sort(null),e=d(b),a=this.attributes.total_gap/b.length,c=_.map(e,function(h,g){var f=h.endAngle-a;h.endAngle=(f>h.startAngle?f:h.startAngle);return h});return c},chrom_data_layout:function(j,b,g,f,h){if(!b||typeof b==="string"){return null}var d=b[0],i=b[3],c=d3.scale.linear().domain([0,h]).range([g,f]),e=d3.layout.pie().value(function(k){return i}).startAngle(j.startAngle).endAngle(j.endAngle),a=e(d);_.each(d,function(k,l){a[l].outerRadius=c(k[1])});return a}});var CircsterView=Backbone.View.extend({className:"circster",initialize:function(a){this.width=a.width;this.height=a.height;this.total_gap=a.total_gap;this.genome=a.genome;this.dataset=a.dataset;this.radius_start=a.radius_start;this.dataset_arc_height=a.dataset_arc_height},render:function(){var d=this.radius_start,e=this.dataset_arc_height,j=new CircsterHistogramDatasetLayout({genome:this.genome,total_gap:this.total_gap}),i=j.chroms_layout(),g=_.zip(i,this.dataset.attributes.data),h=this.dataset.attributes.max,b=_.map(g,function(m){var n=m[0],l=m[1];return j.chrom_data_layout(n,l,d,d+e,h)});var c=d3.select(this.$el[0]).append("svg").attr("width",this.width).attr("height",this.height).append("g").attr("transform","translate("+this.width/2+","+this.height/2+")");var k=c.append("g").attr("id","inner-arc"),f=d3.svg.arc().innerRadius(d).outerRadius(d+e),a=k.selectAll("#inner-arc>path").data(i).enter().append("path").attr("d",f).style("stroke","#ccc").style("fill","#ccc").append("title").text(function(l){return l.data.chrom});_.each(b,function(l){if(!l){return}var o=c.append("g"),n=d3.svg.arc().innerRadius(d),m=o.selectAll("path").data(l).enter().append("path").attr("d",n).style("stroke","red").style("fill","red")})}});var TrackBrowserRouter=Backbone.Router.extend({initialize:function(b){this.view=b.view;this.route(/([\w]+)$/,"change_location");this.route(/([\w]+\:[\d,]+-[\d,]+)$/,"change_location");var a=this;a.view.on("navigate",function(c){a.navigate(c)})},change_location:function(a){this.view.go_to(a)}});var add_datasets=function(a,c,b){$.ajax({url:a,data:{"f-dbkey":view.dbkey},error:function(){alert("Grid failed")},success:function(d){show_modal("Select datasets for new tracks",d,{Cancel:function(){hide_modal()},Add:function(){var e=[];$("input[name=id]:checked,input[name=ldda_ids]:checked").each(function(){var f,g=$(this).val();if($(this).attr("name")==="id"){f={hda_id:g}}else{f={ldda_id:g}}e[e.length]=$.ajax({url:c,data:f,dataType:"json"})});$.when.apply($,e).then(function(){var f=(arguments[0] instanceof Array?$.map(arguments,function(g){return g[0]}):[arguments[0]]);b(f)});hide_modal()}})}})};
\ No newline at end of file
diff -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 -r 456f11df0b53897086257b952457d615b3942539 static/scripts/viz/trackster_ui.js
--- a/static/scripts/viz/trackster_ui.js
+++ b/static/scripts/viz/trackster_ui.js
@@ -5,29 +5,35 @@
/**
* Add bookmark.
*/
-var add_bookmark = function(position, annotation) {
- var
- bookmarks_container = $("#bookmarks-container"),
- new_bookmark = $("<div/>").addClass("bookmark").appendTo(bookmarks_container),
- delete_icon_container = $("<div/>").addClass("delete-icon-container").appendTo(new_bookmark).click(function (){
- // Remove bookmark.
- new_bookmark.slideUp("fast");
- new_bookmark.remove();
- view.has_changes = true;
- return false;
- }),
- delete_icon = $("<a href=''/>").addClass("icon-button delete").appendTo(delete_icon_container),
- position_div = $("<div/>").addClass("position").appendTo(new_bookmark),
+var add_bookmark = function(position, annotation, editable) {
+ // Create HTML.
+ var bookmarks_container = $("#bookmarks-container"),
+ new_bookmark = $("<div/>").addClass("bookmark").appendTo(bookmarks_container);
+
+ var position_div = $("<div/>").addClass("position").appendTo(new_bookmark),
position_link = $("<a href=''/>").text(position).appendTo(position_div).click(function() {
view.go_to(position);
return false;
}),
- annotation_div = $("<div/>").text(annotation).make_text_editable({
+ annotation_div = $("<div/>").text(annotation).appendTo(new_bookmark);
+
+ // If editable, enable bookmark deletion and annotation editing.
+ if (editable) {
+ var delete_icon_container = $("<div/>").addClass("delete-icon-container").prependTo(new_bookmark).click(function (){
+ // Remove bookmark.
+ new_bookmark.slideUp("fast");
+ new_bookmark.remove();
+ view.has_changes = true;
+ return false;
+ }),
+ delete_icon = $("<a href=''/>").addClass("icon-button delete").appendTo(delete_icon_container);
+ annotation_div.make_text_editable({
num_rows: 3,
use_textarea: true,
- help_text: "Set bookmark note"
- }).addClass("annotation").appendTo(new_bookmark);
-
+ help_text: "Edit bookmark note"
+ }).addClass("annotation");
+ }
+
view.has_changes = true;
return new_bookmark;
};
@@ -67,7 +73,7 @@
/**
* Create a complete Trackster visualization. Returns view.
*/
-var create_visualization = function(view_config, viewport_config, drawables_config, bookmarks_config) {
+var create_visualization = function(view_config, viewport_config, drawables_config, bookmarks_config, editable) {
// Create view.
view = new View(view_config);
@@ -114,7 +120,7 @@
var bookmark;
for (var i = 0; i < bookmarks_config.length; i++) {
bookmark = bookmarks_config[i];
- add_bookmark(bookmark['position'], bookmark['annotation']);
+ add_bookmark(bookmark['position'], bookmark['annotation'], editable);
}
}
diff -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 -r 456f11df0b53897086257b952457d615b3942539 static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -526,17 +526,25 @@
/**
* A genome browser bookmark.
*/
-var BrowserBookmark = Backbone.Model.extend({
+var BrowserBookmark = Backbone.RelationalModel.extend({
defaults: {
region: null,
- note: ""
- }
+ note: ''
+ },
+
+ relations: [
+ {
+ type: Backbone.HasOne,
+ key: 'region',
+ relatedModel: 'GenomeRegion'
+ }
+ ]
});
/**
* Bookmarks collection.
*/
-var BrowserBookmarks = Backbone.Collection.extend({
+var BrowserBookmarkCollection = Backbone.Collection.extend({
model: BrowserBookmark
});
diff -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 -r 456f11df0b53897086257b952457d615b3942539 templates/tracks/browser.mako
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -178,7 +178,8 @@
},
JSON.parse('${ h.to_json_string( config.get( 'viewport', dict() ) ) }'),
JSON.parse('${ h.to_json_string( config['tracks'] ).replace("'", "\\'") }'),
- JSON.parse('${ h.to_json_string( config['bookmarks'] ) }')
+ JSON.parse('${ h.to_json_string( config['bookmarks'] ) }'),
+ true
);
init_editor();
set_up_router({view: view});
@@ -239,7 +240,7 @@
// Add new bookmark.
var position = view.chrom + ":" + view.low + "-" + view.high,
annotation = "Bookmark description";
- return add_bookmark(position, annotation);
+ return add_bookmark(position, annotation, true);
});
// make_popupmenu( $("#bookmarks-more-button"), {
diff -r 6face40d68836de96bf92d46c0d6e6bf32cdb616 -r 456f11df0b53897086257b952457d615b3942539 templates/visualization/display.mako
--- a/templates/visualization/display.mako
+++ b/templates/visualization/display.mako
@@ -3,6 +3,16 @@
<%def name="javascripts()"><% config = item_data %>
${parent.javascripts()}
+
+ <script type='text/javascript'>
+ $(function() {
+ // HACK: add bookmarks container and header.
+ $('#right > .unified-panel-body > div').append(
+ $('<div/>').attr('id', 'bookmarks-container')
+ .append( $('<h4/>').text('Bookmarks') )
+ );
+ });
+ </script><!--[if lt IE 9]><script type='text/javascript' src="${h.url_for('/static/scripts/excanvas.js')}"></script>
@@ -12,30 +22,16 @@
<%def name="stylesheets()">
${parent.stylesheets()}
- ## For page:
+ ## Style changes needed for display.
<style type="text/css">
.page-body {
padding: 0px;
}
- </style>
-
- <style type="text/css">
- #browser-container {
- overflow: none;
+ #bookmarks-container {
+ padding-left: 10px;
}
- .nav-container {
- width: 100%;
- ## Overriding styles from trackster.css to push nav up into title bar
- height: 0;
- text-align: center;
- }
- .nav {
- ## Overriding styles from trackster.css to push nav up into title bar
- position: relative;
- display: inline-block;
- top: -2em;
- background: transparent;
- border: none;
+ .bookmark {
+ margin: 0em;
}
</style></%def>
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.
1
0