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
March 2013
- 1 participants
- 183 discussions
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e0e98d8937f4/
changeset: e0e98d8937f4
user: dannon
date: 2013-03-12 20:39:52
summary: Remove unused import.
affected #: 1 file
diff -r a9cb31de456c2e9bcdb1022adc1fc972df7bc73a -r e0e98d8937f4c01d65208dc65af9fe33bae62e0d lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -12,7 +12,6 @@
from galaxy.tools.parameters.basic import DataToolParameter, UnvalidatedValue
from galaxy.util.bunch import Bunch
from galaxy.util.hash_util import is_hashable
-from galaxy.util import biostar
from galaxy.web import error, url_for
from galaxy.web.base.controller import BaseUIController
from galaxy.web.form_builder import SelectField
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: dan: Do not display empty Sections in the workflow editor tool list.
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a9cb31de456c/
changeset: a9cb31de456c
user: dan
date: 2013-03-12 20:37:05
summary: Do not display empty Sections in the workflow editor tool list.
affected #: 1 file
diff -r ad68e867b900920043d75e109e36e24f88d7a698 -r a9cb31de456c2e9bcdb1022adc1fc972df7bc73a templates/webapps/galaxy/workflow/editor.mako
--- a/templates/webapps/galaxy/workflow/editor.mako
+++ b/templates/webapps/galaxy/workflow/editor.mako
@@ -909,7 +909,7 @@
<div class="toolSectionWrapper">
%if key.startswith( 'tool' ):
${render_tool( val, False )}
- %elif key.startswith( 'section' ):
+ %elif key.startswith( 'section' ) and val.elems:
<% section = val %><div class="toolSectionTitle" id="title_${section.id}"><span>${section.name}</span>
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: dan: Add Data Manager Tools to the workflow editor tool list, when user is admin.
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ad68e867b900/
changeset: ad68e867b900
user: dan
date: 2013-03-12 20:32:32
summary: Add Data Manager Tools to the workflow editor tool list, when user is admin.
affected #: 1 file
diff -r a8caad109542661a7222c504a529ab5afbe303fb -r ad68e867b900920043d75e109e36e24f88d7a698 templates/webapps/galaxy/workflow/editor.mako
--- a/templates/webapps/galaxy/workflow/editor.mako
+++ b/templates/webapps/galaxy/workflow/editor.mako
@@ -930,6 +930,23 @@
%endif
</div>
%endfor
+ ## Data Manager Tools
+ %if trans.user_is_admin() and trans.app.data_managers.data_managers:
+ <div> </div>
+ <div class="toolSectionWrapper">
+ <div class="toolSectionTitle" id="title___DATA_MANAGER_TOOLS__">
+ <span>Data Manager Tools</span>
+ </div>
+ <div id="__DATA_MANAGER_TOOLS__" class="toolSectionBody">
+ <div class="toolSectionBg">
+ %for data_manager_id, data_manager_val in trans.app.data_managers.data_managers.items():
+ ${ render_tool( data_manager_val.tool, True ) }
+ %endfor
+ </div>
+ </div>
+ </div>
+ %endif
+ ## End Data Manager Tools
</div>
## Feedback when search returns no results.
<div id="search-no-results" style="display: none; padding-top: 5px">
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: james_taylor: biostar: support for asking questions with integrated authentication, still need support for landing page and search
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a8caad109542/
changeset: a8caad109542
user: james_taylor
date: 2013-03-12 20:14:25
summary: biostar: support for asking questions with integrated authentication, still need support for landing page and search
affected #: 7 files
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -254,7 +254,9 @@
amqp_config = {}
for k, v in amqp_config:
self.amqp[k] = v
- self.biostar = kwargs.get( 'biostar', None )
+ self.biostar_url = kwargs.get( 'biostar_url', None )
+ self.biostar_key_name = kwargs.get( 'biostar_key_name', None )
+ self.biostar_key = kwargs.get( 'biostar_key', None )
self.running_functional_tests = string_as_bool( kwargs.get( 'running_functional_tests', False ) )
# Experimental: This will not be enabled by default and will hide
# nonproduction code.
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -402,6 +402,30 @@
self.app.model.ToolShedRepository.table.c.owner == owner,
self.app.model.ToolShedRepository.table.c.installed_changeset_revision == installed_changeset_revision ) ) \
.first()
+
+ def get_tool_components( self, tool_id, tool_version=None, get_loaded_tools_by_lineage=False, set_selected=False ):
+ """
+ Retrieve all loaded versions of a tool from the toolbox and return a select list enabling selection of a different version, the list of the tool's
+ loaded versions, and the specified tool.
+ """
+ toolbox = self
+ tool_version_select_field = None
+ tools = []
+ tool = None
+ # Backwards compatibility for datasource tools that have default tool_id configured, but which are now using only GALAXY_URL.
+ tool_ids = listify( tool_id )
+ for tool_id in tool_ids:
+ if get_loaded_tools_by_lineage:
+ tools = toolbox.get_loaded_tools_by_lineage( tool_id )
+ else:
+ tools = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=True )
+ if tools:
+ tool = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=False )
+ if len( tools ) > 1:
+ tool_version_select_field = self.build_tool_version_select_field( tools, tool.id, set_selected )
+ break
+ return tool_version_select_field, tools, tool
+
def load_tool_tag_set( self, elem, panel_dict, integrated_panel_dict, tool_path, load_panel_dict, guid=None, index=None ):
try:
path = elem.get( "file" )
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb lib/galaxy/webapps/galaxy/controllers/biostar.py
--- /dev/null
+++ b/lib/galaxy/webapps/galaxy/controllers/biostar.py
@@ -0,0 +1,86 @@
+"""
+Support for integration with the Biostar Q&A application
+"""
+
+from galaxy.web.base.controller import BaseUIController, url_for, error, web
+
+import base64
+import json
+import hmac
+
+# Biostar requires all keys to be present, so we start with a template
+DEFAULT_PAYLOAD = {
+ 'email': "",
+ 'title': "Question about Galaxy",
+ 'tags': 'galaxy',
+ 'tool_name': '',
+ 'tool_version': '',
+ 'tool_id': ''
+}
+
+def encode_data( key, data ):
+ """
+ Encode data to send a question to Biostar
+ """
+ text = json.dumps(data)
+ text = base64.urlsafe_b64encode(text)
+ digest = hmac.new(key, text).hexdigest()
+ return text, digest
+
+
+class BiostarController( BaseUIController ):
+ """
+ Provides integration with Biostar through external authentication, see: http://liondb.com/help/x/
+ """
+
+ @web.expose
+ def biostar_redirect( self, trans, payload={}, biostar_action=None ):
+ """
+ Generate a redirect to a Biostar site using external authentication to
+ pass Galaxy user information and information about a specific tool.
+ """
+ # Ensure biostar integration is enabled
+ if not trans.app.config.biostar_url:
+ return error( "Biostar integration is not enabled" )
+ # Start building up the payload
+ payload = dict( DEFAULT_PAYLOAD, **payload )
+ # Do the best we can of providing user information for the payload
+ if trans.user:
+ payload['email'] = trans.user.email
+ if trans.user.username:
+ payload['username'] = trans.user.username
+ payload['display_name'] = trans.user.username
+ else:
+ payload['display_name'] = "Galaxy User"
+ else:
+ payload['username'] = payload['display_name'] = "Anonymous Galaxy User %d" % trans.galaxy_session.id
+ data, digest = encode_data( trans.app.config.biostar_key, payload )
+ return trans.response.send_redirect( url_for( trans.app.config.biostar_url, data=data, digest=digest, name=trans.app.config.biostar_key_name, action=biostar_action ) )
+
+ @web.expose
+ def biostar_question_redirect( self, trans, payload={} ):
+ """
+ Generate a redirect to a Biostar site using external authentication to
+ pass Galaxy user information and information about a specific tool.
+ """
+ return self.biostar_redirect( trans, payload=payload, biostar_action='new' )
+
+ @web.expose
+ def biostar_tool_question_redirect( self, trans, tool_id=None ):
+ """
+ Generate a redirect to a Biostar site using external authentication to
+ pass Galaxy user information and information about a specific tool.
+ """
+ # tool_id is required
+ if tool_id is None:
+ return error( "No tool_id provided" )
+ # Load the tool
+ tool_version_select_field, tools, tool = \
+ self.app.toolbox.get_tool_components( tool_id, tool_version=None, get_loaded_tools_by_lineage=False, set_selected=True )
+ # No matching tool, unlikely
+ if not tool:
+ return error( "No tool found matching '%s'" % tool_id )
+ # Tool specific information for payload
+ payload = { 'title': "Question about Galaxy tool '%s'" % tool.name, 'tool_name': tool.name, 'tool_version': tool.version, 'tool_id': tool.id }
+ # Pass on to regular question method
+ return self.biostar_question_redirect( trans, payload )
\ No newline at end of file
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb lib/galaxy/webapps/galaxy/controllers/root.py
--- a/lib/galaxy/webapps/galaxy/controllers/root.py
+++ b/lib/galaxy/webapps/galaxy/controllers/root.py
@@ -26,28 +26,26 @@
params=kwd )
## ---- Tool related -----------------------------------------------------
-
+
@web.expose
def tool_menu( self, trans ):
if trans.app.config.require_login and not trans.user:
- return trans.fill_template( '/no_access.mako', message = 'Please log in to access Galaxy tools.' )
- else:
- ## Get most recently used tools.
- toolbox = self.get_toolbox()
- recent_tools = []
- if trans.user:
- for row in trans.sa_session.query( self.app.model.Job.tool_id ). \
- filter( self.app.model.Job.user==trans.user ). \
- order_by( self.app.model.Job.create_time.desc() ):
- tool_id = row[0]
- a_tool = toolbox.get_tool( tool_id )
- if a_tool and not a_tool.hidden and a_tool not in recent_tools:
- recent_tools.append( a_tool )
- ## TODO: make number of recently used tools a user preference.
- if len ( recent_tools ) == 5:
- break
-
- return trans.fill_template('/root/tool_menu.mako', toolbox=toolbox, recent_tools=recent_tools )
+ return trans.fill_template( '/no_access.mako', message='Please log in to access Galaxy tools.' )
+ toolbox = self.get_toolbox()
+ ## Get most recently used tools.
+ # recent_tools = []
+ # if trans.user:
+ # for row in trans.sa_session.query( self.app.model.Job.tool_id ) \
+ # .filter( self.app.model.Job.user == trans.user ) \
+ # .order_by( self.app.model.Job.create_time.desc() ):
+ # tool_id = row[0]
+ # a_tool = toolbox.get_tool( tool_id )
+ # if a_tool and not a_tool.hidden and a_tool not in recent_tools:
+ # recent_tools.append( a_tool )
+ # ## TODO: make number of recently used tools a user preference.
+ # if len( recent_tools ) == 5:
+ # break
+ return trans.fill_template( '/root/tool_menu.mako', toolbox=toolbox )
@web.json
def tool_search( self, trans, **kwd ):
@@ -215,7 +213,7 @@
"html": unicode( trans.fill_template( "root/history_item.mako", data=data, hid=data.hid ), 'utf-8' ),
"force_history_refresh": force_history_refresh
}
-
+
return rval
@web.json
@@ -231,7 +229,7 @@
def __user_get_usage( self, trans ):
usage = trans.app.quota_agent.get_usage( trans )
- percent = trans.app.quota_agent.get_percent( trans=trans, usage=usage )
+ percent = trans.app.quota_agent.get_percent( trans=trans, usage=usage )
rval = {}
if percent is None:
rval['usage'] = util.nice_size( usage )
@@ -239,20 +237,19 @@
rval['percent'] = percent
return rval
-
## ---- Dataset display / editing ----------------------------------------
@web.expose
def display( self, trans, id=None, hid=None, tofile=None, toext=".txt", **kwd ):
"""
- Returns data directly into the browser.
+ Returns data directly into the browser.
Sets the mime-type according to the extension
"""
if hid is not None:
try:
hid = int( hid )
except:
- return "hid '%s' is invalid" %str( hid )
+ return "hid '%s' is invalid" % str( hid )
history = trans.get_history()
for dataset in history.datasets:
if dataset.hid == hid:
@@ -264,7 +261,7 @@
try:
data = self.app.model.HistoryDatasetAssociation.get( id )
except:
- return "Dataset id '%s' is invalid" %str( id )
+ return "Dataset id '%s' is invalid" % str( id )
if data:
current_user_roles = trans.get_current_user_roles()
if trans.app.security_agent.can_access_dataset( current_user_roles, data.dataset ):
@@ -281,7 +278,7 @@
trans.log_event( "Display dataset id: %s" % str(id) )
try:
return open( data.file_name )
- except:
+ except:
return "This dataset contains no content"
else:
return "You are not allowed to access this dataset"
@@ -322,7 +319,7 @@
return data.as_display_type( display_app, **kwd )
elif authz_method == 'display_at' and trans.app.host_security_agent.allow_action( trans.request.remote_addr,
data.permitted_actions.DATASET_ACCESS,
- dataset = data ):
+ dataset=data ):
trans.response.set_content_type( data.get_mime() )
return data.as_display_type( display_app, **kwd )
else:
@@ -349,12 +346,14 @@
return trans.fill_template( "/history/options.mako",
user=trans.get_user(),
history=trans.get_history( create=True ) )
+
@web.expose
def history_delete( self, trans, id ):
"""
Backward compatibility with check_galaxy script.
"""
return trans.webapp.controllers['history'].list( trans, id, operation='delete' )
+
@web.expose
def clear_history( self, trans ):
"""Clears the history for a user"""
@@ -365,6 +364,7 @@
trans.sa_session.flush()
trans.log_event( "History id %s cleared" % (str(history.id)) )
trans.response.send_redirect( url_for("/index" ) )
+
@web.expose
def history_import( self, trans, id=None, confirm=False, **kwd ):
msg = ""
@@ -379,7 +379,7 @@
if import_history.user_id == user.id:
return trans.show_error_message( "You cannot import your own history.")
new_history = import_history.copy( target_user=trans.user )
- new_history.name = "imported: "+new_history.name
+ new_history.name = "imported: " + new_history.name
new_history.user_id = user.id
galaxy_session = trans.get_galaxy_session()
try:
@@ -399,7 +399,7 @@
to begin.""" % ( new_history.name, web.url_for( '/' ) ) )
elif not user_history.datasets or confirm:
new_history = import_history.copy()
- new_history.name = "imported: "+new_history.name
+ new_history.name = "imported: " + new_history.name
new_history.user_id = None
galaxy_session = trans.get_galaxy_session()
try:
@@ -420,22 +420,24 @@
Warning! If you import this history, you will lose your current
history. Click <a href="%s">here</a> to confirm.
""" % web.url_for( controller='root', action='history_import', id=id, confirm=True ) )
+
@web.expose
def history_new( self, trans, name=None ):
trans.new_history( name=name )
trans.log_event( "Created new History, id: %s." % str(trans.history.id) )
- return trans.show_message( "New history created", refresh_frames = ['history'] )
+ return trans.show_message( "New history created", refresh_frames=['history'] )
+
@web.expose
- def history_add_to( self, trans, history_id=None, file_data=None, name="Data Added to History",info=None,ext="txt",dbkey="?",copy_access_from=None,**kwd ):
+ def history_add_to( self, trans, history_id=None, file_data=None, name="Data Added to History", info=None, ext="txt", dbkey="?", copy_access_from=None, **kwd ):
"""Adds a POSTed file to a History"""
try:
history = trans.sa_session.query( trans.app.model.History ).get( history_id )
- data = trans.app.model.HistoryDatasetAssociation( name = name,
- info = info,
- extension = ext,
- dbkey = dbkey,
- create_dataset = True,
- sa_session = trans.sa_session )
+ data = trans.app.model.HistoryDatasetAssociation( name=name,
+ info=info,
+ extension=ext,
+ dbkey=dbkey,
+ create_dataset=True,
+ sa_session=trans.sa_session )
if copy_access_from:
copy_access_from = trans.sa_session.query( trans.app.model.HistoryDatasetAssociation ).get( copy_access_from )
trans.app.security_agent.copy_dataset_permissions( copy_access_from.dataset, data.dataset )
@@ -457,11 +459,12 @@
trans.sa_session.flush()
data.set_peek()
trans.sa_session.flush()
- trans.log_event("Added dataset %d to history %d" %(data.id, trans.history.id))
- return trans.show_ok_message("Dataset "+str(data.hid)+" added to history "+str(history_id)+".")
+ trans.log_event("Added dataset %d to history %d" % (data.id, trans.history.id))
+ return trans.show_ok_message( "Dataset " + str(data.hid) + " added to history " + str(history_id) + "." )
except Exception, e:
trans.log_event( "Failed to add dataset to history: %s" % ( e ) )
return trans.show_error_message("Adding File to History has Failed")
+
@web.expose
def history_set_default_permissions( self, trans, id=None, **kwd ):
"""Sets the permissions on a history"""
@@ -494,6 +497,7 @@
else:
#user not logged in, history group must be only public
return trans.show_error_message( "You must be logged in to change a history's default permissions." )
+
@web.expose
def dataset_make_primary( self, trans, id=None):
"""Copies a dataset and makes primary"""
@@ -506,7 +510,7 @@
history.add_dataset(new_data)
trans.sa_session.add( new_data )
trans.sa_session.flush()
- return trans.show_message( "<p>Secondary dataset has been made primary.</p>", refresh_frames=['history'] )
+ return trans.show_message( "<p>Secondary dataset has been made primary.</p>", refresh_frames=['history'] )
except:
return trans.show_error_message( "<p>Failed to make secondary dataset primary.</p>" )
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb lib/galaxy/webapps/galaxy/controllers/tool_runner.py
--- a/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
+++ b/lib/galaxy/webapps/galaxy/controllers/tool_runner.py
@@ -12,6 +12,7 @@
from galaxy.tools.parameters.basic import DataToolParameter, UnvalidatedValue
from galaxy.util.bunch import Bunch
from galaxy.util.hash_util import is_hashable
+from galaxy.util import biostar
from galaxy.web import error, url_for
from galaxy.web.base.controller import BaseUIController
from galaxy.web.form_builder import SelectField
@@ -42,28 +43,10 @@
def default(self, trans, tool_id=None, **kwd):
"""Catches the tool id and redirects as needed"""
return self.index(trans, tool_id=tool_id, **kwd)
+
def __get_tool_components( self, tool_id, tool_version=None, get_loaded_tools_by_lineage=False, set_selected=False ):
- """
- Retrieve all loaded versions of a tool from the toolbox and return a select list enabling selection of a different version, the list of the tool's
- loaded versions, and the specified tool.
- """
- toolbox = self.get_toolbox()
- tool_version_select_field = None
- tools = []
- tool = None
- # Backwards compatibility for datasource tools that have default tool_id configured, but which are now using only GALAXY_URL.
- tool_ids = galaxy.util.listify( tool_id )
- for tool_id in tool_ids:
- if get_loaded_tools_by_lineage:
- tools = toolbox.get_loaded_tools_by_lineage( tool_id )
- else:
- tools = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=True )
- if tools:
- tool = toolbox.get_tool( tool_id, tool_version=tool_version, get_all_versions=False )
- if len( tools ) > 1:
- tool_version_select_field = self.build_tool_version_select_field( tools, tool.id, set_selected )
- break
- return tool_version_select_field, tools, tool
+ return self.get_toolbox().get_tool_components( tool_id, tool_version, get_loaded_tools_by_lineage, set_selected )
+
@web.expose
def index(self, trans, tool_id=None, from_noframe=None, **kwd):
# No tool id passed, redirect to main page
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb templates/webapps/galaxy/base_panels.mako
--- a/templates/webapps/galaxy/base_panels.mako
+++ b/templates/webapps/galaxy/base_panels.mako
@@ -120,9 +120,9 @@
## Help tab.
<%
menu_options = []
- qa_url = app.config.get( "qa_url", None )
- if qa_url:
- menu_options = [ [_('Galaxy Q&A'), qa_url, "_blank" ] ]
+ if app.config.biostar_url:
+ menu_options = [ [_('Galaxy Q&A Site'), h.url_for( controller='biostar', action='biostar_redirect', biostar_action='show/tag/galaxy' ), "_blank" ],
+ [_('Ask a question'), h.url_for( controller='biostar', action='biostar_question_redirect' ), "_blank" ] ]
menu_options.extend( [
[_('Support'), app.config.get( "support_url", "http://wiki.g2.bx.psu.edu/Support" ), "_blank" ],
[_('Tool shed wiki'), app.config.get( "wiki_url", "http://wiki.g2.bx.psu.edu/Tool%20Shed" ), "_blank" ],
diff -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 -r a8caad109542661a7222c504a529ab5afbe303fb templates/webapps/galaxy/tool_form.mako
--- a/templates/webapps/galaxy/tool_form.mako
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -308,10 +308,10 @@
%else:
<div class="toolFormTitle">${tool.name} ${tool_version_select_field.get_html()}
%endif
- %if trans.app.config.biostar:
+
+ %if trans.app.config.biostar_url:
<!-- BioStar links -->
- <a href="${trans.app.config.biostar}/new/post/tagged/${low_tool_name}" target="galaxy_main" class="icon-button general-question tooltip close-side-panels" data-original-title="Ask a tool related question"></a>
- <a href="${trans.app.config.biostar}/show/tag/${low_tool_name}/" target="galaxy_main" class="icon-button tag-question tooltip close-side-panels" data-original-title="See tool related posts" ></a>
+ <span class="pull-right"><a href="${h.url_for( controller='biostar', action='biostar_tool_question_redirect', tool_id=tool.id )}" target="galaxy_main" class="fa-icon-question-sign tooltip" data-original-title="Ask a question about this tool"></a></span><!-- End of BioStar links -->
%endif
</div>
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: Handle exceptions when attempting to parse a datatypes_conf.xml file in a tool shed repository.
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a7475ad6ecfc/
changeset: a7475ad6ecfc
user: greg
date: 2013-03-12 20:02:03
summary: Handle exceptions when attempting to parse a datatypes_conf.xml file in a tool shed repository.
affected #: 1 file
diff -r 01e294adf7ac8715039d0baed1d44417e338c1a4 -r a7475ad6ecfc0f1fcdab3cfacce586a107aa8057 lib/tool_shed/util/shed_util_common.py
--- a/lib/tool_shed/util/shed_util_common.py
+++ b/lib/tool_shed/util/shed_util_common.py
@@ -1190,7 +1190,11 @@
return metadata_dict
def generate_datatypes_metadata( app, repository_clone_url, repository_files_dir, datatypes_config, metadata_dict ):
"""Update the received metadata_dict with information from the parsed datatypes_config."""
- tree = ElementTree.parse( datatypes_config )
+ try:
+ tree = ElementTree.parse( datatypes_config )
+ except Exception, e:
+ log.debug( "Exception attempting to parse %s: %s" % ( str( datatypes_config ), str( e ) ) )
+ return metadata_dict
root = tree.getroot()
ElementInclude.include( root )
repository_datatype_code_files = []
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: Add grids for tool shed repositories that are ready for review or have tools with invalid functional tests.
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/01e294adf7ac/
changeset: 01e294adf7ac
user: greg
date: 2013-03-12 19:29:19
summary: Add grids for tool shed repositories that are ready for review or have tools with invalid functional tests.
affected #: 4 files
diff -r f6bc826d0ec20da52746e0703774175e835aee94 -r 01e294adf7ac8715039d0baed1d44417e338c1a4 lib/galaxy/webapps/tool_shed/controllers/repository_review.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository_review.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository_review.py
@@ -20,11 +20,13 @@
class RepositoryReviewController( BaseUIController, common_util.ItemRatings ):
component_grid = repository_review_grids.ComponentGrid()
+ repositories_ready_for_review_grid = repository_review_grids.RepositoriesReadyForReviewGrid()
repositories_reviewed_by_me_grid = repository_review_grids.RepositoriesReviewedByMeGrid()
repositories_with_reviews_grid = repository_review_grids.RepositoriesWithReviewsGrid()
repositories_without_reviews_grid = repository_review_grids.RepositoriesWithoutReviewsGrid()
repository_reviews_by_user_grid = repository_review_grids.RepositoryReviewsByUserGrid()
reviewed_repositories_i_own_grid = repository_review_grids.ReviewedRepositoriesIOwnGrid()
+ repositories_with_invalid_tests_grid = repository_review_grids.RepositoriesWithInvalidTestsGrid()
@web.expose
@web.require_login( "approve repository review" )
@@ -368,6 +370,31 @@
return self.component_grid( trans, **kwd )
@web.expose
+ @web.require_login( "manage repositories ready for review" )
+ def manage_repositories_ready_for_review( self, trans, **kwd ):
+ """
+ A repository is ready to be reviewed if one of the following conditions is met:
+ 1) It contains no tools
+ 2) It contains tools the tools_functionally_correct flag is set to True. This implies that the repository metadata revision was installed and tested
+ by the Tool Shed's install and test framework.
+ """
+ if 'operation' in kwd:
+ operation = kwd['operation'].lower()
+ if operation == "inspect repository revisions":
+ return trans.response.send_redirect( web.url_for( controller='repository_review',
+ action='create_review',
+ **kwd ) )
+ if operation == "view_or_manage_repository":
+ return trans.response.send_redirect( web.url_for( controller='repository_review',
+ action='view_or_manage_repository',
+ **kwd ) )
+ message = 'Any of these repositories that contain tools have been installed into Galaxy and proven to be functionally correct by executing the tests defined '
+ message += 'for each tool. Repositories that do not contain tools have not been installed into Galaxy. '
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = 'warning'
+ return self.repositories_ready_for_review_grid( trans, **kwd )
+
+ @web.expose
@web.require_login( "manage repositories reviewed by me" )
def manage_repositories_reviewed_by_me( self, trans, **kwd ):
# The value of the received id is the encoded repository id.
@@ -383,6 +410,25 @@
return self.repositories_reviewed_by_me_grid( trans, **kwd )
@web.expose
+ @web.require_login( "manage repositories with invalid tests" )
+ def manage_repositories_with_invalid_tests( self, trans, **kwd ):
+ """Display a list of repositories that contain tools, have not yet been reviewed, and have invalid functional tests."""
+ if 'operation' in kwd:
+ operation = kwd['operation'].lower()
+ if operation == "inspect repository revisions":
+ return trans.response.send_redirect( web.url_for( controller='repository_review',
+ action='create_review',
+ **kwd ) )
+ if operation == "view_or_manage_repository":
+ return trans.response.send_redirect( web.url_for( controller='repository_review',
+ action='view_or_manage_repository',
+ **kwd ) )
+ message = 'These repositories contain tools with invalid functional tests (they have not yet been reviewed). '
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = 'warning'
+ return self.repositories_with_invalid_tests_grid( trans, **kwd )
+
+ @web.expose
@web.require_login( "manage repositories with reviews" )
def manage_repositories_with_reviews( self, trans, **kwd ):
# The value of the received id is the encoded repository id.
diff -r f6bc826d0ec20da52746e0703774175e835aee94 -r 01e294adf7ac8715039d0baed1d44417e338c1a4 lib/tool_shed/grids/repository_review_grids.py
--- a/lib/tool_shed/grids/repository_review_grids.py
+++ b/lib/tool_shed/grids/repository_review_grids.py
@@ -1,7 +1,7 @@
import os, logging
from galaxy.webapps.tool_shed import model
from galaxy.web.framework.helpers import grids
-from galaxy.model.orm import and_
+from galaxy.model.orm import and_, or_
from tool_shed.grids.repository_grids import RepositoryGrid
import tool_shed.util.shed_util_common as suc
@@ -11,13 +11,21 @@
log = logging.getLogger( __name__ )
+
class ComponentGrid( grids.Grid ):
+
+
class NameColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, component ):
return component.name
+
+
class DescriptionColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, component ):
return component.description
+
title = "Repository review components"
model_class = model.Component
template='/webapps/tool_shed/repository_review/grid.mako'
@@ -44,6 +52,8 @@
class RepositoriesWithReviewsGrid( RepositoryGrid ):
# This grid filters out repositories that have been marked as either deprecated or deleted.
+
+
class WithReviewsRevisionColumn( grids.GridColumn ):
def get_value( self, trans, grid, repository ):
# Restrict to revisions that have been reviewed.
@@ -53,10 +63,12 @@
for review in repository.reviews:
changeset_revision = review.changeset_revision
rev, label = suc.get_rev_label_from_changeset_revision( repo, changeset_revision )
- rval += '<a href="manage_repository_reviews_of_revision'
- rval += '?id=%s&changeset_revision=%s">%s</a><br/>' % ( trans.security.encode_id( repository.id ), changeset_revision, label )
+ rval += '<a href="manage_repository_reviews_of_revision?id=%s&changeset_revision=%s">%s</a><br/>' % \
+ ( trans.security.encode_id( repository.id ), changeset_revision, label )
return rval
return ''
+
+
class WithoutReviewsRevisionColumn( grids.GridColumn ):
def get_value( self, trans, grid, repository ):
# Restrict the options to revisions that have not yet been reviewed.
@@ -67,11 +79,14 @@
rev, label, changeset_revision = suc.get_rev_label_changeset_revision_from_repository_metadata( trans,
repository_metadata,
repository=repository )
- rval += '<a href="manage_repository_reviews_of_revision'
- rval += '?id=%s&changeset_revision=%s">%s</a><br/>' % ( trans.security.encode_id( repository.id ), changeset_revision, label )
+ rval += '<a href="manage_repository_reviews_of_revision?id=%s&changeset_revision=%s">%s</a><br/>' % \
+ ( trans.security.encode_id( repository.id ), changeset_revision, label )
return rval
return ''
+
+
class ReviewersColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, repository ):
rval = ''
if repository.reviewers:
@@ -95,7 +110,7 @@
ReviewersColumn( "Reviewers", attach_popup=False )
]
columns.append( grids.MulticolFilterColumn( "Search repository name",
- cols_to_filter=[ columns[0] ],
+ cols_to_filter=[ columns[ 0 ] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
@@ -105,6 +120,7 @@
condition=( lambda item: not item.deleted ),
async_compatible=False )
]
+
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( model.Repository ) \
.filter( and_( model.Repository.table.c.deleted == False,
@@ -114,6 +130,7 @@
.outerjoin( ( model.ComponentReview.table, model.ComponentReview.table.c.repository_review_id == model.RepositoryReview.table.c.id ) ) \
.outerjoin( ( model.Component.table, model.Component.table.c.id == model.ComponentReview.table.c.component_id ) )
+
class RepositoriesWithoutReviewsGrid( RepositoriesWithReviewsGrid ):
# This grid filters out repositories that have been marked as either deprecated or deleted.
title = "Repositories with no reviews"
@@ -123,14 +140,14 @@
link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
attach_popup=True ),
RepositoriesWithReviewsGrid.DescriptionColumn( "Synopsis",
- key="description",
- attach_popup=False ),
+ key="description",
+ attach_popup=False ),
RepositoriesWithReviewsGrid.WithoutReviewsRevisionColumn( "Revisions for review" ),
RepositoriesWithReviewsGrid.UserColumn( "Owner",
attach_popup=False )
]
columns.append( grids.MulticolFilterColumn( "Search repository name, description",
- cols_to_filter=[ columns[0], columns[1] ],
+ cols_to_filter=[ columns[ 0 ], columns[ 1 ] ],
key="free-text-search",
visible=False,
filterable="standard" ) )
@@ -138,6 +155,7 @@
allow_multiple=False,
condition=( lambda item: not item.deleted ),
async_compatible=False ) ]
+
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( model.Repository ) \
.filter( and_( model.Repository.table.c.deleted == False,
@@ -145,8 +163,51 @@
model.Repository.reviews == None ) ) \
.join( model.User.table )
+
+class RepositoriesReadyForReviewGrid( RepositoriesWithoutReviewsGrid ):
+ # Repositories that are ready for human review are those that either:
+ # 1) Have no tools
+ # 2) Have tools that have been proven to be functionally correct within Galaxy.
+ # This grid filters out repositories that have been marked as either deprecated or deleted.
+ title = "Repositories ready for review"
+ columns = [
+ RepositoriesWithoutReviewsGrid.NameColumn( "Repository name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=True ),
+ RepositoriesWithoutReviewsGrid.DescriptionColumn( "Synopsis",
+ key="description",
+ attach_popup=False ),
+ RepositoriesWithoutReviewsGrid.WithoutReviewsRevisionColumn( "Revisions for review" ),
+ RepositoriesWithoutReviewsGrid.UserColumn( "Owner",
+ attach_popup=False )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search repository name, description",
+ cols_to_filter=[ columns[ 0 ], columns[ 1 ] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ operations = [ grids.GridOperation( "Inspect repository revisions",
+ allow_multiple=False,
+ condition=( lambda item: not item.deleted ),
+ async_compatible=False ) ]
+
+ def build_initial_query( self, trans, **kwd ):
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
+ model.Repository.table.c.deprecated == False,
+ model.Repository.reviews == None ) ) \
+ .join( model.RepositoryMetadata.table ) \
+ .filter( and_( model.RepositoryMetadata.table.c.downloadable == True,
+ or_( model.RepositoryMetadata.table.c.includes_tools == False,
+ and_( model.RepositoryMetadata.table.c.includes_tools == True,
+ model.RepositoryMetadata.table.c.tools_functionally_correct == True ) ) ) ) \
+ .join( model.User.table )
+
+
class RepositoriesReviewedByMeGrid( RepositoriesWithReviewsGrid ):
# This grid filters out repositories that have been marked as either deprecated or deleted.
+
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( model.Repository ) \
.filter( and_( model.Repository.table.c.deleted == False,
@@ -157,15 +218,25 @@
.outerjoin( ( model.ComponentReview.table, model.ComponentReview.table.c.repository_review_id == model.RepositoryReview.table.c.id ) ) \
.outerjoin( ( model.Component.table, model.Component.table.c.id == model.ComponentReview.table.c.component_id ) )
+
class RepositoryReviewsByUserGrid( grids.Grid ):
# This grid filters out repositories that have been marked as deprecated.
+
+
class RepositoryNameColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, review ):
return review.repository.name
+
+
class RepositoryDescriptionColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, review ):
return review.repository.description
+
+
class RevisionColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, review ):
encoded_review_id = trans.security.encode_id( review.id )
rval = '<a class="action-button" href="'
@@ -175,7 +246,10 @@
rval +='browse_review'
rval += '?id=%s">%s</a>' % ( encoded_review_id, suc.get_revision_label( trans, review.repository, review.changeset_revision ) )
return rval
+
+
class RatingColumn( grids.TextColumn ):
+
def get_value( self, trans, grid, review ):
if review.rating:
rval = '<input '
@@ -187,6 +261,7 @@
rval += '/>'
return rval
return ''
+
title = "Reviews by user"
model_class = model.RepositoryReview
template='/webapps/tool_shed/repository_review/grid.mako'
@@ -217,6 +292,7 @@
num_rows_per_page = 50
preserve_state = False
use_paging = True
+
def build_initial_query( self, trans, **kwd ):
user_id = trans.security.decode_id( kwd[ 'id' ] )
return trans.sa_session.query( model.RepositoryReview ) \
@@ -225,6 +301,7 @@
.join( ( model.Repository.table, model.RepositoryReview.table.c.repository_id == model.Repository.table.c.id ) ) \
.filter( model.Repository.table.c.deprecated == False )
+
class ReviewedRepositoriesIOwnGrid( RepositoriesWithReviewsGrid ):
title = "Reviewed repositories I own"
columns = [
@@ -248,6 +325,7 @@
condition=( lambda item: not item.deleted ),
async_compatible=False )
]
+
def build_initial_query( self, trans, **kwd ):
return trans.sa_session.query( model.Repository ) \
.join( ( model.RepositoryReview.table, model.RepositoryReview.table.c.repository_id == model.Repository.table.c.id ) ) \
@@ -255,4 +333,43 @@
.join( ( model.User.table, model.User.table.c.id == model.RepositoryReview.table.c.user_id ) ) \
.outerjoin( ( model.ComponentReview.table, model.ComponentReview.table.c.repository_review_id == model.RepositoryReview.table.c.id ) ) \
.outerjoin( ( model.Component.table, model.Component.table.c.id == model.ComponentReview.table.c.component_id ) )
-
\ No newline at end of file
+
+
+class RepositoriesWithInvalidTestsGrid( RepositoriesWithoutReviewsGrid ):
+ # Repositories that are ready for human review are those that either:
+ # 1) Have no tools
+ # 2) Have tools that have been proven to be functionally correct within Galaxy.
+ # This grid filters out repositories that have been marked as either deprecated or deleted.
+ title = "Repositories that contain tools with invalid functional tests"
+ columns = [
+ RepositoriesWithoutReviewsGrid.NameColumn( "Repository name",
+ key="name",
+ link=( lambda item: dict( operation="view_or_manage_repository", id=item.id ) ),
+ attach_popup=True ),
+ RepositoriesWithoutReviewsGrid.DescriptionColumn( "Synopsis",
+ key="description",
+ attach_popup=False ),
+ RepositoriesWithoutReviewsGrid.WithoutReviewsRevisionColumn( "Revisions for review" ),
+ RepositoriesWithoutReviewsGrid.UserColumn( "Owner",
+ attach_popup=False )
+ ]
+ columns.append( grids.MulticolFilterColumn( "Search repository name, description",
+ cols_to_filter=[ columns[ 0 ], columns[ 1 ] ],
+ key="free-text-search",
+ visible=False,
+ filterable="standard" ) )
+ operations = [ grids.GridOperation( "Inspect repository revisions",
+ allow_multiple=False,
+ condition=( lambda item: not item.deleted ),
+ async_compatible=False ) ]
+
+ def build_initial_query( self, trans, **kwd ):
+ return trans.sa_session.query( model.Repository ) \
+ .filter( and_( model.Repository.table.c.deleted == False,
+ model.Repository.table.c.deprecated == False,
+ model.Repository.reviews == None ) ) \
+ .join( model.RepositoryMetadata.table ) \
+ .filter( and_( model.RepositoryMetadata.table.c.downloadable == True,
+ model.RepositoryMetadata.table.c.includes_tools == True,
+ model.RepositoryMetadata.table.c.tools_functionally_correct == False ) ) \
+ .join( model.User.table )
diff -r f6bc826d0ec20da52746e0703774175e835aee94 -r 01e294adf7ac8715039d0baed1d44417e338c1a4 templates/webapps/tool_shed/admin/index.mako
--- a/templates/webapps/tool_shed/admin/index.mako
+++ b/templates/webapps/tool_shed/admin/index.mako
@@ -72,6 +72,15 @@
</div><div class="toolSectionBody"><div class="toolSectionBg">
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_ready_for_review' )}">Repositories ready for review</a>
+ </div>
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_invalid_tests' )}">Repositories with invalid tests</a>
+ </div>
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">All repositories with no reviews</a>
+ </div>
%if trans.user.repository_reviews:
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_reviewed_by_me' )}">Repositories reviewed by me</a>
@@ -81,9 +90,6 @@
<a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_reviews' )}">All reviewed repositories</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">Repositories with no reviews</a>
- </div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_components' )}">Manage review components</a></div></div>
diff -r f6bc826d0ec20da52746e0703774175e835aee94 -r 01e294adf7ac8715039d0baed1d44417e338c1a4 templates/webapps/tool_shed/index.mako
--- a/templates/webapps/tool_shed/index.mako
+++ b/templates/webapps/tool_shed/index.mako
@@ -129,6 +129,15 @@
</div><div class="toolSectionBody"><div class="toolSectionBg">
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_ready_for_review' )}">Repositories ready for review</a>
+ </div>
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_invalid_tests' )}">Repositories with invalid tests</a>
+ </div>
+ <div class="toolTitle">
+ <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">All repositories with no reviews</a>
+ </div>
%if trans.user.repository_reviews:
<div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_reviewed_by_me' )}">Repositories reviewed by me</a>
@@ -138,9 +147,6 @@
<a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_with_reviews' )}">All reviewed repositories</a></div><div class="toolTitle">
- <a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_repositories_without_reviews' )}">Repositories with no reviews</a>
- </div>
- <div class="toolTitle"><a target="galaxy_main" href="${h.url_for( controller='repository_review', action='manage_components' )}">Manage review components</a></div></div>
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: carlfeberhard: browser tests: better parsing of environ vars, prevent subprocess hanging, allow setting debug flags via environ var
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f6bc826d0ec2/
changeset: f6bc826d0ec2
user: carlfeberhard
date: 2013-03-12 18:28:58
summary: browser tests: better parsing of environ vars, prevent subprocess hanging, allow setting debug flags via environ var
affected #: 3 files
diff -r d8009117d5a0af02767c27162a2d5bd3befb9b5d -r f6bc826d0ec20da52746e0703774175e835aee94 test/casperjs/casperjs_runner.py
--- a/test/casperjs/casperjs_runner.py
+++ b/test/casperjs/casperjs_runner.py
@@ -47,6 +47,7 @@
_TODO = """
get data back from js scripts (uploaded files, etc.)
use returned json to output list of failed assertions if code == 2
+ better way to turn debugging on from the environment
"""
# ====================================================================
@@ -72,7 +73,7 @@
debug = False
# bit of a hack - this is the beginning of the last string when capserjs --verbose=true --logLevel=debug
# use this to get subprocess to stop waiting for output
- casper_done_str = '[info] [phantom] Done'
+ casper_done_str = '# Tests complete'
# convert js test results to unittest.TestResults
results_adapter = None #CasperJsonToUnittestResultsConverter()
@@ -140,8 +141,11 @@
command_line_list.append( '--return-json' )
# check flag to output (very) verbose debugging messages from casperjs and tests
- if self.debug:
+ #NOTE: this can be set in the class or by using the debug_these_tests flag in server_env
+ if( ( self.debug )
+ or ( rel_script_path in self.env.debug_these_tests ) ):
command_line_list.extend([ '--verbose=true', '--logLevel=debug' ])
+ #TODO: add capture, html output flags
#TODO: allow casperjs cli options ('--includes='), ?in args, kwargs?
command_line_list.extend( args )
@@ -297,16 +301,15 @@
class Test_01_User( CasperJSTestCase ):
"""TestCase that uses javascript and a headless browser to test dynamic pages.
"""
- #debug = True
def test_10_registration( self ):
"""User registration tests: register new user, logout, attempt bad registrations.
"""
# all keywords will be compiled into a single JSON obj and passed to the server
#self.run_js_script( 'registration-tests.js',
+ # testUser=test_user )
# # this causes a time out in history-panel-tests: why?
# # also: I can't seem to bump the timeout to an error (using a handler) - causes script to hang
# # removing for the sake of bbot
- # testUser=test_user )
self.run_js_script( 'registration-tests.js' )
#TODO:?? could theoretically do db cleanup, checks here with SQLALX
@@ -321,7 +324,6 @@
class Test_02_Tools( CasperJSTestCase ):
"""(Minimal) casperjs tests for tools.
"""
- #debug = True
def test_10_upload( self ):
"""Tests uploading files
"""
@@ -331,7 +333,6 @@
class Test_03_HistoryPanel( CasperJSTestCase ):
"""(Minimal) casperjs tests for tools.
"""
- #debug = True
def test_00_history_panel( self ):
"""Test history panel basics (controls, structure, refresh, history options menu, etc.).
"""
@@ -347,6 +348,8 @@
# ==================================================================== MAIN
if __name__ == '__main__':
log.setLevel( logging.DEBUG )
+ from server_env import log as server_env_log
+ server_env_log.setLevel( logging.DEBUG )
setup_module()
#TODO: server_env config doesn't work with unittest's lame main fn
unittest.main()
diff -r d8009117d5a0af02767c27162a2d5bd3befb9b5d -r f6bc826d0ec20da52746e0703774175e835aee94 test/casperjs/server_env.py
--- a/test/casperjs/server_env.py
+++ b/test/casperjs/server_env.py
@@ -22,6 +22,7 @@
ENV_FILE_DIR = 'GALAXY_TEST_FILE_DIR'
ENV_TOOL_SHED_TEST_FILE = 'GALAXY_TOOL_SHED_TEST_FILE'
ENV_SAVED_FILES_DIR = 'GALAXY_TEST_SAVE' # AKA: twilltestcase.keepOutdir
+ ENV_DEBUG_THESE_TESTS = 'GALAXY_DEBUG_THESE_TESTS'
DEFAULT_PROTOCOL = 'http'
DEFAULT_HOST = 'localhost'
@@ -33,8 +34,7 @@
does not yet exist.
"""
# singleton pattern
- if( ( not cls._instance )
- or ( config ) ):
+ if not cls._instance:
log.debug( 'creating singleton instance of "%s", config: %s', str( cls ), str( config ) )
cls._instance = cls( config )
return cls._instance
@@ -43,60 +43,93 @@
self.config = env_config_dict or {}
self.protocol = self._get_setting_from_config_or_env(
- 'protocol', self.ENV_PROTOCOL, self.DEFAULT_PROTOCOL )
+ 'protocol', self.ENV_PROTOCOL, self.DEFAULT_PROTOCOL ) #TODO: required=True )
self.host = self._get_setting_from_config_or_env(
- 'host', self.ENV_HOST, self.DEFAULT_HOST )
+ 'host', self.ENV_HOST, self.DEFAULT_HOST ) #TODO: required=True )
self.port = self._get_setting_from_config_or_env(
- 'port', self.ENV_PORT, self.DEFAULT_PORT )
+ 'port', self.ENV_PORT, self.DEFAULT_PORT ) #TODO: required=True )
+ #TODO: move these setters/init'rs into a parser dict
self.history_id = self._get_setting_from_config_or_env(
- 'history_id', self.ENV_HISTORY_ID, default=None )
+ 'history_id', self.ENV_HISTORY_ID )
self.file_dir = self._get_setting_from_config_or_env(
- 'file_dir', self.ENV_FILE_DIR, default=None )
-
+ 'file_dir', self.ENV_FILE_DIR )
self.tool_shed_test_file = self._get_setting_from_config_or_env(
- 'tool_shed_test_file', self.ENV_TOOL_SHED_TEST_FILE, default=None )
+ 'tool_shed_test_file', self.ENV_TOOL_SHED_TEST_FILE )
self.shed_tools_dict = self._get_shed_tools_dict()
+ # saved output goes here: test diffs, screenshots, html, etc.
self.saved_output_dir = self._get_setting_from_config_or_env(
- 'saved_output_dir', self.ENV_SAVED_FILES_DIR, default=None )
- self._init_saved_files_dir()
+ 'saved_output_dir', self.ENV_SAVED_FILES_DIR )
+ self._create_saved_output_dir()
- def _get_setting_from_config_or_env( self, config_name, env_name, default=False ):
+ # if a test script (e.g. 'history-panel-tests.js') is listed in this var,
+ # the test will output additional/full debug info
+ self.debug_these_tests = self._get_setting_from_config_or_env(
+ 'debug_these_tests', self.ENV_DEBUG_THESE_TESTS )
+ self._parse_debug_these_tests()
+
+ log.debug( 'server_env: %s', str( self.as_dict() ) )
+
+ def as_dict( self, attributes=None ):
+ if not attributes:
+ #TODO:?? raise to class scope?
+ attributes = [ 'protocol', 'host', 'port', 'history_id', 'file_dir',
+ 'tool_shed_test_file', 'shed_tools_dict', 'saved_output_dir', 'debug_these_tests' ]
+ this_dict = {}
+ for attr_name in attributes:
+ attr_val = getattr( self, attr_name )
+ this_dict[ attr_name ] = attr_val
+ return this_dict
+
+ def _get_setting_from_config_or_env( self, config_name, env_name, default=None ):
"""Try to get a setting from (in order):
TestEnvironment.config, the os env, or some default (if not False).
"""
- #TODO: if falsy value needed, use None - not ideal
- config = self.config.get( config_name, None )
- env = os.environ.get( env_name, None )
- if( ( not ( config or env ) )
- and ( default == False ) ):
- raise AttributeError( '"%s" was not set via config or %s or default' %( config_name, env_name ) )
- return config or env or default
+ config_val = self.config.get( config_name, None )
+ env_val = os.environ.get( env_name, None )
+ return config_val or env_val or default
def _get_shed_tools_dict( self ):
"""Read the shed tools from the tool shed test file if given,
otherwise an empty dict.
"""
+ shed_tools_dict = {}
if self.tool_shed_test_file:
- f = open( self.tool_shed_test_file, 'r' )
- text = f.read()
- f.close()
- return from_json_string( text )
- else:
- return {}
+ try:
+ f = open( self.tool_shed_test_file, 'r' )
+ text = f.read()
+ f.close()
+ shed_tools_dict = from_json_string( text )
+ except Exception, exc:
+ log.error( 'Error reading tool shed test file "%s": %s', self.tool_shed_test_file, exc, exc_info=True )
- def _init_saved_files_dir( self ):
+ return shed_tools_dict
+
+ def _create_saved_output_dir( self ):
"""Set up the desired directory to save test output.
"""
- if self.saved_output_dir > '':
+ if self.saved_output_dir:
try:
- os.makedirs( self.saved_output_dir )
+ if not os.path.exists( self.saved_output_dir ):
+ os.makedirs( self.saved_output_dir )
except Exception, exc:
log.error( 'unable to create saved files directory "%s": %s',
self.saved_output_dir, exc, exc_info=True )
self.saved_output_dir = None
+ def _parse_debug_these_tests( self, delim=',' ):
+ """Simple parser for the list of test scripts on which to set debug=True.
+ """
+ debug_list = []
+ if self.debug_these_tests:
+ try:
+ debug_list = self.debug_these_tests.split( delim )
+ except Exception, exc:
+ log.error( 'unable to parse debug_these_tests "%s": %s',
+ self.debug_these_tests, exc, exc_info=True )
+ self.debug_these_tests = debug_list
+
@property
def url( self ):
"""Builds and returns the url of the test server.
diff -r d8009117d5a0af02767c27162a2d5bd3befb9b5d -r f6bc826d0ec20da52746e0703774175e835aee94 test/casperjs/spaceghost.js
--- a/test/casperjs/spaceghost.js
+++ b/test/casperjs/spaceghost.js
@@ -432,7 +432,10 @@
var returnCode = ( this.test.testResults.failed )?( 2 ):( 0 );
// if --return-json is used: output json and exit
+ //NOTE: used by the test runner to gather JSON test info from stdout
if( this.options.returnJsonOnly ){
+ // echo a string to indicate that tests are complete (used in casperjs_runner.py to stop process)
+ this.echo( '# Tests complete' );
this.outputStateAsJson();
this.exit( returnCode );
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: Automated script to mark repositories as deprecated if no metadata records are associated with the repository, and the repository is older than the specified cutoff date.
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d8009117d5a0/
changeset: d8009117d5a0
user: inithello
date: 2013-03-12 16:29:12
summary: Automated script to mark repositories as deprecated if no metadata records are associated with the repository, and the repository is older than the specified cutoff date.
affected #: 1 file
diff -r 2c56c1e49f288ed53234f485c0f19606d013dd1b -r d8009117d5a0af02767c27162a2d5bd3befb9b5d lib/tool_shed/scripts/deprecate_repositories_without_metadata.py
--- /dev/null
+++ b/lib/tool_shed/scripts/deprecate_repositories_without_metadata.py
@@ -0,0 +1,169 @@
+#!/usr/bin/env python
+
+import os, sys, logging, string, textwrap
+
+new_path = [ os.path.join( os.getcwd(), "lib" ) ]
+new_path.extend( sys.path[1:] )
+sys.path = new_path
+
+log = logging.getLogger()
+log.setLevel( 10 )
+log.addHandler( logging.StreamHandler( sys.stdout ) )
+
+from galaxy import eggs
+import pkg_resources
+pkg_resources.require( "SQLAlchemy >= 0.4" )
+
+import time, ConfigParser, shutil
+from datetime import datetime, timedelta
+from time import strftime
+from optparse import OptionParser
+
+from galaxy.tools import parameters
+from tool_shed.util.shed_util_common import url_join
+import galaxy.webapps.tool_shed.config as tool_shed_config
+import galaxy.webapps.tool_shed.model.mapping
+import sqlalchemy as sa
+from galaxy.model.orm import and_, not_, distinct
+from galaxy.util import send_mail as galaxy_send_mail
+
+assert sys.version_info[:2] >= ( 2, 4 )
+
+def build_citable_url( host, repository ):
+ return url_join( host, 'view', repository.user.username, repository.name )
+
+def main():
+ '''
+ Script to deprecate any repositories that are older than n days, and have been empty since creation.
+ '''
+ parser = OptionParser()
+ parser.add_option( "-d", "--days", dest="days", action="store", type="int", help="number of days (14)", default=14 )
+ parser.add_option( "-i", "--info_only", action="store_true", dest="info_only", help="info about the requested action", default=False )
+ parser.add_option( "-v", "--verbose", action="store_true", dest="verbose", help="verbose mode, print the name of each repository", default=False )
+ ( options, args ) = parser.parse_args()
+ ini_file = args[0]
+ config_parser = ConfigParser.ConfigParser( {'here':os.getcwd()} )
+ config_parser.read( ini_file )
+ config_dict = {}
+ for key, value in config_parser.items( "app:main" ):
+ config_dict[key] = value
+ config = tool_shed_config.Configuration( **config_dict )
+
+ app = DeprecateRepositoriesApplication( config )
+ cutoff_time = datetime.utcnow() - timedelta( days=options.days )
+ now = strftime( "%Y-%m-%d %H:%M:%S" )
+ print "\n####################################################################################"
+ print "# %s - Handling stuff older than %i days" % ( now, options.days )
+
+ if options.info_only:
+ print "# Displaying info only ( --info_only )"
+
+ deprecate_repositories( app, cutoff_time, days=options.days, info_only=options.info_only, verbose=options.verbose )
+
+def send_mail_to_owner( app, name, owner, email, repositories_deprecated, days=14 ):
+ '''
+ Sends an email to the owner of the provided repository.
+ '''
+ smtp_server = app.config.get( 'smtp_server', None )
+ from_address = app.config.get( 'email_from', None )
+ # Since there is no way to programmatically determine the URL for the tool shed from the .ini file, this method requires that
+ # an environment variable named TOOL_SHED_CANONICAL_URL be set, pointing to the tool shed that is being checked.
+ url = os.environ.get( 'TOOL_SHED_CANONICAL_URL', None )
+ if None in [ smtp_server, from_address ]:
+ print '# Mail not configured, not sending email to repository owner.'
+ return
+ elif url is None:
+ print '# Environment variable TOOL_SHED_CANONICAL_URL not set, not sending email to repository owner.'
+ return
+ subject = "Regarding your tool shed repositories at %s" % url
+ message_body_template = 'The tool shed automated repository checker has discovered that one or more of your repositories hosted ' + \
+ 'at this tool shed url ${url} have remained empty for over ${days} days, so they have been marked as deprecated. If you have plans ' + \
+ 'for these repositories, you can mark them as un-deprecated at any time.'
+ message_template = string.Template( message_body_template )
+ body = '\n'.join( textwrap.wrap( message_template.safe_substitute( days=days, url=url ), width=95 ) )
+ body += '\n\n'
+ body += 'Repositories that were deprecated:\n'
+ body += '\n'.join( [ build_citable_url( url, repository ) for repository in repositories_deprecated ] )
+ try:
+ galaxy_send_mail( from_address, repository.user.email, subject, body, app.config )
+ print "# An email has been sent to %s, the owner of %s." % ( repository.user.username, ', '.join( [ repository.name for repository in repositories_deprecated ] ) )
+ return True
+ except Exception, e:
+ print "# An error occurred attempting to send email: %s" % str( e )
+ return False
+
+def deprecate_repositories( app, cutoff_time, days=14, info_only=False, verbose=False ):
+ # This method will get a list of repositories that were created on or before cutoff_time, but have never
+ # had any metadata records associated with them. Then it will iterate through that list and deprecate the
+ # repositories, sending an email to each repository owner.
+ dataset_count = 0
+ disk_space = 0
+ start = time.time()
+ repository_ids_to_not_check = []
+ # Get a unique list of repository ids from the repository_metadata table. Any repository ID found in this table is not
+ # empty, and will not be checked.
+ metadata_records = sa.select( [ distinct( app.model.RepositoryMetadata.table.c.repository_id ) ],
+ from_obj=app.model.RepositoryMetadata.table ) \
+ .execute()
+ for metadata_record in metadata_records:
+ repository_ids_to_not_check.append( metadata_record.repository_id )
+ # Get the repositories that are A) not present in the above list, and b) older than the specified time.
+ # This will yield a list of repositories that have been created more than n days ago, but never populated.
+ repository_query = sa.select( [ app.model.Repository.table.c.id ],
+ whereclause = and_( app.model.Repository.table.c.create_time < cutoff_time,
+ app.model.Repository.table.c.deprecated == False,
+ app.model.Repository.table.c.deleted == False,
+ not_( app.model.Repository.table.c.id.in_( repository_ids_to_not_check ) ) ),
+ from_obj = [ app.model.Repository.table ] )
+ query_result = repository_query.execute()
+ repositories = []
+ repositories_by_owner = {}
+ repository_ids = [ row.id for row in query_result ]
+ # Iterate through the list of repository ids for empty repositories and deprecate them unless info_only is set.
+ for repository_id in repository_ids:
+ repository = app.sa_session.query( app.model.Repository ) \
+ .filter( app.model.Repository.table.c.id == repository_id ) \
+ .one()
+ owner = repository.user
+ if info_only:
+ print '# Repository %s owned by %s would have been deprecated, but info_only was set.' % ( repository.name, repository.user.username )
+ else:
+ if verbose:
+ print '# Deprecating repository %s owned by %s.' % ( repository.name, owner.username )
+ if owner.username not in repositories_by_owner:
+ repositories_by_owner[ owner.username ] = dict( owner=owner, repositories=[] )
+ repositories_by_owner[ owner.username ][ 'repositories' ].append( repository )
+ repositories.append( repository )
+ # Send an email to each repository owner, listing the repositories that were deprecated.
+ for repository_owner in repositories_by_owner:
+ for repository in repositories_by_owner[ repository_owner ][ 'repositories' ]:
+ repository.deprecated = True
+ app.sa_session.add( repository )
+ app.sa_session.flush()
+ owner = repositories_by_owner[ repository_owner ][ 'owner' ]
+ send_mail_to_owner( app, repository.name, owner.username, owner.email, repositories_by_owner[ repository_owner ][ 'repositories' ], days )
+ stop = time.time()
+ print '# Deprecated %d repositories.' % len( repositories )
+ print "# Elapsed time: ", stop - start
+ print "####################################################################################"
+
+class DeprecateRepositoriesApplication( object ):
+ """Encapsulates the state of a Universe application"""
+ def __init__( self, config ):
+ if config.database_connection is False:
+ config.database_connection = "sqlite:///%s?isolation_level=IMMEDIATE" % config.database
+ # Setup the database engine and ORM
+ self.model = galaxy.webapps.tool_shed.model.mapping.init( config.file_path, config.database_connection, engine_options={}, create_tables=False )
+ self.config = config
+ @property
+ def sa_session( self ):
+ """
+ Returns a SQLAlchemy session -- currently just gets the current
+ session from the threadlocal session context, but this is provided
+ to allow migration toward a more SQLAlchemy 0.4 style of use.
+ """
+ return self.model.context.current
+ def shutdown( self ):
+ pass
+
+if __name__ == "__main__": main()
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
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2c56c1e49f28/
changeset: 2c56c1e49f28
user: greg
date: 2013-03-12 15:46:15
summary: Handle tool shed repositories that contain only tools that should not be displayed in the Galaxy tool panel from those that contain tools that should be displayed in the Galaxy tool panel appropriately. Selecting a tool pnale section is no longer allowed for repositories that do not contany any tools that should be displayed there. This behavior exists when installing or resinstalling repositories into Galaxy.
affected #: 14 files
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -3217,6 +3217,14 @@
return 'tools' in self.metadata
return False
@property
+ def includes_tools_for_display_in_tool_panel( self ):
+ if self.includes_tools:
+ tool_dicts = self.metadata[ 'tools' ]
+ for tool_dict in tool_dicts:
+ if tool_dict.get( 'add_to_tool_panel', True ):
+ return True
+ return False
+ @property
def includes_tool_dependencies( self ):
if self.metadata:
return 'tool_dependencies' in self.metadata
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
--- a/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
+++ b/lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
@@ -89,7 +89,8 @@
if repository.uninstalled:
# Since we're reinstalling the repository we need to find the latest changeset revision to which it can be updated so that we
# can reset the metadata if necessary. This will ensure that information about repository dependencies and tool dependencies
- # will be current. Only allow selecting a different section in the tool panel if the repository was uninstalled.
+ # will be current. Only allow selecting a different section in the tool panel if the repository was uninstalled and it contained
+ # tools that should be displayed in the tool panel.
changeset_revision_dict = shed_util.get_update_to_changeset_revision_and_ctx_rev( trans, repository )
current_changeset_revision = changeset_revision_dict.get( 'changeset_revision', None )
current_ctx_rev = changeset_revision_dict.get( 'ctx_rev', None )
@@ -213,7 +214,7 @@
repository_install_dir = None
errors = ''
if params.get( 'deactivate_or_uninstall_repository_button', False ):
- if tool_shed_repository.includes_tools:
+ if tool_shed_repository.includes_tools_for_display_in_tool_panel:
# Handle tool panel alterations.
shed_util.remove_from_tool_panel( trans, tool_shed_repository, shed_tool_conf, uninstall=remove_from_disk_checked )
if tool_shed_repository.includes_data_managers:
@@ -944,6 +945,8 @@
tool_panel_section_keys = []
# One or more repositories may include tools, but not necessarily all of them.
includes_tools = util.string_as_bool( kwd.get( 'includes_tools', False ) )
+ # Some tools should not be displayed in the tool panel (e.g., DataManager tools and datatype converters).
+ includes_tools_for_display_in_tool_panel = util.string_as_bool( kwd.get( 'includes_tools_for_display_in_tool_panel', 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 ) )
@@ -960,12 +963,13 @@
response.close()
repo_information_dict = json.from_json_string( raw_text )
includes_tools = util.string_as_bool( repo_information_dict.get( 'includes_tools', False ) )
+ includes_tools_for_display_in_tool_panel = util.string_as_bool( repo_information_dict.get( 'includes_tools_for_display_in_tool_panel', False ) )
has_repository_dependencies = util.string_as_bool( repo_information_dict.get( 'has_repository_dependencies', False ) )
includes_tool_dependencies = util.string_as_bool( repo_information_dict.get( 'includes_tool_dependencies', False ) )
encoded_repo_info_dicts = util.listify( repo_information_dict.get( 'repo_info_dicts', [] ) )
repo_info_dicts = [ encoding_util.tool_shed_decode( encoded_repo_info_dict ) for encoded_repo_info_dict in encoded_repo_info_dicts ]
- if ( ( not includes_tools and not has_repository_dependencies ) and kwd.get( 'select_shed_tool_panel_config_button', False ) ) or \
- ( ( includes_tools or has_repository_dependencies ) and kwd.get( 'select_tool_panel_section_button', False ) ):
+ if ( ( not includes_tools_for_display_in_tool_panel and not has_repository_dependencies ) and kwd.get( 'select_shed_tool_panel_config_button', False ) ) or \
+ ( ( includes_tools_for_display_in_tool_panel or has_repository_dependencies ) and kwd.get( 'select_tool_panel_section_button', False ) ):
install_repository_dependencies = CheckboxField.is_checked( install_repository_dependencies )
if includes_tool_dependencies:
install_tool_dependencies = CheckboxField.is_checked( install_tool_dependencies )
@@ -992,7 +996,7 @@
status='error' ) )
if created_or_updated_tool_shed_repositories:
# Handle contained tools.
- if includes_tools and ( new_tool_panel_section or tool_panel_section ):
+ if includes_tools_for_display_in_tool_panel 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 )
@@ -1021,6 +1025,7 @@
for tsr in created_or_updated_tool_shed_repositories:
tool_panel_section_keys.append( tool_panel_section_key )
new_kwd = dict( includes_tools=includes_tools,
+ includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
has_repository_dependencies=has_repository_dependencies,
install_repository_dependencies=install_repository_dependencies,
includes_tool_dependencies=includes_tool_dependencies,
@@ -1108,10 +1113,11 @@
install_tool_dependencies_check_box = CheckboxField( 'install_tool_dependencies', checked=install_tool_dependencies_check_box_checked )
# Handle repository dependencies check box.
install_repository_dependencies_check_box = CheckboxField( 'install_repository_dependencies', checked=True )
- if includes_tools or has_repository_dependencies:
+ if includes_tools_for_display_in_tool_panel or has_repository_dependencies:
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_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
includes_tool_dependencies=includes_tool_dependencies,
install_tool_dependencies_check_box=install_tool_dependencies_check_box,
has_repository_dependencies=has_repository_dependencies,
@@ -1130,6 +1136,7 @@
return trans.fill_template( '/admin/tool_shed_repository/select_shed_tool_panel_config.mako',
encoded_repo_info_dicts=encoded_repo_info_dicts,
includes_tools=includes_tools,
+ includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
includes_tool_dependencies=includes_tool_dependencies,
install_tool_dependencies_check_box=install_tool_dependencies_check_box,
has_repository_dependencies=has_repository_dependencies,
@@ -1169,7 +1176,7 @@
metadata = tool_shed_repository.metadata
# Keep track of tool dependencies defined for the current repository or those defined for any of it's repository dependencies.
includes_tool_dependencies = tool_shed_repository.includes_tool_dependencies
- if tool_shed_repository.includes_tools:
+ if tool_shed_repository.includes_tools_for_display_in_tool_panel:
# Handle the selected tool panel location for loading tools included in the tool shed repository.
tool_section, new_tool_panel_section, tool_panel_section_key = \
shed_util.handle_tool_panel_selection( trans=trans,
@@ -1239,6 +1246,7 @@
encoded_repository_ids = [ trans.security.encode_id( r.id ) for r in created_or_updated_tool_shed_repositories ]
new_kwd = dict( includes_tool_dependencies=includes_tool_dependencies,
includes_tools=tool_shed_repository.includes_tools,
+ includes_tools_for_display_in_tool_panel=tool_shed_repository.includes_tools_for_display_in_tool_panel,
install_tool_dependencies=install_tool_dependencies,
repo_info_dicts=filtered_repo_info_dicts,
message=message,
@@ -1316,6 +1324,7 @@
includes_data_managers = updated_repo_info_dict.get( 'includes_data_managers', False )
includes_datatypes = updated_repo_info_dict.get( 'includes_datatypes', False )
includes_tools = updated_repo_info_dict.get( 'includes_tools', False )
+ includes_tools_for_display_in_tool_panel = updated_repo_info_dict.get( 'includes_tools_for_display_in_tool_panel', False )
includes_workflows = updated_repo_info_dict.get( 'includes_workflows', False )
has_repository_dependencies = updated_repo_info_dict.get( 'has_repository_dependencies', False )
includes_tool_dependencies = updated_repo_info_dict.get( 'includes_tool_dependencies', False )
@@ -1327,6 +1336,7 @@
includes_datatypes = False
includes_tool_dependencies = False
includes_tools = False
+ includes_tools_for_display_in_tool_panel = False
includes_workflows = False
readme_files_dict = None
tool_dependencies = None
@@ -1337,6 +1347,12 @@
includes_datatypes = True
if 'tools' in metadata:
includes_tools = True
+ # Handle includes_tools_for_display_in_tool_panel.
+ tool_dicts = metadata[ 'tools' ]
+ for tool_dict in tool_dicts:
+ if tool_dict.get( 'add_to_tool_panel', True ):
+ includes_tools_for_display_in_tool_panel = True
+ break
if 'tool_dependencies' in metadata:
includes_tool_dependencies = True
if 'workflows' in metadata:
@@ -1365,7 +1381,7 @@
has_repository_dependencies = True
else:
has_repository_dependencies = False
- if includes_tools:
+ if includes_tools_for_display_in_tool_panel:
# Get the location in the tool panel in which the tools were originally loaded.
if 'tool_panel_section' in metadata:
tool_panel_dict = metadata[ 'tool_panel_section' ]
@@ -1428,6 +1444,7 @@
includes_data_managers=includes_data_managers,
includes_datatypes=includes_datatypes,
includes_tools=includes_tools,
+ includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
includes_tool_dependencies=includes_tool_dependencies,
includes_workflows=includes_workflows,
has_repository_dependencies=has_repository_dependencies,
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b lib/galaxy/webapps/tool_shed/controllers/repository.py
--- a/lib/galaxy/webapps/tool_shed/controllers/repository.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/repository.py
@@ -928,10 +928,12 @@
includes_data_managers = False
includes_datatypes = False
includes_tools = False
+ includes_tools_for_display_in_tool_panel = False
has_repository_dependencies = False
includes_tool_dependencies = False
includes_workflows = False
if repository_metadata:
+ includes_tools_for_display_in_tool_panel = repository_metadata.includes_tools_for_display_in_tool_panel
metadata = repository_metadata.metadata
if metadata:
if 'data_manager' in metadata:
@@ -946,7 +948,7 @@
has_repository_dependencies = True
if 'workflows' in metadata:
includes_workflows = True
- return includes_data_managers, includes_datatypes, includes_tools, includes_tool_dependencies, has_repository_dependencies, includes_workflows
+ return includes_data_managers, includes_datatypes, includes_tools, includes_tools_for_display_in_tool_panel, includes_tool_dependencies, has_repository_dependencies, includes_workflows
params = util.Params( kwd )
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
@@ -958,7 +960,7 @@
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
trans.security.encode_id( repository.id ),
changeset_revision )
- includes_data_managers, includes_datatypes, includes_tools, includes_tool_dependencies, has_repository_dependencies, includes_workflows = \
+ includes_data_managers, includes_datatypes, includes_tools, includes_tools_for_display_in_tool_panel, includes_tool_dependencies, has_repository_dependencies, includes_workflows = \
has_galaxy_utilities( repository_metadata )
repo_dir = repository.repo_path( trans.app )
repo = hg.repository( suc.get_configured_ui(), repo_dir )
@@ -971,6 +973,7 @@
includes_data_managers=includes_data_managers,
includes_datatypes=includes_datatypes,
includes_tools=includes_tools,
+ includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
includes_tool_dependencies=includes_tool_dependencies,
has_repository_dependencies=has_repository_dependencies,
includes_workflows=includes_workflows )
@@ -995,7 +998,7 @@
trans.security.encode_id( repository.id ),
changeset_hash )
if update_to_repository_metadata:
- includes_data_managers, includes_datatypes, includes_tools, includes_tool_dependencies, has_repository_dependencies, includes_workflows = \
+ includes_data_managers, includes_datatypes, includes_tools, includes_tools_for_display_in_tool_panel, includes_tool_dependencies, has_repository_dependencies, includes_workflows = \
has_galaxy_utilities( update_to_repository_metadata )
# We found a RepositoryMetadata record.
if changeset_hash == repository.tip( trans.app ):
@@ -1012,6 +1015,7 @@
update_dict[ 'includes_data_managers' ] = includes_data_managers
update_dict[ 'includes_datatypes' ] = includes_datatypes
update_dict[ 'includes_tools' ] = includes_tools
+ update_dict[ 'includes_tools_for_display_in_tool_panel' ] = includes_tools_for_display_in_tool_panel
update_dict[ 'includes_tool_dependencies' ] = includes_tool_dependencies
update_dict[ 'includes_workflows' ] = includes_workflows
update_dict[ 'has_repository_dependencies' ] = has_repository_dependencies
@@ -1115,6 +1119,7 @@
a local Galaxy instance.
"""
includes_tools = False
+ includes_tools_for_display_in_tool_panel = False
has_repository_dependencies = False
includes_tool_dependencies = False
repo_info_dicts = []
@@ -1127,6 +1132,8 @@
if not includes_tools:
if 'tools' in metadata:
includes_tools = True
+ if not includes_tools_for_display_in_tool_panel:
+ includes_tools_for_display_in_tool_panel = repository_metadata.includes_tools_for_display_in_tool_panel
if not has_repository_dependencies:
if 'repository_dependencies' in metadata:
has_repository_dependencies = True
@@ -1148,6 +1155,7 @@
repository_dependencies=None )
repo_info_dicts.append( encoding_util.tool_shed_encode( repo_info_dict ) )
return dict( includes_tools=includes_tools,
+ includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
has_repository_dependencies=has_repository_dependencies,
includes_tool_dependencies=includes_tool_dependencies,
repo_info_dicts=repo_info_dicts )
@@ -1261,6 +1269,7 @@
includes_data_managers = False
includes_datatypes = False
includes_tools = False
+ includes_tools_for_display_in_tool_panel = False
includes_workflows = False
readme_files_dict = None
metadata = repository_metadata.metadata
@@ -1271,6 +1280,12 @@
includes_datatypes = True
if 'tools' in metadata:
includes_tools = True
+ # Handle includes_tools_for_display_in_tool_panel.
+ tool_dicts = metadata[ 'tools' ]
+ for tool_dict in tool_dicts:
+ if tool_dict.get( 'includes_tools_for_display_in_tool_panel', False ):
+ includes_tools_for_display_in_tool_panel = True
+ break
if 'workflows' in metadata:
includes_workflows = True
readme_files_dict = suc.build_readme_files_dict( metadata )
@@ -1289,6 +1304,7 @@
return dict( includes_data_managers=includes_data_managers,
includes_datatypes=includes_datatypes,
includes_tools=includes_tools,
+ includes_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel,
has_repository_dependencies=has_repository_dependencies,
includes_tool_dependencies=includes_tool_dependencies,
includes_workflows=includes_workflows,
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b lib/galaxy/webapps/tool_shed/model/__init__.py
--- a/lib/galaxy/webapps/tool_shed/model/__init__.py
+++ b/lib/galaxy/webapps/tool_shed/model/__init__.py
@@ -215,6 +215,14 @@
self.includes_tools = includes_tools
self.includes_tool_dependencies = includes_tool_dependencies
self.includes_workflows = includes_workflows
+ @property
+ def includes_tools_for_display_in_tool_panel( self ):
+ if self.metadata:
+ tool_dicts = self.metadata.get( 'tools', [] )
+ for tool_dict in tool_dicts:
+ if tool_dict.get( 'add_to_tool_panel', True ):
+ return True
+ return False
def as_dict( self, value_mapper=None ):
return self.get_api_value( view='element', value_mapper=value_mapper )
def get_api_value( self, view='collection', value_mapper=None ):
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b lib/tool_shed/util/shed_util.py
--- a/lib/tool_shed/util/shed_util.py
+++ b/lib/tool_shed/util/shed_util.py
@@ -28,7 +28,7 @@
shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository )
repository.deleted = False
repository.status = trans.model.ToolShedRepository.installation_status.INSTALLED
- if repository.includes_tools:
+ if repository.includes_tools_for_display_in_tool_panel:
metadata = repository.metadata
repository_tools_tups = suc.get_repository_tools_tups( trans.app, metadata )
# Reload tools into the appropriate tool panel section.
@@ -963,6 +963,7 @@
includes_data_managers = update_dict.get( 'includes_data_managers', False )
includes_datatypes = update_dict.get( 'includes_datatypes', False )
includes_tools = update_dict.get( 'includes_tools', False )
+ includes_tools_for_display_in_tool_panel = update_dict.get( 'includes_tools_for_display_in_tool_panel', False )
includes_tool_dependencies = update_dict.get( 'includes_tool_dependencies', False )
includes_workflows = update_dict.get( 'includes_workflows', False )
has_repository_dependencies = update_dict.get( 'has_repository_dependencies', False )
@@ -972,6 +973,7 @@
changeset_revision_dict[ 'includes_data_managers' ] = includes_data_managers
changeset_revision_dict[ 'includes_datatypes' ] = includes_datatypes
changeset_revision_dict[ 'includes_tools' ] = includes_tools
+ changeset_revision_dict[ 'includes_tools_for_display_in_tool_panel' ] = includes_tools_for_display_in_tool_panel
changeset_revision_dict[ 'includes_tool_dependencies' ] = includes_tool_dependencies
changeset_revision_dict[ 'includes_workflows' ] = includes_workflows
changeset_revision_dict[ 'has_repository_dependencies' ] = has_repository_dependencies
@@ -982,6 +984,7 @@
changeset_revision_dict[ 'includes_data_managers' ] = False
changeset_revision_dict[ 'includes_datatypes' ] = False
changeset_revision_dict[ 'includes_tools' ] = False
+ changeset_revision_dict[ 'includes_tools_for_display_in_tool_panel' ] = False
changeset_revision_dict[ 'includes_tool_dependencies' ] = False
changeset_revision_dict[ 'includes_workflows' ] = False
changeset_revision_dict[ 'has_repository_dependencies' ] = False
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
--- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
+++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
@@ -59,7 +59,7 @@
<div class="toolParamHelp" style="clear: both;">
* The repository and all of it's contents will remain on disk.
</div>
- %if repository.includes_tools:
+ %if repository.includes_tools_for_display_in_tool_panel:
<div class="toolParamHelp" style="clear: both;">
* The repository's tools will not be loaded into the tool panel.
</div>
@@ -87,7 +87,7 @@
<div class="toolParamHelp" style="clear: both;">
* The repository and all of it's contents will be removed from disk.
</div>
- %if repository.includes_tools:
+ %if repository.includes_tools_for_display_in_tool_panel:
<div class="toolParamHelp" style="clear: both;">
* The repository's tool tag sets will be removed from the tool config file in which they are defined.
</div>
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b 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
@@ -66,7 +66,7 @@
%else:
<input type="hidden" name="shed_tool_conf" value="${shed_tool_conf}"/>
%endif
- %if includes_tools:
+ %if includes_tools_for_display_in_tool_panel:
<div style="clear: both"></div><div class="form-row">
${no_changes_check_box.get_html()}
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b templates/admin/tool_shed_repository/select_shed_tool_panel_config.mako
--- a/templates/admin/tool_shed_repository/select_shed_tool_panel_config.mako
+++ b/templates/admin/tool_shed_repository/select_shed_tool_panel_config.mako
@@ -60,7 +60,7 @@
</div><div class="toolForm"><div class="toolFormBody">
- <form name="select_shed_tool_panel_config" id="select_shed_tool_panel_config" 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" >
+ <form name="select_shed_tool_panel_config" id="select_shed_tool_panel_config" 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_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel, includes_tool_dependencies=includes_tool_dependencies )}" method="post" ><div style="clear: both"></div><% readme_files_dict = containers_dict.get( 'readme_files', None ) %>
%if readme_files_dict:
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b 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
@@ -60,7 +60,7 @@
</div><div class="toolForm"><div class="toolFormBody">
- <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" >
+ <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_tools_for_display_in_tool_panel=includes_tools_for_display_in_tool_panel, includes_tool_dependencies=includes_tool_dependencies )}" method="post" ><div style="clear: both"></div><% readme_files_dict = containers_dict.get( 'readme_files', None ) %>
%if readme_files_dict:
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -661,7 +661,7 @@
def install_repository( self, name, owner, category_name, install_tool_dependencies=False,
install_repository_dependencies=True, changeset_revision=None,
strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[],
- post_submit_strings_displayed=[], new_tool_panel_section=None, includes_tools=True,
+ post_submit_strings_displayed=[], new_tool_panel_section=None, includes_tools_for_display_in_tool_panel=True,
**kwd ):
self.browse_tool_shed( url=self.url )
self.browse_category( test_db_util.get_category_by_name( category_name ) )
@@ -692,7 +692,7 @@
kwd[ 'shed_tool_conf' ] = self.shed_tool_conf
if new_tool_panel_section:
kwd[ 'new_tool_panel_section' ] = new_tool_panel_section
- if includes_tools:
+ if includes_tools_for_display_in_tool_panel:
self.submit_form( 1, 'select_tool_panel_section_button', **kwd )
self.check_for_strings( post_submit_strings_displayed, strings_not_displayed )
else:
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b test/tool_shed/functional/test_1060_install_repository_with_workflow.py
--- a/test/tool_shed/functional/test_1060_install_repository_with_workflow.py
+++ b/test/tool_shed/functional/test_1060_install_repository_with_workflow.py
@@ -137,7 +137,7 @@
common.test_user_1_name,
'Test 0060 Workflow Features',
install_tool_dependencies=False,
- includes_tools=False )
+ includes_tools_for_display_in_tool_panel=False )
def test_0030_import_workflow_from_installed_repository( self ):
'''Import the workflow from the installed repository and verify that it appears in the list of all workflows.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( workflow_repository_name, common.test_user_1_name )
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
--- a/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
+++ b/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
@@ -252,7 +252,7 @@
self.install_repository( emboss_datatypes_repository_name,
common.test_user_1_name,
category_name,
- includes_tools=False )
+ includes_tools_for_display_in_tool_panel=False )
installed_repositories = [ ( emboss_datatypes_repository_name, common.test_user_1_name ),
( freebayes_repository_name, common.test_user_1_name ) ]
uninstalled_repositories = [ ( emboss_repository_name, common.test_user_1_name ),
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
--- a/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
+++ b/test/tool_shed/functional/test_1100_install_repository_with_complex_dependencies.py
@@ -233,7 +233,7 @@
install_tool_dependencies=True,
preview_strings_displayed=preview_strings_displayed,
post_submit_strings_displayed=[ base_repository.name, tool_repository.name, 'new' ],
- includes_tools=True )
+ includes_tools_for_display_in_tool_panel=True )
def test_0050_verify_installed_repositories( self ):
'''Verify that the installed repositories are displayed properly.'''
base_repository = test_db_util.get_installed_repository_by_name_owner( bwa_base_repository_name, common.test_user_1_name )
diff -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 -r 2c56c1e49f288ed53234f485c0f19606d013dd1b test/tool_shed/functional/test_1110_install_repository_with_invalid_repository_dependency.py
--- a/test/tool_shed/functional/test_1110_install_repository_with_invalid_repository_dependency.py
+++ b/test/tool_shed/functional/test_1110_install_repository_with_invalid_repository_dependency.py
@@ -182,6 +182,6 @@
install_repository_dependencies=True,
preview_strings_displayed=preview_strings_displayed,
post_submit_strings_displayed=[ repository.name, repository.name, 'new' ],
- includes_tools=True )
+ includes_tools_for_display_in_tool_panel=True )
repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
self.display_installed_repository_manage_page( repository, strings_not_displayed=[ 'Repository dependencies' ] )
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: carlfeberhard: history panel: have 'new' state HDAs display their body properly
by commits-noreply@bitbucket.org 12 Mar '13
by commits-noreply@bitbucket.org 12 Mar '13
12 Mar '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/86411cd12e2f/
changeset: 86411cd12e2f
user: carlfeberhard
date: 2013-03-12 15:42:41
summary: history panel: have 'new' state HDAs display their body properly
affected #: 3 files
diff -r 6ea891cafbbb7f9435887ca86b0823e1b8709882 -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -358,6 +358,7 @@
//TODO: not a fan of this dispatch
switch( this.model.get( 'state' ) ){
case HistoryDatasetAssociation.STATES.NEW :
+ this._render_body_new( body );
break;
case HistoryDatasetAssociation.STATES.NOT_VIEWABLE :
this._render_body_not_viewable( body );
@@ -400,12 +401,21 @@
this._setUpBehaviors( body );
},
+ /** Render a new dataset - this should be a transient state that's never shown
+ * in case it does tho, we'll make sure there's some information here
+ * @param {jQuery} parent DOM to which to append this body
+ */
+ _render_body_new : function( parent ){
+ var newMsg = 'This is a new dataset and not all of its data are available yet';
+ parent.append( $( '<div>' + _l( newMsg ) + '</div>' ) );
+ },
+
/** Render inaccessible, not-owned by curr user.
* @param {jQuery} parent DOM to which to append this body
*/
_render_body_not_viewable : function( parent ){
//TODO: revisit - still showing display, edit, delete (as common) - that CAN'T be right
- parent.append( $( '<div>' + _l( 'You do not have permission to view dataset' ) + '.</div>' ) );
+ parent.append( $( '<div>' + _l( 'You do not have permission to view dataset' ) + '</div>' ) );
},
/** Render an HDA still being uploaded.
@@ -419,7 +429,7 @@
* @param {jQuery} parent DOM to which to append this body
*/
_render_body_queued : function( parent ){
- parent.append( $( '<div>' + _l( 'Job is waiting to run' ) + '.</div>' ) );
+ parent.append( $( '<div>' + _l( 'Job is waiting to run' ) + '</div>' ) );
parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers ));
},
@@ -427,7 +437,7 @@
* @param {jQuery} parent DOM to which to append this body
*/
_render_body_paused: function( parent ){
- parent.append( $( '<div>' + _l( 'Job is paused. Use the history menu to resume' ) + '.</div>' ) );
+ parent.append( $( '<div>' + _l( 'Job is paused. Use the history menu to resume' ) + '</div>' ) );
parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers ));
},
@@ -435,7 +445,7 @@
* @param {jQuery} parent DOM to which to append this body
*/
_render_body_running : function( parent ){
- parent.append( '<div>' + _l( 'Job is currently running' ) + '.</div>' );
+ parent.append( '<div>' + _l( 'Job is currently running' ) + '</div>' );
parent.append( this._render_primaryActionButtons( this.defaultPrimaryActionButtonRenderers ));
},
diff -r 6ea891cafbbb7f9435887ca86b0823e1b8709882 -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 static/style/base.less
--- a/static/style/base.less
+++ b/static/style/base.less
@@ -1650,6 +1650,15 @@
}
}
+div.historyItem-new {
+ .state-icon {
+ .fa-icon();
+ &:before {
+ content: "\f071";
+ }
+ }
+}
+
// Special case for showing the spinner but not changing the background
div.historyItemTitleBar.spinner .state-icon {
background: url(data_running.gif) 0 1px no-repeat !important;
diff -r 6ea891cafbbb7f9435887ca86b0823e1b8709882 -r 86411cd12e2f591f6f6f7502a8481d832bcf56c0 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1133,6 +1133,7 @@
div.historyItem-queued{background:#eeeeee;}
div.historyItem-noPermission{filter:alpha(opacity=60);-moz-opacity:.60;opacity:.60;}
div.historyItem-paused{background:#d9edf7;}div.historyItem-paused .state-icon{font-family:FontAwesome;font-size:1.1666666666666667em;background-image:none !important;background-position:0% 0%;background-repeat:repeat;}div.historyItem-paused .state-icon:before{content:"\f04c";}
+div.historyItem-new .state-icon{font-family:FontAwesome;font-size:1.1666666666666667em;background-image:none !important;background-position:0% 0%;background-repeat:repeat;}div.historyItem-new .state-icon:before{content:"\f071";}
div.historyItemTitleBar.spinner .state-icon{background:url(data_running.gif) 0 1px no-repeat !important;}
div.historyItemButtons{float:right;}
div.historyItemBody div{padding-top:2px;}
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