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
December 2013
- 1 participants
- 207 discussions
commit/galaxy-central: Dave Bouvier: Fix tool description being displayed in version column.
by commits-noreply@bitbucket.org 06 Dec '13
by commits-noreply@bitbucket.org 06 Dec '13
06 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d36e62d38e67/
Changeset: d36e62d38e67
User: Dave Bouvier
Date: 2013-12-06 18:31:11
Summary: Fix tool description being displayed in version column.
Affected #: 1 file
diff -r b469e14ff34c91e747057f91086969ef726fe78d -r d36e62d38e670ca18d294ce03b8e2aeba75fa8ee lib/tool_shed/util/container_util.py
--- a/lib/tool_shed/util/container_util.py
+++ b/lib/tool_shed/util/container_util.py
@@ -987,7 +987,7 @@
tool_id = str( tool_dict.get( 'id', 'unknown' ) )
name = str( tool_dict.get( 'name', 'unknown' ) )
description = str( tool_dict.get( 'description', '' ) )
- version = str( tool_dict.get( 'description', 'unknown' ) )
+ version = str( tool_dict.get( 'version', 'unknown' ) )
except Exception, e:
tool_config = str( e )
tool_id = 'unknown'
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
06 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b469e14ff34c/
Changeset: b469e14ff34c
User: carlfeberhard
Date: 2013-12-06 18:21:05
Summary: Merge stable
Affected #: 4 files
diff -r 3bf36025f174e2b2a47d33be555026be343e37c5 -r b469e14ff34c91e747057f91086969ef726fe78d lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -170,9 +170,6 @@
"""
controller = "visualization"
action = item.type
- if item.type == "phyloviz":
- controller = "phyloviz"
- action = "visualization"
return dict( controller=controller, action=action, id=item.id )
# Grid definition
@@ -898,22 +895,35 @@
query_args=kwargs )
@web.expose
- def phyloviz( self, trans, dataset_id, tree_index=0, **kwargs ):
- # Get HDA.
- hda = self.get_dataset( trans, dataset_id, check_ownership=False, check_accessible=True )
+ def phyloviz( self, trans, id=None, dataset_id=None, tree_index=0, **kwargs ):
+ config = None
+ data = None
- # Get data.
+ # if id, then this is a saved visualization; get it's config and the dataset_id from there
+ if id:
+ visualization = self.get_visualization( trans, id )
+ config = self.get_visualization_config( trans, visualization )
+ dataset_id = config.get( 'dataset_id', None )
+
+ # get the hda if we can, then it's data using the phyloviz parsers
+ if dataset_id:
+ hda = self.get_dataset( trans, dataset_id, check_ownership=False, check_accessible=True )
+ else:
+ return trans.show_message( "Phyloviz couldn't find a dataset_id" )
+
pd = PhylovizDataProvider( original_dataset=hda )
- config = pd.get_data( tree_index=tree_index )
+ data = pd.get_data( tree_index=tree_index )
- config["title"] = hda.display_name()
- config["ext"] = hda.datatype.file_ext
- config["dataset_id"] = dataset_id
- config["treeIndex"] = tree_index
- config["saved_visualization"] = False
-
- # Return viz.
- return trans.fill_template_mako( "visualization/phyloviz.mako", data = config[ "data" ], config=config )
+ # ensure at least a default configuration (gen. an new/unsaved visualization)
+ if not config:
+ config = {
+ 'dataset_id': dataset_id,
+ 'title' : hda.display_name(),
+ 'ext' : hda.datatype.file_ext,
+ 'treeIndex' : tree_index,
+ 'saved_visualization' : False
+ }
+ return trans.fill_template_mako( "visualization/phyloviz.mako", data=data, config=config )
@web.json
def bookmarks_from_dataset( self, trans, hda_id=None, ldda_id=None ):
diff -r 3bf36025f174e2b2a47d33be555026be343e37c5 -r b469e14ff34c91e747057f91086969ef726fe78d 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);this.set("root",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)}});console.debug("source:",n);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("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
diff -r 3bf36025f174e2b2a47d33be555026be343e37c5 -r b469e14ff34c91e747057f91086969ef726fe78d static/scripts/viz/phyloviz.js
--- a/static/scripts/viz/phyloviz.js
+++ b/static/scripts/viz/phyloviz.js
@@ -244,7 +244,7 @@
save: function() {
var root = this.root;
cleanTree(root);
- this.set("root", root);
+ //this.set("root", root);
function cleanTree(node){
// we need to remove parent to delete circular reference
@@ -267,10 +267,10 @@
show_message("Saving to Galaxy", "progress");
return $.ajax({
- url: this.url(),
- type: "POST",
+ url : this.url,
+ type : "POST",
dataType: "json",
- data: {
+ data : {
vis_json: JSON.stringify(config)
},
success: function(res){
@@ -478,7 +478,6 @@
self.updateAndRender(d); // re-render the tree
}
});
- console.debug( 'source:', source )
//TODO: newick and phyloxml return arrays. where should this go (client (here, else), server)?
if( toString.call( source ) === '[object Array]' ){
// if d is an array, replate with the first object (newick, phyloxml)
diff -r 3bf36025f174e2b2a47d33be555026be343e37c5 -r b469e14ff34c91e747057f91086969ef726fe78d templates/webapps/galaxy/visualization/phyloviz.mako
--- a/templates/webapps/galaxy/visualization/phyloviz.mako
+++ b/templates/webapps/galaxy/visualization/phyloviz.mako
@@ -169,9 +169,7 @@
$(function firstVizLoad(){ // calls when viz is loaded for the first time
var config = ${ h.to_json_string( config )};
- window.config = config;
- var data = ${h.to_json_string(data)};
- window.data = data;
+ var data = ${h.to_json_string(data['data'])};
initPhyloViz(data, config);
});
});
@@ -197,7 +195,7 @@
<div id = "phylovizNexInfo" class="navControl"><p>Select a tree to view:
<select id="phylovizNexSelector">
- % for tree, index in config["trees"]:
+ % for tree, index in data["trees"]:
<option value="${index}">${tree}</option>
% endfor
</select>
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: Visualizations: fixes to phyloviz to allow saving and loading as a visualization
by commits-noreply@bitbucket.org 06 Dec '13
by commits-noreply@bitbucket.org 06 Dec '13
06 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2e8596a621b4/
Changeset: 2e8596a621b4
Branch: stable
User: carlfeberhard
Date: 2013-12-06 18:20:13
Summary: Visualizations: fixes to phyloviz to allow saving and loading as a visualization
Affected #: 4 files
diff -r 63006e23bf7d32e18033e0e59c0c194259935f6d -r 2e8596a621b44cc83511b16ef71c5b31f4469194 lib/galaxy/webapps/galaxy/controllers/visualization.py
--- a/lib/galaxy/webapps/galaxy/controllers/visualization.py
+++ b/lib/galaxy/webapps/galaxy/controllers/visualization.py
@@ -170,9 +170,6 @@
"""
controller = "visualization"
action = item.type
- if item.type == "phyloviz":
- controller = "phyloviz"
- action = "visualization"
return dict( controller=controller, action=action, id=item.id )
# Grid definition
@@ -896,22 +893,35 @@
query_args=kwargs )
@web.expose
- def phyloviz( self, trans, dataset_id, tree_index=0, **kwargs ):
- # Get HDA.
- hda = self.get_dataset( trans, dataset_id, check_ownership=False, check_accessible=True )
+ def phyloviz( self, trans, id=None, dataset_id=None, tree_index=0, **kwargs ):
+ config = None
+ data = None
- # Get data.
+ # if id, then this is a saved visualization; get it's config and the dataset_id from there
+ if id:
+ visualization = self.get_visualization( trans, id )
+ config = self.get_visualization_config( trans, visualization )
+ dataset_id = config.get( 'dataset_id', None )
+
+ # get the hda if we can, then it's data using the phyloviz parsers
+ if dataset_id:
+ hda = self.get_dataset( trans, dataset_id, check_ownership=False, check_accessible=True )
+ else:
+ return trans.show_message( "Phyloviz couldn't find a dataset_id" )
+
pd = PhylovizDataProvider( original_dataset=hda )
- config = pd.get_data( tree_index=tree_index )
+ data = pd.get_data( tree_index=tree_index )
- config["title"] = hda.display_name()
- config["ext"] = hda.datatype.file_ext
- config["dataset_id"] = dataset_id
- config["treeIndex"] = tree_index
- config["saved_visualization"] = False
-
- # Return viz.
- return trans.fill_template_mako( "visualization/phyloviz.mako", data = config[ "data" ], config=config )
+ # ensure at least a default configuration (gen. an new/unsaved visualization)
+ if not config:
+ config = {
+ 'dataset_id': dataset_id,
+ 'title' : hda.display_name(),
+ 'ext' : hda.datatype.file_ext,
+ 'treeIndex' : tree_index,
+ 'saved_visualization' : False
+ }
+ return trans.fill_template_mako( "visualization/phyloviz.mako", data=data, config=config )
@web.json
def bookmarks_from_dataset( self, trans, hda_id=None, ldda_id=None ):
diff -r 63006e23bf7d32e18033e0e59c0c194259935f6d -r 2e8596a621b44cc83511b16ef71c5b31f4469194 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);this.set("root",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)}});console.debug("source:",n);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("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
diff -r 63006e23bf7d32e18033e0e59c0c194259935f6d -r 2e8596a621b44cc83511b16ef71c5b31f4469194 static/scripts/viz/phyloviz.js
--- a/static/scripts/viz/phyloviz.js
+++ b/static/scripts/viz/phyloviz.js
@@ -244,7 +244,7 @@
save: function() {
var root = this.root;
cleanTree(root);
- this.set("root", root);
+ //this.set("root", root);
function cleanTree(node){
// we need to remove parent to delete circular reference
@@ -267,10 +267,10 @@
show_message("Saving to Galaxy", "progress");
return $.ajax({
- url: this.url(),
- type: "POST",
+ url : this.url,
+ type : "POST",
dataType: "json",
- data: {
+ data : {
vis_json: JSON.stringify(config)
},
success: function(res){
@@ -478,7 +478,6 @@
self.updateAndRender(d); // re-render the tree
}
});
- console.debug( 'source:', source )
//TODO: newick and phyloxml return arrays. where should this go (client (here, else), server)?
if( toString.call( source ) === '[object Array]' ){
// if d is an array, replate with the first object (newick, phyloxml)
diff -r 63006e23bf7d32e18033e0e59c0c194259935f6d -r 2e8596a621b44cc83511b16ef71c5b31f4469194 templates/webapps/galaxy/visualization/phyloviz.mako
--- a/templates/webapps/galaxy/visualization/phyloviz.mako
+++ b/templates/webapps/galaxy/visualization/phyloviz.mako
@@ -169,9 +169,7 @@
$(function firstVizLoad(){ // calls when viz is loaded for the first time
var config = ${ h.to_json_string( config )};
- window.config = config;
- var data = ${h.to_json_string(data)};
- window.data = data;
+ var data = ${h.to_json_string(data['data'])};
initPhyloViz(data, config);
});
});
@@ -197,7 +195,7 @@
<div id = "phylovizNexInfo" class="navControl"><p>Select a tree to view:
<select id="phylovizNexSelector">
- % for tree, index in config["trees"]:
+ % for tree, index in data["trees"]:
<option value="${index}">${tree}</option>
% endfor
</select>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dan: Fix for determining pre-existing trans.app.model.GalaxySessionToHistoryAssociation when switching histories.
by commits-noreply@bitbucket.org 06 Dec '13
by commits-noreply@bitbucket.org 06 Dec '13
06 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3bf36025f174/
Changeset: 3bf36025f174
User: dan
Date: 2013-12-06 18:15:45
Summary: Fix for determining pre-existing trans.app.model.GalaxySessionToHistoryAssociation when switching histories.
Affected #: 1 file
diff -r bba4f8883afb62b142dd9ffa229db387f7e9f857 -r 3bf36025f174e2b2a47d33be555026be343e37c5 lib/galaxy/webapps/galaxy/controllers/history.py
--- a/lib/galaxy/webapps/galaxy/controllers/history.py
+++ b/lib/galaxy/webapps/galaxy/controllers/history.py
@@ -377,7 +377,7 @@
galaxy_session = trans.get_galaxy_session()
try:
association = trans.sa_session.query( trans.app.model.GalaxySessionToHistoryAssociation ) \
- .filter_by( session_id=galaxy_session.id, history_id=trans.security.decode_id( new_history.id ) ) \
+ .filter_by( session_id=galaxy_session.id, history_id=new_history.id ) \
.first()
except:
association = None
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jmchilton: Allow override of util.unicodify default encoding with GALAXY_DEFAULT_ENCODING.
by commits-noreply@bitbucket.org 06 Dec '13
by commits-noreply@bitbucket.org 06 Dec '13
06 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bba4f8883afb/
Changeset: bba4f8883afb
User: jmchilton
Date: 2013-12-06 16:45:59
Summary: Allow override of util.unicodify default encoding with GALAXY_DEFAULT_ENCODING.
See mailing list for more information : http://dev.list.galaxyproject.org/error-with-unicode-output-tp4662783.html. It would be more correct to add a database_encoding option to universe_wsgi.ini, but that would be more work and the even correcter approach is for deployers to configure their databases to store UTF-8 data.
Affected #: 1 file
diff -r a29d54619813d5da992b897557162a360b8d610c -r bba4f8883afb62b142dd9ffa229db387f7e9f857 lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py
+++ b/lib/galaxy/util/__init__.py
@@ -37,7 +37,7 @@
gzip_magic = '\037\213'
bz2_magic = 'BZh'
-DEFAULT_ENCODING = 'utf-8'
+DEFAULT_ENCODING = os.environ.get('GALAXY_DEFAULT_ENCODING', 'utf-8')
NULL_CHAR = '\000'
BINARY_CHARS = [ NULL_CHAR ]
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Send only a tool panel section id if selecting and existing section or a new tool panel section label when installing repositories that contain tools for display in the Galaxy tool panel from the tool shed. ToolSection objects are not passed at all, so the parameter names have been corrected for better identification.
by commits-noreply@bitbucket.org 05 Dec '13
by commits-noreply@bitbucket.org 05 Dec '13
05 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a29d54619813/
Changeset: a29d54619813
User: greg
Date: 2013-12-05 22:49:11
Summary: Send only a tool panel section id if selecting and existing section or a new tool panel section label when installing repositories that contain tools for display in the Galaxy tool panel from the tool shed. ToolSection objects are not passed at all, so the parameter names have been corrected for better identification.
Affected #: 29 files
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
--- a/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
+++ b/lib/galaxy/webapps/galaxy/api/tool_shed_repositories.py
@@ -264,7 +264,7 @@
no_tool_dependency_dir_message = "Tool dependencies can be automatically installed only if you set the value of your 'tool_dependency_dir' "
no_tool_dependency_dir_message += "setting in your Galaxy configuration file (universe_wsgi.ini) and restart your Galaxy server."
raise HTTPBadRequest( detail=no_tool_dependency_dir_message )
- new_tool_panel_section = payload.get( 'new_tool_panel_section_label', '' )
+ new_tool_panel_section_label = payload.get( 'new_tool_panel_section_label', '' )
shed_tool_conf = payload.get( 'shed_tool_conf', None )
if shed_tool_conf:
# Get the tool_path setting.
@@ -282,15 +282,20 @@
raise HTTPBadRequest( detail="Missing required parameter 'shed_tool_conf'." )
tool_panel_section_id = payload.get( 'tool_panel_section_id', '' )
if tool_panel_section_id not in [ None, '' ]:
- tool_panel_section = trans.app.toolbox.tool_panel[ tool_panel_section_id ]
+ if tool_panel_section_id not in trans.app.toolbox.tool_panel:
+ fixed_tool_panel_section_id = 'section_%s' % tool_panel_section_id
+ if fixed_tool_panel_section_id in trans.app.toolbox.tool_panel:
+ tool_panel_section_id = fixed_tool_panel_section_id
+ else:
+ tool_panel_section_id = ''
else:
- tool_panel_section = ''
+ tool_panel_section_id = ''
# Build the dictionary of information necessary for creating tool_shed_repository database records for each repository being installed.
installation_dict = dict( install_repository_dependencies=install_repository_dependencies,
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
no_changes_checked=False,
repo_info_dicts=repo_info_dicts,
- tool_panel_section=tool_panel_section,
+ tool_panel_section_id=tool_panel_section_id,
tool_path=tool_path,
tool_shed_url=tool_shed_url )
# Create the tool_shed_repository database records and gather additional information for repository installation.
@@ -307,17 +312,18 @@
install_repository_dependencies=install_repository_dependencies,
install_tool_dependencies=install_tool_dependencies,
message='',
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
shed_tool_conf=shed_tool_conf,
status='done',
- tool_panel_section=tool_panel_section,
+ tool_panel_section_id=tool_panel_section_id,
tool_panel_section_keys=tool_panel_section_keys,
tool_path=tool_path,
tool_shed_url=tool_shed_url )
# Prepare the repositories for installation. Even though this method receives a single combination of tool_shed_url, name, owner and
# changeset_revision, there may be multiple repositories for installation at this point because repository dependencies may have added
# additional repositories for installation along with the single specified repository.
- encoded_kwd, query, tool_shed_repositories, encoded_repository_ids = repository_util.initiate_repository_installation( trans, installation_dict )
+ encoded_kwd, query, tool_shed_repositories, encoded_repository_ids = \
+ repository_util.initiate_repository_installation( trans, installation_dict )
# Some repositories may have repository dependencies that are required to be installed before the dependent repository, so we'll
# order the list of tsr_ids to ensure all repositories install in the required order.
tsr_ids = [ trans.security.encode_id( tool_shed_repository.id ) for tool_shed_repository in tool_shed_repositories ]
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c 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
@@ -568,7 +568,10 @@
# Some repositories may have repository dependencies that are required to be installed before the dependent repository, so we'll
# order the list of tsr_ids to ensure all repositories install in the required order.
ordered_tsr_ids, ordered_repo_info_dicts, ordered_tool_panel_section_keys = \
- repository_util.order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys=tool_panel_section_keys )
+ repository_util.order_components_for_installation( trans,
+ tsr_ids,
+ repo_info_dicts,
+ tool_panel_section_keys=tool_panel_section_keys )
for tsr_id in ordered_tsr_ids:
repository = trans.install_model.context.query( trans.install_model.ToolShedRepository ).get( trans.security.decode_id( tsr_id ) )
if repository.status in [ trans.install_model.ToolShedRepository.installation_status.NEW,
@@ -816,8 +819,8 @@
has_repository_dependencies = util.string_as_bool( kwd.get( 'has_repository_dependencies', False ) )
install_repository_dependencies = kwd.get( 'install_repository_dependencies', '' )
# Every repository will be installed into the same tool panel section or all will be installed outside of any sections.
- new_tool_panel_section = kwd.get( 'new_tool_panel_section', '' )
- tool_panel_section = kwd.get( 'tool_panel_section', '' )
+ new_tool_panel_section_label = kwd.get( 'new_tool_panel_section_label', '' )
+ tool_panel_section_id = kwd.get( 'tool_panel_section_id', '' )
tool_panel_section_keys = []
# One or more repositories may include tools, but not necessarily all of them.
includes_tools = util.string_as_bool( kwd.get( 'includes_tools', False ) )
@@ -859,10 +862,10 @@
install_tool_dependencies = False
tool_path = suc.get_tool_path_by_shed_tool_conf_filename( trans, shed_tool_conf )
installation_dict = dict( install_repository_dependencies=install_repository_dependencies,
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
no_changes_checked=False,
repo_info_dicts=repo_info_dicts,
- tool_panel_section=tool_panel_section,
+ tool_panel_section_id=tool_panel_section_id,
tool_path=tool_path,
tool_shed_url=tool_shed_url )
created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \
@@ -877,10 +880,10 @@
install_repository_dependencies=install_repository_dependencies,
install_tool_dependencies=install_tool_dependencies,
message=message,
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
shed_tool_conf=shed_tool_conf,
status=status,
- tool_panel_section=tool_panel_section,
+ tool_panel_section_id=tool_panel_section_id,
tool_panel_section_keys=tool_panel_section_keys,
tool_path=tool_path,
tool_shed_url=tool_shed_url )
@@ -993,7 +996,7 @@
install_tool_dependencies_check_box=install_tool_dependencies_check_box,
has_repository_dependencies=has_repository_dependencies,
install_repository_dependencies_check_box=install_repository_dependencies_check_box,
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
containers_dict=containers_dict,
shed_tool_conf=shed_tool_conf,
shed_tool_conf_select_field=shed_tool_conf_select_field,
@@ -1012,7 +1015,7 @@
install_tool_dependencies_check_box=install_tool_dependencies_check_box,
has_repository_dependencies=has_repository_dependencies,
install_repository_dependencies_check_box=install_repository_dependencies_check_box,
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
containers_dict=containers_dict,
shed_tool_conf=shed_tool_conf,
shed_tool_conf_select_field=shed_tool_conf_select_field,
@@ -1024,7 +1027,10 @@
@web.expose
@web.require_admin
def reinstall_repository( self, trans, **kwd ):
- """Reinstall a tool shed repository that has been previously uninstalled, making sure to handle all repository and tool dependencies of the repository."""
+ """
+ Reinstall a tool shed repository that has been previously uninstalled, making sure to handle all repository
+ and tool dependencies of the repository.
+ """
message = kwd.get( 'message', '' )
status = kwd.get( 'status', 'done' )
repository_id = kwd[ 'id' ]
@@ -1040,8 +1046,8 @@
relative_install_dir = os.path.join( clone_dir, tool_shed_repository.name )
tool_shed_url = suc.get_url_from_tool_shed( trans.app, tool_shed_repository.tool_shed )
tool_section = None
- tool_panel_section = kwd.get( 'tool_panel_section', '' )
- new_tool_panel_section = kwd.get( 'new_tool_panel_section', '' )
+ tool_panel_section_id = kwd.get( 'tool_panel_section_id', '' )
+ new_tool_panel_section_label = kwd.get( 'new_tool_panel_section_label', '' )
tool_panel_section_key = None
tool_panel_section_keys = []
metadata = tool_shed_repository.metadata
@@ -1049,11 +1055,15 @@
includes_tool_dependencies = tool_shed_repository.includes_tool_dependencies
if tool_shed_repository.includes_tools_for_display_in_tool_panel:
# Handle the selected tool panel location for loading tools included in the tool shed repository.
- tool_section, new_tool_panel_section, tool_panel_section_key = tool_util.handle_tool_panel_selection( trans=trans,
- metadata=metadata,
- no_changes_checked=no_changes_checked,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
+ tool_section, tool_panel_section_key = \
+ tool_util.handle_tool_panel_selection( trans=trans,
+ metadata=metadata,
+ no_changes_checked=no_changes_checked,
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
+ if tool_section is not None:
+ # Just in case the tool_section.id differs from tool_panel_section_id, which it shouldn't...
+ tool_panel_section_id = str( tool_section.id )
if tool_shed_repository.status == trans.install_model.ToolShedRepository.installation_status.UNINSTALLED:
# The repository's status must be updated from 'Uninstalled' to 'New' when initiating reinstall so the repository_installation_updater will function.
tool_shed_repository = suc.create_or_update_tool_shed_repository( trans.app,
@@ -1080,7 +1090,8 @@
else:
# Entering this else block occurs only if the tool_shed_repository does not include any valid tools.
if install_repository_dependencies:
- repository_dependencies = repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
+ repository_dependencies = \
+ repository_dependency_util.get_repository_dependencies_for_installed_tool_shed_repository( trans, tool_shed_repository )
else:
repository_dependencies = None
if metadata:
@@ -1107,8 +1118,7 @@
repo_info_dicts=repo_info_dicts,
install_repository_dependencies=install_repository_dependencies,
no_changes_checked=no_changes_checked,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
+ tool_panel_section_id=tool_panel_section_id )
# Default the selected tool panel location for loading tools included in each newly installed required tool shed repository to the location
# selected for the repository selected for reinstallation.
for index, tps_key in enumerate( tool_panel_section_keys ):
@@ -1121,10 +1131,10 @@
install_tool_dependencies=install_tool_dependencies,
repo_info_dicts=filtered_repo_info_dicts,
message=message,
- new_tool_panel_section=new_tool_panel_section,
+ new_tool_panel_section_label=new_tool_panel_section_label,
shed_tool_conf=shed_tool_conf,
status=status,
- tool_panel_section=tool_panel_section,
+ tool_panel_section_id=tool_panel_section_id,
tool_path=tool_path,
tool_panel_section_keys=tool_panel_section_keys,
tool_shed_repository_ids=encoded_repository_ids,
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c 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
@@ -244,9 +244,10 @@
tool_panel_section_id = section_dict[ 'id' ]
tool_panel_section_name = section_dict[ 'name' ]
if tool_panel_section_id:
- tool_panel_section_key, tool_panel_section = tool_util.get_or_create_tool_section( trans,
- tool_panel_section_id=tool_panel_section_id,
- new_tool_panel_section=tool_panel_section_name )
+ tool_panel_section_key, tool_panel_section = \
+ tool_util.get_or_create_tool_section( trans,
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=tool_panel_section_name )
else:
tool_dependencies = None
repo_info_dict = create_repo_info_dict( trans=trans,
@@ -432,10 +433,10 @@
def handle_tool_shed_repositories( trans, installation_dict, using_api=False ):
# The following installation_dict entries are all required.
install_repository_dependencies = installation_dict[ 'install_repository_dependencies' ]
- new_tool_panel_section = installation_dict[ 'new_tool_panel_section' ]
+ new_tool_panel_section_label = installation_dict[ 'new_tool_panel_section_label' ]
no_changes_checked = installation_dict[ 'no_changes_checked' ]
repo_info_dicts = installation_dict[ 'repo_info_dicts' ]
- tool_panel_section = installation_dict[ 'tool_panel_section' ]
+ tool_panel_section_id = installation_dict[ 'tool_panel_section_id' ]
tool_path = installation_dict[ 'tool_path' ]
tool_shed_url = installation_dict[ 'tool_shed_url' ]
created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts = \
@@ -445,8 +446,8 @@
repo_info_dicts=repo_info_dicts,
install_repository_dependencies=install_repository_dependencies,
no_changes_checked=no_changes_checked,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
return created_or_updated_tool_shed_repositories, tool_panel_section_keys, repo_info_dicts, filtered_repo_info_dicts
def initiate_repository_installation( trans, installation_dict ):
@@ -460,18 +461,19 @@
install_repository_dependencies = installation_dict[ 'install_repository_dependencies' ]
install_tool_dependencies = installation_dict[ 'install_tool_dependencies' ]
message = installation_dict[ 'message' ]
- new_tool_panel_section = installation_dict[ 'new_tool_panel_section' ]
+ new_tool_panel_section_label = installation_dict[ 'new_tool_panel_section_label' ]
shed_tool_conf = installation_dict[ 'shed_tool_conf' ]
status = installation_dict[ 'status' ]
- tool_panel_section = installation_dict[ 'tool_panel_section' ]
+ tool_panel_section_id = installation_dict[ 'tool_panel_section_id' ]
tool_panel_section_keys = installation_dict[ 'tool_panel_section_keys' ]
tool_path = installation_dict[ 'tool_path' ]
tool_shed_url = installation_dict[ 'tool_shed_url' ]
# Handle contained tools.
- if includes_tools_for_display_in_tool_panel and ( new_tool_panel_section or tool_panel_section ):
- tool_panel_section_key, tool_section = tool_util.handle_tool_panel_section( trans,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
+ if includes_tools_for_display_in_tool_panel and ( new_tool_panel_section_label or tool_panel_section_id ):
+ tool_panel_section_key, tool_section = \
+ tool_util.handle_tool_panel_section( trans,
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
else:
tool_panel_section_key = None
tool_section = None
@@ -667,16 +669,19 @@
def order_components_for_installation( trans, tsr_ids, repo_info_dicts, tool_panel_section_keys ):
"""
- Some repositories may have repository dependencies that are required to be installed before the dependent repository. This method will inspect the list of
- repositories about to be installed and make sure to order them appropriately. For each repository about to be installed, if required repositories are not
- contained in the list of repositories about to be installed, then they are not considered. Repository dependency definitions that contain circular dependencies
- should not result in an infinite loop, but obviously prior installation will not be handled for one or more of the repositories that require prior installation.
+ Some repositories may have repository dependencies that are required to be installed before the dependent repository.
+ This method will inspect the list of repositories about to be installed and make sure to order them appropriately.
+ For each repository about to be installed, if required repositories are not contained in the list of repositories about
+ to be installed, then they are not considered. Repository dependency definitions that contain circular dependencies
+ should not result in an infinite loop, but obviously prior installation will not be handled for one or more of the
+ repositories that require prior installation.
"""
ordered_tsr_ids = []
ordered_repo_info_dicts = []
ordered_tool_panel_section_keys = []
- # Create a dictionary whose keys are the received tsr_ids and whose values are a list of tsr_ids, each of which is contained in the received list of tsr_ids
- # and whose associated repository must be installed prior to the repository associated with the tsr_id key.
+ # Create a dictionary whose keys are the received tsr_ids and whose values are a list of tsr_ids, each of which is
+ # contained in the received list of tsr_ids and whose associated repository must be installed prior to the repository
+ # associated with the tsr_id key.
prior_install_required_dict = suc.get_prior_import_or_install_required_dict( trans, tsr_ids, repo_info_dicts )
processed_tsr_ids = []
while len( processed_tsr_ids ) != len( prior_install_required_dict.keys() ):
@@ -688,17 +693,19 @@
for prior_install_required_id in prior_install_required_ids:
if prior_install_required_id not in ordered_tsr_ids:
# Install the associated repository dependency first.
- prior_repo_info_dict, prior_tool_panel_section_key = get_repository_components_for_installation( prior_install_required_id,
- tsr_ids,
- repo_info_dicts,
- tool_panel_section_keys=tool_panel_section_keys )
+ prior_repo_info_dict, prior_tool_panel_section_key = \
+ get_repository_components_for_installation( prior_install_required_id,
+ tsr_ids,
+ repo_info_dicts,
+ tool_panel_section_keys=tool_panel_section_keys )
ordered_tsr_ids.append( prior_install_required_id )
ordered_repo_info_dicts.append( prior_repo_info_dict )
ordered_tool_panel_section_keys.append( prior_tool_panel_section_key )
- repo_info_dict, tool_panel_section_key = get_repository_components_for_installation( tsr_id,
- tsr_ids,
- repo_info_dicts,
- tool_panel_section_keys=tool_panel_section_keys )
+ repo_info_dict, tool_panel_section_key = \
+ get_repository_components_for_installation( tsr_id,
+ tsr_ids,
+ repo_info_dicts,
+ tool_panel_section_keys=tool_panel_section_keys )
ordered_tsr_ids.append( tsr_id )
ordered_repo_info_dicts.append( repo_info_dict )
ordered_tool_panel_section_keys.append( tool_panel_section_key )
@@ -763,11 +770,12 @@
shed_tool_conf, tool_path, relative_install_dir = suc.get_tool_panel_config_tool_path_install_dir( trans.app, repository )
# Reset the repository attributes to the New state for installation.
if metadata:
- tool_section, new_tool_panel_section, tool_panel_section_key = tool_util.handle_tool_panel_selection( trans,
- metadata,
- no_changes_checked=True,
- tool_panel_section=None,
- new_tool_panel_section=None )
+ tool_section, tool_panel_section_key = \
+ tool_util.handle_tool_panel_selection( trans,
+ metadata,
+ no_changes_checked=True,
+ tool_panel_section_id=None,
+ new_tool_panel_section_label=None )
else:
# The tools will be loaded outside of any sections in the tool panel.
tool_panel_section_key = None
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c lib/tool_shed/util/repository_dependency_util.py
--- a/lib/tool_shed/util/repository_dependency_util.py
+++ b/lib/tool_shed/util/repository_dependency_util.py
@@ -96,7 +96,7 @@
return True
def create_repository_dependency_objects( trans, tool_path, tool_shed_url, repo_info_dicts, install_repository_dependencies=False,
- no_changes_checked=False, tool_panel_section=None, new_tool_panel_section=None ):
+ no_changes_checked=False, tool_panel_section_id=None, new_tool_panel_section_label=None ):
"""
Discover all repository dependencies and make sure all tool_shed_repository and associated repository_dependency records exist as well as
the dependency relationships between installed repositories. This method is called when uninstalled repositories are being reinstalled.
@@ -174,28 +174,30 @@
# The database record for the tool shed repository currently being processed can be updated. Get the repository metadata
# to see where it was previously located in the tool panel.
if repository_db_record and repository_db_record.metadata:
- tool_section, new_tool_panel_section, tool_panel_section_key = \
+ tool_section, tool_panel_section_key = \
tool_util.handle_tool_panel_selection( trans=trans,
metadata=repository_db_record.metadata,
no_changes_checked=no_changes_checked,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
else:
# We're installing a new tool shed repository that does not yet have a database record.
- tool_panel_section_key, tool_section = tool_util.handle_tool_panel_section( trans,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
- tool_shed_repository = suc.create_or_update_tool_shed_repository( app=trans.app,
- name=name,
- description=description,
- installed_changeset_revision=changeset_revision,
- ctx_rev=ctx_rev,
- repository_clone_url=repository_clone_url,
- metadata_dict={},
- status=trans.install_model.ToolShedRepository.installation_status.NEW,
- current_changeset_revision=changeset_revision,
- owner=repository_owner,
- dist_to_shed=False )
+ tool_panel_section_key, tool_section = \
+ tool_util.handle_tool_panel_section( trans,
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
+ tool_shed_repository = \
+ suc.create_or_update_tool_shed_repository( app=trans.app,
+ name=name,
+ description=description,
+ installed_changeset_revision=changeset_revision,
+ ctx_rev=ctx_rev,
+ repository_clone_url=repository_clone_url,
+ metadata_dict={},
+ status=trans.install_model.ToolShedRepository.installation_status.NEW,
+ current_changeset_revision=changeset_revision,
+ owner=repository_owner,
+ dist_to_shed=False )
if tool_shed_repository not in all_created_or_updated_tool_shed_repositories:
all_created_or_updated_tool_shed_repositories.append( tool_shed_repository )
# Only append the tool shed repository to the list of created_or_updated_tool_shed_repositories if it is supposed to be installed.
@@ -459,9 +461,10 @@
common_util.parse_repository_dependency_tuple( repository_dependency )
if suc.tool_shed_is_this_tool_shed( toolshed ):
required_repository = suc.get_repository_by_name_and_owner( trans.app, name, owner )
- required_repository_metadata = metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
- trans.security.encode_id( required_repository.id ),
- changeset_revision )
+ required_repository_metadata = \
+ metadata_util.get_repository_metadata_by_repository_id_changeset_revision( trans,
+ trans.security.encode_id( required_repository.id ),
+ changeset_revision )
if required_repository_metadata:
# The required_repository_metadata changeset_revision is installable.
required_metadata = required_repository_metadata.metadata
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c lib/tool_shed/util/tool_util.py
--- a/lib/tool_shed/util/tool_util.py
+++ b/lib/tool_shed/util/tool_util.py
@@ -108,7 +108,7 @@
for k, v in trans.app.toolbox.tool_panel.items():
if isinstance( v, galaxy.tools.ToolSection ):
options.append( ( v.name, v.id ) )
- select_field = SelectField( name='tool_panel_section', display='radio' )
+ select_field = SelectField( name='tool_panel_section_id', display='radio' )
for option_tup in options:
select_field.add_option( option_tup[ 0 ], option_tup[ 1 ] )
return select_field
@@ -461,29 +461,28 @@
fh.close()
return sample_files, deleted_sample_files
-def get_or_create_tool_section( trans, tool_panel_section_id, new_tool_panel_section=None ):
- tool_panel_section_key = 'section_%s' % str( tool_panel_section_id )
+def get_or_create_tool_section( trans, tool_panel_section_id, new_tool_panel_section_label=None ):
+ if tool_panel_section_id.startswith( 'section_' ):
+ tool_panel_section_key = tool_panel_section_id
+ tool_panel_section_id.lstrip( 'section_' )
+ else:
+ tool_panel_section_key = 'section_%s' % str( tool_panel_section_id )
if tool_panel_section_key in trans.app.toolbox.tool_panel:
# Appending a tool to an existing section in trans.app.toolbox.tool_panel
tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
log.debug( "Appending to tool panel section: %s" % str( tool_section.name ) )
else:
# Appending a new section to trans.app.toolbox.tool_panel
- try:
- new_tool_panel_section_name = new_tool_panel_section.name
- except:
- new_tool_panel_section_name = new_tool_panel_section
- if new_tool_panel_section_name:
- elem = XmlET.Element( 'section' )
- elem.attrib[ 'name' ] = new_tool_panel_section_name
- elem.attrib[ 'id' ] = tool_panel_section_id
- elem.attrib[ 'version' ] = ''
- tool_section = galaxy.tools.ToolSection( elem )
- trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section
- log.debug( "Loading new tool panel section: %s" % str( tool_section.name ) )
- else:
- log.debug( "Unable to create new tool pane section using received new_tool_panel_section: %s" % str( new_tool_panel_section ))
- return None, None
+ if new_tool_panel_section_label is None:
+ # This might add an ugly section label to the tool panel, but, oh well...
+ new_tool_panel_section_label = tool_panel_section_id
+ elem = XmlET.Element( 'section' )
+ elem.attrib[ 'name' ] = new_tool_panel_section_label
+ elem.attrib[ 'id' ] = tool_panel_section_id
+ elem.attrib[ 'version' ] = ''
+ tool_section = galaxy.tools.ToolSection( elem )
+ trans.app.toolbox.tool_panel[ tool_panel_section_key ] = tool_section
+ log.debug( "Loading new tool panel section: %s" % str( tool_section.name ) )
return tool_panel_section_key, tool_section
def get_tool_path_install_dir( partial_install_dir, shed_tool_conf_dict, tool_dict, config_elems ):
@@ -633,16 +632,20 @@
error = True
return error, message
-def handle_tool_panel_selection( trans, metadata, no_changes_checked, tool_panel_section, new_tool_panel_section ):
- """Handle the selected tool panel location for loading tools included in tool shed repositories when installing or reinstalling them."""
+def handle_tool_panel_selection( trans, metadata, no_changes_checked, tool_panel_section_id, new_tool_panel_section_label ):
+ """
+ Handle the selected tool panel location for loading tools included in tool shed repositories when installing
+ or reinstalling them.
+ """
# Get the location in the tool panel in which each tool was originally loaded.
tool_section = None
tool_panel_section_key = None
if 'tools' in metadata:
# This forces everything to be loaded into the same section (or no section) in the tool panel.
if no_changes_checked:
- # Make sure the no_changes check box overrides the new_tool_panel_section if the user checked the check box and entered something into the field.
- new_tool_panel_section = None
+ # Make sure the no_changes check box overrides the new_tool_panel_section_label if the user checked the check
+ # box and entered something into the field.
+ new_tool_panel_section_label = None
if 'tool_panel_section' in metadata:
tool_panel_dict = metadata[ 'tool_panel_section' ]
if not tool_panel_dict:
@@ -656,24 +659,33 @@
original_section_id = tool_section_dict[ 'id' ]
original_section_name = tool_section_dict[ 'name' ]
if original_section_id:
- tool_panel_section_key, tool_section = get_or_create_tool_section( trans,
- tool_panel_section_id=original_section_id,
- new_tool_panel_section=new_tool_panel_section )
+ tool_panel_section_key, tool_section = \
+ get_or_create_tool_section( trans,
+ tool_panel_section_id=original_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
else:
# The user elected to change the tool panel section to contain the tools.
tool_panel_section_key, tool_section = handle_tool_panel_section( trans,
- tool_panel_section=tool_panel_section,
- new_tool_panel_section=new_tool_panel_section )
- return tool_section, new_tool_panel_section, tool_panel_section_key
+ tool_panel_section_id=tool_panel_section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
+ return tool_section, tool_panel_section_key
-def handle_tool_panel_section( trans, tool_panel_section=None, new_tool_panel_section=None ):
- if new_tool_panel_section:
- section_id = new_tool_panel_section.lower().replace( ' ', '_' )
- tool_panel_section_key, tool_section = get_or_create_tool_section( trans,
- tool_panel_section_id=section_id,
- new_tool_panel_section=new_tool_panel_section )
- elif tool_panel_section:
- tool_panel_section_key = 'section_%s' % str( tool_panel_section )
+def handle_tool_panel_section( trans, tool_panel_section_id=None, new_tool_panel_section_label=None ):
+ """Return a ToolSection object retrieved from the current in-memory tool_panel."""
+ # If tool_panel_section_id is received, the section exists in the tool panel. In this case, the value of the
+ # received tool_panel_section_id must be the id retrieved from a tool panel config (e.g., tool_conf.xml, which
+ # may have getext). If new_tool_panel_section_label is received, a new section will be added to the tool panel.
+ if new_tool_panel_section_label:
+ section_id = 'section_%s' % str( new_tool_panel_section_label.lower().replace( ' ', '_' ) )
+ tool_panel_section_key, tool_section = \
+ get_or_create_tool_section( trans,
+ tool_panel_section_id=section_id,
+ new_tool_panel_section_label=new_tool_panel_section_label )
+ elif tool_panel_section_id:
+ if tool_panel_section_id.startswith( 'section_' ):
+ tool_panel_section_key = str( tool_panel_section_id )
+ else:
+ tool_panel_section_key = 'section_%s' % str( tool_panel_section_id )
tool_section = trans.app.toolbox.tool_panel[ tool_panel_section_key ]
else:
return None, None
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/reselect_tool_panel_section.mako
@@ -80,7 +80,7 @@
</div><div class="form-row"><label>Add new tool panel section:</label>
- <input name="new_tool_panel_section" type="textfield" value="" size="40"/>
+ <input name="new_tool_panel_section_label" type="textfield" value="" size="40"/><div class="toolParamHelp" style="clear: both;">
Add a new tool panel section to contain the installed tools (optional).
</div>
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c templates/admin/tool_shed_repository/select_tool_panel_section.mako
--- a/templates/admin/tool_shed_repository/select_tool_panel_section.mako
+++ b/templates/admin/tool_shed_repository/select_tool_panel_section.mako
@@ -115,7 +115,7 @@
%endif
<div class="form-row"><label>Add new tool panel section:</label>
- <input name="new_tool_panel_section" type="textfield" value="${new_tool_panel_section}" size="40"/>
+ <input name="new_tool_panel_section_label" type="textfield" value="${new_tool_panel_section_label}" size="40"/><div class="toolParamHelp" style="clear: both;">
Add a new tool panel section to contain the installed tools (optional).
</div>
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/install_and_test_tool_shed_repositories/base/twilltestcase.py
--- a/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
+++ b/test/install_and_test_tool_shed_repositories/base/twilltestcase.py
@@ -47,7 +47,7 @@
install_tool_dependencies=False,
install_repository_dependencies=True,
no_changes=True,
- new_tool_panel_section=None ):
+ new_tool_panel_section_label=None ):
html = self.last_page()
# Since the installation process is by necessity asynchronous, we have to get the parameters to 'manually' initiate the
# installation process. This regex will return the tool shed repository IDs in group(1), the encoded_kwd parameter in
@@ -71,7 +71,7 @@
def install_repository( self, repository_info_dict, install_tool_dependencies=True, install_repository_dependencies=True,
strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[],
- post_submit_strings_displayed=[], new_tool_panel_section=None, **kwd ):
+ post_submit_strings_displayed=[], new_tool_panel_section_label=None, **kwd ):
name = repository_info_dict[ 'name' ]
owner = repository_info_dict[ 'owner' ]
changeset_revision = repository_info_dict[ 'changeset_revision' ]
@@ -103,13 +103,13 @@
kwd = self.set_form_value( form, kwd, 'install_tool_dependencies', install_tool_dependencies )
kwd = self.set_form_value( form, kwd, 'install_repository_dependencies', install_repository_dependencies )
kwd = self.set_form_value( form, kwd, 'shed_tool_conf', self.shed_tool_conf )
- if new_tool_panel_section is not None:
- kwd = self.set_form_value( form, kwd, 'new_tool_panel_section', new_tool_panel_section )
+ if new_tool_panel_section_label is not None:
+ kwd = self.set_form_value( form, kwd, 'new_tool_panel_section_label', new_tool_panel_section_label )
submit_button_control = form.find_control( type='submit' )
assert submit_button_control is not None, 'No submit button found for form %s.' % form.attrs.get( 'id' )
self.submit_form( form.attrs.get( 'id' ), str( submit_button_control.name ), **kwd )
self.check_for_strings( post_submit_strings_displayed, strings_not_displayed )
- repository_ids = self.initiate_installation_process( new_tool_panel_section=new_tool_panel_section )
+ repository_ids = self.initiate_installation_process( new_tool_panel_section_label=new_tool_panel_section_label )
log.debug( 'Waiting for the installation of repository IDs: %s' % str( repository_ids ) )
self.wait_for_repository_installation( repository_ids )
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/base/twilltestcase.py
--- a/test/tool_shed/base/twilltestcase.py
+++ b/test/tool_shed/base/twilltestcase.py
@@ -804,7 +804,7 @@
install_tool_dependencies=False,
install_repository_dependencies=True,
no_changes=True,
- new_tool_panel_section=None ):
+ new_tool_panel_section_label=None ):
html = self.last_page()
# Since the installation process is by necessity asynchronous, we have to get the parameters to 'manually' initiate the
# installation process. This regex will return the tool shed repository IDs in group(1), the encoded_kwd parameter in
@@ -855,7 +855,7 @@
def install_repository( self, name, owner, category_name, install_tool_dependencies=False,
install_repository_dependencies=True, changeset_revision=None,
strings_displayed=[], strings_not_displayed=[], preview_strings_displayed=[],
- post_submit_strings_displayed=[], new_tool_panel_section=None, includes_tools_for_display_in_tool_panel=True,
+ post_submit_strings_displayed=[], new_tool_panel_section_label=None, includes_tools_for_display_in_tool_panel=True,
**kwd ):
self.browse_tool_shed( url=self.url )
self.browse_category( test_db_util.get_category_by_name( category_name ) )
@@ -877,13 +877,13 @@
kwd = self.set_form_value( form, kwd, 'install_tool_dependencies', install_tool_dependencies )
kwd = self.set_form_value( form, kwd, 'install_repository_dependencies', install_repository_dependencies )
kwd = self.set_form_value( form, kwd, 'shed_tool_conf', self.shed_tool_conf )
- if new_tool_panel_section is not None:
- kwd = self.set_form_value( form, kwd, 'new_tool_panel_section', new_tool_panel_section )
+ if new_tool_panel_section_label is not None:
+ kwd = self.set_form_value( form, kwd, 'new_tool_panel_section_label', new_tool_panel_section_label )
submit_button_control = form.find_control( type='submit' )
assert submit_button_control is not None, 'No submit button found for form %s.' % form.attrs.get( 'id' )
self.submit_form( form.attrs.get( 'id' ), str( submit_button_control.name ), **kwd )
self.check_for_strings( post_submit_strings_displayed, strings_not_displayed )
- repository_ids = self.initiate_installation_process( new_tool_panel_section=new_tool_panel_section )
+ repository_ids = self.initiate_installation_process( new_tool_panel_section_label=new_tool_panel_section_label )
log.debug( 'Waiting for the installation of repository IDs: %s' % str( repository_ids ) )
self.wait_for_repository_installation( repository_ids )
@@ -1000,7 +1000,7 @@
install_repository_dependencies=True,
install_tool_dependencies=False,
no_changes=True,
- new_tool_panel_section='',
+ new_tool_panel_section_label='',
strings_displayed=[],
strings_not_displayed=[] ):
url = '/admin_toolshed/reselect_tool_panel_section?id=%s' % self.security.encode_id( installed_repository.id )
@@ -1011,15 +1011,15 @@
repo_dependencies = self.create_checkbox_query_string( field_name='install_repository_dependencies', value=install_repository_dependencies )
tool_dependencies = self.create_checkbox_query_string( field_name='install_tool_dependencies', value=install_tool_dependencies )
encoded_repository_id = self.security.encode_id( installed_repository.id )
- url = '/admin_toolshed/reinstall_repository?id=%s&%s&%s&no_changes=%s&new_tool_panel_section=%s' % \
- ( encoded_repository_id, repo_dependencies, tool_dependencies, str( no_changes ), new_tool_panel_section )
+ url = '/admin_toolshed/reinstall_repository?id=%s&%s&%s&no_changes=%s&new_tool_panel_section_label=%s' % \
+ ( encoded_repository_id, repo_dependencies, tool_dependencies, str( no_changes ), new_tool_panel_section_label )
self.visit_galaxy_url( url )
# Manually initiate the install process, as with installing a repository. See comments in the
# initiate_installation_process method for details.
repository_ids = self.initiate_installation_process( install_tool_dependencies,
install_repository_dependencies,
no_changes,
- new_tool_panel_section )
+ new_tool_panel_section_label )
# Finally, wait until all repositories are in a final state (either Error or Installed) before returning.
self.wait_for_repository_installation( repository_ids )
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1000_install_basic_repository.py
--- a/test/tool_shed/functional/test_1000_install_basic_repository.py
+++ b/test/tool_shed/functional/test_1000_install_basic_repository.py
@@ -93,7 +93,7 @@
self.install_repository( 'filtering_0000',
common.test_user_1_name,
'Test 0000 Basic Repository Features 1',
- new_tool_panel_section='test_1000' )
+ new_tool_panel_section_label='test_1000' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
strings_displayed = [ 'filtering_0000',
"Galaxy's filtering tool",
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
--- a/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
+++ b/test/tool_shed/functional/test_1010_install_repository_with_tool_dependencies.py
@@ -109,7 +109,7 @@
category_name,
strings_displayed=strings_displayed,
install_tool_dependencies=False,
- new_tool_panel_section='test_1010' )
+ new_tool_panel_section_label='test_1010' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( repository_name, common.test_user_1_name )
strings_displayed = [ 'freebayes_0010',
"Galaxy's freebayes tool",
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py
--- a/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py
+++ b/test/tool_shed/functional/test_1020_install_repository_with_repository_dependencies.py
@@ -97,7 +97,7 @@
'Test 0020 Basic Repository Dependencies',
strings_displayed=strings_displayed,
install_tool_dependencies=False,
- new_tool_panel_section='test_1020' )
+ new_tool_panel_section_label='test_1020' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0020', common.test_user_1_name )
strings_displayed = [ 'emboss_0020',
'Galaxy wrappers for Emboss version 5.0.0 tools for test 0020',
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py
--- a/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py
+++ b/test/tool_shed/functional/test_1030_install_repository_with_dependency_revisions.py
@@ -140,7 +140,7 @@
'Test 0030 Repository Dependency Revisions',
strings_displayed=strings_displayed,
install_tool_dependencies=False,
- new_tool_panel_section='test_1030' )
+ new_tool_panel_section_label='test_1030' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'emboss_0030', common.test_user_1_name )
strings_displayed = [ 'emboss_0030',
'Galaxy wrappers for Emboss version 5.0.0 tools for test 0030',
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1040_install_repository_basic_circular_dependencies.py
--- a/test/tool_shed/functional/test_1040_install_repository_basic_circular_dependencies.py
+++ b/test/tool_shed/functional/test_1040_install_repository_basic_circular_dependencies.py
@@ -126,7 +126,7 @@
self.reinstall_repository( installed_freebayes_repository,
install_tool_dependencies=False,
install_repository_dependencies=True,
- new_tool_panel_section='freebayes',
+ new_tool_panel_section_label='freebayes',
no_changes=False )
def test_0040_uninstall_filtering_repository( self ):
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py
--- a/test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py
+++ b/test/tool_shed/functional/test_1050_circular_dependencies_4_levels.py
@@ -282,7 +282,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=True,
- new_tool_panel_section='column_maker' )
+ new_tool_panel_section_label='column_maker' )
# This should result in column_maker and convert_chars being installed, and the rest never installed.
installed_repositories = [ ( column_repository_name, common.test_user_1_name ),
( convert_repository_name, common.test_user_1_name ) ]
@@ -300,7 +300,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=True,
- new_tool_panel_section='emboss_5_0050' )
+ new_tool_panel_section_label='emboss_5_0050' )
if running_standalone:
assert original_datatypes < self.get_datatypes_count(), 'Installing a repository that depends on emboss_datatypes did not add datatypes.'
# Now we have emboss_datatypes, emboss, bismark, column_maker, and convert_chars installed, filtering and freebayes never installed.
@@ -358,7 +358,7 @@
strings_displayed=strings_displayed,
install_tool_dependencies=False,
install_repository_dependencies=True,
- new_tool_panel_section='freebayes' )
+ new_tool_panel_section_label='freebayes' )
assert original_datatypes < self.get_datatypes_count(), 'Installing a repository that depends on emboss_datatypes did not add datatypes.'
emboss_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
datatypes_repository = test_db_util.get_installed_repository_by_name_owner( emboss_datatypes_repository_name, common.test_user_1_name )
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1060_install_repository_with_workflow.py
--- a/test/tool_shed/functional/test_1060_install_repository_with_workflow.py
+++ b/test/tool_shed/functional/test_1060_install_repository_with_workflow.py
@@ -82,7 +82,7 @@
common.test_user_1_name,
'Test 0060 Workflow Features',
install_tool_dependencies=False,
- new_tool_panel_section='test_1060' )
+ new_tool_panel_section_label='test_1060' )
def test_0015_import_workflow_from_installed_repository( self ):
'''Import the workflow from the installed repository and verify that it appears in the list of all workflows.'''
installed_repository = test_db_util.get_installed_repository_by_name_owner( repository_name, common.test_user_1_name )
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1070_invalid_tool.py
--- a/test/tool_shed/functional/test_1070_invalid_tool.py
+++ b/test/tool_shed/functional/test_1070_invalid_tool.py
@@ -71,7 +71,7 @@
common.test_user_1_name,
category_name,
install_tool_dependencies=False,
- new_tool_panel_section='test_1070' )
+ new_tool_panel_section_label='test_1070' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( repository_name, common.test_user_1_name )
strings_displayed = [ 'bismark_0070',
"Galaxy's bismark wrapper",
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py
--- a/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py
+++ b/test/tool_shed/functional/test_1080_advanced_circular_dependency_installation.py
@@ -109,7 +109,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=False,
- new_tool_panel_section='convert_chars' )
+ new_tool_panel_section_label='convert_chars' )
installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name,
common.test_user_1_name )
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name,
@@ -135,7 +135,7 @@
common.test_user_1_name,
category_name,
install_repository_dependencies=True,
- new_tool_panel_section='column_maker',
+ new_tool_panel_section_label='column_maker',
strings_displayed=[ 'install_repository_dependencies' ] )
installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name,
common.test_user_1_name )
@@ -363,7 +363,7 @@
self.reinstall_repository( installed_convert_repository,
install_repository_dependencies=True,
no_changes=False,
- new_tool_panel_section='convert_maker' )
+ new_tool_panel_section_label='convert_maker' )
strings_displayed = [ 'column_maker_0080',
'Add column',
self.url.replace( 'http://', '' ),
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1085_repository_dependency_handling.py
--- a/test/tool_shed/functional/test_1085_repository_dependency_handling.py
+++ b/test/tool_shed/functional/test_1085_repository_dependency_handling.py
@@ -99,7 +99,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=True,
- new_tool_panel_section='column_maker',
+ new_tool_panel_section_label='column_maker',
strings_displayed=[ 'install_repository_dependencies' ] )
installed_convert_repository = test_db_util.get_installed_repository_by_name_owner( convert_repository_name,
common.test_user_1_name )
@@ -145,7 +145,7 @@
self.reinstall_repository( installed_column_repository,
install_tool_dependencies=False,
install_repository_dependencies=False,
- new_tool_panel_section='new_column_maker',
+ new_tool_panel_section_label='new_column_maker',
no_changes=False )
strings_displayed = [ 'column_maker_1085',
'Add column',
@@ -161,7 +161,7 @@
self.reinstall_repository( installed_convert_repository,
install_tool_dependencies=False,
install_repository_dependencies=False,
- new_tool_panel_section='new_convert_chars',
+ new_tool_panel_section_label='new_convert_chars',
no_changes=False )
strings_displayed = [ 'convert_chars_1085',
'Convert delimiters',
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py
--- a/test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py
+++ b/test/tool_shed/functional/test_1087_install_updated_repository_dependencies.py
@@ -89,7 +89,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=True,
- new_tool_panel_section='column_maker',
+ new_tool_panel_section_label='column_maker',
strings_not_displayed=[ 'install_repository_dependencies' ] )
installed_column_repository = test_db_util.get_installed_repository_by_name_owner( column_repository_name, common.test_user_1_name )
self.uninstall_repository( installed_column_repository, remove_from_disk=True )
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
--- a/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
+++ b/test/tool_shed/functional/test_1090_install_tool_from_tool_search.py
@@ -226,7 +226,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=False,
- new_tool_panel_section='freebayes_1090' )
+ new_tool_panel_section_label='freebayes_1090' )
installed_repositories = [ ( freebayes_repository_name, common.test_user_1_name ) ]
strings_displayed = [ 'freebayes_0090' ]
strings_not_displayed = [ 'filtering_0090', 'emboss_0090', 'emboss_datatypes_0090', 'bwa_color_0090', 'bwa_base_0090' ]
@@ -246,7 +246,7 @@
category_name,
install_tool_dependencies=False,
install_repository_dependencies=False,
- new_tool_panel_section='filtering_1090' )
+ new_tool_panel_section_label='filtering_1090' )
installed_repositories = [ ( filtering_repository_name, common.test_user_1_name ),
( freebayes_repository_name, common.test_user_1_name ) ]
strings_displayed = [ 'filtering_0090', 'freebayes_0090' ]
@@ -307,7 +307,7 @@
self.install_repositories_from_search_results( repositories_to_install,
install_repository_dependencies='True',
install_tool_dependencies=False,
- new_tool_panel_section='bwa_1090',
+ new_tool_panel_section_label='bwa_1090',
strings_displayed=strings_displayed )
installed_repositories = [ ( emboss_repository_name, common.test_user_1_name ),
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py
--- a/test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py
+++ b/test/tool_shed/functional/test_1120_simple_repository_dependency_multiple_owners.py
@@ -175,7 +175,7 @@
category_name='Test 0120',
install_repository_dependencies=True,
post_submit_strings_displayed=post_submit_strings_displayed,
- new_tool_panel_section='Test 0120' )
+ new_tool_panel_section_label='Test 0120' )
def test_0050_verify_repository_installation( self ):
'''Verify installation of blastxml_to_top_descr_0120 and blast_datatypes_0120.'''
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py
--- a/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py
+++ b/test/tool_shed/functional/test_1200_uninstall_and_reinstall_basic_repository.py
@@ -75,7 +75,7 @@
self.install_repository( 'filtering_0000',
common.test_user_1_name,
'Test 0000 Basic Repository Features 1',
- new_tool_panel_section='test_1000' )
+ new_tool_panel_section_label='test_1000' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_0000', common.test_user_1_name )
strings_displayed = [ 'filtering_0000',
"Galaxy's filtering tool for test 0000",
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py
--- a/test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py
+++ b/test/tool_shed/functional/test_1210_uninstall_reinstall_repository_with_tool_dependencies.py
@@ -94,7 +94,7 @@
common.test_user_1_name,
'Test 0010 Repository With Tool Dependencies',
strings_displayed=strings_displayed,
- new_tool_panel_section='test_1210' )
+ new_tool_panel_section_label='test_1210' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'freebayes_0010', common.test_user_1_name )
strings_displayed = [ 'freebayes_0010',
"Galaxy's freebayes tool",
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py
--- a/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py
+++ b/test/tool_shed/functional/test_1220_uninstall_reinstall_repository_with_repository_dependencies.py
@@ -91,7 +91,7 @@
common.test_user_1_name,
'Test 0020 Basic Repository Dependencies',
strings_displayed=strings_displayed,
- new_tool_panel_section='test_1210' )
+ new_tool_panel_section_label='test_1210' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
strings_displayed = [ 'emboss_0020',
'Galaxy wrappers for Emboss version 5.0.0 tools',
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py
--- a/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py
+++ b/test/tool_shed/functional/test_1230_uninstall_reinstall_repository_with_dependency_revisions.py
@@ -123,7 +123,7 @@
common.test_user_1_name,
'Test 0030 Repository Dependency Revisions',
strings_displayed=strings_displayed,
- new_tool_panel_section='test_1210' )
+ new_tool_panel_section_label='test_1210' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( emboss_repository_name, common.test_user_1_name )
strings_displayed = [ 'emboss_0030',
'Galaxy wrappers for Emboss version 5.0.0 tools',
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1410_update_manager.py
--- a/test/tool_shed/functional/test_1410_update_manager.py
+++ b/test/tool_shed/functional/test_1410_update_manager.py
@@ -78,7 +78,7 @@
self.install_repository( 'filtering_1410',
common.test_user_1_name,
category_name,
- new_tool_panel_section='test_1410' )
+ new_tool_panel_section_label='test_1410' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'filtering_1410', common.test_user_1_name )
strings_displayed = [ 'filtering_1410',
"Galaxy's filtering tool",
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1430_repair_installed_repository.py
--- a/test/tool_shed/functional/test_1430_repair_installed_repository.py
+++ b/test/tool_shed/functional/test_1430_repair_installed_repository.py
@@ -133,7 +133,7 @@
self.install_repository( 'column_1430',
common.test_user_1_name,
category_name,
- new_tool_panel_section='repair',
+ new_tool_panel_section_label='repair',
post_submit_strings_displayed=post_submit_strings_displayed,
install_tool_dependencies=False,
install_repository_dependencies=True )
diff -r 6be4eb823a7ea30f35411251900487ee92734b7e -r a29d54619813d5da992b897557162a360b8d610c test/tool_shed/functional/test_1450_installing_datatypes_sniffers.py
--- a/test/tool_shed/functional/test_1450_installing_datatypes_sniffers.py
+++ b/test/tool_shed/functional/test_1450_installing_datatypes_sniffers.py
@@ -90,7 +90,7 @@
common.test_user_1_name,
category_name,
strings_displayed=strings_displayed,
- new_tool_panel_section='test_1450' )
+ new_tool_panel_section_label='test_1450' )
installed_repository = test_db_util.get_installed_repository_by_name_owner( 'proteomics_datatypes_1450', common.test_user_1_name )
strings_displayed = [ 'user1',
self.url.replace( 'http://', '' ),
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: HDA API: return purged with summary data, allow purge flag in query or payload for DELETE
by commits-noreply@bitbucket.org 05 Dec '13
by commits-noreply@bitbucket.org 05 Dec '13
05 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/6be4eb823a7e/
Changeset: 6be4eb823a7e
User: carlfeberhard
Date: 2013-12-05 20:15:43
Summary: HDA API: return purged with summary data, allow purge flag in query or payload for DELETE
Affected #: 1 file
diff -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 -r 6be4eb823a7ea30f35411251900487ee92734b7e 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
@@ -120,6 +120,7 @@
'state' : hda.state,
'deleted': hda.deleted,
'visible': hda.visible,
+ 'purged': hda.purged,
'hid' : hda.hid,
'url' : url_for( 'history_content', history_id=encoded_history_id, id=encoded_id, ),
}
@@ -309,8 +310,9 @@
return { 'error': str( exception ) }
return changed
+ #TODO: allow anonymous del/purge and test security on this
@web.expose_api
- def delete( self, trans, history_id, id, **kwd ):
+ def delete( self, trans, history_id, id, purge=False, **kwd ):
"""
delete( self, trans, history_id, id, **kwd )
* DELETE /api/histories/{history_id}/contents/{id}
@@ -319,22 +321,29 @@
:type id: str
:param id: the encoded id of the history to delete
+ :type purge: bool
+ :param purge: if True, purge the HDA
:type kwd: dict
:param kwd: (optional) dictionary structure containing:
* payload: a dictionary itself containing:
* purge: if True, purge the HDA
+ .. note:: that payload optionally can be placed in the query string of the request.
+ This allows clients that strip the request body to still purge the dataset.
+
:rtype: dict
:returns: an error object if an error occurred or a dictionary containing:
* id: the encoded id of the history,
* deleted: if the history was marked as deleted,
* purged: if the history was purged
"""
- # a request body is optional here
- purge = False
+ # get purge from the query or from the request body payload (a request body is optional here)
+ purge = util.string_as_bool( purge )
if kwd.get( 'payload', None ):
- purge = util.string_as_bool( kwd['payload'].get( 'purge', False ) )
+ # payload takes priority
+ purge = util.string_as_bool( kwd['payload'].get( 'purge', purge ) )
+
rval = { 'id' : id }
try:
hda = self.get_dataset( trans, id,
@@ -356,8 +365,10 @@
# flush now to preserve deleted state in case of later interruption
trans.sa_session.flush()
rval[ 'purged' ] = True
+
trans.sa_session.flush()
rval[ 'deleted' ] = True
+
except exceptions.httpexceptions.HTTPInternalServerError, http_server_err:
log.exception( 'HDA API, delete: uncaught HTTPInternalServerError: %s, %s\n%s',
id, str( kwd ), str( http_server_err ) )
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: Dave Bouvier: Use walltime configured in job_conf.xml instead of maxseconds for determining whether a test tool run is stuck.
by commits-noreply@bitbucket.org 05 Dec '13
by commits-noreply@bitbucket.org 05 Dec '13
05 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/bba295ef97e4/
Changeset: bba295ef97e4
User: Dave Bouvier
Date: 2013-12-05 19:52:22
Summary: Use walltime configured in job_conf.xml instead of maxseconds for determining whether a test tool run is stuck.
Affected #: 3 files
diff -r 66e0f985ad0b9b33e5429979651e363a656ac686 -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 scripts/functional_tests.py
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -72,6 +72,24 @@
# should this serve static resources (scripts, images, styles, etc.)
STATIC_ENABLED = True
+# Set up a job_conf.xml that explicitly limits jobs to 10 minutes.
+job_conf_xml = '''<?xml version="1.0"?>
+<!-- A test job config that explicitly configures job running the way it is configured by default (if there is no explicit config). -->
+<job_conf>
+ <plugins>
+ <plugin id="local" type="runner" load="galaxy.jobs.runners.local:LocalJobRunner" workers="4"/>
+ </plugins>
+ <handlers>
+ <handler id="main"/>
+ </handlers>
+ <destinations>
+ <destination id="local" runner="local"/>
+ </destinations>
+ <limits>
+ <limit type="walltime">00:10:00</limit>
+ </limits>
+</job_conf>
+'''
def get_static_settings():
"""Returns dictionary of the settings necessary for a galaxy App
@@ -231,6 +249,11 @@
if galaxy_test_tmp_dir is None:
galaxy_test_tmp_dir = tempfile.mkdtemp()
+ galaxy_job_conf_file = os.environ.get( 'GALAXY_TEST_JOB_CONF',
+ os.path.join( galaxy_test_tmp_dir, 'test_job_conf.xml' ) )
+ # Generate the job_conf.xml file.
+ file( galaxy_job_conf_file, 'w' ).write( job_conf_xml )
+
database_auto_migrate = False
galaxy_test_proxy_port = None
diff -r 66e0f985ad0b9b33e5429979651e363a656ac686 -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 test/base/twilltestcase.py
--- a/test/base/twilltestcase.py
+++ b/test/base/twilltestcase.py
@@ -1424,20 +1424,21 @@
"""Waits for the tools to finish"""
return self.wait_for(lambda: self.get_running_datasets(), **kwds)
- def wait_for(self, func, maxseconds=120):
+ def wait_for( self, func, **kwd ):
sleep_amount = 0.1
slept = 0
- while slept <= maxseconds:
+ walltime_exceeded = 86400
+ while slept <= walltime_exceeded:
result = func()
if result:
time.sleep( sleep_amount )
slept += sleep_amount
sleep_amount *= 2
- if slept + sleep_amount > maxseconds:
- sleep_amount = maxseconds - slept # don't overshoot maxseconds
+ if slept + sleep_amount > walltime_exceeded:
+ sleep_amount = walltime_exceeded - slept # don't overshoot maxseconds
else:
break
- assert slept < maxseconds
+ assert slept < walltime_exceeded, 'Tool run exceeded reasonable walltime of 24 hours, terminating.'
# Dataset Security stuff
# Tests associated with users
diff -r 66e0f985ad0b9b33e5429979651e363a656ac686 -r bba295ef97e41acfcf3e160d1d3067d4ee0e81a1 test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -91,6 +91,7 @@
# Should this serve static resources (scripts, images, styles, etc.)?
STATIC_ENABLED = True
+# Set up a job_conf.xml that explicitly limits jobs to 10 minutes.
job_conf_xml = '''<?xml version="1.0"?><!-- A test job config that explicitly configures job running the way it is configured by default (if there is no explicit config). --><job_conf>
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: Dataset, purge and purge async: allow non-deleted datasets to be purged (setting delete in the process)
by commits-noreply@bitbucket.org 05 Dec '13
by commits-noreply@bitbucket.org 05 Dec '13
05 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/66e0f985ad0b/
Changeset: 66e0f985ad0b
User: carlfeberhard
Date: 2013-12-05 19:42:05
Summary: Dataset, purge and purge async: allow non-deleted datasets to be purged (setting delete in the process)
Affected #: 1 file
diff -r 5b1f793c3227d3eb13240a4730627d9f17a5d556 -r 66e0f985ad0b9b33e5429979651e363a656ac686 lib/galaxy/webapps/galaxy/controllers/dataset.py
--- a/lib/galaxy/webapps/galaxy/controllers/dataset.py
+++ b/lib/galaxy/webapps/galaxy/controllers/dataset.py
@@ -887,8 +887,8 @@
# If the user is known, make sure the HDA is owned by the current user.
else:
assert topmost_parent.history.user == trans.user, 'Invalid history dataset ID'
- # HDA is not deleted
- assert hda.deleted, 'History dataset is not marked as deleted'
+ # Ensure HDA is deleted
+ hda.deleted = True
# HDA is purgeable
# Decrease disk usage first
if user:
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: carlfeberhard: History panel: remove href and target from disabled buttons
by commits-noreply@bitbucket.org 05 Dec '13
by commits-noreply@bitbucket.org 05 Dec '13
05 Dec '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/5b1f793c3227/
Changeset: 5b1f793c3227
User: carlfeberhard
Date: 2013-12-05 19:32:05
Summary: History panel: remove href and target from disabled buttons
Affected #: 2 files
diff -r d500c13a819f7a2a6dd5540b5f2ceaa020ecfe2e -r 5b1f793c3227d3eb13240a4730627d9f17a5d556 static/scripts/mvc/ui.js
--- a/static/scripts/mvc/ui.js
+++ b/static/scripts/mvc/ui.js
@@ -497,9 +497,9 @@
var html = [
'<a class="', options.classes.join( ' ' ), '"',
- (( options.title )? ( ' title="' + options.title + '"' ):( '' )),
- (( options.target )? ( ' target="' + options.target + '"' ):( '' )),
- ' href="', (( options.href )?( options.href ):( 'javascript:void(0);' )), '">',
+ (( options.title )?( ' title="' + options.title + '"' ):( '' )),
+ (( !options.disabled && options.target )? ( ' target="' + options.target + '"' ):( '' )),
+ ' href="', (( !options.disabled && options.href )?( options.href ):( 'javascript:void(0);' )), '">',
// could go with something less specific here - like 'html'
'<span class="fa ', options.faIcon, '"></span>',
'</a>'
diff -r d500c13a819f7a2a6dd5540b5f2ceaa020ecfe2e -r 5b1f793c3227d3eb13240a4730627d9f17a5d556 static/scripts/packed/mvc/ui.js
--- a/static/scripts/packed/mvc/ui.js
+++ b/static/scripts/packed/mvc/ui.js
@@ -1,1 +1,1 @@
-var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,is_menu_button:true,id:null,href:null,target:null,enabled:true,visible:true,tooltip_config:{}}});var IconButtonView=Backbone.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"};this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var a=this.template(this.model.toJSON());a.tooltip(this.model.get("tooltip_config"));this.$el.replaceWith(a);this.setElement(a);return this},events:{click:"click"},click:function(a){if(_.isFunction(this.model.get("on_click"))){this.model.get("on_click")(a);return false}return true},template:function(b){var a='title="'+b.title+'" class="icon-button';if(b.is_menu_button){a+=" menu-button"}a+=" "+b.icon_class;if(!b.enabled){a+="_disabled"}a+='"';if(b.id){a+=' id="'+b.id+'"'}a+=' href="'+b.href+'"';if(b.target){a+=' target="'+b.target+'"'}if(!b.visible){a+=' style="display: none;"'}if(b.enabled){a="<a "+a+"/>"}else{a="<span "+a+"/>"}return $(a)}});var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var a=this;this.collection.each(function(d){var b=$("<a/>").attr("href","javascript:void(0)").attr("title",d.attributes.title).addClass("icon-button menu-button").addClass(d.attributes.icon_class).appendTo(a.$el).click(d.attributes.on_click);if(d.attributes.tooltip_config){b.tooltip(d.attributes.tooltip_config)}var c=d.get("options");if(c){make_popupmenu(b,c)}});return this}});var create_icon_buttons_menu=function(b,a){if(!a){a={}}var c=new IconButtonCollection(_.map(b,function(d){return new IconButton(_.extend(d,a))}));return new IconButtonMenuView({collection:c})};var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});var PopupMenu=Backbone.View.extend({initialize:function(b,a){this.$button=b;if(!this.$button.size()){this.$button=$("<div/>")}this.options=a||[];var c=this;this.$button.click(function(d){$(".popmenu-wrapper").remove();c._renderAndShow(d);return false})},_renderAndShow:function(a){this.render();this.$el.appendTo("body").css(this._getShownPosition(a)).show();this._setUpCloseBehavior()},render:function(){this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options));if(this.options.length){var a=this;this.$el.find("li").each(function(c,b){var d=a.options[c];if(d.func){$(this).children("a.popupmenu-option").click(function(e){d.func.call(a,e,d)})}})}return this},template:function(b,a){return['<ul id="',b,'-menu" class="dropdown-menu">',this._templateOptions(a),"</ul>"].join("")},_templateOptions:function(a){if(!a.length){return"<li>(no options)</li>"}return _.map(a,function(d){if(d.divider){return'<li class="divider"></li>'}else{if(d.header){return['<li class="head"><a href="javascript:void(0);">',d.html,"</a></li>"].join("")}}var c=d.href||"javascript:void(0);",e=(d.target)?(' target="'+d.target+'"'):(""),b=(d.checked)?('<span class="fa fa-check"></span>'):("");return['<li><a class="popupmenu-option" href="',c,'"',e,">",b,d.html,"</a></li>"].join("")}).join("")},_getShownPosition:function(b){var c=this.$el.width();var a=b.pageX-c/2;a=Math.min(a,$(document).scrollLeft()+$(window).width()-c-5);a=Math.max(a,$(document).scrollLeft()+5);return{top:b.pageY,left:a}},_setUpCloseBehavior:function(){var c=this;function a(e){$(document).off("click.close_popup");if(window.parent!==window){try{$(window.parent.document).off("click.close_popup")}catch(d){}}else{try{$("iframe#galaxy_main").contents().off("click.close_popup")}catch(d){}}c.remove()}$("html").one("click.close_popup",a);if(window.parent!==window){try{$(window.parent.document).find("html").one("click.close_popup",a)}catch(b){}}else{try{$("iframe#galaxy_main").contents().one("click.close_popup",a)}catch(b){}}},addItem:function(b,a){a=(a>=0)?a:this.options.length;this.options.splice(a,0,b);return this},removeItem:function(a){if(a>=0){this.options.splice(a,1)}return this},findIndexByHtml:function(b){for(var a=0;a<this.options.length;a++){if(_.has(this.options[a],"html")&&(this.options[a].html===b)){return a}}return null},findItemByHtml:function(a){return this.options[(this.findIndexByHtml(a))]},toString:function(){return"PopupMenu"}});PopupMenu.make_popupmenu=function(b,c){var a=[];_.each(c,function(f,d){var e={html:d};if(f===null){e.header=true}else{if(jQuery.type(f)==="function"){e.func=f}}a.push(e)});return new PopupMenu($(b),a)};PopupMenu.convertLinksToOptions=function(c,a){c=$(c);a=a||"a";var b=[];c.find(a).each(function(g,e){var f={},d=$(g);f.html=d.text();if(d.attr("href")){var j=d.attr("href"),k=d.attr("target"),h=d.attr("confirm");f.func=function(){if((h)&&(!confirm(h))){return}switch(k){case"_parent":window.parent.location=j;break;case"_top":window.top.location=j;break;default:window.location=j}}}b.push(f)});return b};PopupMenu.fromExistingDom=function(d,c,a){d=$(d);c=$(c);var b=PopupMenu.convertLinksToOptions(c,a);c.remove();return new PopupMenu(d,b)};PopupMenu.make_popup_menus=function(c,b,d){c=c||document;b=b||"div[popupmenu]";d=d||function(e,f){return"#"+e.attr("popupmenu")};var a=[];$(c).find(b).each(function(){var e=$(this),f=$(c).find(d(e,c));a.push(PopupMenu.fromDom(f,e));f.addClass("popup")});return a};var faIconButton=function(a){a=a||{};a.tooltipConfig=a.tooltipConfig||{placement:"bottom"};a.classes=["icon-btn"].concat(a.classes||[]);if(a.disabled){a.classes.push("disabled")}var b=['<a class="',a.classes.join(" "),'"',((a.title)?(' title="'+a.title+'"'):("")),((a.target)?(' target="'+a.target+'"'):("")),' href="',((a.href)?(a.href):("javascript:void(0);")),'">','<span class="fa ',a.faIcon,'"></span>',"</a>"].join("");var c=$(b).tooltip(a.tooltipConfig);if(_.isFunction(a.onclick)){c.click(a.onclick)}return c};var searchInput=function(k){var a=27,h=13,i=$("<div/>"),b={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onsearch:function(l){},minSearchLen:0,escWillClear:true,oninit:function(){}};if(jQuery.type(k)==="object"){k=jQuery.extend(true,b,k)}function d(l){var m=$(this).parent().children("input");m.val("");m.trigger("clear:searchInput");k.onclear()}function j(m,l){$(this).trigger("search:searchInput",l);k.onsearch(l)}function c(){return['<input type="text" name="',k.name,'" placeholder="',k.placeholder,'" ','class="search-query ',k.classes,'" ',"/>"].join("")}function g(){return $(c()).css({width:"100%","padding-right":"24px"}).focus(function(l){$(this).select()}).keyup(function(m){if(m.which===a&&k.escWillClear){d.call(this,m)}else{var l=$(this).val();if((m.which===h)||(k.minSearchLen&&l.length>=k.minSearchLen)){j.call(this,m,l)}else{if(!l.length){d.call(this,m)}}}}).val(k.initialVal)}function f(){return'<span class="search-clear fa fa-times-circle" title="'+_l("clear search (esc)")+'"></span>'}function e(){return $(f()).css({position:"absolute",right:"15px","font-size":"1.4em","line-height":"23px",color:"grey"}).tooltip({placement:"bottom"}).click(function(l){d.call(this,l)})}return i.append([g(),e()])};function LoadingIndicator(a,c){var b=this;c=jQuery.extend({cover:false},c||{});function d(){var e=['<div class="loading-indicator">','<div class="loading-indicator-text">','<span class="fa fa-spinner fa-spin fa-lg"></span>','<span class="loading-indicator-message">loading...</span>',"</div>","</div>"].join("\n");var g=$(e).hide().css(c.css||{position:"fixed"}),f=g.children(".loading-indicator-text");if(c.cover){g.css({"z-index":2,top:a.css("top"),bottom:a.css("bottom"),left:a.css("left"),right:a.css("right"),opacity:0.5,"background-color":"white","text-align":"center"});f=g.children(".loading-indicator-text").css({"margin-top":"20px"})}else{f=g.children(".loading-indicator-text").css({margin:"12px 0px 0px 10px",opacity:"0.85",color:"grey"});f.children(".loading-indicator-message").css({margin:"0px 8px 0px 0px","font-style":"italic"})}return g}b.show=function(f,e,g){f=f||"loading...";e=e||"fast";b.$indicator=d().insertBefore(a);b.message(f);b.$indicator.fadeIn(e,g);return b};b.message=function(e){b.$indicator.find("i").text(e)};b.hide=function(e,f){e=e||"fast";if(b.$indicator&&b.$indicator.size()){b.$indicator.fadeOut(e,function(){b.$indicator.remove();if(f){f()}})}else{if(f){f()}}return b};return b};
\ No newline at end of file
+var IconButton=Backbone.Model.extend({defaults:{title:"",icon_class:"",on_click:null,menu_options:null,is_menu_button:true,id:null,href:null,target:null,enabled:true,visible:true,tooltip_config:{}}});var IconButtonView=Backbone.View.extend({initialize:function(){this.model.attributes.tooltip_config={placement:"bottom"};this.model.bind("change",this.render,this)},render:function(){this.$el.tooltip("hide");var a=this.template(this.model.toJSON());a.tooltip(this.model.get("tooltip_config"));this.$el.replaceWith(a);this.setElement(a);return this},events:{click:"click"},click:function(a){if(_.isFunction(this.model.get("on_click"))){this.model.get("on_click")(a);return false}return true},template:function(b){var a='title="'+b.title+'" class="icon-button';if(b.is_menu_button){a+=" menu-button"}a+=" "+b.icon_class;if(!b.enabled){a+="_disabled"}a+='"';if(b.id){a+=' id="'+b.id+'"'}a+=' href="'+b.href+'"';if(b.target){a+=' target="'+b.target+'"'}if(!b.visible){a+=' style="display: none;"'}if(b.enabled){a="<a "+a+"/>"}else{a="<span "+a+"/>"}return $(a)}});var IconButtonCollection=Backbone.Collection.extend({model:IconButton});var IconButtonMenuView=Backbone.View.extend({tagName:"div",initialize:function(){this.render()},render:function(){var a=this;this.collection.each(function(d){var b=$("<a/>").attr("href","javascript:void(0)").attr("title",d.attributes.title).addClass("icon-button menu-button").addClass(d.attributes.icon_class).appendTo(a.$el).click(d.attributes.on_click);if(d.attributes.tooltip_config){b.tooltip(d.attributes.tooltip_config)}var c=d.get("options");if(c){make_popupmenu(b,c)}});return this}});var create_icon_buttons_menu=function(b,a){if(!a){a={}}var c=new IconButtonCollection(_.map(b,function(d){return new IconButton(_.extend(d,a))}));return new IconButtonMenuView({collection:c})};var Grid=Backbone.Collection.extend({});var GridView=Backbone.View.extend({});var PopupMenu=Backbone.View.extend({initialize:function(b,a){this.$button=b;if(!this.$button.size()){this.$button=$("<div/>")}this.options=a||[];var c=this;this.$button.click(function(d){$(".popmenu-wrapper").remove();c._renderAndShow(d);return false})},_renderAndShow:function(a){this.render();this.$el.appendTo("body").css(this._getShownPosition(a)).show();this._setUpCloseBehavior()},render:function(){this.$el.addClass("popmenu-wrapper").hide().css({position:"absolute"}).html(this.template(this.$button.attr("id"),this.options));if(this.options.length){var a=this;this.$el.find("li").each(function(c,b){var d=a.options[c];if(d.func){$(this).children("a.popupmenu-option").click(function(e){d.func.call(a,e,d)})}})}return this},template:function(b,a){return['<ul id="',b,'-menu" class="dropdown-menu">',this._templateOptions(a),"</ul>"].join("")},_templateOptions:function(a){if(!a.length){return"<li>(no options)</li>"}return _.map(a,function(d){if(d.divider){return'<li class="divider"></li>'}else{if(d.header){return['<li class="head"><a href="javascript:void(0);">',d.html,"</a></li>"].join("")}}var c=d.href||"javascript:void(0);",e=(d.target)?(' target="'+d.target+'"'):(""),b=(d.checked)?('<span class="fa fa-check"></span>'):("");return['<li><a class="popupmenu-option" href="',c,'"',e,">",b,d.html,"</a></li>"].join("")}).join("")},_getShownPosition:function(b){var c=this.$el.width();var a=b.pageX-c/2;a=Math.min(a,$(document).scrollLeft()+$(window).width()-c-5);a=Math.max(a,$(document).scrollLeft()+5);return{top:b.pageY,left:a}},_setUpCloseBehavior:function(){var c=this;function a(e){$(document).off("click.close_popup");if(window.parent!==window){try{$(window.parent.document).off("click.close_popup")}catch(d){}}else{try{$("iframe#galaxy_main").contents().off("click.close_popup")}catch(d){}}c.remove()}$("html").one("click.close_popup",a);if(window.parent!==window){try{$(window.parent.document).find("html").one("click.close_popup",a)}catch(b){}}else{try{$("iframe#galaxy_main").contents().one("click.close_popup",a)}catch(b){}}},addItem:function(b,a){a=(a>=0)?a:this.options.length;this.options.splice(a,0,b);return this},removeItem:function(a){if(a>=0){this.options.splice(a,1)}return this},findIndexByHtml:function(b){for(var a=0;a<this.options.length;a++){if(_.has(this.options[a],"html")&&(this.options[a].html===b)){return a}}return null},findItemByHtml:function(a){return this.options[(this.findIndexByHtml(a))]},toString:function(){return"PopupMenu"}});PopupMenu.make_popupmenu=function(b,c){var a=[];_.each(c,function(f,d){var e={html:d};if(f===null){e.header=true}else{if(jQuery.type(f)==="function"){e.func=f}}a.push(e)});return new PopupMenu($(b),a)};PopupMenu.convertLinksToOptions=function(c,a){c=$(c);a=a||"a";var b=[];c.find(a).each(function(g,e){var f={},d=$(g);f.html=d.text();if(d.attr("href")){var j=d.attr("href"),k=d.attr("target"),h=d.attr("confirm");f.func=function(){if((h)&&(!confirm(h))){return}switch(k){case"_parent":window.parent.location=j;break;case"_top":window.top.location=j;break;default:window.location=j}}}b.push(f)});return b};PopupMenu.fromExistingDom=function(d,c,a){d=$(d);c=$(c);var b=PopupMenu.convertLinksToOptions(c,a);c.remove();return new PopupMenu(d,b)};PopupMenu.make_popup_menus=function(c,b,d){c=c||document;b=b||"div[popupmenu]";d=d||function(e,f){return"#"+e.attr("popupmenu")};var a=[];$(c).find(b).each(function(){var e=$(this),f=$(c).find(d(e,c));a.push(PopupMenu.fromDom(f,e));f.addClass("popup")});return a};var faIconButton=function(a){a=a||{};a.tooltipConfig=a.tooltipConfig||{placement:"bottom"};a.classes=["icon-btn"].concat(a.classes||[]);if(a.disabled){a.classes.push("disabled")}var b=['<a class="',a.classes.join(" "),'"',((a.title)?(' title="'+a.title+'"'):("")),((!a.disabled&&a.target)?(' target="'+a.target+'"'):("")),' href="',((!a.disabled&&a.href)?(a.href):("javascript:void(0);")),'">','<span class="fa ',a.faIcon,'"></span>',"</a>"].join("");var c=$(b).tooltip(a.tooltipConfig);if(_.isFunction(a.onclick)){c.click(a.onclick)}return c};var searchInput=function(k){var a=27,h=13,i=$("<div/>"),b={initialVal:"",name:"search",placeholder:"search",classes:"",onclear:function(){},onsearch:function(l){},minSearchLen:0,escWillClear:true,oninit:function(){}};if(jQuery.type(k)==="object"){k=jQuery.extend(true,b,k)}function d(l){var m=$(this).parent().children("input");m.val("");m.trigger("clear:searchInput");k.onclear()}function j(m,l){$(this).trigger("search:searchInput",l);k.onsearch(l)}function c(){return['<input type="text" name="',k.name,'" placeholder="',k.placeholder,'" ','class="search-query ',k.classes,'" ',"/>"].join("")}function g(){return $(c()).css({width:"100%","padding-right":"24px"}).focus(function(l){$(this).select()}).keyup(function(m){if(m.which===a&&k.escWillClear){d.call(this,m)}else{var l=$(this).val();if((m.which===h)||(k.minSearchLen&&l.length>=k.minSearchLen)){j.call(this,m,l)}else{if(!l.length){d.call(this,m)}}}}).val(k.initialVal)}function f(){return'<span class="search-clear fa fa-times-circle" title="'+_l("clear search (esc)")+'"></span>'}function e(){return $(f()).css({position:"absolute",right:"15px","font-size":"1.4em","line-height":"23px",color:"grey"}).tooltip({placement:"bottom"}).click(function(l){d.call(this,l)})}return i.append([g(),e()])};function LoadingIndicator(a,c){var b=this;c=jQuery.extend({cover:false},c||{});function d(){var e=['<div class="loading-indicator">','<div class="loading-indicator-text">','<span class="fa fa-spinner fa-spin fa-lg"></span>','<span class="loading-indicator-message">loading...</span>',"</div>","</div>"].join("\n");var g=$(e).hide().css(c.css||{position:"fixed"}),f=g.children(".loading-indicator-text");if(c.cover){g.css({"z-index":2,top:a.css("top"),bottom:a.css("bottom"),left:a.css("left"),right:a.css("right"),opacity:0.5,"background-color":"white","text-align":"center"});f=g.children(".loading-indicator-text").css({"margin-top":"20px"})}else{f=g.children(".loading-indicator-text").css({margin:"12px 0px 0px 10px",opacity:"0.85",color:"grey"});f.children(".loading-indicator-message").css({margin:"0px 8px 0px 0px","font-style":"italic"})}return g}b.show=function(f,e,g){f=f||"loading...";e=e||"fast";b.$indicator=d().insertBefore(a);b.message(f);b.$indicator.fadeIn(e,g);return b};b.message=function(e){b.$indicator.find("i").text(e)};b.hide=function(e,f){e=e||"fast";if(b.$indicator&&b.$indicator.size()){b.$indicator.fadeOut(e,function(){b.$indicator.remove();if(f){f()}})}else{if(f){f()}}return b};return b};
\ 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