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
April 2014
- 1 participants
- 261 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b423b847f58e/
Changeset: b423b847f58e
Branch: next-stable
User: carlfeberhard
Date: 2014-04-11 22:46:50
Summary: Pack data.js from 86f93a1
Affected #: 1 file
diff -r 86f93a18715e8fe22710a8ef788e54db08cdfe6c -r b423b847f58e1d8b1c29bcd9cf3089806bf0ac68 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
https://bitbucket.org/galaxy/galaxy-central/commits/2e7a93837c14/
Changeset: 2e7a93837c14
User: carlfeberhard
Date: 2014-04-11 22:48:28
Summary: merge next-stable
Affected #: 1 file
diff -r 0b98c12b720e4a3276c03cc92d3e358173f7d97f -r 2e7a93837c146a588c8d8fa00e226a6694d0f377 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ 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.
1
0
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/86f93a18715e/
Changeset: 86f93a18715e
Branch: next-stable
User: carlfeberhard
Date: 2014-04-11 22:22:11
Summary: PR #366 from Jian-Long Huang: to next-stable
Affected #: 1 file
diff -r dcfd828a229e5d43d1610cc510d71088620a1112 -r 86f93a18715e8fe22710a8ef788e54db08cdfe6c static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -21,7 +21,7 @@
initialize: function() {
this._set_metadata();
-
+
// Update metadata on change.
this.on('change', this._set_metadata, this);
},
@@ -30,7 +30,7 @@
var metadata = new DatasetMetadata();
// Move metadata from dataset attributes to metadata object.
- _.each(_.keys(this.attributes), function(k) {
+ _.each(_.keys(this.attributes), function(k) {
if (k.indexOf('metadata_') === 0) {
// Found metadata.
var new_key = k.split('metadata_')[1];
@@ -108,8 +108,8 @@
});
/**
- * Provides a base for table-based, dynamic view of a tabular dataset.
- * Do not instantiate directly; use either TopLevelTabularDatasetChunkedView
+ * Provides a base for table-based, dynamic view of a tabular dataset.
+ * Do not instantiate directly; use either TopLevelTabularDatasetChunkedView
* or EmbeddedTabularDatasetChunkedView.
*/
var TabularDatasetChunkedView = Backbone.View.extend({
@@ -193,7 +193,7 @@
$cell.attr('colspan', colspan).addClass('stringalign');
} else if (column_types) {
if (index < column_types.length) {
- if (column_types[index] === 'str' || column_types === 'list') {
+ if (column_types[index] === 'str' || column_types[index] === 'list') {
/* Left align all str columns, right align the rest */
$cell.addClass('stringalign');
}
@@ -329,22 +329,22 @@
initialize: function (options) {
// check if environment is available
var Galaxy = parent.Galaxy;
-
+
// link galaxy modal or create one
if (Galaxy && Galaxy.modal) {
this.modal = Galaxy.modal;
}
-
+
// link galaxy frames
if (Galaxy && Galaxy.frame) {
this.frame = Galaxy.frame;
}
-
+
// check
if (!this.modal || !this.frame) {
return;
}
-
+
// model/metadata
var model = options.model;
var metadata = model.get('metadata');
@@ -353,10 +353,10 @@
if (!model.get('data_type')) {
return;
}
-
+
// get data type
this.data_type = model.get('data_type');
-
+
// check for bed-file format
if (this.data_type == 'bed')
{
@@ -394,7 +394,7 @@
return;
}
}
-
+
// check
if(this.col.chrom === undefined) {
return;
@@ -407,7 +407,7 @@
console.log('TabularButtonTrackster : Dataset identification is missing.');
return;
}
-
+
// get url
if (model.get('url_viz')) {
this.url_viz = model.get('url_viz');
@@ -429,10 +429,10 @@
id : 'btn_viz'
})
});
-
+
// set element
this.setElement(options.$el);
-
+
// add to element
this.$el.append(btn_viz.render().$el);
@@ -446,14 +446,14 @@
'mouseover tr' : 'show',
'mouseleave' : 'hide'
},
-
+
// show button
show: function (e) {
// is numeric
function is_numeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
};
-
+
// check
if(this.col.chrom === null)
return;
@@ -470,7 +470,7 @@
// double check location
if (!chrom.match("^#") && chrom !== "" && is_numeric(start)) {
-
+
// get target gene region
var btn_viz_pars = {
dataset_id : this.dataset_id,
@@ -494,17 +494,17 @@
$('#btn_viz').hide();
}
},
-
+
// hide button
hide: function () {
this.$el.find('#btn_viz').hide();
},
-
+
// create action
create_trackster_action : function (vis_url, dataset_params, dbkey) {
// link this
var self = this;
-
+
// create function
return function() {
var listTracksParams = {};
@@ -546,13 +546,13 @@
'Add to visualization': function(){
// hide
self.modal.hide();
-
+
// search selected fields
self.modal.$el.find('input[name=id]:checked').each(function(){
// get visualization id
var vis_id = $(this).val();
dataset_params.id = vis_id;
-
+
// add widget
self.frame.add({
title : 'Trackster',
@@ -567,7 +567,7 @@
'View in new visualization': function(){
// hide
self.modal.hide();
-
+
// add widget
self.frame.add({
title : 'Trackster',
@@ -619,7 +619,7 @@
delete options.embedded;
delete options.parent_elt;
delete options.dataset_config;
-
+
// Create and set up view.
var view = (embedded ? new EmbeddedTabularDatasetChunkedView(options) :
new TopLevelTabularDatasetChunkedView(options));
https://bitbucket.org/galaxy/galaxy-central/commits/adad115b69ee/
Changeset: adad115b69ee
User: carlfeberhard
Date: 2014-04-11 22:40:12
Summary: merge next-stable
Affected #: 0 files
https://bitbucket.org/galaxy/galaxy-central/commits/0b98c12b720e/
Changeset: 0b98c12b720e
User: carlfeberhard
Date: 2014-04-11 22:41:45
Summary: pack scripts
Affected #: 2 files
diff -r adad115b69eeab8447cff22f23a5925282c3afa8 -r 0b98c12b720e4a3276c03cc92d3e358173f7d97f static/scripts/packed/utils/metrics-logger.js
--- a/static/scripts/packed/utils/metrics-logger.js
+++ b/static/scripts/packed/utils/metrics-logger.js
@@ -1,1 +1,1 @@
-define([],function(){function h(z){z=z||{};var y=this;y.consoleLogger=z.consoleLogger||null;y._init(z);return y}h.ALL=0;h.DEBUG=10;h.INFO=20;h.WARN=30;h.ERROR=40;h.METRIC=50;h.NONE=100;h.defaultOptions={logLevel:h.INFO,consoleLevel:h.NONE,defaultNamespace:"Galaxy",clientPrefix:"client.",maxCacheSize:3000,postSize:1000,addTime:true,postUrl:"/api/metrics",postOnUnload:true,getPingData:undefined,onServerResponse:undefined};h.prototype._init=function i(A){var z=this;z.options={};for(var y in h.defaultOptions){if(h.defaultOptions.hasOwnProperty(y)){z.options[y]=(A.hasOwnProperty(y))?(A[y]):(h.defaultOptions[y])}}z.options.logLevel=z._parseLevel(z.options.logLevel);z.options.consoleLevel=z._parseLevel(z.options.consoleLevel);z._sending=false;z._postSize=z.options.postSize;z._initCache();if(z.options.postOnUnload){z.onpageunload=function B(C){C.preventDefault();z._postCache({count:z.cache.length()})};window.addEventListener("unload",z.onpageunload)}return z};h.prototype._initCache=function a(){this.cache=new w({maxSize:this.options.maxCacheSize})};h.prototype._parseLevel=function j(A){var z=typeof A;if(z==="number"){return A}var y=A.toUpperCase();if(z==="string"&&h.hasOwnProperty(y)){return h[y]}throw new Error("Unknown log level: "+A)};h.prototype.emit=function m(B,A,z){var y=this;A=A||y.options.defaultNamespace;if(!B||!z){return y}B=y._parseLevel(B);if(B>=y.options.logLevel){y._addToCache(B,A,z)}if(y.consoleLogger&&B>=y.options.consoleLevel){y._emitToConsole(B,A,z)}return y};h.prototype._addToCache=function b(D,A,z){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var y=this;try{var C=y.cache.add(y._buildEntry(D,A,z));if(C>=y._postSize){y._postCache()}}catch(B){if(y.options.consoleLevel<=h.WARN){console.warn("Metrics logger could not stringify logArguments:",A,z);console.error(B)}}return y};h.prototype._buildEntry=function r(B,z,y){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var A={level:B,namespace:this.options.clientPrefix+z,args:y};if(this.options.addTime){A.time=new Date().toISOString()}return A};h.prototype._postCache=function s(B){B=B||{};this._emitToConsole("info","MetricsLogger",["_postCache",B,this._postSize]);if(!this.options.postUrl||this._sending){return jQuery.when({})}var A=this,D=B.count||A._postSize,y=A.cache.get(D),C=y.length,z=(typeof A.options.getPingData==="function")?(A.options.getPingData()):({});z.metrics=A._preprocessCache(y);A._sending=true;return jQuery.post(A.options.postUrl,z).always(function(){A._sending=false}).fail(function(){A._postSize=A.options.maxCacheSize}).done(function(E){if(typeof A.options.onServerResponse==="function"){A.options.onServerResponse(E)}A.cache.remove(C);console.debug("removed entries:",C,"size now:",A.cache.length());A._postSize=A.options.postSize})};h.prototype._preprocessCache=function f(y){return["[",(y.join(",\n")),"]"].join("\n")};h.prototype._emitToConsole=function c(C,B,A){var y=this;if(!y.consoleLogger){return y}var z=Array.prototype.slice.call(A,0);z.unshift(B);if(C>=h.METRIC&&typeof(y.consoleLogger.info)==="function"){return y.consoleLogger.info.apply(y.consoleLogger,z)}else{if(C>=h.ERROR&&typeof(y.consoleLogger.error)==="function"){return y.consoleLogger.error.apply(y.consoleLogger,z)}else{if(C>=h.WARN&&typeof(y.consoleLogger.warn)==="function"){y.consoleLogger.warn.apply(y.consoleLogger,z)}else{if(C>=h.INFO&&typeof(y.consoleLogger.info)==="function"){y.consoleLogger.info.apply(y.consoleLogger,z)}else{if(C>=h.DEBUG&&typeof(y.consoleLogger.debug)==="function"){y.consoleLogger.debug.apply(y.consoleLogger,z)}else{if(typeof(y.consoleLogger.log)==="function"){y.consoleLogger.log.apply(y.consoleLogger,z)}}}}}}return y};h.prototype.debug=function l(){this.emit(h.DEBUG,this.options.defaultNamespace,arguments)};h.prototype.log=function g(){this.emit(1,this.options.defaultNamespace,arguments)};h.prototype.info=function u(){this.emit(h.INFO,this.options.defaultNamespace,arguments)};h.prototype.warn=function t(){this.emit(h.WARN,this.options.defaultNamespace,arguments)};h.prototype.error=function p(){this.emit(h.ERROR,this.options.defaultNamespace,arguments)};h.prototype.metric=function n(){this.emit(h.METRIC,this.options.defaultNamespace,arguments)};function w(z){var y=this;y._cache=[];return y._init(z||{})}w.defaultOptions={maxSize:5000};w.prototype._init=function i(y){this.maxSize=y.maxSize||w.defaultOptions.maxSize;return this};w.prototype.add=function k(A){var z=this,y=(z.length()+1)-z.maxSize;if(y>0){z.remove(y)}z._cache.push(z._preprocessEntry(A));return z.length()};w.prototype._preprocessEntry=function q(y){return JSON.stringify(y)};w.prototype.length=function e(){return this._cache.length};w.prototype.get=function v(y){return this._cache.slice(0,y)};w.prototype.remove=function x(y){return this._cache.splice(0,y)};w.prototype.stringify=function o(y){return["[",(this.get(y).join(",\n")),"]"].join("\n")};w.prototype.print=function d(){this._cache.forEach(function(y){console.log(y)})};return{MetricsLogger:h}});
\ No newline at end of file
+define([],function(){function h(z){z=z||{};var y=this;y.consoleLogger=z.consoleLogger||null;y._init(z);return y}h.ALL=0;h.DEBUG=10;h.INFO=20;h.WARN=30;h.ERROR=40;h.METRIC=50;h.NONE=100;h.defaultOptions={logLevel:h.INFO,consoleLevel:h.NONE,defaultNamespace:"Galaxy",clientPrefix:"client.",maxCacheSize:3000,postSize:1000,addTime:true,postUrl:"/api/metrics",postOnUnload:true,getPingData:undefined,onServerResponse:undefined};h.prototype._init=function i(A){var z=this;z.options={};for(var y in h.defaultOptions){if(h.defaultOptions.hasOwnProperty(y)){z.options[y]=(A.hasOwnProperty(y))?(A[y]):(h.defaultOptions[y])}}z.options.logLevel=z._parseLevel(z.options.logLevel);z.options.consoleLevel=z._parseLevel(z.options.consoleLevel);z._sending=false;z._postSize=z.options.postSize;z._initCache();if(z.options.postOnUnload){z.onpageunload=function B(C){C.preventDefault();z._postCache({count:z.cache.length()})};window.addEventListener("unload",z.onpageunload)}return z};h.prototype._initCache=function a(){this.cache=new w({maxSize:this.options.maxCacheSize})};h.prototype._parseLevel=function j(A){var z=typeof A;if(z==="number"){return A}if(z==="string"){var y=A.toUpperCase();if(h.hasOwnProperty(y)){return h[y]}}throw new Error("Unknown log level: "+A)};h.prototype.emit=function m(B,A,z){var y=this;A=A||y.options.defaultNamespace;if(!B||!z){return y}B=y._parseLevel(B);if(B>=y.options.logLevel){y._addToCache(B,A,z)}if(y.consoleLogger&&B>=y.options.consoleLevel){y._emitToConsole(B,A,z)}return y};h.prototype._addToCache=function b(D,A,z){this._emitToConsole("debug","MetricsLogger",["_addToCache:",arguments,this.options.addTime,this.cache.length()]);var y=this;try{var C=y.cache.add(y._buildEntry(D,A,z));if(C>=y._postSize){y._postCache()}}catch(B){if(y.options.consoleLevel<=h.WARN){console.warn("Metrics logger could not stringify logArguments:",A,z);console.error(B)}}return y};h.prototype._buildEntry=function r(B,z,y){this._emitToConsole("debug","MetricsLogger",["_buildEntry:",arguments]);var A={level:B,namespace:this.options.clientPrefix+z,args:y};if(this.options.addTime){A.time=new Date().toISOString()}return A};h.prototype._postCache=function s(B){B=B||{};this._emitToConsole("info","MetricsLogger",["_postCache",B,this._postSize]);if(!this.options.postUrl||this._sending){return jQuery.when({})}var A=this,D=B.count||A._postSize,y=A.cache.get(D),C=y.length,z=(typeof A.options.getPingData==="function")?(A.options.getPingData()):({});z.metrics=A._preprocessCache(y);A._sending=true;return jQuery.post(A.options.postUrl,z).always(function(){A._sending=false}).fail(function(){A._postSize=A.options.maxCacheSize}).done(function(E){if(typeof A.options.onServerResponse==="function"){A.options.onServerResponse(E)}A.cache.remove(C);console.debug("removed entries:",C,"size now:",A.cache.length());A._postSize=A.options.postSize})};h.prototype._preprocessCache=function f(y){return["[",(y.join(",\n")),"]"].join("\n")};h.prototype._emitToConsole=function c(C,B,A){var y=this;if(!y.consoleLogger){return y}var z=Array.prototype.slice.call(A,0);z.unshift(B);if(C>=h.METRIC&&typeof(y.consoleLogger.info)==="function"){return y.consoleLogger.info.apply(y.consoleLogger,z)}else{if(C>=h.ERROR&&typeof(y.consoleLogger.error)==="function"){return y.consoleLogger.error.apply(y.consoleLogger,z)}else{if(C>=h.WARN&&typeof(y.consoleLogger.warn)==="function"){y.consoleLogger.warn.apply(y.consoleLogger,z)}else{if(C>=h.INFO&&typeof(y.consoleLogger.info)==="function"){y.consoleLogger.info.apply(y.consoleLogger,z)}else{if(C>=h.DEBUG&&typeof(y.consoleLogger.debug)==="function"){y.consoleLogger.debug.apply(y.consoleLogger,z)}else{if(typeof(y.consoleLogger.log)==="function"){y.consoleLogger.log.apply(y.consoleLogger,z)}}}}}}return y};h.prototype.debug=function l(){this.emit(h.DEBUG,this.options.defaultNamespace,arguments)};h.prototype.log=function g(){this.emit(1,this.options.defaultNamespace,arguments)};h.prototype.info=function u(){this.emit(h.INFO,this.options.defaultNamespace,arguments)};h.prototype.warn=function t(){this.emit(h.WARN,this.options.defaultNamespace,arguments)};h.prototype.error=function p(){this.emit(h.ERROR,this.options.defaultNamespace,arguments)};h.prototype.metric=function n(){this.emit(h.METRIC,this.options.defaultNamespace,arguments)};function w(z){var y=this;y._cache=[];return y._init(z||{})}w.defaultOptions={maxSize:5000};w.prototype._init=function i(y){this.maxSize=y.maxSize||w.defaultOptions.maxSize;return this};w.prototype.add=function k(A){var z=this,y=(z.length()+1)-z.maxSize;if(y>0){z.remove(y)}z._cache.push(z._preprocessEntry(A));return z.length()};w.prototype._preprocessEntry=function q(y){return JSON.stringify(y)};w.prototype.length=function e(){return this._cache.length};w.prototype.get=function v(y){return this._cache.slice(0,y)};w.prototype.remove=function x(y){return this._cache.splice(0,y)};w.prototype.stringify=function o(y){return["[",(this.get(y).join(",\n")),"]"].join("\n")};w.prototype.print=function d(){this._cache.forEach(function(y){console.log(y)})};return{MetricsLogger:h,LoggingCache:w}});
\ No newline at end of file
diff -r adad115b69eeab8447cff22f23a5925282c3afa8 -r 0b98c12b720e4a3276c03cc92d3e358173f7d97f static/scripts/packed/viz/phyloviz.js
--- a/static/scripts/packed/viz/phyloviz.js
+++ b/static/scripts/packed/viz/phyloviz.js
@@ -1,1 +1,1 @@
-define(["libs/d3","viz/visualization","mvc/data"],function(m,f,g){var l=Backbone.View.extend({className:"UserMenuBase",isAcceptableValue:function(q,o,n){var r=q.val(),s=q.attr("displayLabel")||q.attr("id").replace("phyloViz","");function p(t){return !isNaN(parseFloat(t))&&isFinite(t)}if(!p(r)){alert(s+" is not a number!");return false}if(r>n){alert(s+" is too large.");return false}else{if(r<o){alert(s+" is too small.");return false}}return true},hasIllegalJsonCharacters:function(n){if(n.val().search(/"|'|\\/)!==-1){alert("Named fields cannot contain these illegal characters: double quote(\"), single guote('), or back slash(\\). ");return true}return false}});function h(){var w=this,r=m.layout.hierarchy().sort(null).value(null),v=360,q="Linear",u=18,s=200,t=0,p=0.5,n=50;w.leafHeight=function(x){if(typeof x==="undefined"){return u}else{u=x;return w}};w.layoutMode=function(x){if(typeof x==="undefined"){return q}else{q=x;return w}};w.layoutAngle=function(x){if(typeof x==="undefined"){return v}if(isNaN(x)||x<0||x>360){return w}else{v=x;return w}};w.separation=function(x){if(typeof x==="undefined"){return s}else{s=x;return w}};w.links=function(x){return m.layout.tree().links(x)};w.nodes=function(A,y){if(toString.call(A)==="[object Array]"){A=A[0]}var z=r.call(w,A,y),x=[],C=0,B=0;window._d=A;window._nodes=z;z.forEach(function(D){C=D.depth>C?D.depth:C;x.push(D)});x.forEach(function(D){if(!D.children){B+=1;D.depth=C}});u=q==="Circular"?v/B:u;t=0;o(x[0],C,u,null);return x};function o(B,D,A,z){var y=B.children,x=0;var C=B.dist||p;C=C>1?1:C;B.dist=C;if(z!==null){B.y0=z.y0+C*s}else{B.y0=n}if(!y){B.x0=t*A;t+=1}else{y.forEach(function(E){E.parent=B;x+=o(E,D,A,B)});B.x0=x/y.length}B.x=B.x0;B.y=B.y0;return B.x0}return w}var b=f.Visualization.extend({defaults:{layout:"Linear",separation:250,leafHeight:18,type:"phyloviz",title:"Title",scaleFactor:1,translate:[0,0],fontSize:12,selectedNode:null,nodeAttrChangedTime:0},initialize:function(n){this.set("dataset",new g.Dataset({id:n.dataset_id}))},root:{},toggle:function(n){if(typeof n==="undefined"){return}if(n.children){n._children=n.children;n.children=null}else{n.children=n._children;n._children=null}},toggleAll:function(n){if(n.children&&n.children.length!==0){n.children.forEach(this.toggleAll);toggle(n)}},getData:function(){return this.root},save:function(){var n=this.root;o(n);function o(q){delete q.parent;if(q._selected){delete q._selected}if(q.children){q.children.forEach(o)}if(q._children){q._children.forEach(o)}}var p=jQuery.extend(true,{},this.attributes);p.selectedNode=null;show_message("Saving to Galaxy","progress");return $.ajax({url:this.url,type:"POST",dataType:"json",data:{vis_json:JSON.stringify(p)},success:function(q){var r=q.url.split("id=")[1].split("&")[0],s="/visualization?id="+r;window.history.pushState({},"",s+window.location.hash);hide_modal()}})}});var d=Backbone.View.extend({defaults:{nodeRadius:4.5},stdInit:function(o){var n=this;n.model.on("change:separation change:leafHeight change:fontSize change:nodeAttrChangedTime",n.updateAndRender,n);n.vis=o.vis;n.i=0;n.maxDepth=-1;n.width=o.width;n.height=o.height},updateAndRender:function(p){var o=m.select(".vis"),n=this;p=p||n.model.root;n.renderNodes(p);n.renderLinks(p);n.addTooltips()},renderLinks:function(n){var w=this;var o=w.diagonal;var p=w.duration;var r=w.layoutMode;var t=w.vis.selectAll("g.completeLink").data(w.tree.links(w.nodes),function(x){return x.target.id});var v=function(x){x.pos0=x.source.y0+" "+x.source.x0;x.pos1=x.source.y0+" "+x.target.x0;x.pos2=x.target.y0+" "+x.target.x0};var u=t.enter().insert("svg:g","g.node").attr("class","completeLink");u.append("svg:path").attr("class","link").attr("d",function(x){v(x);return"M "+x.pos0+" L "+x.pos1});var s=t.transition().duration(500);s.select("path.link").attr("d",function(x){v(x);return"M "+x.pos0+" L "+x.pos1+" L "+x.pos2});var q=t.exit().remove()},selectNode:function(o){var n=this;m.selectAll("g.node").classed("selectedHighlight",function(p){if(o.id===p.id){if(o._selected){delete o._selected;return false}else{o._selected=true;return true}}return false});n.model.set("selectedNode",o);$("#phyloVizSelectedNodeName").val(o.name);$("#phyloVizSelectedNodeDist").val(o.dist);$("#phyloVizSelectedNodeAnnotation").val(o.annotation||"")},addTooltips:function(){$(".tooltip").remove();$(".node").attr("data-original-title",function(){var o=this.__data__,n=o.annotation||"None";return o?(o.name?o.name+"<br/>":"")+"Dist: "+o.dist+" <br/>Annotation: "+n:""}).tooltip({placement:"top",trigger:"hover"})}});var a=d.extend({initialize:function(o){var n=this;n.margins=o.margins;n.layoutMode="Linear";n.stdInit(o);n.layout();n.updateAndRender(n.model.root)},layout:function(){var n=this;n.tree=new h().layoutMode("Linear");n.diagonal=m.svg.diagonal().projection(function(o){return[o.y,o.x]})},renderNodes:function(n){var u=this,v=u.model.get("fontSize")+"px";u.tree.separation(u.model.get("separation")).leafHeight(u.model.get("leafHeight"));var q=500,o=u.tree.separation(u.model.get("separation")).nodes(u.model.root);var p=u.vis.selectAll("g.node").data(o,function(w){return w.name+w.id||(w.id=++u.i)});u.nodes=o;u.duration=q;var r=p.enter().append("svg:g").attr("class","node").on("dblclick",function(){m.event.stopPropagation()}).on("click",function(w){if(m.event.altKey){u.selectNode(w)}else{if(w.children&&w.children.length===0){return}u.model.toggle(w);u.updateAndRender(w)}});if(toString.call(n)==="[object Array]"){n=n[0]}r.attr("transform",function(w){return"translate("+n.y0+","+n.x0+")"});r.append("svg:circle").attr("r",0.000001).style("fill",function(w){return w._children?"lightsteelblue":"#fff"});r.append("svg:text").attr("class","nodeLabel").attr("x",function(w){return w.children||w._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(w){return w.children||w._children?"end":"start"}).style("fill-opacity",0.000001);var s=p.transition().duration(q);s.attr("transform",function(w){return"translate("+w.y+","+w.x+")"});s.select("circle").attr("r",u.defaults.nodeRadius).style("fill",function(w){return w._children?"lightsteelblue":"#fff"});s.select("text").style("fill-opacity",1).style("font-size",v).text(function(w){return w.name});var t=p.exit().transition().duration(q).remove();t.select("circle").attr("r",0.000001);t.select("text").style("fill-opacity",0.000001);o.forEach(function(w){w.x0=w.x;w.y0=w.y})}});var j=Backbone.View.extend({className:"phyloviz",initialize:function(o){var n=this;n.MIN_SCALE=0.05;n.MAX_SCALE=5;n.MAX_DISPLACEMENT=500;n.margins=[10,60,10,80];n.width=$("#PhyloViz").width();n.height=$("#PhyloViz").height();n.radius=n.width;n.data=o.data;$(window).resize(function(){n.width=$("#PhyloViz").width();n.height=$("#PhyloViz").height();n.render()});n.phyloTree=new b(o.config);n.phyloTree.root=n.data;n.zoomFunc=m.behavior.zoom().scaleExtent([n.MIN_SCALE,n.MAX_SCALE]);n.zoomFunc.translate(n.phyloTree.get("translate"));n.zoomFunc.scale(n.phyloTree.get("scaleFactor"));n.navMenu=new c(n);n.settingsMenu=new i({phyloTree:n.phyloTree});n.nodeSelectionView=new e({phyloTree:n.phyloTree});n.search=new k();setTimeout(function(){n.zoomAndPan()},1000)},render:function(){var o=this;$("#PhyloViz").empty();o.mainSVG=m.select("#PhyloViz").append("svg:svg").attr("width",o.width).attr("height",o.height).attr("pointer-events","all").call(o.zoomFunc.on("zoom",function(){o.zoomAndPan()}));o.boundingRect=o.mainSVG.append("svg:rect").attr("class","boundingRect").attr("width",o.width).attr("height",o.height).attr("stroke","black").attr("fill","white");o.vis=o.mainSVG.append("svg:g").attr("class","vis");o.layoutOptions={model:o.phyloTree,width:o.width,height:o.height,vis:o.vis,margins:o.margins};$("#title").text("Phylogenetic Tree from "+o.phyloTree.get("title")+":");var n=new a(o.layoutOptions)},zoomAndPan:function(n){var t,p;if(typeof n!=="undefined"){t=n.zoom;p=n.translate}var w=this,r=w.zoomFunc.scale(),v=w.zoomFunc.translate(),s="",u="";switch(t){case"reset":r=1;v=[0,0];break;case"+":r*=1.1;break;case"-":r*=0.9;break;default:if(typeof t==="number"){r=t}else{if(m.event!==null){r=m.event.scale}}}if(r<w.MIN_SCALE||r>w.MAX_SCALE){return}w.zoomFunc.scale(r);s="translate("+w.margins[3]+","+w.margins[0]+") scale("+r+")";if(m.event!==null){u="translate("+m.event.translate+")"}else{if(typeof p!=="undefined"){var q=p.split(",")[0];var o=p.split(",")[1];if(!isNaN(q)&&!isNaN(o)){v=[v[0]+parseFloat(q),v[1]+parseFloat(o)]}}w.zoomFunc.translate(v);u="translate("+v+")"}w.phyloTree.set("scaleFactor",r);w.phyloTree.set("translate",v);w.vis.attr("transform",u+s)},reloadViz:function(){var n=this,o=$("#phylovizNexSelector :selected").val();$.getJSON(n.phyloTree.get("dataset").url(),{tree_index:o,data_type:"raw_data"},function(p){n.data=p.data;n.config=p;n.render()})}});var c=Backbone.View.extend({initialize:function(o){var n=this;n.phylovizView=o;$("#panelHeaderRightBtns").empty();$("#phyloVizNavBtns").empty();$("#phylovizNexSelector").off();n.initNavBtns();n.initRightHeaderBtns();$("#phylovizNexSelector").off().on("change",function(){n.phylovizView.reloadViz()})},initRightHeaderBtns:function(){var n=this;rightMenu=create_icon_buttons_menu([{icon_class:"gear",title:"PhyloViz Settings",on_click:function(){$("#SettingsMenu").show();n.settingsMenu.updateUI()}},{icon_class:"disk",title:"Save visualization",on_click:function(){var o=$("#phylovizNexSelector option:selected").text();if(o){n.phylovizView.phyloTree.set("title",o)}n.phylovizView.phyloTree.save()}},{icon_class:"chevron-expand",title:"Search / Edit Nodes",on_click:function(){$("#nodeSelectionView").show()}},{icon_class:"information",title:"Phyloviz Help",on_click:function(){window.open("http://wiki.g2.bx.psu.edu/Learn/Visualization/PhylogeneticTree")}}],{tooltip_config:{placement:"bottom"}});$("#panelHeaderRightBtns").append(rightMenu.$el)},initNavBtns:function(){var n=this,o=create_icon_buttons_menu([{icon_class:"zoom-in",title:"Zoom in",on_click:function(){n.phylovizView.zoomAndPan({zoom:"+"})}},{icon_class:"zoom-out",title:"Zoom out",on_click:function(){n.phylovizView.zoomAndPan({zoom:"-"})}},{icon_class:"arrow-circle",title:"Reset Zoom/Pan",on_click:function(){n.phylovizView.zoomAndPan({zoom:"reset"})}}],{tooltip_config:{placement:"bottom"}});$("#phyloVizNavBtns").append(o.$el)}});var i=l.extend({className:"Settings",initialize:function(o){var n=this;n.phyloTree=o.phyloTree;n.el=$("#SettingsMenu");n.inputs={separation:$("#phyloVizTreeSeparation"),leafHeight:$("#phyloVizTreeLeafHeight"),fontSize:$("#phyloVizTreeFontSize")};$("#settingsCloseBtn").off().on("click",function(){n.el.hide()});$("#phylovizResetSettingsBtn").off().on("click",function(){n.resetToDefaults()});$("#phylovizApplySettingsBtn").off().on("click",function(){n.apply()})},apply:function(){var n=this;if(!n.isAcceptableValue(n.inputs.separation,50,2500)||!n.isAcceptableValue(n.inputs.leafHeight,5,30)||!n.isAcceptableValue(n.inputs.fontSize,5,20)){return}$.each(n.inputs,function(o,p){n.phyloTree.set(o,p.val())})},updateUI:function(){var n=this;$.each(n.inputs,function(o,p){p.val(n.phyloTree.get(o))})},resetToDefaults:function(){$(".tooltip").remove();var n=this;$.each(n.phyloTree.defaults,function(o,p){n.phyloTree.set(o,p)});n.updateUI()},render:function(){}});var e=l.extend({className:"Settings",initialize:function(o){var n=this;n.el=$("#nodeSelectionView");n.phyloTree=o.phyloTree;n.UI={enableEdit:$("#phylovizEditNodesCheck"),saveChanges:$("#phylovizNodeSaveChanges"),cancelChanges:$("#phylovizNodeCancelChanges"),name:$("#phyloVizSelectedNodeName"),dist:$("#phyloVizSelectedNodeDist"),annotation:$("#phyloVizSelectedNodeAnnotation")};n.valuesOfConcern={name:null,dist:null,annotation:null};$("#nodeSelCloseBtn").off().on("click",function(){n.el.hide()});n.UI.saveChanges.off().on("click",function(){n.updateNodes()});n.UI.cancelChanges.off().on("click",function(){n.cancelChanges()});(function(p){p.fn.enable=function(q){return p(this).each(function(){if(q){p(this).removeAttr("disabled")}else{p(this).attr("disabled","disabled")}})}})(jQuery);n.UI.enableEdit.off().on("click",function(){n.toggleUI()})},toggleUI:function(){var n=this,o=n.UI.enableEdit.is(":checked");if(!o){n.cancelChanges()}$.each(n.valuesOfConcern,function(p,q){n.UI[p].enable(o)});if(o){n.UI.saveChanges.show();n.UI.cancelChanges.show()}else{n.UI.saveChanges.hide();n.UI.cancelChanges.hide()}},cancelChanges:function(){var n=this,o=n.phyloTree.get("selectedNode");if(o){$.each(n.valuesOfConcern,function(p,q){n.UI[p].val(o[p])})}},updateNodes:function(){var n=this,o=n.phyloTree.get("selectedNode");if(o){if(!n.isAcceptableValue(n.UI.dist,0,1)||n.hasIllegalJsonCharacters(n.UI.name)||n.hasIllegalJsonCharacters(n.UI.annotation)){return}$.each(n.valuesOfConcern,function(p,q){(o[p])=n.UI[p].val()});n.phyloTree.set("nodeAttrChangedTime",new Date())}else{alert("No node selected")}}});var k=l.extend({initialize:function(){var n=this;$("#phyloVizSearchBtn").on("click",function(){var p=$("#phyloVizSearchTerm"),q=$("#phyloVizSearchCondition").val().split("-"),o=q[0],r=q[1];n.hasIllegalJsonCharacters(p);if(o==="dist"){n.isAcceptableValue(p,0,1)}n.searchTree(o,r,p.val())})},searchTree:function(n,p,o){m.selectAll("g.node").classed("searchHighlight",function(r){var q=r[n];if(typeof q!=="undefined"&&q!==null){if(n==="dist"){switch(p){case"greaterEqual":return q>=+o;case"lesserEqual":return q<=+o;default:return}}else{if(n==="name"||n==="annotation"){return q.toLowerCase().indexOf(o.toLowerCase())!==-1}}}})}});return{PhylovizView:j}});
\ No newline at end of file
+define(["libs/d3","viz/visualization","mvc/data"],function(m,f,g){var l=Backbone.View.extend({className:"UserMenuBase",isAcceptableValue:function(q,o,n){var r=q.val(),s=q.attr("displayLabel")||q.attr("id").replace("phyloViz","");function p(t){return !isNaN(parseFloat(t))&&isFinite(t)}if(!p(r)){alert(s+" is not a number!");return false}if(r>n){alert(s+" is too large.");return false}else{if(r<o){alert(s+" is too small.");return false}}return true},hasIllegalJsonCharacters:function(n){if(n.val().search(/"|'|\\/)!==-1){alert("Named fields cannot contain these illegal characters: double quote(\"), single guote('), or back slash(\\). ");return true}return false}});function h(){var w=this,r=m.layout.hierarchy().sort(null).value(null),v=360,q="Linear",u=18,s=200,t=0,p=0.5,n=50;w.leafHeight=function(x){if(typeof x==="undefined"){return u}else{u=x;return w}};w.layoutMode=function(x){if(typeof x==="undefined"){return q}else{q=x;return w}};w.layoutAngle=function(x){if(typeof x==="undefined"){return v}if(isNaN(x)||x<0||x>360){return w}else{v=x;return w}};w.separation=function(x){if(typeof x==="undefined"){return s}else{s=x;return w}};w.links=function(x){return m.layout.tree().links(x)};w.nodes=function(A,y){if(toString.call(A)==="[object Array]"){A=A[0]}var z=r.call(w,A,y),x=[],C=0,B=0;window._d=A;window._nodes=z;z.forEach(function(D){C=D.depth>C?D.depth:C;x.push(D)});x.forEach(function(D){if(!D.children){B+=1;D.depth=C}});u=q==="Circular"?v/B:u;t=0;o(x[0],C,u,null);return x};function o(B,D,A,z){var y=B.children,x=0;var C=B.dist||p;C=C>1?1:C;B.dist=C;if(z!==null){B.y0=z.y0+C*s}else{B.y0=n}if(!y){B.x0=t*A;t+=1}else{y.forEach(function(E){E.parent=B;x+=o(E,D,A,B)});B.x0=x/y.length}B.x=B.x0;B.y=B.y0;return B.x0}return w}var b=f.Visualization.extend({defaults:{layout:"Linear",separation:250,leafHeight:18,type:"phyloviz",title:"Title",scaleFactor:1,translate:[0,0],fontSize:12,selectedNode:null,nodeAttrChangedTime:0},initialize:function(n){this.set("dataset",new g.Dataset({id:n.dataset_id}))},root:{},toggle:function(n){if(typeof n==="undefined"){return}if(n.children){n._children=n.children;n.children=null}else{n.children=n._children;n._children=null}},toggleAll:function(n){if(n.children&&n.children.length!==0){n.children.forEach(this.toggleAll);toggle(n)}},getData:function(){return this.root},save:function(){var n=this.root;o(n);function o(q){delete q.parent;if(q._selected){delete q._selected}if(q.children){q.children.forEach(o)}if(q._children){q._children.forEach(o)}}var p=jQuery.extend(true,{},this.attributes);p.selectedNode=null;show_message("Saving to Galaxy","progress");return $.ajax({url:this.url,type:"POST",dataType:"json",data:{vis_json:JSON.stringify(p)},success:function(q){var r=q.url.split("id=")[1].split("&")[0],s="/visualization?id="+r;window.history.pushState({},"",s+window.location.hash);hide_modal()}})}});var d=Backbone.View.extend({defaults:{nodeRadius:4.5},stdInit:function(o){var n=this;n.model.on("change:separation change:leafHeight change:fontSize change:nodeAttrChangedTime",n.updateAndRender,n);n.vis=o.vis;n.i=0;n.maxDepth=-1;n.width=o.width;n.height=o.height},updateAndRender:function(p){var o=m.select(".vis"),n=this;p=p||n.model.root;n.renderNodes(p);n.renderLinks(p);n.addTooltips()},renderLinks:function(n){var w=this;var o=w.diagonal;var p=w.duration;var r=w.layoutMode;var t=w.vis.selectAll("g.completeLink").data(w.tree.links(w.nodes),function(x){return x.target.id});var v=function(x){x.pos0=x.source.y0+" "+x.source.x0;x.pos1=x.source.y0+" "+x.target.x0;x.pos2=x.target.y0+" "+x.target.x0};var u=t.enter().insert("svg:g","g.node").attr("class","completeLink");u.append("svg:path").attr("class","link").attr("d",function(x){v(x);return"M "+x.pos0+" L "+x.pos1});var s=t.transition().duration(500);s.select("path.link").attr("d",function(x){v(x);return"M "+x.pos0+" L "+x.pos1+" L "+x.pos2});var q=t.exit().remove()},selectNode:function(o){var n=this;m.selectAll("g.node").classed("selectedHighlight",function(p){if(o.id===p.id){if(o._selected){delete o._selected;return false}else{o._selected=true;return true}}return false});n.model.set("selectedNode",o);$("#phyloVizSelectedNodeName").val(o.name);$("#phyloVizSelectedNodeDist").val(o.dist);$("#phyloVizSelectedNodeAnnotation").val(o.annotation||"")},addTooltips:function(){$(".tooltip").remove();$(".node").attr("data-original-title",function(){var o=this.__data__,n=o.annotation||"None";return o?(o.name?o.name+"<br/>":"")+"Dist: "+o.dist+" <br/>Annotation: "+n:""}).tooltip({placement:"top",trigger:"hover"})}});var a=d.extend({initialize:function(o){var n=this;n.margins=o.margins;n.layoutMode="Linear";n.stdInit(o);n.layout();n.updateAndRender(n.model.root)},layout:function(){var n=this;n.tree=new h().layoutMode("Linear");n.diagonal=m.svg.diagonal().projection(function(o){return[o.y,o.x]})},renderNodes:function(n){var u=this,v=u.model.get("fontSize")+"px";u.tree.separation(u.model.get("separation")).leafHeight(u.model.get("leafHeight"));var q=500,o=u.tree.separation(u.model.get("separation")).nodes(u.model.root);var p=u.vis.selectAll("g.node").data(o,function(w){return w.name+w.id||(w.id=++u.i)});u.nodes=o;u.duration=q;var r=p.enter().append("svg:g").attr("class","node").on("dblclick",function(){m.event.stopPropagation()}).on("click",function(w){if(m.event.altKey){u.selectNode(w)}else{if(w.children&&w.children.length===0){return}u.model.toggle(w);u.updateAndRender(w)}});if(toString.call(n)==="[object Array]"){n=n[0]}r.attr("transform",function(w){return"translate("+n.y0+","+n.x0+")"});r.append("svg:circle").attr("r",0.000001).style("fill",function(w){return w._children?"lightsteelblue":"#fff"});r.append("svg:text").attr("class","nodeLabel").attr("x",function(w){return w.children||w._children?-10:10}).attr("dy",".35em").attr("text-anchor",function(w){return w.children||w._children?"end":"start"}).style("fill-opacity",0.000001);var s=p.transition().duration(q);s.attr("transform",function(w){return"translate("+w.y+","+w.x+")"});s.select("circle").attr("r",u.defaults.nodeRadius).style("fill",function(w){return w._children?"lightsteelblue":"#fff"});s.select("text").style("fill-opacity",1).style("font-size",v).text(function(w){return w.name});var t=p.exit().transition().duration(q).remove();t.select("circle").attr("r",0.000001);t.select("text").style("fill-opacity",0.000001);o.forEach(function(w){w.x0=w.x;w.y0=w.y})}});var j=Backbone.View.extend({className:"phyloviz",initialize:function(o){var n=this;n.MIN_SCALE=0.05;n.MAX_SCALE=5;n.MAX_DISPLACEMENT=500;n.margins=[10,60,10,80];n.width=$("#PhyloViz").width();n.height=$("#PhyloViz").height();n.radius=n.width;n.data=o.data;$(window).resize(function(){n.width=$("#PhyloViz").width();n.height=$("#PhyloViz").height();n.render()});n.phyloTree=new b(o.config);n.phyloTree.root=n.data;n.zoomFunc=m.behavior.zoom().scaleExtent([n.MIN_SCALE,n.MAX_SCALE]);n.zoomFunc.translate(n.phyloTree.get("translate"));n.zoomFunc.scale(n.phyloTree.get("scaleFactor"));n.navMenu=new c(n);n.settingsMenu=new i({phyloTree:n.phyloTree});n.nodeSelectionView=new e({phyloTree:n.phyloTree});n.search=new k();setTimeout(function(){n.zoomAndPan()},1000)},render:function(){var o=this;$("#PhyloViz").empty();o.mainSVG=m.select("#PhyloViz").append("svg:svg").attr("width",o.width).attr("height",o.height).attr("pointer-events","all").call(o.zoomFunc.on("zoom",function(){o.zoomAndPan()}));o.boundingRect=o.mainSVG.append("svg:rect").attr("class","boundingRect").attr("width",o.width).attr("height",o.height).attr("stroke","black").attr("fill","white");o.vis=o.mainSVG.append("svg:g").attr("class","vis");o.layoutOptions={model:o.phyloTree,width:o.width,height:o.height,vis:o.vis,margins:o.margins};$("#title").text("Phylogenetic Tree from "+o.phyloTree.get("title")+":");var n=new a(o.layoutOptions)},zoomAndPan:function(n){var t,p;if(typeof n!=="undefined"){t=n.zoom;p=n.translate}var w=this,r=w.zoomFunc.scale(),v=w.zoomFunc.translate(),s="",u="";switch(t){case"reset":r=1;v=[0,0];break;case"+":r*=1.1;break;case"-":r*=0.9;break;default:if(typeof t==="number"){r=t}else{if(m.event!==null){r=m.event.scale}}}if(r<w.MIN_SCALE||r>w.MAX_SCALE){return}w.zoomFunc.scale(r);s="translate("+w.margins[3]+","+w.margins[0]+") scale("+r+")";if(m.event!==null){u="translate("+m.event.translate+")"}else{if(typeof p!=="undefined"){var q=p.split(",")[0];var o=p.split(",")[1];if(!isNaN(q)&&!isNaN(o)){v=[v[0]+parseFloat(q),v[1]+parseFloat(o)]}}w.zoomFunc.translate(v);u="translate("+v+")"}w.phyloTree.set("scaleFactor",r);w.phyloTree.set("translate",v);w.vis.attr("transform",u+s)},reloadViz:function(){var n=this,o=$("#phylovizNexSelector :selected").val();$.getJSON(n.phyloTree.get("dataset").url(),{tree_index:o,data_type:"raw_data"},function(p){n.data=p.data;n.config=p;n.render()})}});var c=Backbone.View.extend({initialize:function(o){var n=this;n.phylovizView=o;$("#panelHeaderRightBtns").empty();$("#phyloVizNavBtns").empty();$("#phylovizNexSelector").off();n.initNavBtns();n.initRightHeaderBtns();$("#phylovizNexSelector").off().on("change",function(){n.phylovizView.reloadViz()})},initRightHeaderBtns:function(){var n=this;rightMenu=create_icon_buttons_menu([{icon_class:"gear",title:"PhyloViz Settings",on_click:function(){$("#SettingsMenu").show();n.settingsMenu.updateUI()}},{icon_class:"disk",title:"Save visualization",on_click:function(){var o=$("#phylovizNexSelector option:selected").text();if(o){n.phylovizView.phyloTree.set("title",o)}n.phylovizView.phyloTree.save()}},{icon_class:"chevron-expand",title:"Search / Edit Nodes",on_click:function(){$("#nodeSelectionView").show()}},{icon_class:"information",title:"Phyloviz Help",on_click:function(){window.open("https://wiki.galaxyproject.org/Learn/Visualization/PhylogeneticTree")}}],{tooltip_config:{placement:"bottom"}});$("#panelHeaderRightBtns").append(rightMenu.$el)},initNavBtns:function(){var n=this,o=create_icon_buttons_menu([{icon_class:"zoom-in",title:"Zoom in",on_click:function(){n.phylovizView.zoomAndPan({zoom:"+"})}},{icon_class:"zoom-out",title:"Zoom out",on_click:function(){n.phylovizView.zoomAndPan({zoom:"-"})}},{icon_class:"arrow-circle",title:"Reset Zoom/Pan",on_click:function(){n.phylovizView.zoomAndPan({zoom:"reset"})}}],{tooltip_config:{placement:"bottom"}});$("#phyloVizNavBtns").append(o.$el)}});var i=l.extend({className:"Settings",initialize:function(o){var n=this;n.phyloTree=o.phyloTree;n.el=$("#SettingsMenu");n.inputs={separation:$("#phyloVizTreeSeparation"),leafHeight:$("#phyloVizTreeLeafHeight"),fontSize:$("#phyloVizTreeFontSize")};$("#settingsCloseBtn").off().on("click",function(){n.el.hide()});$("#phylovizResetSettingsBtn").off().on("click",function(){n.resetToDefaults()});$("#phylovizApplySettingsBtn").off().on("click",function(){n.apply()})},apply:function(){var n=this;if(!n.isAcceptableValue(n.inputs.separation,50,2500)||!n.isAcceptableValue(n.inputs.leafHeight,5,30)||!n.isAcceptableValue(n.inputs.fontSize,5,20)){return}$.each(n.inputs,function(o,p){n.phyloTree.set(o,p.val())})},updateUI:function(){var n=this;$.each(n.inputs,function(o,p){p.val(n.phyloTree.get(o))})},resetToDefaults:function(){$(".tooltip").remove();var n=this;$.each(n.phyloTree.defaults,function(o,p){n.phyloTree.set(o,p)});n.updateUI()},render:function(){}});var e=l.extend({className:"Settings",initialize:function(o){var n=this;n.el=$("#nodeSelectionView");n.phyloTree=o.phyloTree;n.UI={enableEdit:$("#phylovizEditNodesCheck"),saveChanges:$("#phylovizNodeSaveChanges"),cancelChanges:$("#phylovizNodeCancelChanges"),name:$("#phyloVizSelectedNodeName"),dist:$("#phyloVizSelectedNodeDist"),annotation:$("#phyloVizSelectedNodeAnnotation")};n.valuesOfConcern={name:null,dist:null,annotation:null};$("#nodeSelCloseBtn").off().on("click",function(){n.el.hide()});n.UI.saveChanges.off().on("click",function(){n.updateNodes()});n.UI.cancelChanges.off().on("click",function(){n.cancelChanges()});(function(p){p.fn.enable=function(q){return p(this).each(function(){if(q){p(this).removeAttr("disabled")}else{p(this).attr("disabled","disabled")}})}})(jQuery);n.UI.enableEdit.off().on("click",function(){n.toggleUI()})},toggleUI:function(){var n=this,o=n.UI.enableEdit.is(":checked");if(!o){n.cancelChanges()}$.each(n.valuesOfConcern,function(p,q){n.UI[p].enable(o)});if(o){n.UI.saveChanges.show();n.UI.cancelChanges.show()}else{n.UI.saveChanges.hide();n.UI.cancelChanges.hide()}},cancelChanges:function(){var n=this,o=n.phyloTree.get("selectedNode");if(o){$.each(n.valuesOfConcern,function(p,q){n.UI[p].val(o[p])})}},updateNodes:function(){var n=this,o=n.phyloTree.get("selectedNode");if(o){if(!n.isAcceptableValue(n.UI.dist,0,1)||n.hasIllegalJsonCharacters(n.UI.name)||n.hasIllegalJsonCharacters(n.UI.annotation)){return}$.each(n.valuesOfConcern,function(p,q){(o[p])=n.UI[p].val()});n.phyloTree.set("nodeAttrChangedTime",new Date())}else{alert("No node selected")}}});var k=l.extend({initialize:function(){var n=this;$("#phyloVizSearchBtn").on("click",function(){var p=$("#phyloVizSearchTerm"),q=$("#phyloVizSearchCondition").val().split("-"),o=q[0],r=q[1];n.hasIllegalJsonCharacters(p);if(o==="dist"){n.isAcceptableValue(p,0,1)}n.searchTree(o,r,p.val())})},searchTree:function(n,p,o){m.selectAll("g.node").classed("searchHighlight",function(r){var q=r[n];if(typeof q!=="undefined"&&q!==null){if(n==="dist"){switch(p){case"greaterEqual":return q>=+o;case"lesserEqual":return q<=+o;default:return}}else{if(n==="name"||n==="annotation"){return q.toLowerCase().indexOf(o.toLowerCase())!==-1}}}})}});return{PhylovizView:j}});
\ 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.
1
0
commit/galaxy-central: jlhg: Fix the column alignment in the tabular format data
by commits-noreply@bitbucket.org 11 Apr '14
by commits-noreply@bitbucket.org 11 Apr '14
11 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/14df6b188d7e/
Changeset: 14df6b188d7e
User: jlhg
Date: 2014-04-11 21:29:53
Summary: Fix the column alignment in the tabular format data
Affected #: 2 files
diff -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 -r 14df6b188d7e09046e1e42c2c5c9113322a191f9 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -21,7 +21,7 @@
initialize: function() {
this._set_metadata();
-
+
// Update metadata on change.
this.on('change', this._set_metadata, this);
},
@@ -30,7 +30,7 @@
var metadata = new DatasetMetadata();
// Move metadata from dataset attributes to metadata object.
- _.each(_.keys(this.attributes), function(k) {
+ _.each(_.keys(this.attributes), function(k) {
if (k.indexOf('metadata_') === 0) {
// Found metadata.
var new_key = k.split('metadata_')[1];
@@ -108,8 +108,8 @@
});
/**
- * Provides a base for table-based, dynamic view of a tabular dataset.
- * Do not instantiate directly; use either TopLevelTabularDatasetChunkedView
+ * Provides a base for table-based, dynamic view of a tabular dataset.
+ * Do not instantiate directly; use either TopLevelTabularDatasetChunkedView
* or EmbeddedTabularDatasetChunkedView.
*/
var TabularDatasetChunkedView = Backbone.View.extend({
@@ -193,7 +193,7 @@
$cell.attr('colspan', colspan).addClass('stringalign');
} else if (column_types) {
if (index < column_types.length) {
- if (column_types[index] === 'str' || column_types === 'list') {
+ if (column_types[index] === 'str' || column_types[index] === 'list') {
/* Left align all str columns, right align the rest */
$cell.addClass('stringalign');
}
@@ -329,22 +329,22 @@
initialize: function (options) {
// check if environment is available
var Galaxy = parent.Galaxy;
-
+
// link galaxy modal or create one
if (Galaxy && Galaxy.modal) {
this.modal = Galaxy.modal;
}
-
+
// link galaxy frames
if (Galaxy && Galaxy.frame) {
this.frame = Galaxy.frame;
}
-
+
// check
if (!this.modal || !this.frame) {
return;
}
-
+
// model/metadata
var model = options.model;
var metadata = model.get('metadata');
@@ -353,10 +353,10 @@
if (!model.get('data_type')) {
return;
}
-
+
// get data type
this.data_type = model.get('data_type');
-
+
// check for bed-file format
if (this.data_type == 'bed')
{
@@ -394,7 +394,7 @@
return;
}
}
-
+
// check
if(this.col.chrom === undefined) {
return;
@@ -407,7 +407,7 @@
console.log('TabularButtonTrackster : Dataset identification is missing.');
return;
}
-
+
// get url
if (model.get('url_viz')) {
this.url_viz = model.get('url_viz');
@@ -429,10 +429,10 @@
id : 'btn_viz'
})
});
-
+
// set element
this.setElement(options.$el);
-
+
// add to element
this.$el.append(btn_viz.render().$el);
@@ -446,14 +446,14 @@
'mouseover tr' : 'show',
'mouseleave' : 'hide'
},
-
+
// show button
show: function (e) {
// is numeric
function is_numeric(n) {
return !isNaN(parseFloat(n)) && isFinite(n);
};
-
+
// check
if(this.col.chrom === null)
return;
@@ -470,7 +470,7 @@
// double check location
if (!chrom.match("^#") && chrom !== "" && is_numeric(start)) {
-
+
// get target gene region
var btn_viz_pars = {
dataset_id : this.dataset_id,
@@ -494,17 +494,17 @@
$('#btn_viz').hide();
}
},
-
+
// hide button
hide: function () {
this.$el.find('#btn_viz').hide();
},
-
+
// create action
create_trackster_action : function (vis_url, dataset_params, dbkey) {
// link this
var self = this;
-
+
// create function
return function() {
var listTracksParams = {};
@@ -546,13 +546,13 @@
'Add to visualization': function(){
// hide
self.modal.hide();
-
+
// search selected fields
self.modal.$el.find('input[name=id]:checked').each(function(){
// get visualization id
var vis_id = $(this).val();
dataset_params.id = vis_id;
-
+
// add widget
self.frame.add({
title : 'Trackster',
@@ -567,7 +567,7 @@
'View in new visualization': function(){
// hide
self.modal.hide();
-
+
// add widget
self.frame.add({
title : 'Trackster',
@@ -619,7 +619,7 @@
delete options.embedded;
delete options.parent_elt;
delete options.dataset_config;
-
+
// Create and set up view.
var view = (embedded ? new EmbeddedTabularDatasetChunkedView(options) :
new TopLevelTabularDatasetChunkedView(options));
diff -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 -r 14df6b188d7e09046e1e42c2c5c9113322a191f9 static/scripts/packed/mvc/data.js
--- a/static/scripts/packed/mvc/data.js
+++ b/static/scripts/packed/mvc/data.js
@@ -1,1 +1,1 @@
-define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
\ No newline at end of file
+define(["mvc/ui/ui-modal","mvc/ui/ui-frames"],function(j,i){var g=Backbone.Model.extend({});var b=Backbone.Model.extend({defaults:{id:"",type:"",name:"",hda_ldda:"hda",metadata:null},initialize:function(){this._set_metadata();this.on("change",this._set_metadata,this)},_set_metadata:function(){var m=new g();_.each(_.keys(this.attributes),function(n){if(n.indexOf("metadata_")===0){var o=n.split("metadata_")[1];m.set(o,this.attributes[n]);delete this.attributes[n]}},this);this.set("metadata",m,{silent:true})},get_metadata:function(m){return this.attributes.metadata.get(m)},urlRoot:galaxy_config.root+"api/datasets"});var h=b.extend({defaults:_.extend({},b.prototype.defaults,{chunk_url:null,first_data_chunk:null,chunk_index:-1,at_eof:false}),initialize:function(m){b.prototype.initialize.call(this);this.attributes.chunk_index=(this.attributes.first_data_chunk?1:0)},get_next_chunk:function(){if(this.attributes.at_eof){return null}var m=this,n=$.Deferred();$.getJSON(this.attributes.chunk_url,{chunk:m.attributes.chunk_index++}).success(function(o){var p;if(o.ck_data!==""){p=o}else{m.attributes.at_eof=true;p=null}n.resolve(p)});return n}});var e=Backbone.Collection.extend({model:b});var a=Backbone.View.extend({initialize:function(m){this.row_count=0;this.header_color="#AAA";this.dark_row_color="#DDD";new d({model:m.model,$el:this.$el})},render:function(){var q=$("<table/>").attr({id:"content_table",cellpadding:0});this.$el.append(q);var m=this.model.get_metadata("column_names"),r=$("<tr/>").css("background-color",this.header_color).appendTo(q);if(m){r.append("<th>"+m.join("</th><th>")+"</th>")}var o=this.model.get("first_data_chunk");if(o){this._renderChunk(o)}var n=this,p=false;this.scroll_elt.scroll(function(){if(!p&&n.scrolled_to_bottom()){p=true;$.when(n.model.get_next_chunk()).then(function(s){if(s){n._renderChunk(s);p=false}})}});$("#loading_indicator").ajaxStart(function(){$(this).show()}).ajaxStop(function(){$(this).hide()})},scrolled_to_bottom:function(){return false},_renderCell:function(p,m,q){var n=$("<td>").text(p);var o=this.model.get_metadata("column_types");if(q!==undefined){n.attr("colspan",q).addClass("stringalign")}else{if(o){if(m<o.length){if(o[m]==="str"||o[m]==="list"){n.addClass("stringalign")}}}}return n},_renderRow:function(m){var n=m.split("\t"),p=$("<tr>"),o=this.model.get_metadata("columns");if(this.row_count%2!==0){p.css("background-color",this.dark_row_color)}if(n.length===o){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this)}else{if(n.length>o){_.each(n.slice(0,o-1),function(r,q){p.append(this._renderCell(r,q))},this);p.append(this._renderCell(n.slice(o-1).join("\t"),o-1))}else{if(o>5&&n.length===o-1){_.each(n,function(r,q){p.append(this._renderCell(r,q))},this);p.append($("<td>"))}else{p.append(this._renderCell(m,0,o))}}}this.row_count++;return p},_renderChunk:function(m){var n=this.$el.find("table");_.each(m.ck_data.split("\n"),function(o,p){n.append(this._renderRow(o))},this)}});var f=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);scroll_elt=_.find(this.$el.parents(),function(n){return $(n).css("overflow")==="auto"});if(!scroll_elt){scroll_elt=window}this.scroll_elt=$(scroll_elt)},scrolled_to_bottom:function(){return(this.$el.height()-this.scroll_elt.scrollTop()-this.scroll_elt.height()<=0)}});var l=a.extend({initialize:function(m){a.prototype.initialize.call(this,m);this.scroll_elt=this.$el.css({position:"relative",overflow:"scroll",height:this.options.height||"500px"})},scrolled_to_bottom:function(){return this.$el.scrollTop()+this.$el.innerHeight()>=this.el.scrollHeight}});var d=Backbone.View.extend({col:{chrom:null,start:null,end:null},url_viz:null,dataset_id:null,genome_build:null,data_type:null,initialize:function(o){var r=parent.Galaxy;if(r&&r.modal){this.modal=r.modal}if(r&&r.frame){this.frame=r.frame}if(!this.modal||!this.frame){return}var n=o.model;var q=n.get("metadata");if(!n.get("data_type")){return}this.data_type=n.get("data_type");if(this.data_type=="bed"){if(q.get("chromCol")&&q.get("startCol")&&q.get("endCol")){this.col.chrom=q.get("chromCol")-1;this.col.start=q.get("startCol")-1;this.col.end=q.get("endCol")-1}else{console.log("TabularButtonTrackster : Bed-file metadata incomplete.");return}}if(this.data_type=="vcf"){function p(t,u){for(var s=0;s<u.length;s++){if(u[s].match(t)){return s}}return -1}this.col.chrom=p("Chrom",q.get("column_names"));this.col.start=p("Pos",q.get("column_names"));this.col.end=null;if(this.col.chrom==-1||this.col.start==-1){console.log("TabularButtonTrackster : VCF-file metadata incomplete.");return}}if(this.col.chrom===undefined){return}if(n.id){this.dataset_id=n.id}else{console.log("TabularButtonTrackster : Dataset identification is missing.");return}if(n.get("url_viz")){this.url_viz=n.get("url_viz")}else{console.log("TabularButtonTrackster : Url for visualization controller is missing.");return}if(n.get("genome_build")){this.genome_build=n.get("genome_build")}var m=new IconButtonView({model:new IconButton({title:"Visualize",icon_class:"chart_curve",id:"btn_viz"})});this.setElement(o.$el);this.$el.append(m.render().$el);this.hide()},events:{"mouseover tr":"show",mouseleave:"hide"},show:function(r){function q(w){return !isNaN(parseFloat(w))&&isFinite(w)}if(this.col.chrom===null){return}var v=$(r.target).parent();var s=v.children().eq(this.col.chrom).html();var m=v.children().eq(this.col.start).html();var o=this.col.end?v.children().eq(this.col.end).html():m;if(!s.match("^#")&&s!==""&&q(m)){var u={dataset_id:this.dataset_id,gene_region:s+":"+m+"-"+o};var p=v.offset();var n=p.left-10;var t=p.top-$(window).scrollTop()+3;$("#btn_viz").css({position:"fixed",top:t+"px",left:n+"px"});$("#btn_viz").off("click");$("#btn_viz").click(this.create_trackster_action(this.url_viz,u,this.genome_build));$("#btn_viz").show()}else{$("#btn_viz").hide()}},hide:function(){this.$el.find("#btn_viz").hide()},create_trackster_action:function(m,p,o){var n=this;return function(){var q={};if(o){q["f-dbkey"]=o}$.ajax({url:m+"/list_tracks?"+$.param(q),dataType:"html",error:function(){n.modal.show({title:"Something went wrong!",body:"Unfortunately we could not add this dataset to the track browser. Please try again or contact us.",buttons:{Cancel:function(){n.modal.hide()}}})},success:function(r){n.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){n.modal.hide()},"View in saved visualization":function(){n.modal.show({title:"Add Data to Saved Visualization",body:r,buttons:{Cancel:function(){n.modal.hide()},"Add to visualization":function(){n.modal.hide();n.modal.$el.find("input[name=id]:checked").each(function(){var s=$(this).val();p.id=s;n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})})}}})},"View in new visualization":function(){n.modal.hide();n.frame.add({title:"Trackster",type:"url",content:m+"/trackster?"+$.param(p)})}}})}});return false}}});var k=function(p,n,q,m){var o=new n({model:new p(q)});o.render();if(m){m.append(o.$el)}return o};var c=function(o){o.model=new h(o.dataset_config);var n=o.parent_elt;var p=o.embedded;delete o.embedded;delete o.parent_elt;delete o.dataset_config;var m=(p?new l(o):new f(o));m.render();if(n){n.append(m.$el)}return m};return{Dataset:b,TabularDataset:h,DatasetCollection:e,TabularDatasetChunkedView:a,createTabularDatasetChunkedView:c}});
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
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/e02cccf0fb8a/
Changeset: e02cccf0fb8a
User: dcnorris
Date: 2014-04-10 15:48:59
Summary: Added IGB display support for bed graph files
Affected #: 6 files
diff -r febeffc4787e625f3687c7d24298d5b2d3fa6241 -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 datatypes_conf.xml.sample
--- a/datatypes_conf.xml.sample
+++ b/datatypes_conf.xml.sample
@@ -26,6 +26,7 @@
</datatype><datatype extension="bedgraph" type="galaxy.datatypes.interval:BedGraph" display_in_upload="true"><converter file="bedgraph_to_bigwig_converter.xml" target_datatype="bigwig"/>
+ <display file="igb/bedgraph.xml" /></datatype><datatype extension="bedstrict" type="galaxy.datatypes.interval:BedStrict" /><datatype extension="bed6" type="galaxy.datatypes.interval:Bed6">
diff -r febeffc4787e625f3687c7d24298d5b2d3fa6241 -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 display_applications/igb/bam.xml
--- a/display_applications/igb/bam.xml
+++ b/display_applications/igb/bam.xml
@@ -1,4 +1,4 @@
-<display id="igb_bam" version="0.0.0" name="display in IGB">
+<display id="igb_bam" version="0.0.0" name="Display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${bam_file.dbkey}&feature_url…</url><param type="data" name="bam_file_for_name" viewable="False"/>
diff -r febeffc4787e625f3687c7d24298d5b2d3fa6241 -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 display_applications/igb/bb.xml
--- a/display_applications/igb/bb.xml
+++ b/display_applications/igb/bb.xml
@@ -1,4 +1,4 @@
-<display id="igb_bb" version="1.0.0" name="display in IGB">
+<display id="igb_bb" version="1.0.0" name="Display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${bigbed_file.dbkey}&loadresi…</url>
diff -r febeffc4787e625f3687c7d24298d5b2d3fa6241 -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 display_applications/igb/bed.xml
--- a/display_applications/igb/bed.xml
+++ b/display_applications/igb/bed.xml
@@ -1,4 +1,4 @@
-<display id="igb_bed" version="1.0.0" name="display in IGB">
+<display id="igb_bed" version="1.0.0" name="Display in IGB"><link id="View" name="View"><url>$bioviz</url>
diff -r febeffc4787e625f3687c7d24298d5b2d3fa6241 -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 display_applications/igb/bedgraph.xml
--- /dev/null
+++ b/display_applications/igb/bedgraph.xml
@@ -0,0 +1,17 @@
+<display id="igb_bedgraph" version="1.0.0" name="Display in IGB">
+
+ <link id="View" name="View">
+ <url>$bioviz</url>
+ <param type="data" name="bedgraph_file_for_name" viewable="False"/>
+ <param type="template" name="niceName" viewable="False" strip="True">
+ #import re
+ #set nm=$bedgraph_file_for_name.name
+ ${re.sub('\W',"_",nm)}
+ </param>
+ <param type="data" name="bedgraph_file" url="${niceName}.bed.bedgraph" strip_https="True" />
+
+ <param type="template" name="bioviz" strip="True" >
+ http://bioviz.org/igb/galaxy.html?version=${bedgraph_file.dbkey}&loadre…
+ </param>
+ </link>
+</display>
\ No newline at end of file
diff -r febeffc4787e625f3687c7d24298d5b2d3fa6241 -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 display_applications/igb/wig.xml
--- a/display_applications/igb/wig.xml
+++ b/display_applications/igb/wig.xml
@@ -1,4 +1,4 @@
-<display id="igb_wig" version="1.0.0" name="display in IGB">
+<display id="igb_wig" version="1.0.0" name="Display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${wig_file.dbkey}&${position}…</url>
https://bitbucket.org/galaxy/galaxy-central/commits/c8866f186e4d/
Changeset: c8866f186e4d
User: dcnorris
Date: 2014-04-11 19:41:07
Summary: Reverted capitalization
Affected #: 6 files
diff -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a display_applications/igb/bam.xml
--- a/display_applications/igb/bam.xml
+++ b/display_applications/igb/bam.xml
@@ -1,4 +1,4 @@
-<display id="igb_bam" version="0.0.0" name="Display in IGB">
+<display id="igb_bam" version="0.0.0" name="display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${bam_file.dbkey}&feature_url…</url><param type="data" name="bam_file_for_name" viewable="False"/>
diff -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a display_applications/igb/bb.xml
--- a/display_applications/igb/bb.xml
+++ b/display_applications/igb/bb.xml
@@ -1,4 +1,4 @@
-<display id="igb_bb" version="1.0.0" name="Display in IGB">
+<display id="igb_bb" version="1.0.0" name="display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${bigbed_file.dbkey}&loadresi…</url>
diff -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a display_applications/igb/bed.xml
--- a/display_applications/igb/bed.xml
+++ b/display_applications/igb/bed.xml
@@ -1,4 +1,4 @@
-<display id="igb_bed" version="1.0.0" name="Display in IGB">
+<display id="igb_bed" version="1.0.0" name="display in IGB"><link id="View" name="View"><url>$bioviz</url>
diff -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a display_applications/igb/bedgraph.xml
--- a/display_applications/igb/bedgraph.xml
+++ b/display_applications/igb/bedgraph.xml
@@ -1,4 +1,4 @@
-<display id="igb_bedgraph" version="1.0.0" name="Display in IGB">
+<display id="igb_bedgraph" version="1.0.0" name="display in IGB"><link id="View" name="View"><url>$bioviz</url>
@@ -14,4 +14,4 @@
http://bioviz.org/igb/galaxy.html?version=${bedgraph_file.dbkey}&loadre…
</param></link>
-</display>
\ No newline at end of file
+</display>
diff -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a display_applications/igb/bigwig.xml
--- a/display_applications/igb/bigwig.xml
+++ b/display_applications/igb/bigwig.xml
@@ -1,4 +1,4 @@
-<display id="igb_bigwig" version="1.0.0" name="Display in IGB">
+<display id="igb_bigwig" version="1.0.0" name="display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${bigwig_file.dbkey}&loadresi…</url>
diff -r e02cccf0fb8a6385ec2e8ee3b57b4327169fcb55 -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a display_applications/igb/wig.xml
--- a/display_applications/igb/wig.xml
+++ b/display_applications/igb/wig.xml
@@ -1,4 +1,4 @@
-<display id="igb_wig" version="1.0.0" name="Display in IGB">
+<display id="igb_wig" version="1.0.0" name="display in IGB"><link id="View" name="View"><url>http://bioviz.org/igb/galaxy.html?version=${wig_file.dbkey}&${position}…</url>
https://bitbucket.org/galaxy/galaxy-central/commits/18ac7049d256/
Changeset: 18ac7049d256
User: hillrunner2008
Date: 2014-04-11 19:41:31
Summary: Merged galaxy/galaxy-central into default
Affected #: 114 files
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 config/plugins/visualizations/charts/static/app.js
--- a/config/plugins/visualizations/charts/static/app.js
+++ b/config/plugins/visualizations/charts/static/app.js
@@ -51,7 +51,6 @@
// append views
this.$el.append(this.viewer_view.$el);
this.$el.append(this.editor_view.$el);
- this.$el.css('height', 'inherit');
// pick start screen
if (!this.storage.load()) {
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 config/plugins/visualizations/charts/static/charts/nvd3/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3/config.js
@@ -1,15 +1,15 @@
define([], function() {
return {
- title : '',
- library : 'nvd3.js',
- element : 'svg',
+ title : '',
+ library : 'nvd3.js',
+ element : 'svg',
columns : {
y : {
title : 'Values for y-axis'
}
},
- settings : {
+ settings : {
separator_label : {
title : 'X axis',
type : 'separator'
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 config/plugins/visualizations/charts/static/charts/nvd3_piechart/config.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_piechart/config.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_piechart/config.js
@@ -1,7 +1,18 @@
-define(['plugin/charts/nvd3/config'], function(nvd3_config) {
+define([], function() {
-return $.extend(true, {}, nvd3_config, {
- title : 'Pie chart',
-});
+return {
+ title : 'Pie chart',
+ library : 'nvd3.js',
+ element : 'svg',
+ columns : {
+ label : {
+ title : 'Labels',
+ any_type : true
+ },
+ y : {
+ title : 'Values'
+ }
+ }
+};
});
\ No newline at end of file
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 config/plugins/visualizations/charts/static/charts/nvd3_piechart/nvd3_piechart.js
--- a/config/plugins/visualizations/charts/static/charts/nvd3_piechart/nvd3_piechart.js
+++ b/config/plugins/visualizations/charts/static/charts/nvd3_piechart/nvd3_piechart.js
@@ -27,29 +27,29 @@
for (var key in group.values) {
var value = group.values[key];
pie_data.push ({
- key : value.x,
- y : value.y
+ y : value.y,
+ x : value.label
});
}
+ }
+
+ // add graph to screen
+ nv.addGraph(function() {
+ self.chart_3d = nv.models.pieChart()
+ .donut(true)
+ .showLegend(false);
- // add graph to screen
- nv.addGraph(function() {
- self.chart_3d = nv.models.pieChart()
- .donut(true)
- .showLegend(false);
-
- self.options.canvas.datum(pie_data)
- .call(self.chart_3d);
+ self.options.canvas.datum(pie_data)
+ .call(self.chart_3d);
- nv.utils.windowResize(self.chart_3d.update);
-
- // set chart state
- chart.state('ok', 'Pie chart drawn.');
-
- // unregister process
- chart.deferred.done(process_id);
- });
- }
+ nv.utils.windowResize(self.chart_3d.update);
+
+ // set chart state
+ chart.state('ok', 'Chart has been drawn.');
+
+ // unregister process
+ chart.deferred.done(process_id);
+ });
});
}
});
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 config/plugins/visualizations/charts/static/library/deferred.js
--- a/config/plugins/visualizations/charts/static/library/deferred.js
+++ b/config/plugins/visualizations/charts/static/library/deferred.js
@@ -59,17 +59,19 @@
// unregister process
done: function(id) {
- // delete tag
- delete this.process[id];
-
- // decrease process counter
- this.counter--;
-
- // log
- console.debug('Deferred:done() - Unregistering ' + id);
-
- // trigger change
- this.trigger('refresh');
+ if (this.process[id]) {
+ // delete tag
+ delete this.process[id];
+
+ // decrease process counter
+ this.counter--;
+
+ // log
+ console.debug('Deferred:done() - Unregistering ' + id);
+
+ // trigger change
+ this.trigger('refresh');
+ }
},
// ready
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 config/plugins/visualizations/charts/static/views/group.js
--- a/config/plugins/visualizations/charts/static/views/group.js
+++ b/config/plugins/visualizations/charts/static/views/group.js
@@ -5,9 +5,6 @@
// widget
return Backbone.View.extend(
{
- // columns
- columns: [],
-
// initialize
initialize: function(app, options) {
// link app
@@ -121,24 +118,29 @@
// get dataset
this.app.datasets.request({id : dataset_id}, function(dataset) {
- // configure columns
- self.columns = [];
- var meta = dataset.metadata_column_types;
- for (var key in meta) {
- // check type
- if(meta[key] == 'int' || meta[key] == 'float') {
- // add to selection
- self.columns.push({
- 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']',
- 'value' : key
- });
+ // update select fields
+ for (var id in list) {
+
+ // is a numeric number required
+ var any_type = chart_settings.columns[id].any_type;
+
+ // configure columns
+ var columns = [];
+ var meta = dataset.metadata_column_types;
+ for (var key in meta) {
+ // check type
+ if (meta[key] == 'int' || meta[key] == 'float' || any_type) {
+ // add to selection
+ columns.push({
+ 'label' : 'Column: ' + (parseInt(key) + 1) + ' [' + meta[key] + ']',
+ 'value' : key
+ });
+ }
}
- }
- // update select fields
- for (var key in list) {
- list[key].update(self.columns);
- list[key].show();
+ // list
+ list[id].update(columns);
+ list[id].show();
}
// loading
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 doc/source/lib/galaxy.webapps.galaxy.api.rst~
--- a/doc/source/lib/galaxy.webapps.galaxy.api.rst~
+++ /dev/null
@@ -1,179 +0,0 @@
-api Package
-===========
-
-:mod:`datasets` Module
-----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.datasets
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`folder_contents` Module
------------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.folder_contents
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`folders` Module
----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.folders
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`forms` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.forms
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`genomes` Module
----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.genomes
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`group_roles` Module
--------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.group_roles
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`group_users` Module
--------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.group_users
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`groups` Module
---------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.groups
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`histories` Module
------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.histories
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`history_contents` Module
-------------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.history_contents
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`libraries` Module
------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.libraries
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`library_contents` Module
-------------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.library_contents
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`permissions` Module
--------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.permissions
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`quotas` Module
---------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.quotas
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`request_types` Module
----------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.request_types
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`requests` Module
-----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.requests
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`roles` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.roles
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`samples` Module
----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.samples
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`tools` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.tools
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`users` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.users
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`visualizations` Module
-----------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.visualizations
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`workflows` Module
------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.workflows
- :members:
- :undoc-members:
- :show-inheritance:
-
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 eggs.ini
--- a/eggs.ini
+++ b/eggs.ini
@@ -3,7 +3,7 @@
;
; This file is version controlled and should not be edited by hand!
; For more information, see:
-; http://wiki.g2.bx.psu.edu/Admin/Config/Eggs
+; https://wiki.galaxyproject.org/Admin/Config/Eggs
;
[general]
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 job_conf.xml.sample_advanced
--- a/job_conf.xml.sample_advanced
+++ b/job_conf.xml.sample_advanced
@@ -110,7 +110,7 @@
<!-- Traditionally, the LWR client sends request to LWR
server to populate various system properties. This
extra step can be disabled and these calculated here
- on client by uncommenting job_directory and
+ on client by uncommenting jobs_directory and
specifying any additional remote_property_ of
interest. When using message queues this is nessecary
not optional.
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -217,7 +217,7 @@
self.message_box_visible = kwargs.get( 'message_box_visible', False )
self.message_box_content = kwargs.get( 'message_box_content', None )
self.message_box_class = kwargs.get( 'message_box_class', 'info' )
- self.support_url = kwargs.get( 'support_url', 'http://wiki.g2.bx.psu.edu/Support' )
+ self.support_url = kwargs.get( 'support_url', 'https://wiki.galaxyproject.org/Support' )
self.wiki_url = kwargs.get( 'wiki_url', 'http://wiki.galaxyproject.org/' )
self.blog_url = kwargs.get( 'blog_url', None )
self.screencasts_url = kwargs.get( 'screencasts_url', None )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/exceptions/__init__.py
--- a/lib/galaxy/exceptions/__init__.py
+++ b/lib/galaxy/exceptions/__init__.py
@@ -60,6 +60,10 @@
status_code = 400
err_code = error_codes.MALFORMED_ID
+class UnknownContentsType( MessageException ):
+ status_code = 400
+ err_code = error_codes.UNKNOWN_CONTENTS_TYPE
+
class RequestParameterMissingException( MessageException ):
status_code = 400
err_code = error_codes.USER_REQUEST_MISSING_PARAMETER
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/exceptions/error_codes.json
--- a/lib/galaxy/exceptions/error_codes.json
+++ b/lib/galaxy/exceptions/error_codes.json
@@ -50,6 +50,11 @@
"message": "The id of the resource is malformed."
},
{
+ "name": "UNKNOWN_CONTENTS_TYPE",
+ "code": 400010,
+ "message": "The request contains unknown type of contents."
+ },
+ {
"name": "USER_NO_API_KEY",
"code": 403001,
"message": "API authentication required for this request"
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -72,9 +72,9 @@
'Variable_List' : '-v',
}
-# From pbs' job.h
+# From pbs' pbs_job.h
JOB_EXIT_STATUS = {
- 0: "job exec successful",
+ 0: "job exec successful",
-1: "job exec failed, before files, no retry",
-2: "job exec failed, after files, no retry",
-3: "job execution failed, do retry",
@@ -83,7 +83,10 @@
-6: "job aborted on MOM init, chkpt, ok migrate",
-7: "job restart failed",
-8: "exec() of user command failed",
- -11: "job maximum walltime exceeded", # Added by John, not from job.h.
+ -9: "could not create/open stdout stderr files",
+ -10: "job exceeded a memory limit",
+ -11: "job exceeded a walltime limit",
+ -12: "job exceeded a cpu time limit",
}
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/model/tool_shed_install/__init__.py
--- a/lib/galaxy/model/tool_shed_install/__init__.py
+++ b/lib/galaxy/model/tool_shed_install/__init__.py
@@ -4,6 +4,7 @@
from galaxy.util.bunch import Bunch
from galaxy.util import asbool
from tool_shed.util import common_util
+from urlparse import urljoin
log = logging.getLogger( __name__ )
@@ -73,6 +74,12 @@
def can_reinstall_or_activate( self ):
return self.deleted
+ def get_sharable_url( self, app ):
+ tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry( app, self.tool_shed )
+ if tool_shed_url:
+ return urljoin( tool_shed_url, 'view/%s/%s' % ( self.owner, self.name ) )
+ return tool_shed_url
+
def get_shed_config_filename( self ):
shed_config_filename = None
if self.metadata:
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/tools/errors.py
--- a/lib/galaxy/tools/errors.py
+++ b/lib/galaxy/tools/errors.py
@@ -28,7 +28,9 @@
-----------------------------------------------------------------------------
job id: ${job_id}
tool id: ${job_tool_id}
+tool version: ${tool_version}
job pid or drm id: ${job_runner_external_id}
+job tool version: ${job_tool_version}
-----------------------------------------------------------------------------
job command line:
${job_command_line}
@@ -86,7 +88,9 @@
history_item_name=hda.get_display_name(),
history_view_link=history_view_link,
job_id=job.id,
+ tool_version=job.tool_version,
job_tool_id=job.tool_id,
+ job_tool_version=hda.tool_version,
job_runner_external_id=job.job_runner_external_id,
job_command_line=job.command_line,
job_stderr=util.unicodify( job.stderr ),
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -979,7 +979,7 @@
if option[2]:
# Found selected option.
value = option[1]
- d[ 'value' ] = options
+ d[ 'value' ] = value
return d
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/util/biostar.py
--- a/lib/galaxy/util/biostar.py
+++ b/lib/galaxy/util/biostar.py
@@ -86,7 +86,14 @@
def populate_tool_payload( payload=None, tool=None ):
payload = populate_tag_payload( payload=payload, tool=tool )
payload[ 'title' ] = 'Need help with "%s" tool' % ( tool.name )
- payload[ 'content' ] = '<br /><hr /><p>Tool name: %s</br>Tool version: %s</br>Tool ID: %s</p>' % ( tool.name, tool.version, tool.id )
+ tool_url = None
+ if tool.tool_shed_repository:
+ tool_url = tool.tool_shed_repository.get_sharable_url( tool.app )
+ if tool_url:
+ tool_url = '</br>ToolShed URL: <a href="%s">%s</a>' % ( tool_url, tool_url )
+ if not tool_url:
+ tool_url = ''
+ payload[ 'content' ] = '<br /><hr /><p>Tool name: %s</br>Tool version: %s</br>Tool ID: %s%s</p></br>' % ( tool.name, tool.version, tool.id, tool_url )
return payload
def determine_cookie_domain( galaxy_hostname, biostar_hostname ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/demo_sequencer/config.py
--- a/lib/galaxy/webapps/demo_sequencer/config.py
+++ b/lib/galaxy/webapps/demo_sequencer/config.py
@@ -50,7 +50,7 @@
self.smtp_server = kwargs.get( 'smtp_server', None )
self.log_actions = string_as_bool( kwargs.get( 'log_actions', 'False' ) )
self.brand = kwargs.get( 'brand', None )
- self.wiki_url = kwargs.get( 'wiki_url', 'http://wiki.g2.bx.psu.edu/FrontPage' )
+ self.wiki_url = kwargs.get( 'wiki_url', 'https://wiki.galaxyproject.org/' )
self.blog_url = kwargs.get( 'blog_url', None )
self.screencasts_url = kwargs.get( 'screencasts_url', None )
self.log_events = False
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/folder_contents.py
--- a/lib/galaxy/webapps/galaxy/api/folder_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/folder_contents.py
@@ -1,13 +1,15 @@
"""
-API operations on the contents of a folder.
+API operations on the contents of a library folder.
"""
-import logging, os, string, shutil, urllib, re, socket
-from cgi import escape, FieldStorage
-from galaxy import util, datatypes, jobs, web, util
-from galaxy.web.base.controller import *
-from galaxy.util.sanitize_html import sanitize_html
-from galaxy.model.orm import *
+from galaxy import web
+from galaxy import exceptions
+from galaxy.web import _future_expose_api as expose_api
+from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
+from sqlalchemy.orm.exc import MultipleResultsFound
+from sqlalchemy.orm.exc import NoResultFound
+from galaxy.web.base.controller import BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems
+import logging
log = logging.getLogger( __name__ )
class FolderContentsController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems ):
@@ -15,7 +17,111 @@
Class controls retrieval, creation and updating of folder contents.
"""
- def load_folder_contents( self, trans, folder ):
+ @expose_api_anonymous
+ def index( self, trans, folder_id, **kwd ):
+ """
+ GET /api/folders/{encoded_folder_id}/contents
+ Displays a collection (list) of a folder's contents (files and folders).
+ Encoded folder ID is prepended with 'F' if it is a folder as opposed to a data set which does not have it.
+ Full path is provided in response as a separate object providing data for breadcrumb path building.
+ """
+
+ if ( len( folder_id ) == 17 and folder_id.startswith( 'F' ) ):
+ try:
+ decoded_folder_id = trans.security.decode_id( folder_id[ 1: ] )
+ except TypeError:
+ raise exceptions.MalformedId( 'Malformed folder id ( %s ) specified, unable to decode.' % str( folder_id ) )
+ else:
+ raise exceptions.MalformedId( 'Malformed folder id ( %s ) specified, unable to decode.' % str( folder_id ) )
+
+ try:
+ folder = trans.sa_session.query( trans.app.model.LibraryFolder ).filter( trans.app.model.LibraryFolder.table.c.id == decoded_folder_id ).one()
+ except MultipleResultsFound:
+ raise exceptions.InconsistentDatabase( 'Multiple folders with same id found.' )
+ except NoResultFound:
+ raise exceptions.ObjectNotFound( 'Folder with the id provided ( %s ) was not found' % str( folder_id ) )
+ except Exception:
+ raise exceptions.InternalServerError( 'Error loading from the database.' )
+
+ current_user_roles = trans.get_current_user_roles()
+ can_add_library_item = trans.user_is_admin() or trans.app.security_agent.can_add_library_item( current_user_roles, folder )
+
+ if not ( trans.user_is_admin() or trans.app.security_agent.can_access_library_item( current_user_roles, folder, trans.user ) ):
+ if folder.parent_id == None:
+ try:
+ library = trans.sa_session.query( trans.app.model.Library ).filter( trans.app.model.Library.table.c.root_folder_id == decoded_folder_id ).one()
+ except Exception:
+ raise exceptions.InternalServerError( 'Error loading from the database.' )
+ if trans.app.security_agent.library_is_public( library, contents=False ):
+ pass
+ else:
+ if trans.user:
+ log.warning( "SECURITY: User (id: %s) without proper access rights is trying to load folder with ID of %s" % ( trans.user.id, decoded_folder_id ) )
+ else:
+ log.warning( "SECURITY: Anonymous user without proper access rights is trying to load folder with ID of %s" % ( decoded_folder_id ) )
+ raise exceptions.ObjectNotFound( 'Folder with the id provided ( %s ) was not found' % str( folder_id ) )
+ else:
+ if trans.user:
+ log.warning( "SECURITY: User (id: %s) without proper access rights is trying to load folder with ID of %s" % ( trans.user.id, decoded_folder_id ) )
+ else:
+ log.warning( "SECURITY: Anonymous user without proper access rights is trying to load folder with ID of %s" % ( decoded_folder_id ) )
+ raise exceptions.ObjectNotFound( 'Folder with the id provided ( %s ) was not found' % str( folder_id ) )
+
+ def build_path( folder ):
+ """
+ Search the path upwards recursively and load the whole route of names and ids for breadcrumb building purposes.
+ """
+ path_to_root = []
+ # We are almost in root
+ if folder.parent_id is None:
+ path_to_root.append( ( 'F' + trans.security.encode_id( folder.id ), folder.name ) )
+ else:
+ # We add the current folder and traverse up one folder.
+ path_to_root.append( ( 'F' + trans.security.encode_id( folder.id ), folder.name ) )
+ upper_folder = trans.sa_session.query( trans.app.model.LibraryFolder ).get( folder.parent_id )
+ path_to_root.extend( build_path( upper_folder ) )
+ return path_to_root
+
+ # Return the reversed path so it starts with the library node.
+ full_path = build_path( folder )[::-1]
+
+ folder_contents = []
+ time_updated = ''
+ time_created = ''
+ # Go through every accessible item in the folder and include its meta-data.
+ for content_item in self._load_folder_contents( trans, folder ):
+ if trans.app.security_agent.can_access_library_item( current_user_roles, content_item, trans.user ):
+ return_item = {}
+ encoded_id = trans.security.encode_id( content_item.id )
+ time_updated = content_item.update_time.strftime( "%Y-%m-%d %I:%M %p" )
+ time_created = content_item.create_time.strftime( "%Y-%m-%d %I:%M %p" )
+
+ # For folder return also hierarchy values
+ if content_item.api_type == 'folder':
+ encoded_id = 'F' + encoded_id
+ return_item.update ( dict ( item_count = content_item.item_count ) )
+
+ if content_item.api_type == 'file':
+ library_dataset_dict = content_item.to_dict()
+ library_dataset_dict['data_type']
+ library_dataset_dict['file_size']
+ library_dataset_dict['date_uploaded']
+ return_item.update ( dict ( data_type = library_dataset_dict['data_type'],
+ file_size = library_dataset_dict['file_size'],
+ date_uploaded = library_dataset_dict['date_uploaded'] ) )
+
+ # For every item return also the default meta-data
+ return_item.update( dict( id = encoded_id,
+ type = content_item.api_type,
+ name = content_item.name,
+ time_updated = time_updated,
+ time_created = time_created
+ ) )
+ folder_contents.append( return_item )
+
+ return { 'metadata' : { 'full_path' : full_path, 'can_add_library_item': can_add_library_item }, 'folder_contents' : folder_contents }
+
+ def _load_folder_contents( self, trans, folder ):
"""
Loads all contents of the folder (folders and data sets) but only in the first level.
"""
@@ -37,101 +143,11 @@
return content_items
@web.expose_api
- def index( self, trans, folder_id, **kwd ):
- """
- GET /api/folders/{encoded_folder_id}/contents
- Displays a collection (list) of a folder's contents (files and folders).
- Encoded folder ID is prepended with 'F' if it is a folder as opposed to a data set which does not have it.
- Full path is provided as a separate object in response providing data for breadcrumb path building.
- """
- folder_container = []
- current_user_roles = trans.get_current_user_roles()
-
- if ( folder_id.startswith( 'F' ) ):
- try:
- decoded_folder_id = trans.security.decode_id( folder_id[1:] )
- except TypeError:
- trans.response.status = 400
- return "Malformed folder id ( %s ) specified, unable to decode." % str( folder_id )
-
- try:
- folder = trans.sa_session.query( trans.app.model.LibraryFolder ).get( decoded_folder_id )
- except:
- folder = None
- log.error( "FolderContentsController.index: Unable to retrieve folder with ID: %s" % folder_id )
-
- # We didn't find the folder or user does not have an access to it.
- if not folder:
- trans.response.status = 400
- return "Invalid folder id ( %s ) specified." % str( folder_id )
-
- if not ( trans.user_is_admin() or trans.app.security_agent.can_access_library_item( current_user_roles, folder, trans.user ) ):
- log.warning( "SECURITY: User (id: %s) without proper access rights is trying to load folder with ID of %s" % ( trans.user.id, folder.id ) )
- trans.response.status = 400
- return "Invalid folder id ( %s ) specified." % str( folder_id )
-
- path_to_root = []
- def build_path ( folder ):
- """
- Search the path upwards recursively and load the whole route of names and ids for breadcrumb purposes.
- """
- path_to_root = []
- # We are almost in root
- if folder.parent_id is None:
- path_to_root.append( ( 'F' + trans.security.encode_id( folder.id ), folder.name ) )
- else:
- # We add the current folder and traverse up one folder.
- path_to_root.append( ( 'F' + trans.security.encode_id( folder.id ), folder.name ) )
- upper_folder = trans.sa_session.query( trans.app.model.LibraryFolder ).get( folder.parent_id )
- path_to_root.extend( build_path( upper_folder ) )
- return path_to_root
-
- # Return the reversed path so it starts with the library node.
- full_path = build_path( folder )[::-1]
- folder_container.append( dict( full_path = full_path ) )
-
- folder_contents = []
- time_updated = ''
- time_created = ''
- # Go through every item in the folder and include its meta-data.
- for content_item in self.load_folder_contents( trans, folder ):
- return_item = {}
- encoded_id = trans.security.encode_id( content_item.id )
- time_updated = content_item.update_time.strftime( "%Y-%m-%d %I:%M %p" )
- time_created = content_item.create_time.strftime( "%Y-%m-%d %I:%M %p" )
-
- # For folder return also hierarchy values
- if content_item.api_type == 'folder':
- encoded_id = 'F' + encoded_id
- return_item.update ( dict ( item_count = content_item.item_count ) )
-
- if content_item.api_type == 'file':
- library_dataset_dict = content_item.to_dict()
- library_dataset_dict['data_type']
- library_dataset_dict['file_size']
- library_dataset_dict['date_uploaded']
- return_item.update ( dict ( data_type = library_dataset_dict['data_type'],
- file_size = library_dataset_dict['file_size'],
- date_uploaded = library_dataset_dict['date_uploaded'] ) )
-
- # For every item return also the default meta-data
- return_item.update( dict( id = encoded_id,
- type = content_item.api_type,
- name = content_item.name,
- time_updated = time_updated,
- time_created = time_created
- ) )
- folder_contents.append( return_item )
- # Put the data in the container
- folder_container.append( dict( folder_contents = folder_contents ) )
- return folder_container
-
- @web.expose_api
def show( self, trans, id, library_id, **kwd ):
"""
GET /api/folders/{encoded_folder_id}/
"""
- pass
+ raise exceptions.NotImplemented( 'Showing the library folder content is not implemented.' )
@web.expose_api
def create( self, trans, library_id, payload, **kwd ):
@@ -140,20 +156,11 @@
Creates a new folder. This should be superseded by the
LibraryController.
"""
- pass
+ raise exceptions.NotImplemented( 'Creating the library folder content is not implemented.' )
@web.expose_api
def update( self, trans, id, library_id, payload, **kwd ):
"""
PUT /api/folders/{encoded_folder_id}/contents
"""
- pass
-
- # TODO: Move to library_common.
- def __decode_library_content_id( self, trans, content_id ):
- if ( len( content_id ) % 16 == 0 ):
- return 'LibraryDataset', content_id
- elif ( content_id.startswith( 'F' ) ):
- return 'LibraryFolder', content_id[1:]
- else:
- raise HTTPBadRequest( 'Malformed library content id ( %s ) specified, unable to decode.' % str( content_id ) )
+ raise exceptions.NotImplemented( 'Updating the library folder content is not implemented.' )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/folders.py
--- a/lib/galaxy/webapps/galaxy/api/folders.py
+++ b/lib/galaxy/webapps/galaxy/api/folders.py
@@ -1,14 +1,17 @@
"""
-API operations on folders
+API operations on library folders
"""
-import logging, os, string, shutil, urllib, re, socket, traceback
+import os, string, shutil, urllib, re, socket, traceback
from galaxy import datatypes, jobs, web, security
+from galaxy.web import _future_expose_api as expose_api
+from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
from galaxy.web.base.controller import BaseAPIController,UsesLibraryMixin,UsesLibraryMixinItems
from galaxy.util.sanitize_html import sanitize_html
from cgi import escape, FieldStorage
from paste.httpexceptions import HTTPBadRequest
+import logging
log = logging.getLogger( __name__ )
class FoldersController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems ):
@@ -18,9 +21,9 @@
"""
GET /api/folders/
This would normally display a list of folders. However, that would
- be across multiple libraries, so it's not implemented yet.
+ be across multiple libraries, so it's not implemented.
"""
- pass
+ raise exceptions.NotImplemented( 'Listing all accessible library folders is not implemented.' )
@web.expose_api
def show( self, trans, id, **kwd ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/genomes.py
--- a/lib/galaxy/webapps/galaxy/api/genomes.py
+++ b/lib/galaxy/webapps/galaxy/api/genomes.py
@@ -1,7 +1,7 @@
-from galaxy import config, tools, web, util
-from galaxy.web.base.controller import BaseController, BaseAPIController
-from galaxy.util.bunch import Bunch
+from galaxy import web, util
+from galaxy.web.base.controller import BaseAPIController
from galaxy.web.framework.helpers import is_true
+from galaxy.webapps.galaxy.controllers.data_admin import build_param_dict as massage
def get_id( base, format ):
if format:
@@ -76,7 +76,6 @@
# 'download' Download and index
# 'index' Index only
params = util.Params( payload )
- from galaxy.web.controllers.data_admin import build_param_dict as massage
paramdict = massage( params, trans )
func = params.get( 'func', 'download' )
if func == 'download':
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/group_users.py
--- a/lib/galaxy/webapps/galaxy/api/group_users.py
+++ b/lib/galaxy/webapps/galaxy/api/group_users.py
@@ -58,7 +58,7 @@
email = user.email,
url = url_for( 'group_user', group_id=group_id, id=user_id) ) # TODO Fix This
if not item:
- item = "user %s not in group %s" % (user.email,group.name)
+ item = "user %s not in group %s" % (user.email, group.name)
except Exception, e:
item = "Error in group_user API group %s user %s" % (group.name, user.email)
log.error(item + ": %s" % str(e))
@@ -92,7 +92,7 @@
email = user.email,
url = url_for( 'group_user', group_id=group_id, id=user_id) )
except Exception, e:
- item = "Error in group_user API Adding user %s to group %s" % (user.email,group.name)
+ item = "Error in group_user API Adding user %s to group %s" % (user.email, group.name)
log.error(item + ": %s" % str(e))
return item
@@ -117,8 +117,8 @@
email = user.email,
url = url_for( 'group_user', group_id=group_id, id=user_id) )
if not item:
- item = "user %s not in group %s" % (user.email,group.name)
+ item = "user %s not in group %s" % (user.email, group.name)
except Exception, e:
- item = "Error in group_user API Removing user %s from group %s" % (user.email,group.name)
+ item = "Error in group_user API Removing user %s from group %s" % (user.email, group.name)
log.error(item + ": %s" % str(e))
return item
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/histories.py
--- a/lib/galaxy/webapps/galaxy/api/histories.py
+++ b/lib/galaxy/webapps/galaxy/api/histories.py
@@ -8,7 +8,6 @@
pkg_resources.require( "Paste" )
from galaxy import exceptions
-from galaxy import web
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
from galaxy.web import _future_expose_api_raw as expose_api_raw
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/history_contents.py
--- a/lib/galaxy/webapps/galaxy/api/history_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/history_contents.py
@@ -4,7 +4,6 @@
from galaxy import exceptions
from galaxy import util
-from galaxy import web
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
@@ -18,7 +17,6 @@
from galaxy.web.base.controller import UsesTagsMixin
from galaxy.web.base.controller import url_for
-from galaxy.util.sanitize_html import sanitize_html
from galaxy.webapps.galaxy.api import histories
@@ -190,8 +188,7 @@
hda_dict[ 'display_apps' ] = self.get_display_apps( trans, hda )
return hda_dict
- #TODO: allow anon users to copy hdas, ldas
- @expose_api
+ @expose_api_anonymous
def create( self, trans, history_id, payload, **kwd ):
"""
create( self, trans, history_id, payload, **kwd )
@@ -436,10 +433,7 @@
return validated_payload
def __handle_unknown_contents_type( self, trans, contents_type ):
- # TODO: raise a message exception instead of setting status and returning dict.
- trans.response.status = 400
- return { 'error': 'Unknown contents type %s' % type }
-
+ raise exceptions.UnknownContentsType('Unknown contents type: %s' % type)
class HDAManager( object ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/lda_datasets.py
--- a/lib/galaxy/webapps/galaxy/api/lda_datasets.py
+++ b/lib/galaxy/webapps/galaxy/api/lda_datasets.py
@@ -12,9 +12,13 @@
import urllib
import urllib2
import zipfile
-from paste.httpexceptions import HTTPBadRequest
-from galaxy import util, web
-from galaxy.exceptions import ItemAccessibilityException, MessageException, ItemDeletionException, ObjectNotFound
+from galaxy import exceptions
+from galaxy.web import _future_expose_api as expose_api
+from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
+# from paste.httpexceptions import HTTPBadRequest
+from galaxy import util
+from galaxy import web
+# from galaxy.exceptions import ItemAccessibilityException, MessageException, ItemDeletionException, ObjectNotFound
from galaxy.security import Action
from galaxy.util.streamball import StreamBall
from galaxy.web.base.controller import BaseAPIController, UsesVisualizationMixin
@@ -24,7 +28,7 @@
class LibraryDatasetsController( BaseAPIController, UsesVisualizationMixin ):
- @web.expose_api
+ @expose_api_anonymous
def show( self, trans, id, **kwd ):
"""
show( self, trans, id, **kwd )
@@ -41,19 +45,20 @@
try:
dataset = self.get_library_dataset( trans, id = id, check_ownership=False, check_accessible=True )
except Exception, e:
- trans.response.status = 500
- return str( e )
- try:
- rval = dataset.to_dict()
- except Exception, e:
- rval = "Error in dataset API at listing contents: " + str( e )
- log.error( rval + ": %s" % str(e), exc_info=True )
- trans.response.status = 500
- return "Error in dataset API at listing contents: " + str( e )
+ raise exceptions.ObjectNotFound( 'Requested dataset was not found.' )
+ # trans.response.status = 500
+ # return str( e )
+ # try:
+ rval = dataset.to_dict()
+ # except Exception, e:
+ # rval = "Error in dataset API at listing contents: " + str( e )
+ # log.error( rval + ": %s" % str(e), exc_info=True )
+ # trans.response.status = 500
+ # return "Error in dataset API at listing contents: " + str( e )
rval['id'] = trans.security.encode_id(rval['id']);
rval['ldda_id'] = trans.security.encode_id(rval['ldda_id']);
- rval['folder_id'] = 'f' + trans.security.encode_id(rval['folder_id'])
+ rval['folder_id'] = 'F' + trans.security.encode_id(rval['folder_id'])
return rval
@web.expose
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/libraries.py
--- a/lib/galaxy/webapps/galaxy/api/libraries.py
+++ b/lib/galaxy/webapps/galaxy/api/libraries.py
@@ -7,7 +7,7 @@
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
from galaxy.model.orm import and_, not_, or_
-from galaxy.web.base.controller import BaseAPIController, url_for
+from galaxy.web.base.controller import BaseAPIController
import logging
log = logging.getLogger( __name__ )
@@ -61,7 +61,6 @@
if trans.app.security_agent.library_is_public( library, contents=False ):
item[ 'public' ] = True
current_user_roles = trans.get_current_user_roles()
- # can_user_add = trans.app.security_agent.can_add_library_item( current_user_roles, library.root_folder )
if not trans.user_is_admin():
item['can_user_add'] = trans.app.security_agent.can_add_library_item( current_user_roles, library )
item['can_user_modify'] = trans.app.security_agent.can_modify_library_item( current_user_roles, library )
@@ -98,7 +97,7 @@
deleted = util.string_as_bool( deleted )
try:
decoded_library_id = trans.security.decode_id( library_id )
- except Exception:
+ except TypeError:
raise exceptions.MalformedId( 'Malformed library id ( %s ) specified, unable to decode.' % id )
try:
library = trans.sa_session.query( trans.app.model.Library ).get( decoded_library_id )
@@ -144,7 +143,14 @@
library.root_folder = root_folder
trans.sa_session.add_all( ( library, root_folder ) )
trans.sa_session.flush()
- return library.to_dict( view='element', value_mapper={ 'id' : trans.security.encode_id , 'root_folder_id' : trans.security.encode_id } )
+
+ item = library.to_dict( view='element', value_mapper={ 'id' : trans.security.encode_id , 'root_folder_id' : trans.security.encode_id } )
+ item['can_user_add'] = True
+ item['can_user_modify'] = True
+ item['can_user_manage'] = True
+ if trans.app.security_agent.library_is_public( library, contents=False ):
+ item[ 'public' ] = True
+ return item
@expose_api
def update( self, trans, id, **kwd ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/library_contents.py
--- a/lib/galaxy/webapps/galaxy/api/library_contents.py
+++ b/lib/galaxy/webapps/galaxy/api/library_contents.py
@@ -17,8 +17,7 @@
log = logging.getLogger( __name__ )
-class LibraryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems,
- UsesHistoryDatasetAssociationMixin ):
+class LibraryContentsController( BaseAPIController, UsesLibraryMixin, UsesLibraryMixinItems, UsesHistoryDatasetAssociationMixin ):
@expose_api
def index( self, trans, library_id, **kwd ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/metrics.py
--- a/lib/galaxy/webapps/galaxy/api/metrics.py
+++ b/lib/galaxy/webapps/galaxy/api/metrics.py
@@ -7,7 +7,6 @@
import datetime
from galaxy import exceptions
-from galaxy import web
from galaxy.web import require_admin
from galaxy.web import _future_expose_api as expose_api
from galaxy.web import _future_expose_api_anonymous as expose_api_anonymous
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/api/tools.py
--- a/lib/galaxy/webapps/galaxy/api/tools.py
+++ b/lib/galaxy/webapps/galaxy/api/tools.py
@@ -152,48 +152,6 @@
# -- Helper methods --
#
- def _run_tool( self, trans, tool_id, target_dataset_id, **kwargs ):
- """
- Run a tool. This method serves as a general purpose way to run tools asynchronously.
- """
-
- #
- # Set target history (the history that tool will use for outputs) using
- # target dataset. If user owns dataset, put new data in original
- # dataset's history; if user does not own dataset (and hence is accessing
- # dataset via sharing), put new data in user's current history.
- #
- target_dataset = self.get_dataset( trans, target_dataset_id, check_ownership=False, check_accessible=True )
- if target_dataset.history.user == trans.user:
- target_history = target_dataset.history
- else:
- target_history = trans.get_history( create=True )
-
- # HACK: tools require unencoded parameters but kwargs are typically
- # encoded, so try decoding all parameter values.
- for key, value in kwargs.items():
- try:
- value = trans.security.decode_id( value )
- kwargs[ key ] = value
- except:
- pass
-
- #
- # Execute tool.
- #
- tool = trans.app.toolbox.get_tool( tool_id )
- if not tool:
- return trans.app.model.Dataset.conversion_messages.NO_TOOL
-
- # HACK: add run button so that tool.handle_input will run tool.
- kwargs['runtool_btn'] = 'Execute'
- params = util.Params( kwargs, sanitize=False )
- template, vars = tool.handle_input( trans, params.__dict__, history=target_history )
-
- # TODO: check for errors and ensure that output dataset is available.
- output_datasets = vars[ 'out_data' ].values()
- return self.add_track_async( trans, output_datasets[0].id )
-
def _rerun_tool( self, trans, payload, **kwargs ):
"""
Rerun a tool to produce a new output dataset that corresponds to a
@@ -318,7 +276,7 @@
else:
# Recursive search.
return_val = False
- for name, value in param_dict.items():
+ for value in param_dict.values():
if isinstance( value, dict ):
return_val = set_value( value, group_name, group_index, param_name, param_value)
if return_val:
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -284,7 +284,7 @@
# ====================
# Handle displaying tool help images and README file images contained in repositories installed from the tool shed.
- webapp.add_route( '/admin_toolshed/static/images/:repository_id/:image_file',
+ webapp.add_route( '/admin_toolshed/static/images/:repository_id/{image_file:.+?}',
controller='admin_toolshed',
action='display_image_in_repository',
repository_id=None,
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 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
@@ -16,6 +16,7 @@
from tool_shed.util import data_manager_util
from tool_shed.util import datatype_util
from tool_shed.util import encoding_util
+from tool_shed.util import hg_util
from tool_shed.util import metadata_util
from tool_shed.util import readme_util
from tool_shed.util import repository_dependency_util
@@ -941,7 +942,7 @@
message += 'attribute value which is a directory relative to the Galaxy installation directory in order '
message += 'to automatically install tools from a Galaxy Tool Shed (e.g., the file name <b>shed_tool_conf.xml</b> '
message += 'whose <b><toolbox></b> tag is <b><toolbox tool_path="../shed_tools"></b>).<p/>See the '
- message += '<a href="http://wiki.g2.bx.psu.edu/InstallingRepositoriesToGalaxy" target="_blank">Installation '
+ message += '<a href="https://wiki.galaxyproject.org/InstallingRepositoriesToGalaxy" target="_blank">Installation '
message += 'of Galaxy Tool Shed repository tools into a local Galaxy instance</a> section of the Galaxy Tool '
message += 'Shed wiki for all of the details.'
return trans.show_error_message( message )
@@ -1851,7 +1852,7 @@
repo_files_dir = os.path.abspath( os.path.join( tool_path, relative_install_dir, name ) )
else:
repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, name ) )
- repo = hg.repository( suc.get_configured_ui(), path=repo_files_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), path=repo_files_dir )
repository_clone_url = os.path.join( tool_shed_url, 'repos', owner, name )
repository_util.pull_repository( repo, repository_clone_url, latest_ctx_rev )
suc.update_repository( repo, latest_ctx_rev )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/reports/config.py
--- a/lib/galaxy/webapps/reports/config.py
+++ b/lib/galaxy/webapps/reports/config.py
@@ -39,7 +39,7 @@
self.message_box_visible = kwargs.get( 'message_box_visible', False )
self.message_box_content = kwargs.get( 'message_box_content', None )
self.message_box_class = kwargs.get( 'message_box_class', 'info' )
- self.wiki_url = kwargs.get( 'wiki_url', 'http://wiki.g2.bx.psu.edu/FrontPage' )
+ self.wiki_url = kwargs.get( 'wiki_url', 'https://wiki.galaxyproject.org/' )
self.blog_url = kwargs.get( 'blog_url', None )
self.screencasts_url = kwargs.get( 'screencasts_url', None )
self.log_events = False
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/tool_shed/api/repositories.py
--- a/lib/galaxy/webapps/tool_shed/api/repositories.py
+++ b/lib/galaxy/webapps/tool_shed/api/repositories.py
@@ -13,6 +13,7 @@
import tool_shed.util.shed_util_common as suc
from tool_shed.galaxy_install import repository_util
from tool_shed.util import encoding_util
+from tool_shed.util import hg_util
from tool_shed.util import import_util
from tool_shed.util import metadata_util
from tool_shed.util import repository_maintenance_util
@@ -49,7 +50,7 @@
log.debug( error_message )
return []
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
ordered_installable_revisions = suc.get_ordered_metadata_changeset_revisions( repository, repo, downloadable=True )
return ordered_installable_revisions
else:
@@ -133,7 +134,7 @@
# The changeset_revision column in the repository_metadata table has been updated with a new
# value value, so find the changeset_revision to which we need to update.
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
new_changeset_revision = suc.get_next_downloadable_changeset_revision( repository, repo, changeset_revision )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
encoded_repository_id,
@@ -276,7 +277,7 @@
@web.expose_api
def repository_ids_for_setting_metadata( self, trans, my_writable=False, **kwd ):
"""
- GET /api/get_repository_ids_for_setting_metadata
+ GET /api/repository_ids_for_setting_metadata
Displays a collection (list) of repository ids ordered for setting metadata.
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/tool_shed/api/repository_revisions.py
--- a/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
+++ b/lib/galaxy/webapps/tool_shed/api/repository_revisions.py
@@ -6,6 +6,7 @@
from galaxy.model.orm import and_, not_, select
from galaxy.web.base.controller import BaseAPIController, HTTPBadRequest
from tool_shed.util import export_util
+from tool_shed.util import hg_util
import tool_shed.util.shed_util_common as suc
from galaxy import eggs
@@ -26,7 +27,7 @@
Creates and saves a gzip compressed tar archive of a repository and optionally all of it's repository dependencies.
The following parameters are included in the payload.
- :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository was installed
+ :param tool_shed_url (required): the base URL of the Tool Shed from which the Repository is to be exported
:param name (required): the name of the Repository
:param owner (required): the owner of the Repository
:param changeset_revision (required): the changeset_revision of the RepositoryMetadata object associated with the Repository
@@ -168,7 +169,7 @@
# The changeset_revision column in the repository_metadata table has been updated with a new
# value value, so find the changeset_revision to which we need to update.
repo_dir = repository_dependency.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
new_changeset_revision = suc.get_next_downloadable_changeset_revision( repository_dependency,
repo,
changeset_revision )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/tool_shed/config.py
--- a/lib/galaxy/webapps/tool_shed/config.py
+++ b/lib/galaxy/webapps/tool_shed/config.py
@@ -96,8 +96,8 @@
self.message_box_visible = kwargs.get( 'message_box_visible', False )
self.message_box_content = kwargs.get( 'message_box_content', None )
self.message_box_class = kwargs.get( 'message_box_class', 'info' )
- self.support_url = kwargs.get( 'support_url', 'http://wiki.g2.bx.psu.edu/Support' )
- self.wiki_url = kwargs.get( 'wiki_url', 'http://wiki.g2.bx.psu.edu/FrontPage' )
+ self.support_url = kwargs.get( 'support_url', 'https://wiki.galaxyproject.org/Support' )
+ self.wiki_url = kwargs.get( 'wiki_url', 'https://wiki.galaxyproject.org/' )
self.blog_url = kwargs.get( 'blog_url', None )
self.biostar_url = kwargs.get( 'biostar_url', None )
self.screencasts_url = kwargs.get( 'screencasts_url', None )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 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
@@ -19,6 +19,7 @@
from tool_shed.util import container_util
from tool_shed.util import encoding_util
from tool_shed.util import export_util
+from tool_shed.util import hg_util
from tool_shed.util import import_util
from tool_shed.util import metadata_util
from tool_shed.util import readme_util
@@ -719,7 +720,7 @@
status = kwd.get( 'status', 'done' )
commit_message = kwd.get( 'commit_message', 'Deleted selected files' )
repository = suc.get_repository_in_tool_shed( trans, id )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
# Update repository files for browsing.
suc.update_repository( repo )
changeset_revision = repository.tip( trans.app )
@@ -891,9 +892,9 @@
changeset_revision = kwd.get( 'changeset_revision', None )
repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
# Default to the current changeset revision.
- update_to_ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
+ update_to_ctx = hg_util.get_changectx_for_changeset( repo, changeset_revision )
latest_changeset_revision = changeset_revision
from_update_manager = kwd.get( 'from_update_manager', False )
if from_update_manager:
@@ -937,10 +938,10 @@
update_to_changeset_hash = None
for changeset in repo.changelog:
changeset_hash = str( repo.changectx( changeset ) )
- ctx = suc.get_changectx_for_changeset( repo, changeset_hash )
+ ctx = hg_util.get_changectx_for_changeset( repo, changeset_hash )
if update_to_changeset_hash:
if changeset_hash == repository.tip( trans.app ):
- update_to_ctx = suc.get_changectx_for_changeset( repo, changeset_hash )
+ update_to_ctx = hg_util.get_changectx_for_changeset( repo, changeset_hash )
latest_changeset_revision = changeset_hash
break
else:
@@ -949,7 +950,7 @@
changeset_hash )
if repository_metadata:
# We found a RepositoryMetadata record.
- update_to_ctx = suc.get_changectx_for_changeset( repo, changeset_hash )
+ update_to_ctx = hg_util.get_changectx_for_changeset( repo, changeset_hash )
latest_changeset_revision = changeset_hash
break
else:
@@ -1213,7 +1214,7 @@
else:
containers_dict = None
export_repository_dependencies_check_box = None
- revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=True )
+ revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=True )
return trans.fill_template( "/webapps/tool_shed/repository/export_repository.mako",
changeset_revision=changeset_revision,
containers_dict=containers_dict,
@@ -1466,9 +1467,9 @@
has_repository_dependencies_only_if_compiling_contained_td = has_galaxy_utilities_dict[ 'has_repository_dependencies_only_if_compiling_contained_td' ]
includes_workflows = has_galaxy_utilities_dict[ 'includes_workflows' ]
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
# Default to the received changeset revision and ctx_rev.
- update_to_ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
+ update_to_ctx = hg_util.get_changectx_for_changeset( repo, changeset_revision )
ctx_rev = str( update_to_ctx.rev() )
latest_changeset_revision = changeset_revision
update_dict = dict( changeset_revision=changeset_revision,
@@ -1497,7 +1498,7 @@
has_repository_dependencies = False
has_repository_dependencies_only_if_compiling_contained_td = False
changeset_hash = str( repo.changectx( changeset ) )
- ctx = suc.get_changectx_for_changeset( repo, changeset_hash )
+ ctx = hg_util.get_changectx_for_changeset( repo, changeset_hash )
if update_to_changeset_hash:
update_to_repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
trans.security.encode_id( repository.id ),
@@ -1515,10 +1516,10 @@
# We found a RepositoryMetadata record.
if changeset_hash == repository.tip( trans.app ):
# The current ctx is the repository tip, so use it.
- update_to_ctx = suc.get_changectx_for_changeset( repo, changeset_hash )
+ update_to_ctx = hg_util.get_changectx_for_changeset( repo, changeset_hash )
latest_changeset_revision = changeset_hash
else:
- update_to_ctx = suc.get_changectx_for_changeset( repo, update_to_changeset_hash )
+ update_to_ctx = hg_util.get_changectx_for_changeset( repo, update_to_changeset_hash )
latest_changeset_revision = update_to_changeset_hash
break
elif not update_to_changeset_hash and changeset_hash == changeset_revision:
@@ -1544,8 +1545,8 @@
changeset_revision = kwd[ 'changeset_revision' ]
repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
- ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
+ ctx = hg_util.get_changectx_for_changeset( repo, changeset_revision )
if ctx:
return str( ctx.rev() )
return ''
@@ -1560,8 +1561,8 @@
def get_file_from_changeset_revision( self, repo_files_dir, changeset_revision, file_name, dir ):
"""Return file_name from the received changeset_revision of the repository manifest."""
stripped_file_name = suc.strip_path( file_name )
- repo = hg.repository( suc.get_configured_ui(), repo_files_dir )
- ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_files_dir )
+ ctx = hg_util.get_changectx_for_changeset( repo, changeset_revision )
named_tmp_file = suc.get_named_tmpfile_from_ctx( ctx, file_name, dir )
return named_tmp_file
@@ -1604,7 +1605,7 @@
trans.model.Repository.table.c.user_id == user.id ) ):
repository = repository_metadata.repository
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
latest_downloadable_changeset_revsion = suc.get_latest_downloadable_changeset_revision( trans, repository, repo )
if repository_metadata.changeset_revision == latest_downloadable_changeset_revsion:
# We'll display only the test run for the latest installable revision in the rss feed.
@@ -1672,7 +1673,7 @@
if repository_name is not None and repository_owner is not None:
repository = suc.get_repository_by_name_and_owner( trans.app, repository_name, repository_owner )
if repository:
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
return suc.get_latest_downloadable_changeset_revision( trans, repository, repo )
return suc.INITIAL_CHANGELOG_HASH
@@ -1855,7 +1856,7 @@
changeset_revision = kwd[ 'changeset_revision' ]
repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
tool_version_dicts = []
for changeset in repo.changelog:
current_changeset_revision = str( repo.changectx( changeset ) )
@@ -1880,7 +1881,7 @@
repository_id = trans.security.encode_id( repository.id )
repository_clone_url = common_util.generate_clone_url_for_repository_in_tool_shed( trans, repository )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
if not repository_metadata:
# The received changeset_revision is no longer associated with metadata, so get the next changeset_revision in the repository
@@ -1889,7 +1890,7 @@
repo,
after_changeset_revision=changeset_revision )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
- ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
+ ctx = hg_util.get_changectx_for_changeset( repo, changeset_revision )
repo_info_dict = repository_util.create_repo_info_dict( trans=trans,
repository_clone_url=repository_clone_url,
changeset_revision=changeset_revision,
@@ -2165,7 +2166,7 @@
repository = suc.get_repository_in_tool_shed( trans, id )
repository_type = kwd.get( 'repository_type', str( repository.type ) )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
repo_name = kwd.get( 'repo_name', repository.name )
changeset_revision = kwd.get( 'changeset_revision', repository.tip( trans.app ) )
description = kwd.get( 'description', repository.description )
@@ -2317,7 +2318,7 @@
selected_value=changeset_revision,
add_id_to_name=False,
downloadable=False )
- revision_label = suc.get_revision_label( trans, repository, repository.tip( trans.app ), include_date=False )
+ revision_label = hg_util.get_revision_label( trans, repository, repository.tip( trans.app ), include_date=False )
repository_metadata = None
metadata = None
is_malicious = False
@@ -2326,7 +2327,7 @@
if changeset_revision != suc.INITIAL_CHANGELOG_HASH:
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, id, changeset_revision )
if repository_metadata:
- revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=False )
+ revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=False )
metadata = repository_metadata.metadata
is_malicious = repository_metadata.malicious
else:
@@ -2337,7 +2338,7 @@
if previous_changeset_revision != suc.INITIAL_CHANGELOG_HASH:
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, id, previous_changeset_revision )
if repository_metadata:
- revision_label = suc.get_revision_label( trans, repository, previous_changeset_revision, include_date=False )
+ revision_label = hg_util.get_revision_label( trans, repository, previous_changeset_revision, include_date=False )
metadata = repository_metadata.metadata
is_malicious = repository_metadata.malicious
changeset_revision = previous_changeset_revision
@@ -2443,7 +2444,7 @@
# There is no repository_metadata defined for the changeset_revision, so see if it was defined
# in a previous changeset in the changelog.
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
previous_changeset_revision = \
suc.get_previous_metadata_changeset_revision( repository,
repo,
@@ -2520,7 +2521,7 @@
changeset_revision = kwd.get( 'changeset_revision', None )
repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
# Get the next installable changeset_revision beyond the received changeset_revision.
changeset_revision = suc.get_next_downloadable_changeset_revision( repository, repo, changeset_revision )
if changeset_revision:
@@ -2540,7 +2541,7 @@
status = kwd.get( 'status', 'done' )
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
changeset_revision = kwd.get( 'changeset_revision', repository.tip( trans.app ) )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
if repository_metadata:
@@ -2570,17 +2571,14 @@
invalid = True
break
if invalid:
- message += 'The repository dependency definitions for this repository are invalid and will be ignored. '
- message += 'The complete dependency hierarchy could not be determined. The cause of repository dependency '
- message += 'definition errors like this can usually be seen when viewing the repository directly from the '
- message += 'Tool Shed. The exact cause cannot be determined when visiting the Tool Shed from Galaxy to '
- message += 'install the repository.'
+ message = repository_dependency_util.generate_message_for_invalid_repository_dependencies( metadata,
+ error_from_tuple=False )
status = 'error'
else:
repository_metadata_id = None
metadata = None
repository_dependencies = None
- revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=True )
+ revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=True )
changeset_revision_select_field = grids_util.build_changeset_revision_select_field( trans,
repository,
selected_value=changeset_revision,
@@ -2610,7 +2608,7 @@
changeset_revision = kwd.get( 'changeset_revision', None )
repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
# Get the lower bound changeset revision.
lower_bound_changeset_revision = suc.get_previous_metadata_changeset_revision( repository, repo, changeset_revision, downloadable=True )
# Build the list of changeset revision hashes.
@@ -2636,7 +2634,7 @@
status='error' ) )
repository = suc.get_repository_in_tool_shed( trans, id )
changeset_revision = repository.tip( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
if repository.user == trans.user:
return trans.response.send_redirect( web.url_for( controller='repository',
action='browse_repositories',
@@ -2654,7 +2652,7 @@
changeset_revision,
metadata_only=True )
repository_type_select_field = rt_util.build_repository_type_select_field( trans, repository=repository )
- revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=True )
+ revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=True )
return trans.fill_template( '/webapps/tool_shed/repository/rate_repository.mako',
repository=repository,
metadata=metadata,
@@ -2705,7 +2703,7 @@
commit_message = kwd.get( 'commit_message', 'Deleted selected files' )
repository = suc.get_repository_in_tool_shed( trans, id )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
selected_files_to_delete = kwd.get( 'selected_files_to_delete', '' )
if kwd.get( 'select_files_to_delete_button', False ):
if selected_files_to_delete:
@@ -2745,7 +2743,7 @@
# Update the repository files for browsing.
suc.update_repository( repo )
# Get the new repository tip.
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
if tip == repository.tip( trans.app ):
message += 'No changes to repository. '
kwd[ 'message' ] = message
@@ -2934,7 +2932,7 @@
if not repository_metadata:
# Get updates to the received changeset_revision if any exist.
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
upper_bound_changeset_revision = suc.get_next_downloadable_changeset_revision( repository, repo, changeset_revision )
if upper_bound_changeset_revision:
changeset_revision = upper_bound_changeset_revision
@@ -2974,7 +2972,7 @@
trans.security.encode_id( repository.id ),
changeset_revision )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
tool_shed_status_dict = {}
# Handle repository deprecation.
tool_shed_status_dict[ 'repository_deprecated' ] = str( repository.deprecated )
@@ -3066,7 +3064,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository = suc.get_repository_in_tool_shed( trans, id )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
changesets = []
for changeset in repo.changelog:
ctx = repo.changectx( changeset )
@@ -3077,7 +3075,7 @@
change_dict = { 'ctx' : ctx,
'rev' : str( ctx.rev() ),
'date' : date,
- 'display_date' : suc.get_readable_ctx_date( ctx ),
+ 'display_date' : hg_util.get_readable_ctx_date( ctx ),
'description' : ctx.description(),
'files' : ctx.files(),
'user' : ctx.user(),
@@ -3101,8 +3099,8 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository = suc.get_repository_in_tool_shed( trans, id )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
- ctx = suc.get_changectx_for_changeset( repo, ctx_str )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
+ ctx = hg_util.get_changectx_for_changeset( repo, ctx_str )
if ctx is None:
message = "Repository does not include changeset revision '%s'." % str( ctx_str )
status = 'error'
@@ -3132,7 +3130,7 @@
metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans, id, ctx_str, metadata_only=True )
# For rendering the prev button.
if ctx_parent:
- ctx_parent_date = suc.get_readable_ctx_date( ctx_parent )
+ ctx_parent_date = hg_util.get_readable_ctx_date( ctx_parent )
ctx_parent_rev = ctx_parent.rev()
if ctx_parent_rev < 0:
prev = None
@@ -3141,7 +3139,7 @@
else:
prev = None
if ctx_child:
- ctx_child_date = suc.get_readable_ctx_date( ctx_child )
+ ctx_child_date = hg_util.get_readable_ctx_date( ctx_child )
ctx_child_rev = ctx_child.rev()
next = "<b>%s:%s</b><i>(%s)</i>" % ( ctx_child_rev, ctx_child, ctx_child_date )
else:
@@ -3190,7 +3188,7 @@
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository = suc.get_repository_in_tool_shed( trans, id )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
avg_rating, num_ratings = self.get_ave_item_rating_data( trans.sa_session, repository, webapp_model=trans.model )
changeset_revision = kwd.get( 'changeset_revision', repository.tip( trans.app ) )
display_reviews = kwd.get( 'display_reviews', False )
@@ -3224,7 +3222,7 @@
selected_value=changeset_revision,
add_id_to_name=False,
downloadable=False )
- revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=False )
+ revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=False )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, id, changeset_revision )
if repository_metadata:
metadata = repository_metadata.metadata
@@ -3280,13 +3278,13 @@
render_repository_actions_for = kwd.get( 'render_repository_actions_for', 'tool_shed' )
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repo_files_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_files_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_files_dir )
tool_metadata_dict = {}
tool_lineage = []
tool = None
guid = None
original_tool_data_path = trans.app.config.tool_data_path
- revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=False )
+ revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=False )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
if repository_metadata:
repository_metadata_id = trans.security.encode_id( repository_metadata.id )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 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
@@ -7,6 +7,7 @@
from galaxy.webapps.tool_shed.util import ratings_util
from tool_shed.util.container_util import STRSEP
import tool_shed.util.shed_util_common as suc
+from tool_shed.util import hg_util
from tool_shed.util import review_util
from galaxy.util.odict import odict
import tool_shed.grids.repository_review_grids as repository_review_grids
@@ -72,8 +73,8 @@
status = kwd.get( 'status', 'done' )
review = review_util.get_review( trans, kwd[ 'id' ] )
repository = review.repository
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
- rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, review.changeset_revision )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
+ rev, changeset_revision_label = hg_util.get_rev_label_from_changeset_revision( repo, review.changeset_revision )
return trans.fill_template( '/webapps/tool_shed/repository_review/browse_review.mako',
repository=repository,
changeset_revision_label=changeset_revision_label,
@@ -232,7 +233,7 @@
for component in review_util.get_components( trans ):
components_dict[ component.name ] = dict( component=component, component_review=None )
repository = review.repository
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
for component_review in review.component_reviews:
if component_review and component_review.component:
component_name = component_review.component.name
@@ -337,7 +338,7 @@
name='revision_approved',
selected_value=selected_value,
for_component=False )
- rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, review.changeset_revision )
+ rev, changeset_revision_label = hg_util.get_rev_label_from_changeset_revision( repo, review.changeset_revision )
return trans.fill_template( '/webapps/tool_shed/repository_review/edit_review.mako',
repository=repository,
review=review,
@@ -470,7 +471,7 @@
if repository_id:
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
metadata_revision_hashes = [ metadata_revision.changeset_revision for metadata_revision in repository.metadata_revisions ]
reviewed_revision_hashes = [ review.changeset_revision for review in repository.reviews ]
reviews_dict = odict()
@@ -478,7 +479,7 @@
ctx = repo.changectx( changeset )
changeset_revision = str( ctx )
if changeset_revision in metadata_revision_hashes or changeset_revision in reviewed_revision_hashes:
- rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, changeset_revision )
+ rev, changeset_revision_label = hg_util.get_rev_label_from_changeset_revision( repo, changeset_revision )
if changeset_revision in reviewed_revision_hashes:
# Find the review for this changeset_revision
repository_reviews = review_util.get_reviews_by_repository_id_changeset_revision( trans, repository_id, changeset_revision )
@@ -517,9 +518,9 @@
changeset_revision = kwd.get( 'changeset_revision', None )
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
installable = changeset_revision in [ metadata_revision.changeset_revision for metadata_revision in repository.metadata_revisions ]
- rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, changeset_revision )
+ rev, changeset_revision_label = hg_util.get_rev_label_from_changeset_revision( repo, changeset_revision )
reviews = review_util.get_reviews_by_repository_id_changeset_revision( trans, repository_id, changeset_revision )
return trans.fill_template( '/webapps/tool_shed/repository_review/reviews_of_changeset_revision.mako',
repository=repository,
@@ -582,9 +583,9 @@
status = kwd.get( 'status', 'done' )
repository = suc.get_repository_in_tool_shed( trans, kwd[ 'id' ] )
changeset_revision = kwd.get( 'changeset_revision', None )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
previous_reviews_dict = review_util.get_previous_repository_reviews( trans, repository, changeset_revision )
- rev, changeset_revision_label = suc.get_rev_label_from_changeset_revision( repo, changeset_revision )
+ rev, changeset_revision_label = hg_util.get_rev_label_from_changeset_revision( repo, changeset_revision )
return trans.fill_template( '/webapps/tool_shed/repository_review/select_previous_review.mako',
repository=repository,
changeset_revision=changeset_revision,
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/galaxy/webapps/tool_shed/controllers/upload.py
--- a/lib/galaxy/webapps/tool_shed/controllers/upload.py
+++ b/lib/galaxy/webapps/tool_shed/controllers/upload.py
@@ -11,6 +11,7 @@
import tool_shed.repository_types.util as rt_util
import tool_shed.util.shed_util_common as suc
from tool_shed.util import commit_util
+from tool_shed.util import hg_util
from tool_shed.util import metadata_util
from tool_shed.util import repository_dependency_util
from tool_shed.util import tool_dependency_util
@@ -39,7 +40,7 @@
repository_id = kwd.get( 'repository_id', '' )
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
uncompress_file = util.string_as_bool( kwd.get( 'uncompress_file', 'true' ) )
remove_repo_files_not_in_tar = util.string_as_bool( kwd.get( 'remove_repo_files_not_in_tar', 'true' ) )
uploaded_file = None
@@ -63,7 +64,7 @@
repo_url = 'http%s' % url[ len( 'hg' ): ]
repo_url = repo_url.encode( 'ascii', 'replace' )
try:
- commands.clone( suc.get_configured_ui(), repo_url, uploaded_directory )
+ commands.clone( hg_util.get_configured_ui(), repo_url, uploaded_directory )
except Exception, e:
message = 'Error uploading via mercurial clone: %s' % suc.to_html_string( str( e ) )
status = 'error'
@@ -288,7 +289,8 @@
status = 'error'
# Handle messaging for invalid repository dependencies.
invalid_repository_dependencies_message = \
- repository_dependency_util.generate_message_for_invalid_repository_dependencies( metadata_dict )
+ repository_dependency_util.generate_message_for_invalid_repository_dependencies( metadata_dict,
+ error_from_tuple=True )
if invalid_repository_dependencies_message:
message += invalid_repository_dependencies_message
status = 'error'
@@ -322,7 +324,7 @@
def upload_directory( self, trans, repository, uploaded_directory, upload_point, remove_repo_files_not_in_tar,
commit_message, new_repo_alert ):
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
undesirable_dirs_removed = 0
undesirable_files_removed = 0
if upload_point is not None:
@@ -386,7 +388,7 @@
def upload_tar( self, trans, repository, tar, uploaded_file, upload_point, remove_repo_files_not_in_tar, commit_message, new_repo_alert ):
# Upload a tar archive of files.
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
undesirable_dirs_removed = 0
undesirable_files_removed = 0
ok, message = commit_util.check_archive( repository, tar )
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/tool_shed/galaxy_install/repository_util.py
--- a/lib/tool_shed/galaxy_install/repository_util.py
+++ b/lib/tool_shed/galaxy_install/repository_util.py
@@ -15,6 +15,7 @@
from tool_shed.util import data_manager_util
from tool_shed.util import datatype_util
from tool_shed.util import encoding_util
+from tool_shed.util import hg_util
from tool_shed.util import repository_dependency_util
from tool_shed.util import metadata_util
from tool_shed.util import tool_dependency_util
@@ -186,7 +187,7 @@
def get_repo_info_dict( trans, repository_id, changeset_revision ):
repository = suc.get_repository_in_tool_shed( trans, repository_id )
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
repository_clone_url = common_util.generate_clone_url_for_repository_in_tool_shed( trans, repository )
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans,
repository_id,
@@ -225,7 +226,7 @@
has_repository_dependencies_only_if_compiling_contained_td = False
includes_tool_dependencies = False
includes_tools_for_display_in_tool_panel = False
- ctx = suc.get_changectx_for_changeset( repo, changeset_revision )
+ ctx = hg_util.get_changectx_for_changeset( repo, changeset_revision )
repo_info_dict = create_repo_info_dict( trans=trans,
repository_clone_url=repository_clone_url,
changeset_revision=changeset_revision,
@@ -574,7 +575,7 @@
current_changeset_revision = changeset_revision_dict.get( 'changeset_revision', None )
current_ctx_rev = changeset_revision_dict.get( 'ctx_rev', None )
if current_ctx_rev != ctx_rev:
- repo = hg.repository( suc.get_configured_ui(), path=os.path.abspath( install_dir ) )
+ repo = hg.repository( hg_util.get_configured_ui(), path=os.path.abspath( install_dir ) )
pull_repository( repo, repository_clone_url, current_changeset_revision )
suc.update_repository( repo, ctx_rev=current_ctx_rev )
handle_repository_contents( trans,
@@ -804,7 +805,7 @@
def pull_repository( repo, repository_clone_url, ctx_rev ):
"""Pull changes from a remote repository to a local one."""
- commands.pull( suc.get_configured_ui(), repo, source=repository_clone_url, rev=[ ctx_rev ] )
+ commands.pull( hg_util.get_configured_ui(), repo, source=repository_clone_url, rev=[ ctx_rev ] )
def repair_tool_shed_repository( trans, repository, repo_info_dict ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/tool_shed/grids/admin_grids.py
--- a/lib/tool_shed/grids/admin_grids.py
+++ b/lib/tool_shed/grids/admin_grids.py
@@ -5,6 +5,7 @@
from galaxy.webapps.tool_shed import model
from galaxy.model.orm import and_
import tool_shed.util.shed_util_common as suc
+from tool_shed.util import hg_util
from tool_shed.grids.repository_grids import CategoryGrid
from tool_shed.grids.repository_grids import RepositoryGrid
@@ -425,9 +426,11 @@
def get_value( self, trans, grid, repository_metadata ):
repository = repository_metadata.repository
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
- ctx = suc.get_changectx_for_changeset( repo, repository_metadata.changeset_revision )
- return suc.get_revision_label( trans, repository, repository_metadata.changeset_revision, include_date=True )
+ return hg_util.get_revision_label( trans,
+ repository,
+ repository_metadata.changeset_revision,
+ include_date=True,
+ include_hash=True )
class ToolsColumn( grids.TextColumn ):
diff -r c8866f186e4d33a76aa7c4c6cbc975cd0c4e654a -r 18ac7049d256b9fbe24e6b6c0eb1fef79b941549 lib/tool_shed/grids/repository_grids.py
--- a/lib/tool_shed/grids/repository_grids.py
+++ b/lib/tool_shed/grids/repository_grids.py
@@ -6,6 +6,7 @@
from galaxy.model.orm import or_
from galaxy.util import json
from galaxy.util import listify
+from tool_shed.util import hg_util
import tool_shed.util.shed_util_common as suc
import tool_shed.grids.util as grids_util
import tool_shed.repository_types.util as rt_util
@@ -116,7 +117,7 @@
def get_value( self, trans, grid, repository ):
"""Display the current repository heads."""
repo_dir = repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
heads = suc.get_repository_heads( repo )
multiple_heads = len( heads ) > 1
if multiple_heads:
@@ -124,7 +125,7 @@
else:
heads_str = ''
for ctx in heads:
- heads_str += '%s<br/>' % suc.get_revision_label_from_ctx( ctx, include_date=True )
+ heads_str += '%s<br/>' % hg_util.get_revision_label_from_ctx( ctx, include_date=True )
heads_str.rstrip( '<br/>' )
if multiple_heads:
heads_str += '</font>'
@@ -1338,7 +1339,7 @@
def get_value( self, trans, grid, repository_metadata ):
repository = repository_metadata.repository
changeset_revision = repository_metadata.changeset_revision
- changeset_revision_label = suc.get_revision_label( trans, repository, changeset_revision, include_date=True )
+ changeset_revision_label = hg_util.get_revision_label( trans, repository, changeset_revision, include_date=True )
return changeset_revision_label
@@ -1482,7 +1483,7 @@
changeset_revision )
if not required_repository_metadata:
repo_dir = required_repository.repo_path( trans.app )
- repo = hg.repository( suc.get_configured_ui(), repo_dir )
+ repo = hg.repository( hg_util.get_configured_ui(), repo_dir )
updated_changeset_revision = suc.get_next_downloadable_changeset_revision( required_repository, repo, changeset_revision )
required_repository_metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
required_repository_id,
@@ -2029,7 +2030,7 @@
tool_dependency_definition.
"""
encoded_repository_id = trans.security.encode_id( repository.id )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
tip_ctx = str( repo.changectx( repo.changelog.tip() ) )
repository_metadata = None
try:
@@ -2077,7 +2078,7 @@
tool_dependency_definition.
"""
encoded_repository_id = trans.security.encode_id( repository.id )
- repo = hg.repository( suc.get_configured_ui(), repository.repo_path( trans.app ) )
+ repo = hg.repository( hg_util.get_configured_ui(), repository.repo_path( trans.app ) )
tip_ctx = str( repo.changectx( repo.changelog.tip() ) )
try:
repository_metadata = suc.get_repository_metadata_by_changeset_revision( trans, encoded_repository_id, tip_ctx )
This diff is so big that we needed to truncate the remainder.
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: QA: allow grunt watch on qunit tests, add stubs for metrics-logger and hda-base
by commits-noreply@bitbucket.org 11 Apr '14
by commits-noreply@bitbucket.org 11 Apr '14
11 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/144c0473003e/
Changeset: 144c0473003e
User: carlfeberhard
Date: 2014-04-11 19:34:06
Summary: QA: allow grunt watch on qunit tests, add stubs for metrics-logger and hda-base
Affected #: 9 files
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 static/scripts/utils/metrics-logger.js
--- a/static/scripts/utils/metrics-logger.js
+++ b/static/scripts/utils/metrics-logger.js
@@ -125,9 +125,11 @@
MetricsLogger.prototype._parseLevel = function _parseLevel( level ){
var type = typeof level;
if( type === 'number' ){ return level; }
- var upper = level.toUpperCase();
- if( type === 'string' && MetricsLogger.hasOwnProperty( upper ) ){
- return MetricsLogger[ upper ];
+ if( type === 'string' ){
+ var upper = level.toUpperCase();
+ if( MetricsLogger.hasOwnProperty( upper ) ){
+ return MetricsLogger[ upper ];
+ }
}
throw new Error( 'Unknown log level: ' + level );
};
@@ -381,6 +383,7 @@
//=============================================================================
return {
- MetricsLogger : MetricsLogger
+ MetricsLogger : MetricsLogger,
+ LoggingCache : LoggingCache
};
});
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/Gruntfile.js
--- a/test/qunit/Gruntfile.js
+++ b/test/qunit/Gruntfile.js
@@ -1,17 +1,33 @@
-module.exports = function(grunt) {
- grunt.initConfig({
- pkg: grunt.file.readJSON('package.json'),
-
- qunit: {
- all: ['tests/**/*.html'],
- options: {
- }
- },
+module.exports = function( grunt ){
+ grunt.initConfig({
+ pkg: grunt.file.readJSON( 'package.json' ),
- });
+ qunit: {
+ all: [ 'tests/**/*.html' ],
+ options: {
+ }
+ },
- grunt.loadNpmTasks('grunt-contrib-qunit');
- // register one or more task lists (you should ALWAYS have a "default" task list)
- grunt.registerTask('default', ['qunit']);
+ watch: {
+ // watch for changes in the src dir
+ files: [ 'tests/**.js', '../../static/scripts/**/**.js' ],
+ tasks: [ 'default' ]
+ }
+ });
+
+ // use 'grunt --test=my-tests.html' or 'grunt watch --test=my-tests.html'
+ // to only run the tests in tests/my-tests.html
+ if( grunt.option( 'test' ) ){
+ grunt.config.set( 'qunit.all', 'tests/' + grunt.option( 'test' ) );
+ grunt.log.writeln( '(only testing ' + grunt.config.get( 'qunit.all' ) + ')' );
+ }
+
+ grunt.loadNpmTasks( 'grunt-contrib-qunit' );
+
+ // use 'grunt watch' to have the qunit tests run when scripts or tests are changed
+ grunt.loadNpmTasks( 'grunt-contrib-watch' );
+
+ // register one or more task lists (you should ALWAYS have a "default" task list)
+ grunt.registerTask( 'default', [ 'qunit' ] );
};
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/README.txt
--- a/test/qunit/README.txt
+++ b/test/qunit/README.txt
@@ -6,6 +6,19 @@
% npm install
% grunt
+To watch for changes to scripts and tests and automatically re-run tests:
+
+ % grunt watch
+
+You can limit the tests run to a single file using the test option (note:
+that 'tests/' is prepended to the path):
+
+ % grunt --test=metrics-logger.html
+ (only testing tests/metrics-logger.html)
+
+ % grunt watch --test=metrics-logger.html
+ (only testing tests/metrics-logger.html)
+
From Web Browser (no additional dependencies):
Just open test HTML file in Web Browser.
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/package.json
--- a/test/qunit/package.json
+++ b/test/qunit/package.json
@@ -2,6 +2,7 @@
"name": "galaxy-qunit-tests",
"devDependencies": {
"grunt": "^0.4.4",
- "grunt-contrib-qunit": "^0.4.0"
+ "grunt-contrib-qunit": "^0.4.0",
+ "grunt-contrib-watch": "~0.5.3"
}
}
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/test-common.js
--- a/test/qunit/test-common.js
+++ b/test/qunit/test-common.js
@@ -13,7 +13,7 @@
// Custom paths for qunit testing dependencies...
"QUnit": qunit_absolute_directory + "test-libs/qunit-1.14.0", // .. because baseUrl is scripts to match Galaxy.
"sinon": qunit_absolute_directory + "test-libs/sinon-1.9.1",
- "sinon-qunit": qunit_absolute_directory + "test-libs/sinon-qunit-1.0.0",
+ "sinon-qunit": qunit_absolute_directory + "test-libs/sinon-qunit-1.0.0"
},
shim: {
// Ensure correct Qunit order in light of requirejs loading...
@@ -32,12 +32,12 @@
deps: [ 'sinon', "QUnit" ],
exports: "sinon" // Odd but seems to work
},
- "underscore": {
- exports: "_"
+ "underscore": {
+ exports: "_"
},
"backbone": {
deps: [ 'underscore', 'jquery' ],
- exports: "Backbone"
+ exports: "Backbone"
}
}
} );
@@ -48,10 +48,10 @@
root: '/'
};
-
require( [ "jquery", "QUnit" ], function( $, QUnit ) {
// Bootstrap HTML for displaying Qunit results.
- $('head').append( $('<link rel="stylesheet" type="text/css" />').attr( "href", qunit_absolute_directory + "test-libs/qunit-1.14.0.css") );
+ $('head').append( $('<link rel="stylesheet" type="text/css" />')
+ .attr( "href", qunit_absolute_directory + "test-libs/qunit-1.14.0.css") );
$('body').append( $('<div id="qunit">') );
$('body').append( $('<div id="qunit-fixture">') );
@@ -60,7 +60,6 @@
// underscore + backbone loaded here because they are assumed globals by
// much of the Galaxy client code.
require( [ "underscore", "backbone" ], function( _, Backbone ) {
-
require( [ test_module_path ], function( ) {
QUnit.load();
QUnit.start();
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/tests/hda-base.html
--- /dev/null
+++ b/test/qunit/tests/hda-base.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<!-- Minimal outline test page for a requirejs+qunit testing setup,
+ test environment is bootstrapped in test-common.js -->
+<html>
+ <head>
+ <script data-main="../test-common" src="../scripts/libs/require.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/tests/hda-base.js
--- /dev/null
+++ b/test/qunit/tests/hda-base.js
@@ -0,0 +1,35 @@
+// This file isn't really testing anything useful yet, it is just testing
+// (or demonstrating) qunit+backbone interactions.
+define([
+ "mvc/dataset/hda-model",
+ "mvc/dataset/hda-base",
+ "jquery",
+ "sinon-qunit",
+ "utils/localization"
+], function(
+ hdaModel,
+ hdaBase,
+ $,
+ sinon
+){
+ /*globals equal test module expect deepEqual strictEqual */
+ "use strict";
+
+ module( "HDA base backbone view tests" );
+
+ test( "Base HDA view default construction, initialize", function() {
+ var hda = new hdaModel.HistoryDatasetAssociation({
+ id : '123'
+ }),
+ view = new hdaBase.HDABaseView({ model: hda });
+
+ strictEqual( view.model, hda );
+
+ equal( view.linkTarget, '_blank' );
+ equal( view.selectable, false );
+ equal( view.selected, false );
+ equal( view.expanded, false );
+ equal( view.draggable, false );
+ equal( view.id(), 'hda-123' );
+ });
+});
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/tests/metrics-logger.html
--- /dev/null
+++ b/test/qunit/tests/metrics-logger.html
@@ -0,0 +1,10 @@
+<!doctype html>
+<!-- Minimal outline test page for a requirejs+qunit testing setup,
+ test environment is bootstrapped in test-common.js -->
+<html>
+ <head>
+ <script data-main="../test-common" src="../scripts/libs/require.js"></script>
+ </head>
+ <body>
+ </body>
+</html>
diff -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 -r 144c0473003e87d747087b2f04814a7fb6282264 test/qunit/tests/metrics-logger.js
--- /dev/null
+++ b/test/qunit/tests/metrics-logger.js
@@ -0,0 +1,56 @@
+// This file isn't really testing anything useful yet, it is just testing
+// (or demonstrating) qunit+backbone interactions.
+define([
+ "utils/metrics-logger",
+ "jquery",
+ "sinon-qunit"
+], function(
+ metrics,
+ $,
+ sinon
+){
+ /*globals equal test module expect deepEqual strictEqual throws */
+ "use strict";
+
+ module( "Metrics logger tests" );
+
+ test( "logger construction/initializiation defaults", function() {
+ var logger = new metrics.MetricsLogger({});
+ equal( logger.consoleLogger, null );
+ equal( logger.options.logLevel, metrics.MetricsLogger.INFO );
+ equal( logger.options.consoleLevel, metrics.MetricsLogger.NONE );
+ equal( logger.options.defaultNamespace, 'Galaxy' );
+ equal( logger.options.clientPrefix, 'client.' );
+ equal( logger.options.postSize, 1000 );
+ equal( logger.options.maxCacheSize, 3000 );
+ equal( logger.options.addTime, true );
+
+ equal( logger._postSize, 1000 );
+ equal( logger.cache.constructor, metrics.LoggingCache );
+ });
+
+ test( "_parseLevel", function() {
+ var logger = new metrics.MetricsLogger({});
+ equal( logger._parseLevel( 'all' ), metrics.MetricsLogger.ALL );
+ equal( logger._parseLevel( 'debug' ), metrics.MetricsLogger.DEBUG );
+ equal( logger._parseLevel( 'info' ), metrics.MetricsLogger.INFO );
+ equal( logger._parseLevel( 'warn' ), metrics.MetricsLogger.WARN );
+ equal( logger._parseLevel( 'error' ), metrics.MetricsLogger.ERROR );
+ equal( logger._parseLevel( 'metric' ), metrics.MetricsLogger.METRIC );
+ equal( logger._parseLevel( 'none' ), metrics.MetricsLogger.NONE );
+ equal( logger._parseLevel( 15 ), 15 );
+
+ throws( function(){
+ logger._parseLevel( undefined );
+ }, /Unknown log level/, 'Unknown log level throws error' );
+ throws( function(){
+ logger._parseLevel( 'nope' );
+ }, /Unknown log level/, 'Unknown log level throws error' );
+ });
+
+ test( "cache construction/initializiation defaults", function() {
+ var cache = new metrics.LoggingCache();
+ equal( cache.maxSize, 5000 );
+ equal( $.type( cache._cache ), 'array' );
+ });
+});
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: dannon: Merged in jlhg/galaxy-central (pull request #365)
by commits-noreply@bitbucket.org 11 Apr '14
by commits-noreply@bitbucket.org 11 Apr '14
11 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b7e3e7d7a62a/
Changeset: b7e3e7d7a62a
User: dannon
Date: 2014-04-11 17:33:20
Summary: Merged in jlhg/galaxy-central (pull request #365)
Update the job exit codes
Affected #: 1 file
diff -r 5a6b80f9a287c05a4138f5252a7c92d7f6f09f23 -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -72,9 +72,9 @@
'Variable_List' : '-v',
}
-# From pbs' job.h
+# From pbs' pbs_job.h
JOB_EXIT_STATUS = {
- 0: "job exec successful",
+ 0: "job exec successful",
-1: "job exec failed, before files, no retry",
-2: "job exec failed, after files, no retry",
-3: "job execution failed, do retry",
@@ -83,7 +83,10 @@
-6: "job aborted on MOM init, chkpt, ok migrate",
-7: "job restart failed",
-8: "exec() of user command failed",
- -11: "job maximum walltime exceeded", # Added by John, not from job.h.
+ -9: "could not create/open stdout stderr files",
+ -10: "job exceeded a memory limit",
+ -11: "job exceeded a walltime limit",
+ -12: "job exceeded a cpu time limit",
}
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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/8105df30de51/
Changeset: 8105df30de51
User: Jian-Long Huang
Date: 2014-04-11 15:41:39
Summary: Update the job exit codes
Affected #: 1 file
diff -r 5d666f5fae293488bc4f934125778f67627bc1e5 -r 8105df30de51754b5ce2ca3713b3425baf22c8fe lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -72,9 +72,9 @@
'Variable_List' : '-v',
}
-# From pbs' job.h
+# From pbs' pbs_job.h
JOB_EXIT_STATUS = {
- 0: "job exec successful",
+ 0: "job exec successful",
-1: "job exec failed, before files, no retry",
-2: "job exec failed, after files, no retry",
-3: "job execution failed, do retry",
@@ -83,7 +83,10 @@
-6: "job aborted on MOM init, chkpt, ok migrate",
-7: "job restart failed",
-8: "exec() of user command failed",
- -11: "job maximum walltime exceeded", # Added by John, not from job.h.
+ -9: "could not create/open stdout stderr files",
+ -10: "job exceeded a memory limit",
+ -11: "job exceeded a walltime limit",
+ -12: "job exceeded a cpu time limit",
}
https://bitbucket.org/galaxy/galaxy-central/commits/b7e3e7d7a62a/
Changeset: b7e3e7d7a62a
User: dannon
Date: 2014-04-11 17:33:20
Summary: Merged in jlhg/galaxy-central (pull request #365)
Update the job exit codes
Affected #: 1 file
diff -r 5a6b80f9a287c05a4138f5252a7c92d7f6f09f23 -r b7e3e7d7a62a724a3ffb0f04a05ceb0459630004 lib/galaxy/jobs/runners/pbs.py
--- a/lib/galaxy/jobs/runners/pbs.py
+++ b/lib/galaxy/jobs/runners/pbs.py
@@ -72,9 +72,9 @@
'Variable_List' : '-v',
}
-# From pbs' job.h
+# From pbs' pbs_job.h
JOB_EXIT_STATUS = {
- 0: "job exec successful",
+ 0: "job exec successful",
-1: "job exec failed, before files, no retry",
-2: "job exec failed, after files, no retry",
-3: "job execution failed, do retry",
@@ -83,7 +83,10 @@
-6: "job aborted on MOM init, chkpt, ok migrate",
-7: "job restart failed",
-8: "exec() of user command failed",
- -11: "job maximum walltime exceeded", # Added by John, not from job.h.
+ -9: "could not create/open stdout stderr files",
+ -10: "job exceeded a memory limit",
+ -11: "job exceeded a walltime limit",
+ -12: "job exceeded a cpu time limit",
}
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: QA: update anon API tests due to d46493c
by commits-noreply@bitbucket.org 11 Apr '14
by commits-noreply@bitbucket.org 11 Apr '14
11 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5a6b80f9a287/
Changeset: 5a6b80f9a287
User: carlfeberhard
Date: 2014-04-11 16:20:09
Summary: QA: update anon API tests due to d46493c
Affected #: 1 file
diff -r ac7fc8911184064056255224711031153f9421db -r 5a6b80f9a287c05a4138f5252a7c92d7f6f09f23 test/casperjs/api-anon-history-permission-tests.js
--- a/test/casperjs/api-anon-history-permission-tests.js
+++ b/test/casperjs/api-anon-history-permission-tests.js
@@ -82,13 +82,11 @@
'hda show worked' );
this.test.comment( 'Attempting to copy an accessible hda (default is accessible)'
- + ' fails from accessible history (currently login is required): ' + history.name );
- this.api.assertRaises( function(){
- this.api.hdas.create( this.api.histories.show( 'current' ).id, {
- source : 'hda',
- content : hdas[0].id
- });
- }, 403, 'API authentication required for this request', 'update authentication required' );
+ + ' should work from accessible history: ' + history.name );
+ this.api.hdas.create( this.api.histories.show( 'current' ).id, {
+ source : 'hda',
+ content : hdas[0].id
+ });
}
function testAnonReadFunctionsOnInaccessible( history, hdas ){
@@ -121,7 +119,7 @@
content : hdas[0].id
});
this.debug( this.jsonStr( returned ) );
- }, 403, 'API authentication required for this request', 'hda copy from failed with error' );
+ }, 403, 'History is not accessible to the current user', 'hda copy from failed with error' );
}
@@ -158,7 +156,7 @@
// should error before it checks the id
content : 'bler'
});
- }, 403, 'API authentication required for this request', 'hda copy to failed' );
+ }, 403, 'Must be logged in to manage Galaxy histories', 'hda copy to failed' );
}
function testAnonInaccessible( history, hdas ){
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: dannon: Close branch remove-stale-ignored
by commits-noreply@bitbucket.org 11 Apr '14
by commits-noreply@bitbucket.org 11 Apr '14
11 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/65bbbb2d227e/
Changeset: 65bbbb2d227e
Branch: remove-stale-ignored
User: dannon
Date: 2014-04-11 15:04:46
Summary: Close branch remove-stale-ignored
Affected #: 0 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: dannon: Merged in trevorw/galaxy-central-t/remove-stale-ignored (pull request #364)
by commits-noreply@bitbucket.org 11 Apr '14
by commits-noreply@bitbucket.org 11 Apr '14
11 Apr '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/ac7fc8911184/
Changeset: ac7fc8911184
User: dannon
Date: 2014-04-11 15:04:46
Summary: Merged in trevorw/galaxy-central-t/remove-stale-ignored (pull request #364)
remove misc files that slipped past hgignore
Affected #: 2 files
diff -r 2c6c7971d666166eb41ea4bd5838f31f3caabd41 -r ac7fc8911184064056255224711031153f9421db doc/source/lib/galaxy.webapps.galaxy.api.rst~
--- a/doc/source/lib/galaxy.webapps.galaxy.api.rst~
+++ /dev/null
@@ -1,179 +0,0 @@
-api Package
-===========
-
-:mod:`datasets` Module
-----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.datasets
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`folder_contents` Module
------------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.folder_contents
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`folders` Module
----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.folders
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`forms` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.forms
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`genomes` Module
----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.genomes
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`group_roles` Module
--------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.group_roles
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`group_users` Module
--------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.group_users
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`groups` Module
---------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.groups
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`histories` Module
------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.histories
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`history_contents` Module
-------------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.history_contents
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`libraries` Module
------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.libraries
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`library_contents` Module
-------------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.library_contents
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`permissions` Module
--------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.permissions
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`quotas` Module
---------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.quotas
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`request_types` Module
----------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.request_types
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`requests` Module
-----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.requests
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`roles` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.roles
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`samples` Module
----------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.samples
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`tools` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.tools
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`users` Module
--------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.users
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`visualizations` Module
-----------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.visualizations
- :members:
- :undoc-members:
- :show-inheritance:
-
-:mod:`workflows` Module
------------------------
-
-.. automodule:: galaxy.webapps.galaxy.api.workflows
- :members:
- :undoc-members:
- :show-inheritance:
-
diff -r 2c6c7971d666166eb41ea4bd5838f31f3caabd41 -r ac7fc8911184064056255224711031153f9421db static/jqtouch/.DS_Store
Binary file static/jqtouch/.DS_Store has changed
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