1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/facb9f9d2ee4/
Changeset: facb9f9d2ee4
User: jmchilton
Date: 2013-11-19 04:26:29
Summary: Re-fix tool API for uploads coming through nginx.
Give tools.get_incoming_value a chance to mangle all keys and see if they appear in some other format. Thanks to @natefoo for detecting the problem, determining the source of the error, and describing the exact path through the code - i.e. doing all the work.
Affected #: 1 file
diff -r b0535b4864b4bf542e31af7acc027fcbb5a00a54 -r facb9f9d2ee4d614d21e4fc1a4a6d99f2668349a lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -2083,19 +2083,11 @@
if any_group_errors:
errors[input.name] = group_errors
else:
- if key not in incoming \
- and "__force_update__" + key not in incoming:
- # No new value provided, and we are only updating, so keep
- # the old value (which should already be in the state) and
- # preserve the old error message.
- pass
- else:
- incoming_value = get_incoming_value( incoming, key, None )
- value, error = check_param( trans, input, incoming_value, context, source=source )
- # If a callback was provided, allow it to process the value
- if error:
- errors[ input.name ] = error
- state[ input.name ] = value
+ incoming_value = get_incoming_value( incoming, key, None )
+ value, error = check_param( trans, input, incoming_value, context, source=source )
+ if error:
+ errors[ input.name ] = error
+ state[ input.name ] = value
return errors
def update_state( self, trans, inputs, state, incoming, source='html', prefix="", context=None,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b0535b4864b4/
Changeset: b0535b4864b4
User: guerler
Date: 2013-11-18 22:02:41
Summary: Toolshed: Fix grids
Affected #: 2 files
diff -r 32acc00ca229951afbd659281f57d93a47bcab06 -r b0535b4864b4bf542e31af7acc027fcbb5a00a54 templates/webapps/tool_shed/category/grid.mako
--- a/templates/webapps/tool_shed/category/grid.mako
+++ b/templates/webapps/tool_shed/category/grid.mako
@@ -6,6 +6,7 @@
## Render grid header.
## TODO: This is very similar to this directory's valid_grid.mako, so see if we can re-use this code in a better way.
<%def name="render_grid_header( grid, repo_grid, render_title=True)">
+ ${init()}
<div class="grid-header">
%if render_title:
${grid_title()}
diff -r 32acc00ca229951afbd659281f57d93a47bcab06 -r b0535b4864b4bf542e31af7acc027fcbb5a00a54 templates/webapps/tool_shed/category/valid_grid.mako
--- a/templates/webapps/tool_shed/category/valid_grid.mako
+++ b/templates/webapps/tool_shed/category/valid_grid.mako
@@ -5,6 +5,7 @@
## Render grid header.
<%def name="render_grid_header( grid, repo_grid, render_title=True)">
+ ${init()}
<div class="grid-header">
%if render_title:
${grid_title()}
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a0120448a28e/
Changeset: a0120448a28e
User: carlfeberhard
Date: 2013-11-18 18:39:52
Summary: History panel: ensure tooltip deletion on hda view removal, add class selectors for primary action buttons; pack scripts
Affected #: 4 files
diff -r 3ebc0f5c4486cc5c207882bcea819018d23b2bf4 -r a0120448a28eeda50a0476a6d46da74ad3afa484 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -149,8 +149,8 @@
}
var displayBtnData = {
- icon_class : 'display',
- target : 'galaxy_main'
+ target : 'galaxy_main',
+ classes : 'dataset-display'
};
// show a disabled display if the data's been purged
diff -r 3ebc0f5c4486cc5c207882bcea819018d23b2bf4 -r a0120448a28eeda50a0476a6d46da74ad3afa484 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -69,7 +69,7 @@
title : _l( 'Edit Attributes' ),
href : this.urls.edit,
target : 'galaxy_main',
- icon_class : 'edit'
+ classes : 'dataset-edit'
};
// disable if purged or deleted and explain why in the tooltip
@@ -102,21 +102,18 @@
}
var self = this,
- delete_url = self.urls[ 'delete' ],
deleteBtnData = {
title : _l( 'Delete' ),
- href : delete_url,
- icon_class : 'delete',
- onclick : function() {
+ classes : 'dataset-delete',
+ onclick : function() {
// ...bler... tooltips being left behind in DOM (hover out never called on deletion)
- self.$el.find( '.menu-button.delete' ).trigger( 'mouseout' );
+ self.$el.find( '.icon-btn.dataset-delete' ).trigger( 'mouseout' );
self.model[ 'delete' ]();
}
};
if( this.model.get( 'deleted' ) || this.model.get( 'purged' ) ){
deleteBtnData = {
title : _l( 'Dataset is already deleted' ),
- icon_class : 'delete',
disabled : true
};
}
diff -r 3ebc0f5c4486cc5c207882bcea819018d23b2bf4 -r a0120448a28eeda50a0476a6d46da74ad3afa484 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={icon_class:"display",target:"galaxy_main"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:"galaxy_main",classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility"},toggleBodyVisibility:function(d,c){var e=this.$el.find(".dataset-body");c=(c===undefined)?(!e.is(":visible")):(c);if(c){this.expandBody()}else{this.collapseBody()}},expandBody:function(){var c=this;function d(){c.render(false).$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
diff -r 3ebc0f5c4486cc5c207882bcea819018d23b2bf4 -r a0120448a28eeda50a0476a6d46da74ad3afa484 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",icon_class:"edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h=g.urls["delete"],i={title:_l("Delete"),href:h,icon_class:"delete",onclick:function(){g.$el.find(".menu-button.delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){i={title:_l("Dataset is already deleted"),icon_class:"delete",disabled:true}}i.faIcon="fa-times";return faIconButton(i)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))})},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"},confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:"galaxy_main",scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:"galaxy_main",classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:"galaxy_main",faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:"galaxy_main",faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:"galaxy_main"}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))})},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="galaxy_main">?</a>').attr("href",this.urls.edit))}},events:{"click .dataset-title-bar":"toggleBodyVisibility","click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"},confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:"galaxy_main",scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
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.
5 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/40d2e69e89a3/
Changeset: 40d2e69e89a3
User: jmchilton
Date: 2013-11-18 07:51:54
Summary: Redo fix from 8b65e61 so it works when no Twill clicking at all occurs (e.g. all default params used).
Affected #: 1 file
diff -r 64cb656e95b2f40ac5f6f1f26fc484ce88a11ad1 -r 40d2e69e89a3210d1760851ea8563e1e344a0c3f test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1356,11 +1356,11 @@
tool_id = tool_id.replace(" ", "+")
"""Runs the tool 'tool_id' and passes it the key/values from the *kwd"""
self.visit_url( "%s/tool_runner/index?tool_id=%s" % (self.url, tool_id) )
+ # Must click somewhere in tool_form, to disambiguate what form
+ # is being targetted.
+ tc.browser.clicked( tc.browser.get_form( 'tool_form' ), None )
if repeat_name is not None:
repeat_button = '%s_add' % repeat_name
- # Must click somewhere in tool_form, to disambiguate what form
- # is being targetted.
- tc.browser.clicked( tc.browser.get_form( 'tool_form' ), None )
# Submit the "repeat" form button to add an input)
tc.submit( repeat_button )
tc.find( 'runtool_btn' )
https://bitbucket.org/galaxy/galaxy-central/commits/59a0ca3d48c0/
Changeset: 59a0ca3d48c0
User: jmchilton
Date: 2013-11-18 07:51:54
Summary: PEP-8 fixes related to tool test parsing.
Affected #: 2 files
diff -r 40d2e69e89a3210d1760851ea8563e1e344a0c3f -r 59a0ca3d48c019c017d85fc780239837b2e5453d lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -1574,7 +1574,7 @@
# history, but we'll keep it unique per set of tests
composite_data_names_counter = 0
for i, test_elem in enumerate( tests_elem.findall( 'test' ) ):
- name = test_elem.get( 'name', 'Test-%d' % (i+1) )
+ name = test_elem.get( 'name', 'Test-%d' % (i + 1) )
maxseconds = int( test_elem.get( 'maxseconds', '120' ) )
test = ToolTestBuilder( self, name, maxseconds )
try:
@@ -1625,6 +1625,7 @@
raise Exception( "Test output does not have a 'name'" )
assert_elem = output_elem.find("assert_contents")
assert_list = None
+
# Trying to keep testing patch as localized as
# possible, this function should be relocated
# somewhere more conventional.
@@ -1636,7 +1637,7 @@
converted_children = []
for child_elem in child_elems:
converted_children.append( convert_elem(child_elem) )
- return {"tag" : tag, "attributes" : attributes, "children" : converted_children}
+ return {"tag": tag, "attributes": attributes, "children": converted_children}
if assert_elem is not None:
assert_list = []
for assert_child in list(assert_elem):
@@ -1677,6 +1678,7 @@
test.error = True
test.exception = e
self.tests.append( test )
+
def parse_input_page( self, input_elem, enctypes ):
"""
Parse a page of inputs. This basically just calls 'parse_input_elem',
diff -r 40d2e69e89a3210d1760851ea8563e1e344a0c3f -r 59a0ca3d48c019c017d85fc780239837b2e5453d lib/galaxy/tools/test.py
--- a/lib/galaxy/tools/test.py
+++ b/lib/galaxy/tools/test.py
@@ -1,20 +1,18 @@
-import new, sys
import os.path
-import galaxy.util
-import parameters
from parameters import basic
from parameters import grouping
-from elementtree.ElementTree import XML
import logging
log = logging.getLogger( __name__ )
+
class ToolTestBuilder( object ):
"""
Encapsulates information about a tool test, and allows creation of a
dynamic TestCase class (the unittest framework is very class oriented,
doing dynamic tests in this way allows better integration)
"""
+
def __init__( self, tool, name, maxseconds ):
self.tool = tool
self.name = name
@@ -24,6 +22,7 @@
self.outputs = []
self.error = False
self.exception = None
+
def add_param( self, name, value, extra ):
try:
if name not in self.tool.inputs:
@@ -43,8 +42,10 @@
except Exception, e:
log.debug( "Error for tool %s: could not add test parameter %s. %s" % ( self.tool.id, name, e ) )
self.inputs.append( ( name, value, extra ) )
+
def add_output( self, name, file, extra ):
self.outputs.append( ( name, file, extra ) )
+
def __expand_grouping_for_data_input( self, name, value, extra, grouping_name, grouping_value ):
# Currently handles grouping.Conditional and grouping.Repeat
if isinstance( grouping_value, grouping.Conditional ):
@@ -93,20 +94,21 @@
if found_parameter:
return True, new_value
return False, value
+
def __add_uploaded_dataset( self, name, value, extra, input_parameter ):
if value is None:
assert input_parameter.optional, '%s is not optional. You must provide a valid filename.' % name
return value
if ( value, extra ) not in self.required_files:
- self.required_files.append( ( value, extra ) ) #these files will be uploaded
+ self.required_files.append( ( value, extra ) ) # these files will be uploaded
name_change = [ att for att in extra.get( 'edit_attributes', [] ) if att.get( 'type' ) == 'name' ]
if name_change:
- name_change = name_change[-1].get( 'value' ) #only the last name change really matters
- value = name_change #change value for select to renamed uploaded file for e.g. composite dataset
+ name_change = name_change[-1].get( 'value' ) # only the last name change really matters
+ value = name_change # change value for select to renamed uploaded file for e.g. composite dataset
else:
for end in [ '.zip', '.gz' ]:
if value.endswith( end ):
value = value[ :-len( end ) ]
break
- value = os.path.basename( value ) #if uploading a file in a path other than root of test-data
+ value = os.path.basename( value ) # if uploading a file in a path other than root of test-data
return value
https://bitbucket.org/galaxy/galaxy-central/commits/d9482b09663e/
Changeset: d9482b09663e
User: jmchilton
Date: 2013-11-18 07:51:54
Summary: Refactor tool test parsing logic out of Tool and into ToolTestBuilder.
Affected #: 2 files
diff -r 59a0ca3d48c019c017d85fc780239837b2e5453d -r d9482b09663e0cb7cc74adc284267fee1dc498eb lib/galaxy/tools/__init__.py
--- a/lib/galaxy/tools/__init__.py
+++ b/lib/galaxy/tools/__init__.py
@@ -1570,113 +1570,8 @@
store in `self.tests`.
"""
self.tests = []
- # Composite datasets need a unique name: each test occurs in a fresh
- # history, but we'll keep it unique per set of tests
- composite_data_names_counter = 0
for i, test_elem in enumerate( tests_elem.findall( 'test' ) ):
- name = test_elem.get( 'name', 'Test-%d' % (i + 1) )
- maxseconds = int( test_elem.get( 'maxseconds', '120' ) )
- test = ToolTestBuilder( self, name, maxseconds )
- try:
- for param_elem in test_elem.findall( "param" ):
- attrib = dict( param_elem.attrib )
- if 'values' in attrib:
- value = attrib[ 'values' ].split( ',' )
- elif 'value' in attrib:
- value = attrib['value']
- else:
- value = None
- attrib['children'] = list( param_elem.getchildren() )
- if attrib['children']:
- # At this time, we can assume having children only
- # occurs on DataToolParameter test items but this could
- # change and would cause the below parsing to change
- # based upon differences in children items
- attrib['metadata'] = []
- attrib['composite_data'] = []
- attrib['edit_attributes'] = []
- # Composite datasets need to be renamed uniquely
- composite_data_name = None
- for child in attrib['children']:
- if child.tag == 'composite_data':
- attrib['composite_data'].append( child )
- if composite_data_name is None:
- # Generate a unique name; each test uses a
- # fresh history
- composite_data_name = '_COMPOSITE_RENAMED_%i_' \
- % ( composite_data_names_counter )
- composite_data_names_counter += 1
- elif child.tag == 'metadata':
- attrib['metadata'].append( child )
- elif child.tag == 'metadata':
- attrib['metadata'].append( child )
- elif child.tag == 'edit_attributes':
- attrib['edit_attributes'].append( child )
- if composite_data_name:
- # Composite datasets need implicit renaming;
- # inserted at front of list so explicit declarations
- # take precedence
- attrib['edit_attributes'].insert( 0, { 'type': 'name', 'value': composite_data_name } )
- test.add_param( attrib.pop( 'name' ), value, attrib )
- for output_elem in test_elem.findall( "output" ):
- attrib = dict( output_elem.attrib )
- name = attrib.pop( 'name', None )
- if name is None:
- raise Exception( "Test output does not have a 'name'" )
- assert_elem = output_elem.find("assert_contents")
- assert_list = None
-
- # Trying to keep testing patch as localized as
- # possible, this function should be relocated
- # somewhere more conventional.
- def convert_elem(elem):
- """ Converts and XML element to a dictionary format, used by assertion checking code. """
- tag = elem.tag
- attributes = dict( elem.attrib )
- child_elems = list( elem.getchildren() )
- converted_children = []
- for child_elem in child_elems:
- converted_children.append( convert_elem(child_elem) )
- return {"tag": tag, "attributes": attributes, "children": converted_children}
- if assert_elem is not None:
- assert_list = []
- for assert_child in list(assert_elem):
- assert_list.append(convert_elem(assert_child))
- file = attrib.pop( 'file', None )
- # File no longer required if an list of assertions was present.
- if assert_list is None and file is None:
- raise Exception( "Test output does not have a 'file'")
- attributes = {}
- # Method of comparison
- attributes['compare'] = attrib.pop( 'compare', 'diff' ).lower()
- # Number of lines to allow to vary in logs (for dates, etc)
- attributes['lines_diff'] = int( attrib.pop( 'lines_diff', '0' ) )
- # Allow a file size to vary if sim_size compare
- attributes['delta'] = int( attrib.pop( 'delta', '10000' ) )
- attributes['sort'] = string_as_bool( attrib.pop( 'sort', False ) )
- attributes['extra_files'] = []
- attributes['assert_list'] = assert_list
- if 'ftype' in attrib:
- attributes['ftype'] = attrib['ftype']
- for extra in output_elem.findall( 'extra_files' ):
- # File or directory, when directory, compare basename
- # by basename
- extra_type = extra.get( 'type', 'file' )
- extra_name = extra.get( 'name', None )
- assert extra_type == 'directory' or extra_name is not None, \
- 'extra_files type (%s) requires a name attribute' % extra_type
- extra_value = extra.get( 'value', None )
- assert extra_value is not None, 'extra_files requires a value attribute'
- extra_attributes = {}
- extra_attributes['compare'] = extra.get( 'compare', 'diff' ).lower()
- extra_attributes['delta'] = extra.get( 'delta', '0' )
- extra_attributes['lines_diff'] = int( extra.get( 'lines_diff', '0' ) )
- extra_attributes['sort'] = string_as_bool( extra.get( 'sort', False ) )
- attributes['extra_files'].append( ( extra_type, extra_value, extra_name, extra_attributes ) )
- test.add_output( name, file, attributes )
- except Exception, e:
- test.error = True
- test.exception = e
+ test = ToolTestBuilder( self, test_elem, i )
self.tests.append( test )
def parse_input_page( self, input_elem, enctypes ):
diff -r 59a0ca3d48c019c017d85fc780239837b2e5453d -r d9482b09663e0cb7cc74adc284267fee1dc498eb lib/galaxy/tools/test.py
--- a/lib/galaxy/tools/test.py
+++ b/lib/galaxy/tools/test.py
@@ -1,6 +1,7 @@
import os.path
from parameters import basic
from parameters import grouping
+from galaxy.util import string_as_bool
import logging
log = logging.getLogger( __name__ )
@@ -13,7 +14,10 @@
doing dynamic tests in this way allows better integration)
"""
- def __init__( self, tool, name, maxseconds ):
+ def __init__( self, tool, test_elem, i ):
+ name = test_elem.get( 'name', 'Test-%d' % (i + 1) )
+ maxseconds = int( test_elem.get( 'maxseconds', '120' ) )
+
self.tool = tool
self.name = name
self.maxseconds = maxseconds
@@ -23,6 +27,114 @@
self.error = False
self.exception = None
+ self.__parse_elem( test_elem, i )
+
+ def __parse_elem( self, test_elem, i ):
+ # Composite datasets need a unique name: each test occurs in a fresh
+ # history, but we'll keep it unique per set of tests - use i (test #)
+ # and composite_data_names_counter (instance per test #)
+ composite_data_names_counter = 0
+ try:
+ for param_elem in test_elem.findall( "param" ):
+ attrib = dict( param_elem.attrib )
+ if 'values' in attrib:
+ value = attrib[ 'values' ].split( ',' )
+ elif 'value' in attrib:
+ value = attrib['value']
+ else:
+ value = None
+ attrib['children'] = list( param_elem.getchildren() )
+ if attrib['children']:
+ # At this time, we can assume having children only
+ # occurs on DataToolParameter test items but this could
+ # change and would cause the below parsing to change
+ # based upon differences in children items
+ attrib['metadata'] = []
+ attrib['composite_data'] = []
+ attrib['edit_attributes'] = []
+ # Composite datasets need to be renamed uniquely
+ composite_data_name = None
+ for child in attrib['children']:
+ if child.tag == 'composite_data':
+ attrib['composite_data'].append( child )
+ if composite_data_name is None:
+ # Generate a unique name; each test uses a
+ # fresh history
+ composite_data_name = '_COMPOSITE_RENAMED_t%i_d%i' \
+ % ( i, composite_data_names_counter )
+ composite_data_names_counter += 1
+ elif child.tag == 'metadata':
+ attrib['metadata'].append( child )
+ elif child.tag == 'metadata':
+ attrib['metadata'].append( child )
+ elif child.tag == 'edit_attributes':
+ attrib['edit_attributes'].append( child )
+ if composite_data_name:
+ # Composite datasets need implicit renaming;
+ # inserted at front of list so explicit declarations
+ # take precedence
+ attrib['edit_attributes'].insert( 0, { 'type': 'name', 'value': composite_data_name } )
+ self.add_param( attrib.pop( 'name' ), value, attrib )
+ for output_elem in test_elem.findall( "output" ):
+ attrib = dict( output_elem.attrib )
+ name = attrib.pop( 'name', None )
+ if name is None:
+ raise Exception( "Test output does not have a 'name'" )
+ assert_elem = output_elem.find("assert_contents")
+ assert_list = None
+
+ # Trying to keep testing patch as localized as
+ # possible, this function should be relocated
+ # somewhere more conventional.
+ def convert_elem(elem):
+ """ Converts and XML element to a dictionary format, used by assertion checking code. """
+ tag = elem.tag
+ attributes = dict( elem.attrib )
+ child_elems = list( elem.getchildren() )
+ converted_children = []
+ for child_elem in child_elems:
+ converted_children.append( convert_elem(child_elem) )
+ return {"tag": tag, "attributes": attributes, "children": converted_children}
+ if assert_elem is not None:
+ assert_list = []
+ for assert_child in list(assert_elem):
+ assert_list.append(convert_elem(assert_child))
+ file = attrib.pop( 'file', None )
+ # File no longer required if an list of assertions was present.
+ if assert_list is None and file is None:
+ raise Exception( "Test output does not have a 'file'")
+ attributes = {}
+ # Method of comparison
+ attributes['compare'] = attrib.pop( 'compare', 'diff' ).lower()
+ # Number of lines to allow to vary in logs (for dates, etc)
+ attributes['lines_diff'] = int( attrib.pop( 'lines_diff', '0' ) )
+ # Allow a file size to vary if sim_size compare
+ attributes['delta'] = int( attrib.pop( 'delta', '10000' ) )
+ attributes['sort'] = string_as_bool( attrib.pop( 'sort', False ) )
+ attributes['extra_files'] = []
+ attributes['assert_list'] = assert_list
+ if 'ftype' in attrib:
+ attributes['ftype'] = attrib['ftype']
+ for extra in output_elem.findall( 'extra_files' ):
+ # File or directory, when directory, compare basename
+ # by basename
+ extra_type = extra.get( 'type', 'file' )
+ extra_name = extra.get( 'name', None )
+ assert extra_type == 'directory' or extra_name is not None, \
+ 'extra_files type (%s) requires a name attribute' % extra_type
+ extra_value = extra.get( 'value', None )
+ assert extra_value is not None, 'extra_files requires a value attribute'
+ extra_attributes = {}
+ extra_attributes['compare'] = extra.get( 'compare', 'diff' ).lower()
+ extra_attributes['delta'] = extra.get( 'delta', '0' )
+ extra_attributes['lines_diff'] = int( extra.get( 'lines_diff', '0' ) )
+ extra_attributes['sort'] = string_as_bool( extra.get( 'sort', False ) )
+ attributes['extra_files'].append( ( extra_type, extra_value, extra_name, extra_attributes ) )
+ self.add_output( name, file, attributes )
+ except Exception, e:
+ self.error = True
+ self.exception = e
+
def add_param( self, name, value, extra ):
try:
if name not in self.tool.inputs:
https://bitbucket.org/galaxy/galaxy-central/commits/b1a929a53f22/
Changeset: b1a929a53f22
User: jmchilton
Date: 2013-11-18 07:51:54
Summary: Make formerly public methods in ToolTestBuilder private now that it does its own construction.
Affected #: 1 file
diff -r d9482b09663e0cb7cc74adc284267fee1dc498eb -r b1a929a53f22ed8e59e8ca4d75d3ab230344cd46 lib/galaxy/tools/test.py
--- a/lib/galaxy/tools/test.py
+++ b/lib/galaxy/tools/test.py
@@ -74,7 +74,7 @@
# inserted at front of list so explicit declarations
# take precedence
attrib['edit_attributes'].insert( 0, { 'type': 'name', 'value': composite_data_name } )
- self.add_param( attrib.pop( 'name' ), value, attrib )
+ self.__add_param( attrib.pop( 'name' ), value, attrib )
for output_elem in test_elem.findall( "output" ):
attrib = dict( output_elem.attrib )
name = attrib.pop( 'name', None )
@@ -130,12 +130,12 @@
extra_attributes['lines_diff'] = int( extra.get( 'lines_diff', '0' ) )
extra_attributes['sort'] = string_as_bool( extra.get( 'sort', False ) )
attributes['extra_files'].append( ( extra_type, extra_value, extra_name, extra_attributes ) )
- self.add_output( name, file, attributes )
+ self.__add_output( name, file, attributes )
except Exception, e:
self.error = True
self.exception = e
- def add_param( self, name, value, extra ):
+ def __add_param( self, name, value, extra ):
try:
if name not in self.tool.inputs:
found_parameter = False
@@ -155,7 +155,7 @@
log.debug( "Error for tool %s: could not add test parameter %s. %s" % ( self.tool.id, name, e ) )
self.inputs.append( ( name, value, extra ) )
- def add_output( self, name, file, extra ):
+ def __add_output( self, name, file, extra ):
self.outputs.append( ( name, file, extra ) )
def __expand_grouping_for_data_input( self, name, value, extra, grouping_name, grouping_value ):
https://bitbucket.org/galaxy/galaxy-central/commits/3ebc0f5c4486/
Changeset: 3ebc0f5c4486
User: jmchilton
Date: 2013-11-18 07:51:54
Summary: Refactor smaller methods out of tool output test parsing.
Affected #: 1 file
diff -r b1a929a53f22ed8e59e8ca4d75d3ab230344cd46 -r 3ebc0f5c4486cc5c207882bcea819018d23b2bf4 lib/galaxy/tools/test.py
--- a/lib/galaxy/tools/test.py
+++ b/lib/galaxy/tools/test.py
@@ -80,29 +80,12 @@
name = attrib.pop( 'name', None )
if name is None:
raise Exception( "Test output does not have a 'name'" )
- assert_elem = output_elem.find("assert_contents")
- assert_list = None
- # Trying to keep testing patch as localized as
- # possible, this function should be relocated
- # somewhere more conventional.
- def convert_elem(elem):
- """ Converts and XML element to a dictionary format, used by assertion checking code. """
- tag = elem.tag
- attributes = dict( elem.attrib )
- child_elems = list( elem.getchildren() )
- converted_children = []
- for child_elem in child_elems:
- converted_children.append( convert_elem(child_elem) )
- return {"tag": tag, "attributes": attributes, "children": converted_children}
- if assert_elem is not None:
- assert_list = []
- for assert_child in list(assert_elem):
- assert_list.append(convert_elem(assert_child))
+ assert_list = self.__parse_assert_list( output_elem )
file = attrib.pop( 'file', None )
# File no longer required if an list of assertions was present.
- if assert_list is None and file is None:
- raise Exception( "Test output does not have a 'file'")
+ if not assert_list and file is None:
+ raise Exception( "Test output does not have a 'file' to compare with or list of assertions to check")
attributes = {}
# Method of comparison
attributes['compare'] = attrib.pop( 'compare', 'diff' ).lower()
@@ -116,25 +99,51 @@
if 'ftype' in attrib:
attributes['ftype'] = attrib['ftype']
for extra in output_elem.findall( 'extra_files' ):
- # File or directory, when directory, compare basename
- # by basename
- extra_type = extra.get( 'type', 'file' )
- extra_name = extra.get( 'name', None )
- assert extra_type == 'directory' or extra_name is not None, \
- 'extra_files type (%s) requires a name attribute' % extra_type
- extra_value = extra.get( 'value', None )
- assert extra_value is not None, 'extra_files requires a value attribute'
- extra_attributes = {}
- extra_attributes['compare'] = extra.get( 'compare', 'diff' ).lower()
- extra_attributes['delta'] = extra.get( 'delta', '0' )
- extra_attributes['lines_diff'] = int( extra.get( 'lines_diff', '0' ) )
- extra_attributes['sort'] = string_as_bool( extra.get( 'sort', False ) )
- attributes['extra_files'].append( ( extra_type, extra_value, extra_name, extra_attributes ) )
+ attributes['extra_files'].append( self.__parse_extra_files_elem( extra ) )
self.__add_output( name, file, attributes )
except Exception, e:
self.error = True
self.exception = e
+ def __parse_assert_list( self, output_elem ):
+ assert_elem = output_elem.find("assert_contents")
+ assert_list = None
+
+ # Trying to keep testing patch as localized as
+ # possible, this function should be relocated
+ # somewhere more conventional.
+ def convert_elem(elem):
+ """ Converts and XML element to a dictionary format, used by assertion checking code. """
+ tag = elem.tag
+ attributes = dict( elem.attrib )
+ child_elems = list( elem.getchildren() )
+ converted_children = []
+ for child_elem in child_elems:
+ converted_children.append( convert_elem(child_elem) )
+ return {"tag": tag, "attributes": attributes, "children": converted_children}
+ if assert_elem is not None:
+ assert_list = []
+ for assert_child in list(assert_elem):
+ assert_list.append(convert_elem(assert_child))
+
+ return assert_list
+
+ def __parse_extra_files_elem( self, extra ):
+ # File or directory, when directory, compare basename
+ # by basename
+ extra_type = extra.get( 'type', 'file' )
+ extra_name = extra.get( 'name', None )
+ assert extra_type == 'directory' or extra_name is not None, \
+ 'extra_files type (%s) requires a name attribute' % extra_type
+ extra_value = extra.get( 'value', None )
+ assert extra_value is not None, 'extra_files requires a value attribute'
+ extra_attributes = {}
+ extra_attributes['compare'] = extra.get( 'compare', 'diff' ).lower()
+ extra_attributes['delta'] = extra.get( 'delta', '0' )
+ extra_attributes['lines_diff'] = int( extra.get( 'lines_diff', '0' ) )
+ extra_attributes['sort'] = string_as_bool( extra.get( 'sort', False ) )
+ return extra_type, extra_value, extra_name, extra_attributes
+
def __add_param( self, name, value, extra ):
try:
if name not in self.tool.inputs:
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/64cb656e95b2/
Changeset: 64cb656e95b2
User: guerler
Date: 2013-11-17 11:37:57
Summary: Grids: Remove console output
Affected #: 1 file
diff -r 567266a9f5ae16af522a62c0aaf3c47cab39ffc2 -r 64cb656e95b2f40ac5f6f1f26fc484ce88a11ad1 templates/webapps/galaxy/tracks/history_select_grid.mako
--- a/templates/webapps/galaxy/tracks/history_select_grid.mako
+++ b/templates/webapps/galaxy/tracks/history_select_grid.mako
@@ -15,7 +15,6 @@
$(document).ready(function() {
$(".addtracktab, #grid-table a").off();
$(".addtracktab, #grid-table a").click(function() {
- console.log($(this).attr("href"));
var modal_body = $(".modal-body");
if (modal_body.length !== 0) {
modal_body.load($(this).attr("href"));
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/567266a9f5ae/
Changeset: 567266a9f5ae
User: guerler
Date: 2013-11-17 11:16:54
Summary: Grids: Remove console output
Affected #: 1 file
diff -r f1cef709a9e5631cae2126ffff71dbba64611f87 -r 567266a9f5ae16af522a62c0aaf3c47cab39ffc2 templates/grid_base.mako
--- a/templates/grid_base.mako
+++ b/templates/grid_base.mako
@@ -222,7 +222,7 @@
$(function() {
## get configuration
var grid_config = ${ h.to_json_string( self.grid_config ) };
- console.log(grid_config);
+
// Create grid.
var grid = new Grid(grid_config);
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5e534cc8da85/
Changeset: 5e534cc8da85
User: jmchilton
Date: 2013-11-17 09:03:28
Summary: Functional tool test fix.
No tests with a repeat and min=1 were ever going to past.
Affected #: 1 file
diff -r ef9968a089db28349b22c302ca07e9aa152bfe51 -r 5e534cc8da856ad598d63b8b9f03fe20629df05f test/functional/test_toolbox.py
--- a/test/functional/test_toolbox.py
+++ b/test/functional/test_toolbox.py
@@ -93,7 +93,8 @@
repeat_name = None
for input_name, input_value in testdef.tool.inputs_by_page[0].items():
if isinstance( input_value, grouping.Repeat ) and all_inputs.get( input_name, 1 ) not in [ 0, "0" ]: # default behavior is to test 1 repeat, for backwards compatibility
- repeat_name = input_name
+ if not input_value.min: # If input_value.min == 1, the element is already on the page don't add new element.
+ repeat_name = input_name
break
#check if we need to verify number of outputs created dynamically by tool
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.