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
February 2013
- 2 participants
- 189 discussions
commit/galaxy-central: james_taylor: remove comment from sentry middleware that is not a valid doctest
by Bitbucket 03 Feb '13
by Bitbucket 03 Feb '13
03 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/898c9e140da9/
changeset: 898c9e140da9
user: james_taylor
date: 2013-02-04 05:27:04
summary: remove comment from sentry middleware that is not a valid doctest
affected #: 1 file
diff -r b59a3df615c3542cb05ad68dc851669928a586d8 -r 898c9e140da953fe18ebfda5a96b9810d372706d lib/galaxy/web/framework/middleware/sentry.py
--- a/lib/galaxy/web/framework/middleware/sentry.py
+++ b/lib/galaxy/web/framework/middleware/sentry.py
@@ -16,9 +16,6 @@
"""
A WSGI middleware which will attempt to capture any
uncaught exceptions and send them to Sentry.
-
- >>> from raven.base import Client
- >>> application = Sentry(application, Client())
"""
def __init__(self, application, dsn):
self.application = application
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
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b59a3df615c3/
changeset: b59a3df615c3
user: james_taylor
date: 2013-02-04 05:22:16
summary: Add some missing files
affected #: 2 files
diff -r 17c40da527fe8fee481ead85bdf8069776fc8f44 -r b59a3df615c3542cb05ad68dc851669928a586d8 lib/galaxy/web/framework/middleware/request_id.py
--- /dev/null
+++ b/lib/galaxy/web/framework/middleware/request_id.py
@@ -0,0 +1,12 @@
+import uuid
+
+class RequestIDMiddleware( object ):
+ """
+ A WSGI middleware that creates a unique ID for the request and
+ puts it in the environment
+ """
+ def __init__( self, app, global_conf=None ):
+ self.app = app
+ def __call__( self, environ, start_response ):
+ environ['request_id'] = uuid.uuid1().hex
+ return self.app( environ, start_response )
\ No newline at end of file
diff -r 17c40da527fe8fee481ead85bdf8069776fc8f44 -r b59a3df615c3542cb05ad68dc851669928a586d8 static/scripts/packed/libs/jquery/select2.js
--- /dev/null
+++ b/static/scripts/packed/libs/jquery/select2.js
@@ -0,0 +1,1 @@
+(function(a){if(typeof a.fn.each2=="undefined"){a.fn.extend({each2:function(f){var d=a([0]),e=-1,b=this.length;while(++e<b&&(d.context=d[0]=this[e])&&f.call(d[0],e,d)!==false){}return this}})}})(jQuery);(function(j,l){if(window.Select2!==l){return}var c,e,v,B,t,a;c={TAB:9,ENTER:13,ESC:27,SPACE:32,LEFT:37,UP:38,RIGHT:39,DOWN:40,SHIFT:16,CTRL:17,ALT:18,PAGE_UP:33,PAGE_DOWN:34,HOME:36,END:35,BACKSPACE:8,DELETE:46,isArrow:function(C){C=C.which?C.which:C;switch(C){case c.LEFT:case c.RIGHT:case c.UP:case c.DOWN:return true}return false},isControl:function(D){var C=D.which;switch(C){case c.SHIFT:case c.CTRL:case c.ALT:return true}if(D.metaKey){return true}return false},isFunctionKey:function(C){C=C.which?C.which:C;return C>=112&&C<=123}};t=(function(){var C=1;return function(){return C++}}());function b(F,G){var E=0,C=G.length,D;if(typeof F==="undefined"){return -1}if(F.constructor===String){for(;E<C;E=E+1){if(F.localeCompare(G[E])===0){return E}}}else{for(;E<C;E=E+1){D=G[E];if(D.constructor===String){if(D.localeCompare(F)===0){return E}}else{if(D===F){return E}}}}return -1}function q(D,C){if(D===C){return true}if(D===l||C===l){return false}if(D===null||C===null){return false}if(D.constructor===String){return D.localeCompare(C)===0}if(C.constructor===String){return C.localeCompare(D)===0}return false}function m(D,F){var G,E,C;if(D===null||D.length<1){return[]}G=D.split(F);for(E=0,C=G.length;E<C;E=E+1){G[E]=j.trim(G[E])}return G}function n(C){return C.outerWidth()-C.width()}function z(D){var C="keyup-change-value";D.bind("keydown",function(){if(j.data(D,C)===l){j.data(D,C,D.val())}});D.bind("keyup",function(){var E=j.data(D,C);if(E!==l&&D.val()!==E){j.removeData(D,C);D.trigger("keyup-change")}})}j(document).delegate("body","mousemove",function(C){j.data(document,"select2-lastpos",{x:C.pageX,y:C.pageY})});function u(C){C.bind("mousemove",function(E){var D=j.data(document,"select2-lastpos");if(D===l||D.x!==E.pageX||D.y!==E.pageY){j(E.target).trigger("mousemove-filtered",E)}})}function f(F,D,C){C=C||l;var E;return function(){var G=arguments;window.clearTimeout(E);E=window.setTimeout(function(){D.apply(C,G)},F)}}function A(E){var C=false,D;return function(){if(C===false){D=E();C=true}return D}}function g(C,E){var D=f(C,function(F){E.trigger("scroll-debounced",F)});E.bind("scroll",function(F){if(b(F.target,E.get())>=0){D(F)}})}function d(C){C.preventDefault();C.stopPropagation()}function x(D){if(!a){var C=D[0].currentStyle||window.getComputedStyle(D[0],null);a=j("<div></div>").css({position:"absolute",left:"-10000px",top:"-10000px",display:"none",fontSize:C.fontSize,fontFamily:C.fontFamily,fontStyle:C.fontStyle,fontWeight:C.fontWeight,letterSpacing:C.letterSpacing,textTransform:C.textTransform,whiteSpace:"nowrap"});j("body").append(a)}a.text(D.val());return a.width()}function i(G,F,D){var E=G.toUpperCase().indexOf(F.toUpperCase()),C=F.length;if(E<0){D.push(G);return}D.push(G.substring(0,E));D.push("<span class='select2-match'>");D.push(G.substring(E,E+C));D.push("</span>");D.push(G.substring(E+C,G.length))}function p(D){var F,C=0,E=null,G=D.quietMillis||100;return function(H){window.clearTimeout(F);F=window.setTimeout(function(){C+=1;var I=C,L=D.data,M=D.transport||j.ajax,K=D.traditional||false,J=D.type||"GET";L=L.call(this,H.term,H.page,H.context);if(null!==E){E.abort()}E=M.call(null,{url:D.url,dataType:D.dataType,data:L,type:J,traditional:K,success:function(O){if(I<C){return}var N=D.results(O,H.page);H.callback(N)}})},G)}}function r(C){var E=C,D,F=function(G){return""+G.text};if(!j.isArray(E)){F=E.text;if(!j.isFunction(F)){D=E.text;F=function(G){return G[D]}}E=E.results}return function(I){var H=I.term,G={results:[]},J;if(H===""){I.callback({results:E});return}J=function(L,N){var M,K;L=L[0];if(L.children){M={};for(K in L){if(L.hasOwnProperty(K)){M[K]=L[K]}}M.children=[];j(L.children).each2(function(O,P){J(P,M.children)});if(M.children.length){N.push(M)}}else{if(I.matcher(H,F(L))){N.push(L)}}};j(E).each2(function(L,K){J(K,G.results)});I.callback(G)}}function o(C){if(j.isFunction(C)){return C}return function(F){var E=F.term,D={results:[]};j(C).each(function(){var G=this.text!==l,H=G?this.text:this;if(E===""||F.matcher(E,H)){D.results.push(G?this:{id:this,text:this})}});F.callback(D)}}function k(C,D){if(j.isFunction(C)){return true}if(!C){return false}throw new Error("formatterName must be a function or a falsy value")}function s(C){return j.isFunction(C)?C():C}function h(C){var D=0;j.each(C,function(E,F){if(F.children){D+=h(F.children)}else{D++}});return D}function y(K,L,I,C){var D=K,M=false,F,J,G,E,H;if(!C.createSearchChoice||!C.tokenSeparators||C.tokenSeparators.length<1){return l}while(true){J=-1;for(G=0,E=C.tokenSeparators.length;G<E;G++){H=C.tokenSeparators[G];J=K.indexOf(H);if(J>=0){break}}if(J<0){break}F=K.substring(0,J);K=K.substring(J+H.length);if(F.length>0){F=C.createSearchChoice(F,L);if(F!==l&&F!==null&&C.id(F)!==l&&C.id(F)!==null){M=false;for(G=0,E=L.length;G<E;G++){if(q(C.id(F),C.id(L[G]))){M=true;break}}if(!M){I(F)}}}}if(D.localeCompare(K)!=0){return K}}j(document).ready(function(){j(document).delegate("body","mousedown touchend",function(E){var D=j(E.target).closest("div.select2-container").get(0),C;if(D){j(document).find("div.select2-container-active").each(function(){if(this!==D){j(this).data("select2").blur()}})}else{D=j(E.target).closest("div.select2-drop").get(0);j(document).find("div.select2-drop-active").each(function(){if(this!==D){j(this).data("select2").blur()}})}D=j(E.target);C=D.attr("for");if("LABEL"===E.target.tagName&&C&&C.length>0){D=j("#"+C);D=D.data("select2");if(D!==l){D.focus();E.preventDefault()}}})});function w(C,D){var E=function(){};E.prototype=new C;E.prototype.constructor=E;E.prototype.parent=C.prototype;E.prototype=j.extend(E.prototype,D);return E}e=w(Object,{bind:function(D){var C=this;return function(){D.apply(C,arguments)}},init:function(E){var D,C,F=".select2-results";this.opts=E=this.prepareOpts(E);this.id=E.id;if(E.element.data("select2")!==l&&E.element.data("select2")!==null){this.destroy()}this.enabled=true;this.container=this.createContainer();this.containerId="s2id_"+(E.element.attr("id")||"autogen"+t());this.containerSelector="#"+this.containerId.replace(/([;&,\.\+\*\~':"\!\^#$%@\[\]\(\)=>\|])/g,"\\$1");this.container.attr("id",this.containerId);this.body=A(function(){return E.element.closest("body")});if(E.element.attr("class")!==l){this.container.addClass(E.element.attr("class").replace(/validate\[[\S ]+] ?/,""))}this.container.css(s(E.containerCss));this.container.addClass(s(E.containerCssClass));this.opts.element.data("select2",this).hide().before(this.container);this.container.data("select2",this);this.dropdown=this.container.find(".select2-drop");this.dropdown.addClass(s(E.dropdownCssClass));this.dropdown.data("select2",this);this.results=D=this.container.find(F);this.search=C=this.container.find("input.select2-input");C.attr("tabIndex",this.opts.element.attr("tabIndex"));this.resultsPage=0;this.context=null;this.initContainer();this.initContainerWidth();u(this.results);this.dropdown.delegate(F,"mousemove-filtered",this.bind(this.highlightUnderEvent));g(80,this.results);this.dropdown.delegate(F,"scroll-debounced",this.bind(this.loadMoreIfNeeded));if(j.fn.mousewheel){D.mousewheel(function(K,L,I,H){var J=D.scrollTop(),G;if(H>0&&J-H<=0){D.scrollTop(0);d(K)}else{if(H<0&&D.get(0).scrollHeight-D.scrollTop()+H<=D.height()){D.scrollTop(D.get(0).scrollHeight-D.height());d(K)}}})}z(C);C.bind("keyup-change",this.bind(this.updateResults));C.bind("focus",function(){C.addClass("select2-focused");if(C.val()===" "){C.val("")}});C.bind("blur",function(){C.removeClass("select2-focused")});this.dropdown.delegate(F,"mouseup",this.bind(function(G){if(j(G.target).closest(".select2-result-selectable:not(.select2-disabled)").length>0){this.highlightUnderEvent(G);this.selectHighlighted(G)}else{this.focusSearch()}d(G)}));this.dropdown.bind("click mouseup mousedown",function(G){G.stopPropagation()});if(j.isFunction(this.opts.initSelection)){this.initSelection();this.monitorSource()}if(E.element.is(":disabled")||E.element.is("[readonly='readonly']")){this.disable()}},destroy:function(){var C=this.opts.element.data("select2");if(C!==l){C.container.remove();C.dropdown.remove();C.opts.element.removeData("select2").unbind(".select2").show()}},prepareOpts:function(G){var E,D,C,F;E=G.element;if(E.get(0).tagName.toLowerCase()==="select"){this.select=D=G.element}if(D){j.each(["id","multiple","ajax","query","createSearchChoice","initSelection","data","tags"],function(){if(this in G){throw new Error("Option '"+this+"' is not allowed for Select2 when attached to a <select> element.")}})}G=j.extend({},{populateResults:function(H,L,N){var M,K,P,J,I=this.opts.id,O=this;M=function(V,Q,U){var W,S,ab,Y,aa,R,Z,X,T;for(W=0,S=V.length;W<S;W=W+1){ab=V[W];Y=I(ab)!==l;aa=ab.children&&ab.children.length>0;R=j("<li></li>");R.addClass("select2-results-dept-"+U);R.addClass("select2-result");R.addClass(Y?"select2-result-selectable":"select2-result-unselectable");if(aa){R.addClass("select2-result-with-children")}R.addClass(O.opts.formatResultCssClass(ab));Z=j("<div></div>");Z.addClass("select2-result-label");T=G.formatResult(ab,Z,N);if(T!==l){Z.html(O.opts.escapeMarkup(T))}R.append(Z);if(aa){X=j("<ul></ul>");X.addClass("select2-result-sub");M(ab.children,X,U+1);R.append(X)}R.data("select2-data",ab);Q.append(R)}};M(L,H,0)}},j.fn.select2.defaults,G);if(typeof(G.id)!=="function"){C=G.id;G.id=function(H){return H[C]}}if(D){G.query=this.bind(function(K){var J={results:[],more:false},I=K.term,H,M,L;L=function(N,P){var O;if(N.is("option")){if(K.matcher(I,N.text(),N)){P.push({id:N.attr("value"),text:N.text(),element:N.get(),css:N.attr("class")})}}else{if(N.is("optgroup")){O={text:N.attr("label"),children:[],element:N.get(),css:N.attr("class")};N.children().each2(function(Q,R){L(R,O.children)});if(O.children.length>0){P.push(O)}}}};H=E.children();if(this.getPlaceholder()!==l&&H.length>0){M=H[0];if(j(M).text()===""){H=H.not(M)}}H.each2(function(N,O){L(O,J.results)});K.callback(J)});G.id=function(H){return H.id};G.formatResultCssClass=function(H){return H.css}}else{if(!("query" in G)){if("ajax" in G){F=G.element.data("ajax-url");if(F&&F.length>0){G.ajax.url=F}G.query=p(G.ajax)}else{if("data" in G){G.query=r(G.data)}else{if("tags" in G){G.query=o(G.tags);G.createSearchChoice=function(H){return{id:H,text:H}};G.initSelection=function(H,J){var I=[];j(m(H.val(),G.separator)).each(function(){var M=this,L=this,K=G.tags;if(j.isFunction(K)){K=K()}j(K).each(function(){if(q(this.id,M)){L=this.text;return false}});I.push({id:M,text:L})});J(I)}}}}}}if(typeof(G.query)!=="function"){throw"query function not defined for Select2 "+G.element.attr("id")}return G},monitorSource:function(){this.opts.element.bind("change.select2",this.bind(function(C){if(this.opts.element.data("select2-change-triggered")!==true){this.initSelection()}}))},triggerChange:function(C){C=C||{};C=j.extend({},C,{type:"change",val:this.val()});this.opts.element.data("select2-change-triggered",true);this.opts.element.trigger(C);this.opts.element.data("select2-change-triggered",false);this.opts.element.click();if(this.opts.blurOnChange){this.opts.element.blur()}},enable:function(){if(this.enabled){return}this.enabled=true;this.container.removeClass("select2-container-disabled")},disable:function(){if(!this.enabled){return}this.close();this.enabled=false;this.container.addClass("select2-container-disabled")},opened:function(){return this.container.hasClass("select2-dropdown-open")},positionDropdown:function(){var G=this.container.offset(),O=this.container.outerHeight(),D=this.container.outerWidth(),F=this.dropdown.outerHeight(),K=j(window).scrollTop()+document.documentElement.clientHeight,C=G.top+O,N=G.left,L=C+F<=K,J=(G.top-F)>=this.body().scrollTop(),E=this.dropdown.hasClass("select2-drop-above"),H,M,I;if(this.body().css("position")!=="static"){H=this.body().offset();C-=H.top;N-=H.left}if(E){M=true;if(!J&&L){M=false}}else{M=false;if(!L&&J){M=true}}if(M){C=G.top-F;this.container.addClass("select2-drop-above");this.dropdown.addClass("select2-drop-above")}else{this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")}I=j.extend({top:C,left:N,width:D},s(this.opts.dropdownCss));this.dropdown.css(I)},shouldOpen:function(){var C;if(this.opened()){return false}C=j.Event("open");this.opts.element.trigger(C);return !C.isDefaultPrevented()},clearDropdownAlignmentPreference:function(){this.container.removeClass("select2-drop-above");this.dropdown.removeClass("select2-drop-above")},open:function(){if(!this.shouldOpen()){return false}window.setTimeout(this.bind(this.opening),1);return true},opening:function(){var F=this.containerId,D=this.containerSelector,C="scroll."+F,E="resize."+F;this.container.parents().each(function(){j(this).bind(C,function(){var G=j(D);if(G.length==0){j(this).unbind(C)}G.select2("close")})});j(window).bind(E,function(){var G=j(D);if(G.length==0){j(window).unbind(E)}G.select2("close")});this.clearDropdownAlignmentPreference();if(this.search.val()===" "){this.search.val("")}this.container.addClass("select2-dropdown-open").addClass("select2-container-active");this.updateResults(true);if(this.dropdown[0]!==this.body().children().last()[0]){this.dropdown.detach().appendTo(this.body())}this.dropdown.show();this.positionDropdown();this.dropdown.addClass("select2-drop-active");this.ensureHighlightVisible();this.focusSearch()},close:function(){if(!this.opened()){return}var C=this;this.container.parents().each(function(){j(this).unbind("scroll."+C.containerId)});j(window).unbind("resize."+this.containerId);this.clearDropdownAlignmentPreference();this.dropdown.hide();this.container.removeClass("select2-dropdown-open").removeClass("select2-container-active");this.results.empty();this.clearSearch();this.opts.element.trigger(j.Event("close"))},clearSearch:function(){},ensureHighlightVisible:function(){var F=this.results,E,C,J,I,G,H,D;C=this.highlight();if(C<0){return}if(C==0){F.scrollTop(0);return}E=F.find(".select2-result-selectable");J=j(E[C]);I=J.offset().top+J.outerHeight();if(C===E.length-1){D=F.find("li.select2-more-results");if(D.length>0){I=D.offset().top+D.outerHeight()}}G=F.offset().top+F.outerHeight();if(I>G){F.scrollTop(F.scrollTop()+(I-G))}H=J.offset().top-F.offset().top;if(H<0){F.scrollTop(F.scrollTop()+H)}},moveHighlight:function(F){var E=this.results.find(".select2-result-selectable"),D=this.highlight();while(D>-1&&D<E.length){D+=F;var C=j(E[D]);if(C.hasClass("select2-result-selectable")&&!C.hasClass("select2-disabled")){this.highlight(D);break}}},highlight:function(C){var D=this.results.find(".select2-result-selectable").not(".select2-disabled");if(arguments.length===0){return b(D.filter(".select2-highlighted")[0],D.get())}if(C>=D.length){C=D.length-1}if(C<0){C=0}D.removeClass("select2-highlighted");j(D[C]).addClass("select2-highlighted");this.ensureHighlightVisible()},countSelectableResults:function(){return this.results.find(".select2-result-selectable").not(".select2-disabled").length},highlightUnderEvent:function(D){var C=j(D.target).closest(".select2-result-selectable");if(C.length>0&&!C.is(".select2-highlighted")){var E=this.results.find(".select2-result-selectable");this.highlight(E.index(C))}else{if(C.length==0){this.results.find(".select2-highlighted").removeClass("select2-highlighted")}}},loadMoreIfNeeded:function(){var G=this.results,F=G.find("li.select2-more-results"),J,I=-1,H=this.resultsPage+1,C=this,E=this.search.val(),D=this.context;if(F.length===0){return}J=F.offset().top-G.offset().top-G.height();if(J<=0){F.addClass("select2-active");this.opts.query({term:E,page:H,context:D,matcher:this.opts.matcher,callback:this.bind(function(K){if(!C.opened()){return}C.opts.populateResults.call(this,G,K.results,{term:E,page:H,context:D});if(K.more===true){F.detach().appendTo(G).text(C.opts.formatLoadMore(H+1));window.setTimeout(function(){C.loadMoreIfNeeded()},10)}else{F.remove()}C.positionDropdown();C.resultsPage=H})})}},tokenize:function(){},updateResults:function(H){var K=this.search,F=this.results,C=this.opts,E,J=this,I;if(H!==true&&(this.showSearchInput===false||!this.opened())){return}K.addClass("select2-active");function G(){F.scrollTop(0);K.removeClass("select2-active");J.positionDropdown()}function D(L){F.html(J.opts.escapeMarkup(L));G()}if(C.maximumSelectionSize>=1){E=this.data();if(j.isArray(E)&&E.length>=C.maximumSelectionSize&&k(C.formatSelectionTooBig,"formatSelectionTooBig")){D("<li class='select2-selection-limit'>"+C.formatSelectionTooBig(C.maximumSelectionSize)+"</li>");return}}if(K.val().length<C.minimumInputLength&&k(C.formatInputTooShort,"formatInputTooShort")){D("<li class='select2-no-results'>"+C.formatInputTooShort(K.val(),C.minimumInputLength)+"</li>");return}else{D("<li class='select2-searching'>"+C.formatSearching()+"</li>")}I=this.tokenize();if(I!=l&&I!=null){K.val(I)}this.resultsPage=1;C.query({term:K.val(),page:this.resultsPage,context:null,matcher:C.matcher,callback:this.bind(function(M){var L;if(!this.opened()){return}this.context=(M.context===l)?null:M.context;if(this.opts.createSearchChoice&&K.val()!==""){L=this.opts.createSearchChoice.call(null,K.val(),M.results);if(L!==l&&L!==null&&J.id(L)!==l&&J.id(L)!==null){if(j(M.results).filter(function(){return q(J.id(this),J.id(L))}).length===0){M.results.unshift(L)}}}if(M.results.length===0&&k(C.formatNoMatches,"formatNoMatches")){D("<li class='select2-no-results'>"+C.formatNoMatches(K.val())+"</li>");return}F.empty();J.opts.populateResults.call(this,F,M.results,{term:K.val(),page:this.resultsPage,context:null});if(M.more===true&&k(C.formatLoadMore,"formatLoadMore")){F.append("<li class='select2-more-results'>"+J.opts.escapeMarkup(C.formatLoadMore(this.resultsPage))+"</li>");window.setTimeout(function(){J.loadMoreIfNeeded()},10)}this.postprocessResults(M,H);G()})})},cancel:function(){this.close()},blur:function(){this.close();this.container.removeClass("select2-container-active");this.dropdown.removeClass("select2-drop-active");if(this.search[0]===document.activeElement){this.search.blur()}this.clearSearch();this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")},focusSearch:function(){this.search.show();this.search.focus();window.setTimeout(this.bind(function(){this.search.show();this.search.focus();this.search.val(this.search.val())}),10)},selectHighlighted:function(){var C=this.highlight(),D=this.results.find(".select2-highlighted").not(".select2-disabled"),E=D.closest(".select2-result-selectable").data("select2-data");if(E){D.addClass("select2-disabled");this.highlight(C);this.onSelect(E)}},getPlaceholder:function(){return this.opts.element.attr("placeholder")||this.opts.element.attr("data-placeholder")||this.opts.element.data("placeholder")||this.opts.placeholder},initContainerWidth:function(){function D(){var H,F,I,G,E;if(this.opts.width==="off"){return null}else{if(this.opts.width==="element"){return this.opts.element.outerWidth()===0?"auto":this.opts.element.outerWidth()+"px"}else{if(this.opts.width==="copy"||this.opts.width==="resolve"){H=this.opts.element.attr("style");if(H!==l){F=H.split(";");for(G=0,E=F.length;G<E;G=G+1){I=F[G].replace(/\s/g,"").match(/width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/);if(I!==null&&I.length>=1){return I[1]}}}if(this.opts.width==="resolve"){H=this.opts.element.css("width");if(H.indexOf("%")>0){return H}return(this.opts.element.outerWidth()===0?"auto":this.opts.element.outerWidth()+"px")}return null}else{if(j.isFunction(this.opts.width)){return this.opts.width()}else{return this.opts.width}}}}}var C=D.call(this);if(C!==null){this.container.attr("style","width: "+C)}}});v=w(e,{createContainer:function(){var C=j("<div></div>",{"class":"select2-container"}).html([" <a href='#' onclick='return false;' class='select2-choice'>"," <span></span><abbr class='select2-search-choice-close' style='display:none;'></abbr>"," <div><b></b></div>","</a>"," <div class='select2-drop select2-offscreen'>"," <div class='select2-search'>"," <input type='text' autocomplete='off' class='select2-input'/>"," </div>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return C},opening:function(){this.search.show();this.parent.opening.apply(this,arguments);this.dropdown.removeClass("select2-offscreen")},close:function(){if(!this.opened()){return}this.parent.close.apply(this,arguments);this.dropdown.removeAttr("style").addClass("select2-offscreen").insertAfter(this.selection).show()},focus:function(){this.close();this.selection.focus()},isFocused:function(){return this.selection[0]===document.activeElement},cancel:function(){this.parent.cancel.apply(this,arguments);this.selection.focus()},initContainer:function(){var E,D=this.container,F=this.dropdown,C=false;this.selection=E=D.find(".select2-choice");this.search.bind("keydown",this.bind(function(G){if(!this.enabled){return}if(G.which===c.PAGE_UP||G.which===c.PAGE_DOWN){d(G);return}if(this.opened()){switch(G.which){case c.UP:case c.DOWN:this.moveHighlight((G.which===c.UP)?-1:1);d(G);return;case c.TAB:case c.ENTER:this.selectHighlighted();d(G);return;case c.ESC:this.cancel(G);d(G);return}}else{if(G.which===c.TAB||c.isControl(G)||c.isFunctionKey(G)||G.which===c.ESC){return}if(this.opts.openOnEnter===false&&G.which===c.ENTER){return}this.open();if(G.which===c.ENTER){return}}}));this.search.bind("focus",this.bind(function(){this.selection.attr("tabIndex","-1")}));this.search.bind("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active")}window.setTimeout(this.bind(function(){this.selection.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));E.bind("mousedown",this.bind(function(G){C=true;if(this.opened()){this.close();this.selection.focus()}else{if(this.enabled){this.open()}}C=false}));F.bind("mousedown",this.bind(function(){this.search.focus()}));E.bind("focus",this.bind(function(){this.container.addClass("select2-container-active");this.search.attr("tabIndex","-1")}));E.bind("blur",this.bind(function(){if(!this.opened()){this.container.removeClass("select2-container-active")}window.setTimeout(this.bind(function(){this.search.attr("tabIndex",this.opts.element.attr("tabIndex"))}),10)}));E.bind("keydown",this.bind(function(H){if(!this.enabled){return}if(H.which===c.PAGE_UP||H.which===c.PAGE_DOWN){d(H);return}if(H.which===c.TAB||c.isControl(H)||c.isFunctionKey(H)||H.which===c.ESC){return}if(this.opts.openOnEnter===false&&H.which===c.ENTER){return}if(H.which==c.DELETE){if(this.opts.allowClear){this.clear()}return}this.open();if(H.which===c.ENTER){d(H);return}if(H.which<48){d(H);return}var G=String.fromCharCode(H.which).toLowerCase();if(H.shiftKey){G=G.toUpperCase()}this.search.focus();this.search.val(G);d(H)}));E.delegate("abbr","mousedown",this.bind(function(G){if(!this.enabled){return}this.clear();d(G);this.close();this.triggerChange();this.selection.focus()}));this.setPlaceholder();this.search.bind("focus",this.bind(function(){this.container.addClass("select2-container-active")}))},clear:function(){this.opts.element.val("");this.selection.find("span").empty();this.selection.removeData("select2-data");this.setPlaceholder()},initSelection:function(){var D;if(this.opts.element.val()===""){this.close();this.setPlaceholder()}else{var C=this;this.opts.initSelection.call(null,this.opts.element,function(E){if(E!==l&&E!==null){C.updateSelection(E);C.close();C.setPlaceholder()}})}},prepareOpts:function(){var C=this.parent.prepareOpts.apply(this,arguments);if(C.element.get(0).tagName.toLowerCase()==="select"){C.initSelection=function(D,F){var E=D.find(":selected");if(j.isFunction(F)){F({id:E.attr("value"),text:E.text()})}}}return C},setPlaceholder:function(){var C=this.getPlaceholder();if(this.opts.element.val()===""&&C!==l){if(this.select&&this.select.find("option:first").text()!==""){return}this.selection.find("span").html(this.opts.escapeMarkup(C));this.selection.addClass("select2-default");this.selection.find("abbr").hide()}},postprocessResults:function(F,D){var E=0,C=this,G=true;this.results.find(".select2-result-selectable").each2(function(H,I){if(q(C.id(I.data("select2-data")),C.opts.element.val())){E=H;return false}});this.highlight(E);if(D===true){G=this.showSearchInput=h(F.results)>=this.opts.minimumResultsForSearch;this.dropdown.find(".select2-search")[G?"removeClass":"addClass"]("select2-search-hidden");j(this.dropdown,this.container)[G?"addClass":"removeClass"]("select2-with-searchbox")}},onSelect:function(D){var C=this.opts.element.val();this.opts.element.val(this.id(D));this.updateSelection(D);this.close();this.selection.focus();if(!q(C,this.id(D))){this.triggerChange()}},updateSelection:function(E){var C=this.selection.find("span"),D;this.selection.data("select2-data",E);C.empty();D=this.opts.formatSelection(E,C);if(D!==l){C.append(this.opts.escapeMarkup(D))}this.selection.removeClass("select2-default");if(this.opts.allowClear&&this.getPlaceholder()!==l){this.selection.find("abbr").show()}},val:function(){var E,D=null,C=this;if(arguments.length===0){return this.opts.element.val()}E=arguments[0];if(this.select){this.select.val(E).find(":selected").each2(function(F,G){D={id:G.attr("value"),text:G.text()};return false});this.updateSelection(D);this.setPlaceholder()}else{if(this.opts.initSelection===l){throw new Error("cannot call val() if initSelection() is not defined")}if(!E){this.clear();return}this.opts.element.val(E);this.opts.initSelection(this.opts.element,function(F){C.opts.element.val(!F?"":C.id(F));C.updateSelection(F);C.setPlaceholder()})}},clearSearch:function(){this.search.val("")},data:function(D){var C;if(arguments.length===0){C=this.selection.data("select2-data");if(C==l){C=null}return C}else{if(!D||D===""){this.clear()}else{this.opts.element.val(!D?"":this.id(D));this.updateSelection(D)}}}});B=w(e,{createContainer:function(){var C=j("<div></div>",{"class":"select2-container select2-container-multi"}).html([" <ul class='select2-choices'>"," <li class='select2-search-field'>"," <input type='text' autocomplete='off' class='select2-input'>"," </li>","</ul>","<div class='select2-drop select2-drop-multi' style='display:none;'>"," <ul class='select2-results'>"," </ul>","</div>"].join(""));return C},prepareOpts:function(){var C=this.parent.prepareOpts.apply(this,arguments);if(C.element.get(0).tagName.toLowerCase()==="select"){C.initSelection=function(D,F){var E=[];D.find(":selected").each2(function(G,H){E.push({id:H.attr("value"),text:H.text()})});if(j.isFunction(F)){F(E)}}}return C},initContainer:function(){var C=".select2-choices",D;this.searchContainer=this.container.find(".select2-search-field");this.selection=D=this.container.find(C);this.search.bind("keydown",this.bind(function(F){if(!this.enabled){return}if(F.which===c.BACKSPACE&&this.search.val()===""){this.close();var G,E=D.find(".select2-search-choice-focus");if(E.length>0){this.unselect(E.first());this.search.width(10);d(F);return}G=D.find(".select2-search-choice");if(G.length>0){G.last().addClass("select2-search-choice-focus")}}else{D.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus")}if(this.opened()){switch(F.which){case c.UP:case c.DOWN:this.moveHighlight((F.which===c.UP)?-1:1);d(F);return;case c.ENTER:case c.TAB:this.selectHighlighted();d(F);return;case c.ESC:this.cancel(F);d(F);return}}if(F.which===c.TAB||c.isControl(F)||c.isFunctionKey(F)||F.which===c.BACKSPACE||F.which===c.ESC){return}if(this.opts.openOnEnter===false&&F.which===c.ENTER){return}this.open();if(F.which===c.PAGE_UP||F.which===c.PAGE_DOWN){d(F)}}));this.search.bind("keyup",this.bind(this.resizeSearch));this.search.bind("blur",this.bind(function(E){this.container.removeClass("select2-container-active");this.search.removeClass("select2-focused");this.clearSearch();E.stopImmediatePropagation()}));this.container.delegate(C,"mousedown",this.bind(function(E){if(!this.enabled){return}if(j(E.target).closest(".select2-search-choice").length>0){return}this.clearPlaceholder();this.open();this.focusSearch();E.preventDefault()}));this.container.delegate(C,"focus",this.bind(function(){if(!this.enabled){return}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active");this.clearPlaceholder()}));this.clearSearch()},enable:function(){if(this.enabled){return}this.parent.enable.apply(this,arguments);this.search.removeAttr("disabled")},disable:function(){if(!this.enabled){return}this.parent.disable.apply(this,arguments);this.search.attr("disabled",true)},initSelection:function(){var D;if(this.opts.element.val()===""){this.updateSelection([]);this.close();this.clearSearch()}if(this.select||this.opts.element.val()!==""){var C=this;this.opts.initSelection.call(null,this.opts.element,function(E){if(E!==l&&E!==null){C.updateSelection(E);C.close();C.clearSearch()}})}},clearSearch:function(){var C=this.getPlaceholder();if(C!==l&&this.getVal().length===0&&this.search.hasClass("select2-focused")===false){this.search.val(C).addClass("select2-default");this.resizeSearch()}else{this.search.val(" ").width(10)}},clearPlaceholder:function(){if(this.search.hasClass("select2-default")){this.search.val("").removeClass("select2-default")}else{if(this.search.val()===" "){this.search.val("")}}},opening:function(){this.parent.opening.apply(this,arguments);this.clearPlaceholder();this.resizeSearch();this.focusSearch()},close:function(){if(!this.opened()){return}this.parent.close.apply(this,arguments)},focus:function(){this.close();this.search.focus()},isFocused:function(){return this.search.hasClass("select2-focused")},updateSelection:function(F){var E=[],D=[],C=this;j(F).each(function(){if(b(C.id(this),E)<0){E.push(C.id(this));D.push(this)}});F=D;this.selection.find(".select2-search-choice").remove();j(F).each(function(){C.addSelectedChoice(this)});C.postprocessResults()},tokenize:function(){var C=this.search.val();C=this.opts.tokenizer(C,this.data(),this.bind(this.onSelect),this.opts);if(C!=null&&C!=l){this.search.val(C);if(C.length>0){this.open()}}},onSelect:function(C){this.addSelectedChoice(C);if(this.select){this.postprocessResults()}if(this.opts.closeOnSelect){this.close();this.search.width(10)}else{if(this.countSelectableResults()>0){this.search.width(10);this.resizeSearch();this.positionDropdown()}else{this.close()}}this.triggerChange({added:C});this.focusSearch()},cancel:function(){this.close();this.focusSearch()},addSelectedChoice:function(E){var C=j("<li class='select2-search-choice'><div></div><a href='#' onclick='return false;' class='select2-search-choice-close' tabindex='-1'></a></li>"),G=this.id(E),F=this.getVal(),D;D=this.opts.formatSelection(E,C);C.find("div").replaceWith("<div>"+this.opts.escapeMarkup(D)+"</div>");C.find(".select2-search-choice-close").bind("mousedown",d).bind("click dblclick",this.bind(function(H){if(!this.enabled){return}j(H.target).closest(".select2-search-choice").fadeOut("fast",this.bind(function(){this.unselect(j(H.target));this.selection.find(".select2-search-choice-focus").removeClass("select2-search-choice-focus");this.close();this.focusSearch()})).dequeue();d(H)})).bind("focus",this.bind(function(){if(!this.enabled){return}this.container.addClass("select2-container-active");this.dropdown.addClass("select2-drop-active")}));C.data("select2-data",E);C.insertBefore(this.searchContainer);F.push(G);this.setVal(F)},unselect:function(D){var F=this.getVal(),E,C;D=D.closest(".select2-search-choice");if(D.length===0){throw"Invalid argument: "+D+". Must be .select2-search-choice"}E=D.data("select2-data");C=b(this.id(E),F);if(C>=0){F.splice(C,1);this.setVal(F);if(this.select){this.postprocessResults()}}D.remove();this.triggerChange({removed:E})},postprocessResults:function(){var E=this.getVal(),F=this.results.find(".select2-result-selectable"),D=this.results.find(".select2-result-with-children"),C=this;F.each2(function(H,G){var I=C.id(G.data("select2-data"));if(b(I,E)>=0){G.addClass("select2-disabled").removeClass("select2-result-selectable")}else{G.removeClass("select2-disabled").addClass("select2-result-selectable")}});D.each2(function(G,H){if(H.find(".select2-result-selectable").length==0){H.addClass("select2-disabled")}else{H.removeClass("select2-disabled")}});F.each2(function(H,G){if(!G.hasClass("select2-disabled")&&G.hasClass("select2-result-selectable")){C.highlight(0);return false}})},resizeSearch:function(){var H,F,E,C,D,G=n(this.search);H=x(this.search)+10;F=this.search.offset().left;E=this.selection.width();C=this.selection.offset().left;D=E-(F-C)-G;if(D<H){D=E-G}if(D<40){D=E-G}this.search.width(D)},getVal:function(){var C;if(this.select){C=this.select.val();return C===null?[]:C}else{C=this.opts.element.val();return m(C,this.opts.separator)}},setVal:function(D){var C;if(this.select){this.select.val(D)}else{C=[];j(D).each(function(){if(b(this,C)<0){C.push(this)}});this.opts.element.val(C.length===0?"":C.join(this.opts.separator))}},val:function(){var E,D=[],C=this;if(arguments.length===0){return this.getVal()}E=arguments[0];if(!E){this.opts.element.val("");this.updateSelection([]);this.clearSearch();return}this.setVal(E);if(this.select){this.select.find(":selected").each(function(){D.push({id:j(this).attr("value"),text:j(this).text()})});this.updateSelection(D)}else{if(this.opts.initSelection===l){throw new Error("val() cannot be called if initSelection() is not defined")}this.opts.initSelection(this.opts.element,function(G){var F=j(G).map(C.id);C.setVal(F);C.updateSelection(G);C.clearSearch()})}this.clearSearch()},onSortStart:function(){if(this.select){throw new Error("Sorting of elements is not supported when attached to <select>. Attach to <input type='hidden'/> instead.")}this.search.width(0);this.searchContainer.hide()},onSortEnd:function(){var D=[],C=this;this.searchContainer.show();this.searchContainer.appendTo(this.searchContainer.parent());this.resizeSearch();this.selection.find(".select2-search-choice").each(function(){D.push(C.opts.id(j(this).data("select2-data")))});this.setVal(D);this.triggerChange()},data:function(D){var C=this,E;if(arguments.length===0){return this.selection.find(".select2-search-choice").map(function(){return j(this).data("select2-data")}).get()}else{if(!D){D=[]}E=j.map(D,function(F){return C.opts.id(F)});this.setVal(E);this.updateSelection(D);this.clearSearch()}}});j.fn.select2=function(){var F=Array.prototype.slice.call(arguments,0),G,E,H,D,C=["val","destroy","opened","open","close","focus","isFocused","container","onSortStart","onSortEnd","enable","disable","positionDropdown","data"];this.each(function(){if(F.length===0||typeof(F[0])==="object"){G=F.length===0?{}:j.extend({},F[0]);G.element=j(this);if(G.element.get(0).tagName.toLowerCase()==="select"){D=G.element.attr("multiple")}else{D=G.multiple||false;if("tags" in G){G.multiple=D=true}}E=D?new B():new v();E.init(G)}else{if(typeof(F[0])==="string"){if(b(F[0],C)<0){throw"Unknown method: "+F[0]}H=l;E=j(this).data("select2");if(E===l){return}if(F[0]==="container"){H=E.container}else{H=E[F[0]].apply(E,F.slice(1))}if(H!==l){return false}}else{throw"Invalid arguments to select2 plugin: "+F}}});return(H===l)?this:H};j.fn.select2.defaults={width:"copy",closeOnSelect:true,openOnEnter:true,containerCss:{},dropdownCss:{},containerCssClass:"",dropdownCssClass:"",formatResult:function(C,D,F){var E=[];i(C.text,F.term,E);return E.join("")},formatSelection:function(D,C){return D?D.text:l},formatResultCssClass:function(C){return l},formatNoMatches:function(){return"No matches found"},formatInputTooShort:function(C,D){return"Please enter "+(D-C.length)+" more characters"},formatSelectionTooBig:function(C){return"You can only select "+C+" item"+(C==1?"":"s")},formatLoadMore:function(C){return"Loading more results..."},formatSearching:function(){return"Searching..."},minimumResultsForSearch:0,minimumInputLength:0,maximumSelectionSize:0,id:function(C){return C.id},matcher:function(C,D){return D.toUpperCase().indexOf(C.toUpperCase())>=0},separator:",",tokenSeparators:[],tokenizer:y,escapeMarkup:function(C){if(C&&typeof(C)==="string"){return C.replace(/&/g,"&")}return C},blurOnChange:false};window.Select2={query:{ajax:p,local:r,tags:o},util:{debounce:f,markMatch:i},"class":{"abstract":e,single:v,multi:B}}}(jQuery));
\ 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
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/b7e8d3695852/
changeset: b7e8d3695852
user: james_taylor
date: 2013-02-04 05:12:58
summary: templates: Move external_services templates into templates/webapps/galaxy
affected #: 6 files
diff -r 35e476a0c0c4a453396010629030c77575fbec95 -r b7e8d36958522a031a937dc50034b3a57fefe3ed templates/external_services/generic_jquery_grid.mako
--- a/templates/external_services/generic_jquery_grid.mako
+++ /dev/null
@@ -1,59 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="json_common.mako" import="display_item" />
-
-<%def name="title()">${param_dict['service_instance'].name}: ${action.label}</%def>
-
-<%def name="display_json_grid_result( headers, rows )">
- %for row in rows:
- %for name in headers:
- <div class="form-row">
- <label>${name}</label>
- ${display_item( row.get( name ) )}
- <div style="clear: both"></div>
- </div>
- %endfor
- %endfor
-</%def>
-
-<%
- #HACK!!!! need to use better method of displaying jqGrid here, needs to allow paging as optionally available.
- if 'Rows' in result: #paged
- records = result['Records']
- total = result['Total']
- rows = result['Rows']
- page = result['Page']
- else:
- rows = result
- records = None
- total = None
- page = None
- headers = rows[0].keys()
-%>
-
-<div class="toolForm">
- <div class="toolFormTitle">${action.label} of ${param_dict['service_instance'].name} (${param_dict['service'].name}) on ${param_dict['item'].name}</div>
- <div class="toolFormBody">
- %if records:
- <div class="form-row">
- <label>Records</label>
- ${records}
- <div style="clear: both"></div>
- </div>
- %endif
- %if total:
- <div class="form-row">
- <label>Total</label>
- ${total}
- <div style="clear: both"></div>
- </div>
- %endif
- %if page:
- <div class="form-row">
- <label>Page</label>
- ${page}
- <div style="clear: both"></div>
- </div>
- %endif
- ${display_json_grid_result( headers, rows )}
- </div>
-</div>
diff -r 35e476a0c0c4a453396010629030c77575fbec95 -r b7e8d36958522a031a937dc50034b3a57fefe3ed templates/external_services/generic_json.mako
--- a/templates/external_services/generic_json.mako
+++ /dev/null
@@ -1,11 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="json_common.mako" import="display_item" />
-
-<%def name="title()">${action.label} of ${param_dict['service_instance'].name} (${param_dict['service'].name}) on ${param_dict['item'].name}</%def>
-
-<div class="toolForm">
- <div class="toolFormTitle">${action.label} of ${param_dict['service_instance'].name} (${param_dict['service'].name}) on ${param_dict['item'].name}</i></div>
- <div class="toolFormBody">
- ${display_item( result )}
- </div>
-</div>
diff -r 35e476a0c0c4a453396010629030c77575fbec95 -r b7e8d36958522a031a937dc50034b3a57fefe3ed templates/external_services/json_common.mako
--- a/templates/external_services/json_common.mako
+++ /dev/null
@@ -1,28 +0,0 @@
-
-<%def name="display_dict( result_dict )">
- %for key, value in result_dict.items():
- <div class="form-row">
- <label>${key}</label>
- ${display_item( value )}
- <div style="clear: both"></div>
- </div>
- %endfor
-</%def>
-
-<%def name="display_list( items )">
- <ul>
- %for item in items:
- <li>${display_item( item ) }</li>
- %endfor
- </ul>
-</%def>
-
-<%def name="display_item( item )">
- %if isinstance( item, ( list, tuple ) ):
- ${display_list( item )}
- %elif isinstance( item, dict ):
- ${display_dict( item )}
- %else:
- ${item}
- %endif
-</%def>
diff -r 35e476a0c0c4a453396010629030c77575fbec95 -r b7e8d36958522a031a937dc50034b3a57fefe3ed templates/webapps/galaxy/external_services/generic_jquery_grid.mako
--- /dev/null
+++ b/templates/webapps/galaxy/external_services/generic_jquery_grid.mako
@@ -0,0 +1,59 @@
+<%inherit file="/base.mako"/>
+<%namespace file="json_common.mako" import="display_item" />
+
+<%def name="title()">${param_dict['service_instance'].name}: ${action.label}</%def>
+
+<%def name="display_json_grid_result( headers, rows )">
+ %for row in rows:
+ %for name in headers:
+ <div class="form-row">
+ <label>${name}</label>
+ ${display_item( row.get( name ) )}
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+ %endfor
+</%def>
+
+<%
+ #HACK!!!! need to use better method of displaying jqGrid here, needs to allow paging as optionally available.
+ if 'Rows' in result: #paged
+ records = result['Records']
+ total = result['Total']
+ rows = result['Rows']
+ page = result['Page']
+ else:
+ rows = result
+ records = None
+ total = None
+ page = None
+ headers = rows[0].keys()
+%>
+
+<div class="toolForm">
+ <div class="toolFormTitle">${action.label} of ${param_dict['service_instance'].name} (${param_dict['service'].name}) on ${param_dict['item'].name}</div>
+ <div class="toolFormBody">
+ %if records:
+ <div class="form-row">
+ <label>Records</label>
+ ${records}
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ %if total:
+ <div class="form-row">
+ <label>Total</label>
+ ${total}
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ %if page:
+ <div class="form-row">
+ <label>Page</label>
+ ${page}
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ ${display_json_grid_result( headers, rows )}
+ </div>
+</div>
diff -r 35e476a0c0c4a453396010629030c77575fbec95 -r b7e8d36958522a031a937dc50034b3a57fefe3ed templates/webapps/galaxy/external_services/generic_json.mako
--- /dev/null
+++ b/templates/webapps/galaxy/external_services/generic_json.mako
@@ -0,0 +1,11 @@
+<%inherit file="/base.mako"/>
+<%namespace file="json_common.mako" import="display_item" />
+
+<%def name="title()">${action.label} of ${param_dict['service_instance'].name} (${param_dict['service'].name}) on ${param_dict['item'].name}</%def>
+
+<div class="toolForm">
+ <div class="toolFormTitle">${action.label} of ${param_dict['service_instance'].name} (${param_dict['service'].name}) on ${param_dict['item'].name}</i></div>
+ <div class="toolFormBody">
+ ${display_item( result )}
+ </div>
+</div>
diff -r 35e476a0c0c4a453396010629030c77575fbec95 -r b7e8d36958522a031a937dc50034b3a57fefe3ed templates/webapps/galaxy/external_services/json_common.mako
--- /dev/null
+++ b/templates/webapps/galaxy/external_services/json_common.mako
@@ -0,0 +1,28 @@
+
+<%def name="display_dict( result_dict )">
+ %for key, value in result_dict.items():
+ <div class="form-row">
+ <label>${key}</label>
+ ${display_item( value )}
+ <div style="clear: both"></div>
+ </div>
+ %endfor
+</%def>
+
+<%def name="display_list( items )">
+ <ul>
+ %for item in items:
+ <li>${display_item( item ) }</li>
+ %endfor
+ </ul>
+</%def>
+
+<%def name="display_item( item )">
+ %if isinstance( item, ( list, tuple ) ):
+ ${display_list( item )}
+ %elif isinstance( item, dict ):
+ ${display_dict( item )}
+ %else:
+ ${item}
+ %endif
+</%def>
https://bitbucket.org/galaxy/galaxy-central/commits/17c40da527fe/
changeset: 17c40da527fe
user: james_taylor
date: 2013-02-04 05:21:17
summary: genetrack: Purge all genetrack support (since it no longer exists), other than leaving filetype for backward compatibility
affected #: 13 files
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 datatypes_conf.xml.sample
--- a/datatypes_conf.xml.sample
+++ b/datatypes_conf.xml.sample
@@ -26,7 +26,6 @@
<converter file="bed_to_summary_tree_converter.xml" target_datatype="summary_tree"/><converter file="bed_to_fli_converter.xml" target_datatype="fli"/><!-- <display file="ucsc/interval_as_bed.xml" /> -->
- <display file="genetrack.xml" /><display file="igb/bed.xml" /></datatype><datatype extension="bedgraph" type="galaxy.datatypes.interval:BedGraph" display_in_upload="true">
@@ -34,7 +33,6 @@
</datatype><datatype extension="bedstrict" type="galaxy.datatypes.interval:BedStrict" /><datatype extension="bed6" type="galaxy.datatypes.interval:Bed6">
- <converter file="bed_to_genetrack_converter.xml" target_datatype="genetrack"/></datatype><datatype extension="bed12" type="galaxy.datatypes.interval:Bed12" /><datatype extension="len" type="galaxy.datatypes.chrominfo:ChromInfo" display_in_upload="true">
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 display_applications/genetrack.xml
--- a/display_applications/genetrack.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<display id="genetrack_interval" version="1.0.0" name="view in">
- <link id="genetrack" name="GeneTrack">
- <url target_frame="galaxy_main">http://genetrack.g2.bx.psu.edu/galaxy?filename=${encoded_filename.qp}&h…</url>
- <param type="data" name="bed_file" viewable="False" format="bed6,genetrack"/><!-- for now, we'll explicitly take care of the multi-step conversion; walk genetrack datatype down as a conversion of genetrack to genetrack doesn't exist and would likely be pointless -->
- <param type="data" dataset="bed_file" name="genetrack_file" format="genetrack" viewable="False" />
- <param type="template" name="galaxy_url" strip="True" >
- ${BASE_URL}/tool_runner?tool_id=predict2genetrack
- </param>
- <param type="template" name="hash_key" strip="True" >
- #from galaxy.util.hash_util import hmac_new
- ${hmac_new( $APP.config.tool_secret, $genetrack_file.file_name )}
- </param>
- <param type="template" name="encoded_filename" strip="True" >
- #import binascii
- ${binascii.hexlify( $genetrack_file.file_name )}
- </param>
- </link>
-</display>
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -143,7 +143,6 @@
self.sanitize_all_html = string_as_bool( kwargs.get( 'sanitize_all_html', True ) )
self.ucsc_display_sites = kwargs.get( 'ucsc_display_sites', "main,test,archaea,ucla" ).lower().split(",")
self.gbrowse_display_sites = kwargs.get( 'gbrowse_display_sites', "modencode,sgd_yeast,tair,wormbase,wormbase_ws120,wormbase_ws140,wormbase_ws170,wormbase_ws180,wormbase_ws190,wormbase_ws200,wormbase_ws204,wormbase_ws210,wormbase_ws220,wormbase_ws225" ).lower().split(",")
- self.genetrack_display_sites = kwargs.get( 'genetrack_display_sites', "main,test" ).lower().split(",")
self.brand = kwargs.get( 'brand', None )
self.support_url = kwargs.get( 'support_url', 'http://wiki.g2.bx.psu.edu/Support' )
self.wiki_url = kwargs.get( 'wiki_url', 'http://g2.trac.bx.psu.edu/' )
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 lib/galaxy/datatypes/converters/bed_to_genetrack_converter.py
--- a/lib/galaxy/datatypes/converters/bed_to_genetrack_converter.py
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/env python
-
-#FIXME: THIS IS 1:1 COPY OF THE SAME FUNCTIONED TOOL - ALLOW REGULAR TOOLS TO MASCARADE AS CONVERTERS
-
-"""
-Wraps genetrack.scripts.tabs2genetrack so the tool can be executed from Galaxy.
-
-usage: %prog input output shift
-"""
-
-import sys, shutil, os
-from galaxy import eggs
-import pkg_resources
-pkg_resources.require( "GeneTrack" )
-
-from genetrack.scripts import tabs2genetrack
-from genetrack import logger
-
-if __name__ == "__main__":
- import os
- os.environ[ 'LC_ALL' ] = 'C'
- #os.system( 'export' )
-
- parser = tabs2genetrack.option_parser()
-
- options, args = parser.parse_args()
-
- # uppercase the format
- options.format = options.format.upper()
-
- if options.format not in ('BED', 'GFF'):
- sys.stdout = sys.stderr
- parser.print_help()
- sys.exit(-1)
-
- logger.disable(options.verbosity)
-
- # missing file names
- if not (options.inpname and options.outname and options.format):
- parser.print_help()
- sys.exit(-1)
- else:
- tabs2genetrack.transform(inpname=options.inpname, outname=options.outname,\
- format=options.format, shift=options.shift, index=options.index, options=options)
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 lib/galaxy/datatypes/converters/bed_to_genetrack_converter.xml
--- a/lib/galaxy/datatypes/converters/bed_to_genetrack_converter.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<tool id="CONVERTER_bed_to_genetrack_0" name="Convert BED to GeneTrack Index" version="1.0.1">
-<!-- FIXME: THIS IS ALMOST 1:1 COPY OF THE SAME FUNCTIONED TOOL - ALLOW REGULAR TOOLS TO MASCARADE AS CONVERTERS
-Using a shift of 0, but tool allows specifying...
--->
-<!-- <description>__NOT_USED_CURRENTLY_FOR_CONVERTERS__</description> -->
- <command interpreter="python">bed_to_genetrack_converter.py -i $input1 -o $output1 -s 0 -v 0 -f BED -x</command>
- <inputs>
- <page>
- <param format="bed6" name="input1" type="data" label="Choose BED file"/>
- </page>
- </inputs>
- <outputs>
- <data format="genetrack" name="output1"/>
- </outputs>
- <help>
- </help>
-</tool>
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 lib/galaxy/datatypes/tracks.py
--- a/lib/galaxy/datatypes/tracks.py
+++ b/lib/galaxy/datatypes/tracks.py
@@ -10,27 +10,30 @@
log = logging.getLogger(__name__)
+# GeneTrack is no longer supported but leaving the datatype since
+# files of this type may still exist
+
class GeneTrack( binary.Binary ):
file_ext = "genetrack"
def __init__(self, **kwargs):
super( GeneTrack, self ).__init__( **kwargs )
- self.add_display_app( 'genetrack', 'View in', '', 'genetrack_link' )
- def get_display_links( self, dataset, type, app, base_url, target_frame='galaxy_main', **kwd ): #Force target_frame to be 'galaxy_main'
- return binary.Binary.get_display_links( self, dataset, type, app, base_url, target_frame=target_frame, **kwd )
- def genetrack_link( self, hda, type, app, base_url ):
- ret_val = []
- if hda.dataset.has_data():
- # Get the disk file name and data id
- file_name = hda.dataset.get_file_name()
- data_id = quote_plus( str( hda.id ) )
- galaxy_url = quote_plus( "%s%s" % ( base_url, url_for( controller = 'tool_runner', tool_id='predict2genetrack' ) ) )
- # Make it secure
- hashkey = quote_plus( hmac_new( app.config.tool_secret, file_name ) )
- encoded = quote_plus( binascii.hexlify( file_name ) )
- for name, url in util.get_genetrack_sites():
- if name.lower() in app.config.genetrack_display_sites:
- # send both parameters filename and hashkey
- link = "%s?filename=%s&hashkey=%s&input=%s&GALAXY_URL=%s" % ( url, encoded, hashkey, data_id, galaxy_url )
- ret_val.append( ( name, link ) )
- return ret_val
+ # self.add_display_app( 'genetrack', 'View in', '', 'genetrack_link' )
+ # def get_display_links( self, dataset, type, app, base_url, target_frame='galaxy_main', **kwd ): #Force target_frame to be 'galaxy_main'
+ # return binary.Binary.get_display_links( self, dataset, type, app, base_url, target_frame=target_frame, **kwd )
+ # def genetrack_link( self, hda, type, app, base_url ):
+ # ret_val = []
+ # if hda.dataset.has_data():
+ # # Get the disk file name and data id
+ # file_name = hda.dataset.get_file_name()
+ # data_id = quote_plus( str( hda.id ) )
+ # galaxy_url = quote_plus( "%s%s" % ( base_url, url_for( controller = 'tool_runner', tool_id='predict2genetrack' ) ) )
+ # # Make it secure
+ # hashkey = quote_plus( hmac_new( app.config.tool_secret, file_name ) )
+ # encoded = quote_plus( binascii.hexlify( file_name ) )
+ # for name, url in util.get_genetrack_sites():
+ # if name.lower() in app.config.genetrack_display_sites:
+ # # send both parameters filename and hashkey
+ # link = "%s?filename=%s&hashkey=%s&input=%s&GALAXY_URL=%s" % ( url, encoded, hashkey, data_id, galaxy_url )
+ # ret_val.append( ( name, link ) )
+ # return ret_val
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 lib/galaxy/eggs/__init__.py
--- a/lib/galaxy/eggs/__init__.py
+++ b/lib/galaxy/eggs/__init__.py
@@ -349,7 +349,7 @@
raise EggNotFetchable( missing )
class GalaxyConfig( object ):
- always_conditional = ( 'GeneTrack', 'pysam', 'ctypes', 'python_daemon' )
+ always_conditional = ( 'pysam', 'ctypes', 'python_daemon' )
def __init__( self, config_file ):
if config_file is None:
self.config = None
@@ -387,7 +387,6 @@
"guppy": lambda: self.config.get( "app:main", "use_memdump" ),
"python_openid": lambda: self.config.get( "app:main", "enable_openid" ),
"python_daemon": lambda: sys.version_info[:2] >= ( 2, 5 ),
- "GeneTrack": lambda: sys.version_info[:2] >= ( 2, 5 ),
"ctypes": lambda: ( "drmaa" in self.config.get( "app:main", "start_job_runners" ).split(",") ) and sys.version_info[:2] == ( 2, 4 ),
"pysam": lambda: check_pysam()
}.get( egg_name, lambda: True )()
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 lib/galaxy/util/__init__.py
--- a/lib/galaxy/util/__init__.py
+++ b/lib/galaxy/util/__init__.py
@@ -432,11 +432,6 @@
if build in site['builds']:
sites.append((site['name'],site['url']))
return sites
-def get_genetrack_sites():
- sites = []
- for site in genetrack_sites:
- sites.append( ( site['name'], site['url'] ) )
- return sites
def read_dbnames(filename):
""" Read build names from file """
@@ -773,7 +768,6 @@
ncbi_names = read_ncbi( os.path.join( galaxy_root_path, "tool-data", "shared", "ncbi", "builds.txt" ) )
ucsc_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "ucsc", "ucsc_build_sites.txt" ) )
gbrowse_build_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "gbrowse", "gbrowse_build_sites.txt" ) )
-genetrack_sites = read_build_sites( os.path.join( galaxy_root_path, "tool-data", "shared", "genetrack", "genetrack_sites.txt" ), check_builds=False )
dlnames = dict(ucsc=ucsc_names, ensembl=ensembl_names, ncbi=ncbi_names)
def galaxy_directory():
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 templates/genetrack/base.html
--- a/templates/genetrack/base.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
-<title>${self.title()}</title>
-<link rel="stylesheet" href="${h.url_for('/static/genetrack/genetrack.css')}" type="text/css" media="screen">
-<script type="text/javascript" src="${h.url_for('/static/genetrack/genetrack.js')}">var dummy1=0;</script>
-</head>
-
-<%def name="title()">
- Title
-</%def>
-
-<%def name="footer()">
- <div align="center" id="footer">
- <a href="/">Home</a> | <a href="${h.url_for(controller='genetrack',action='search',dataset_id=dataset_id)}">Search</a>
- </div>
- <div align="center" id="tag">
- Powered by <a href="http://genetrack.googlecode.com">GeneTrack</a> |
- <a href="http://atlas.bx.psu.edu/">Penn State Genome Cartography (2008)</a>
- </div>
-</%def>
-
-<body>
- ${self.body()}
- ${self.footer()}
-</body>
-
-</html>
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 templates/genetrack/index.html
--- a/templates/genetrack/index.html
+++ /dev/null
@@ -1,75 +0,0 @@
-## index.html
-<%inherit file="base.html"/>
-<%def name="title()">
- Index
-</%def>
-
-<h1 align="center">${conf.TITLE}</h1>
-
-<form action="" method="get">
-
-<table align="center" cellpadding="2" cellspacing="1" width="100%">
-
-
- % if form.errors():
- <tr class="error"><td align="center">
- % for ekey, evalue in form.errors().items():
- <b>ERROR:</b> ${ekey}: ${evalue}<br>
- % endfor
- </td></tr>
- % endif
-
- <tr class="grey">
- <td colspan="4" align="center">
- <a href="javascript:toggle('options')">More</a><img src="/static/images/thumbtack_icon.png" align="absmiddle" border="0">
-
- Chromosome: ${form.chrom.tag()}
- Feature: ${form.feature.tag()}
- Width: ${form.zoom.tag()}
- Plot: ${form.plot.tag()}
- <input type="submit" name="submit" value="Display!">
- <div id="options" style="display:none" class="selected">
- <table cellpadding="3">
- <tr>
- <td>
- <!-- Nucleosome:${form.nuc_track.tag()}
- ORF:${form.orf_track.tag()}
- -->
- Fit threshold: ${form.min_fit.tag()}
- Image width: ${form.img_size.tag()}
- </td>
- </tr>
- </table>
- </div>
-
- </td>
- </tr>
-
- <tr>
- <td align="center">
- <input type="submit" name="move_left" value="<< Move Left">
-
- <input type="submit" name="zoom_out" value="Shrink -">
-
- <input type="submit" name="zoom_in" value="Magnify +">
-
- <input type="submit" name="move_right" value="Move Right >>">
- </td>
- </tr>
-
- <tr>
- <td align="center">
- <img src="${h.url_for('/static/genetrack/plots/' + param.fname)}" align="center" border="0">
- </td>
- </tr>
-
- <tr>
- <td align="center">
- <!-- <a href='/search'>Search</a> -->
- </td>
- </tr>
-
-</table>
-
-<input type="hidden" id="dataset_id" name="dataset_id" value="${dataset_id}" />
-</form>
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 templates/genetrack/invalid.html
--- a/templates/genetrack/invalid.html
+++ /dev/null
@@ -1,3 +0,0 @@
-## index.html
-<%inherit file="base.html"/>
-<h1>This dataset is not a valid GeneTrack dataset.</h1>
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 templates/genetrack/search.html
--- a/templates/genetrack/search.html
+++ /dev/null
@@ -1,55 +0,0 @@
-## search.html
-<%!
-from itertools import cycle
-colors = cycle( [ 'even', 'odd' ] )
-%>
-
-<%inherit file="base.html"/>
-<%def name="title()">
- Search
-</%def>
-
-<h1 align="center">Search</h1>
-
-<div align="center">
- <form action="search" method="get">
- Search terms <input type="text" name="word" value="${param.word}">
- <input type="hidden" name="dataset_id" id="dataset_id" value="${dataset_id}" />
- <input type="submit" name="submit" value="Search!">
- </form>
-</div>
-
-% if param.word:
-
- % if len(query)>0:
- <h4 align="center">Showing the best ${len(query)} matches</h4>
-
- <table align="center" class="data_table" cellpadding="6" cellspacing="0">
- <tr align="center">
- <th width="25%">Name</td>
- <th width="25%">Chromosome</td>
- <th width="25%">Start:End</td>
- <th width="25%">Type</td>
- </tr>
- % for color, row in zip(colors, query):
- ${makerow(color, row)}
- % endfor
- </table>
-
- % else:
- <h4 align="center">No results found</h4>
- % endif
-
-%endif
-
-<br>
-<%def name="makerow(color, row)">
- <tr class="${color}" align="center">
- <td><a href="${h.url_for(controller='genetrack', action='index', chrom=row.chrom, feature=row.start, dataset_id=dataset_id)}">${row.name}</a></td>
- <td>${row.chrom}</td>
- <td>${row.start}:${row.end}</td>
- <td>${row.label.name}</td>
- </tr>
-</%def>
-
-</form>
diff -r b7e8d36958522a031a937dc50034b3a57fefe3ed -r 17c40da527fe8fee481ead85bdf8069776fc8f44 tool-data/shared/genetrack/genetrack_sites.txt
--- a/tool-data/shared/genetrack/genetrack_sites.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-# GeneTrack sites
-#
-# The key(s) should be added to universe_wsgi.ini as the value of
-# genetrack_display_sites
-#
-# key site url
-psu_galaxy http://genetrack.g2.bx.psu.edu/galaxy
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: james_taylor: templates: Move tool_form templates into templates/webapps/galaxy
by Bitbucket 03 Feb '13
by Bitbucket 03 Feb '13
03 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/35e476a0c0c4/
changeset: 35e476a0c0c4
user: james_taylor
date: 2013-02-04 05:10:37
summary: templates: Move tool_form templates into templates/webapps/galaxy
affected #: 4 files
diff -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 -r 35e476a0c0c4a453396010629030c77575fbec95 templates/tool_executed.mako
--- a/templates/tool_executed.mako
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
-
-<head>
-<title>Galaxy</title>
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-<link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
-<script type="text/javascript">
- var inside_galaxy_frameset = false;
-
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history' )}";
- inside_galaxy_frameset = true;
- }
-
- %if trans.user:
- if (inside_galaxy_frameset)
- {
- //parent.frames.galaxy_tools.update_recently_used();
- }
- %endif
-
- if ( parent.handle_minwidth_hint ) {
- parent.handle_minwidth_hint( -1 );
- }
-
- function main() {
- // If called from outside the galaxy frameset, redirect there
- %if tool.options.refresh:
- if ( ! inside_galaxy_frameset ) {
- setTimeout( "refresh()", 1000 );
- document.getElementById( "refresh_message" ).style.display = "block";
- }
- %endif
- }
-
- function refresh() {
- top.location.href = '${h.url_for( "/" )}';
- }
-
-</script>
-
-</head>
-
-<body onLoad="main()">
-
-<div class="donemessagelarge">
-
-<p>The following job has been successfully added to the queue:</p>
-
-%for data in out_data.values():
- <div style="padding: 10px"><b> ${data.hid}: ${data.name}</b></div>
-%endfor
-
-<p>
-You can check the status of queued jobs and view the resulting
-data by refreshing the <b>History</b> pane. When the job has been run
-the status will change from 'running' to 'finished' if completed
-successfully or 'error' if problems were encountered.
-</p>
-
-%if tool.options.refresh:
-<p id="refresh_message" style="display: none;">You are now being redirected back to <a href="${h.url_for( '/' )}">Galaxy</a></div>
-%endif
-
-</div>
-
-</body>
-
-</html>
diff -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 -r 35e476a0c0c4a453396010629030c77575fbec95 templates/tool_form.mako
--- a/templates/tool_form.mako
+++ /dev/null
@@ -1,357 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/base_panels.mako" import="overlay" />
-
-<%def name="stylesheets()">
- ${h.css( "autocomplete_tagging", "base", "panel_layout", "library" )}
- <style type="text/css">
- html, body {
- background-color: #fff;
- }
- </style>
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- ${h.js( "galaxy.panels", "libs/jquery/select2", "libs/jquery/jstorage" )}
- <script type="text/javascript">
- $(function() {
- $(window).bind("refresh_on_change", function() {
- $(':file').each( function() {
- var file = $(this);
- var file_value = file.val();
- if (file_value) {
- // disable file input, since we don't want to upload the file on refresh
- var file_name = $(this).attr("name");
- file.attr( { name: 'replaced_file_input_' + file_name, disabled: true } );
- // create a new hidden field which stores the filename and has the original name of the file input
- var new_file_input = $(document.createElement('input'));
- new_file_input.attr( { "type": "hidden", "value": file_value, "name": file_name } );
- file.after(new_file_input);
- }
- });
- });
-
- // For drilldown parameters: add expand/collapse buttons and collapse initially-collapsed elements
- $( 'div.drilldown-container' ).each( function() {
- $(this).find('span.form-toggle' ).each( function() {
- var show_hide_click_elt = $(this);
- var group_id = show_hide_click_elt.attr('id').substring( 0, show_hide_click_elt.attr('id').lastIndexOf( '-click' ) );
- $('#' + group_id + '-container').each( function() {
- var show_hide_elt = $(this);
- if ( show_hide_click_elt.hasClass( 'toggle-expand' ) ) {
- show_hide_elt.hide();
- }
- show_hide_click_elt.click( function() {
- if ( show_hide_click_elt.hasClass("toggle") ){
- show_hide_click_elt.addClass("toggle-expand");
- show_hide_click_elt.removeClass("toggle");
- show_hide_elt.slideUp( 'fast' );
- }
- else {
- show_hide_click_elt.addClass("toggle");
- show_hide_click_elt.removeClass("toggle-expand");
- show_hide_elt.slideDown( 'fast' );
- }
- });
- });
- });
- });
-
- function checkUncheckAll( name, check ) {
- $("input[name='" + name + "'][type='checkbox']").attr('checked', !!check);
- }
-
- // Inserts the Select All / Unselect All buttons for checkboxes
- $("div.checkUncheckAllPlaceholder").each( function() {
- var check_name = $(this).attr("checkbox_name");
- select_link = $("<a class='action-button'></a>").text("Select All").click(function() {
- checkUncheckAll(check_name, true);
- });
- unselect_link = $("<a class='action-button'></a>").text("Unselect All").click(function() {
- checkUncheckAll(check_name, false);
- });
- $(this).append(select_link).append(" ").append(unselect_link);
- });
-
- $(".add-librarydataset").live("click", function() {
- var link = $(this);
- $.ajax({
- url: "/visualization/list_libraries",
- error: function(xhr, ajaxOptions, thrownError) { alert( "Grid failed" ); console.log(xhr, ajaxOptions, thrownError); },
- success: function(table_html) {
- show_modal(
- "Select Library Dataset",
- table_html, {
- "Cancel": function() {
- hide_modal();
- },
- "Select": function() {
- var names = [];
- var ids = [];
- counter = 1;
- $('input[name=ldda_ids]:checked').each(function() {
- var name = $.trim( $(this).siblings("label").text() );
- var id = $(this).val();
- names.push( counter + ". " + name );
- counter += 1;
- ids.push(id);
- });
- link.html( names.join("<br/>") );
- link.siblings("input[type=hidden]").val( ids.join("||") );
- hide_modal();
- }
- }
- );
- }
- });
- });
- });
-
- %if not add_frame.debug:
- if( window.name != "galaxy_main" ) {
- location.replace( '${h.url_for( controller='root', action='index', tool_id=tool.id )}' );
- }
- %endif
-
- </script>
-
-</%def>
-
-<%def name="do_inputs( inputs, tool_state, errors, prefix, other_values=None )">
- <%
- from galaxy.util.expressions import ExpressionContext
- other_values = ExpressionContext( tool_state, other_values )
- %>
- %for input_index, input in enumerate( inputs.itervalues() ):
- %if not input.visible:
- <% pass %>
- %elif input.type == "repeat":
- <div class="repeat-group">
- <div class="form-title-row"><strong>${input.title_plural}</strong>
- %if input.help:
- <div class="toolParamHelp" style="clear: both;">
- ${input.help}
- </div>
- %endif
- </div>
- <%
- repeat_state = tool_state[input.name]
- num_repeats = len( repeat_state )
- %>
- %for i in range( num_repeats ):
- <div class="repeat-group-item">
- <%
- if input.name in errors:
- rep_errors = errors[input.name][i]
- else:
- rep_errors = dict()
- index = repeat_state[i]['__index__']
- %>
- <div class="form-title-row"><strong>${input.title} ${i + 1}</strong></div>
- ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
- %if input.min < num_repeats:
- <div class="form-row"><input type="submit" class="btn" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
- %endif
- </div>
- %if rep_errors.has_key( '__index__' ):
- <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${rep_errors['__index__']}</span></div>
- %endif
- %endfor
- %if input.max > num_repeats:
- <div class="form-row"><input type="submit" class="btn" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
- %endif
- </div>
- %elif input.type == "conditional":
- <%
- group_state = tool_state[input.name]
- group_errors = errors.get( input.name, {} )
- current_case = group_state['__current_case__']
- group_prefix = prefix + input.name + "|"
- %>
- %if input.value_ref_in_group:
- ${row_for_param( group_prefix, input.test_param, group_state, group_errors, other_values )}
- %endif
- ${do_inputs( input.cases[current_case].inputs, group_state, group_errors, group_prefix, other_values )}
- %elif input.type == "upload_dataset":
- %if input.get_datatype( trans, other_values ).composite_type is None: #have non-composite upload appear as before
- <%
- if input.name in errors:
- rep_errors = errors[input.name][0]
- else:
- rep_errors = dict()
- %>
- ${do_inputs( input.inputs, tool_state[input.name][0], rep_errors, prefix + input.name + "_" + str( 0 ) + "|", other_values )}
- %else:
- <div class="repeat-group">
- <div class="form-title-row"><strong>${input.group_title( other_values )}</strong></div>
- <%
- repeat_state = tool_state[input.name]
- %>
- %for i in range( len( repeat_state ) ):
- <div class="repeat-group-item">
- <%
- if input.name in errors:
- rep_errors = errors[input.name][i]
- else:
- rep_errors = dict()
- index = repeat_state[i]['__index__']
- %>
- <div class="form-title-row"><strong>File Contents for ${input.title_by_index( trans, i, other_values )}</strong></div>
- ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
- ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
- </div>
- %endfor
- ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
- </div>
- %endif
- %else:
- ${row_for_param( prefix, input, tool_state, errors, other_values )}
- %endif
- %endfor
-</%def>
-
-<%def name="row_for_param( prefix, param, parent_state, parent_errors, other_values )">
- <%
- if parent_errors.has_key( param.name ):
- cls = "form-row form-row-error"
- else:
- cls = "form-row"
-
- label = param.get_label()
-
- field = param.get_html_field( trans, parent_state[ param.name ], other_values )
- field.refresh_on_change = param.refresh_on_change
-
- # Field may contain characters submitted by user and these characters may be unicode; handle non-ascii characters gracefully.
- field_html = field.get_html( prefix )
- if type( field_html ) is not unicode:
- field_html = unicode( field_html, 'utf-8', 'replace' )
-
- if param.type == "hidden":
- return field_html
- %>
- <div class="${cls}">
- %if label:
- <label for="${param.name}">${label}:</label>
- %endif
- <div class="form-row-input">${field_html}</div>
- %if parent_errors.has_key( param.name ):
- <div class="form-row-error-message">
- <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${parent_errors[param.name]}</span></div>
- </div>
- %endif
-
- %if param.help:
- <div class="toolParamHelp" style="clear: both;">
- ${param.help}
- </div>
- %endif
-
- <div style="clear: both;"></div>
-
- </div>
-</%def>
-
-<% overlay(visible=False) %>
-
-%if add_frame.from_noframe:
- <div class="warningmessage">
- <strong>Welcome to Galaxy</strong>
- <hr/>
- It appears that you found this tool from a link outside of Galaxy.
- If you're not familiar with Galaxy, please consider visiting the
- <a href="${h.url_for( controller='root' )}" target="_top">welcome page</a>.
- To learn more about what Galaxy is and what it can do for you, please visit
- the <a href="${add_frame.wiki_url}" target="_top">Galaxy wiki</a>.
- </div>
- <br/>
-%endif
-
-<%
- # Render an error message if a dynamically generated select list is missing a required
- # index file or entry in the tool_data_table_conf.xml file.
- message = ""
- params_with_missing_data_table_entry = tool.params_with_missing_data_table_entry
- params_with_missing_index_file = tool.params_with_missing_index_file
- if params_with_missing_data_table_entry:
- param = params_with_missing_data_table_entry[0]
- message += "Data table named '%s' is required by tool but not configured. " % param.options.missing_tool_data_table_name
- if tool.params_with_missing_index_file:
- param = params_with_missing_index_file[0]
- message += "Index file named '%s' is required by tool but not available. " % param.options.missing_index_file
-
- # Handle calculating the redirect url for the special case where we have nginx proxy
- # upload and need to do url_for on the redirect portion of the tool action.
- try:
- tool_url = h.url_for(tool.action)
- except AttributeError:
- assert len(tool.action) == 2
- tool_url = tool.action[0] + h.url_for(tool.action[1])
-%>
-
-<%
- # Name of the tool in lower case
- low_tool_name = tool.name.lower()
-%>
-
-%if tool_id_version_message:
- ${render_msg( tool_id_version_message, 'warning' )}
-%endif
-
-<div class="toolForm" id="${tool.id}">
- <form id="tool_form" name="tool_form" action="${tool_url}" enctype="${tool.enctype}" target="${tool.target}" method="${tool.method}">
- %if tool.has_multiple_pages:
- <div class="toolFormTitle">${tool.name} (step ${tool_state.page+1} of ${tool.npages})
- %elif not tool_version_select_field:
- <div class="toolFormTitle">${tool.name} (version ${tool.version})
- %else:
- <div class="toolFormTitle">${tool.name} ${tool_version_select_field.get_html()}
- %endif
- %if trans.app.config.biostar:
- <!-- BioStar links -->
- <a href="${trans.app.config.biostar}/new/post/tagged/${low_tool_name}" target="galaxy_main" class="icon-button general-question tooltip close-side-panels" data-original-title="Ask a tool related question"></a>
- <a href="${trans.app.config.biostar}/show/tag/${low_tool_name}/" target="galaxy_main" class="icon-button tag-question tooltip close-side-panels" data-original-title="See tool related posts" ></a>
- <!-- End of BioStar links -->
- %endif
- </div>
- <div class="toolFormBody">
- <input type="hidden" name="refresh" value="refresh">
- <input type="hidden" name="tool_id" value="${tool.id}">
- <input type="hidden" name="tool_state" value="${util.object_to_string( tool_state.encode( tool, app ) )}">
- %if tool.display_by_page[tool_state.page]:
- ${trans.fill_template_string( tool.display_by_page[tool_state.page], context=tool.get_param_html_map( trans, tool_state.page, tool_state.inputs ) )}
- <input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute">
- %else:
- ${do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, errors, "" )}
- <div class="form-row form-actions">
- %if tool_state.page == tool.last_page:
- <input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute">
- %else:
- <input type="submit" class="btn btn-primary" name="runtool_btn" value="Next step">
- %endif
- </div>
- %endif
- </div>
- </form>
-</div>
-%if tool.help:
- <div class="toolHelp">
- <div class="toolHelpBody">
- <%
- if tool.has_multiple_pages:
- tool_help = tool.help_by_page[tool_state.page]
- else:
- tool_help = tool.help
-
- # Help is Mako template, so render using current static path.
- tool_help = tool_help.render( static_path=h.url_for( '/static' ) )
-
- # Convert to unicode to display non-ascii characters.
- if type( tool_help ) is not unicode:
- tool_help = unicode( tool_help, 'utf-8')
- %>
- ${tool_help}
- </div>
- </div>
-%endif
diff -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 -r 35e476a0c0c4a453396010629030c77575fbec95 templates/webapps/galaxy/tool_executed.mako
--- /dev/null
+++ b/templates/webapps/galaxy/tool_executed.mako
@@ -0,0 +1,70 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+<title>Galaxy</title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<link href="${h.url_for('/static/style/base.css')}" rel="stylesheet" type="text/css" />
+<script type="text/javascript">
+ var inside_galaxy_frameset = false;
+
+ if ( parent.frames && parent.frames.galaxy_history ) {
+ parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history' )}";
+ inside_galaxy_frameset = true;
+ }
+
+ %if trans.user:
+ if (inside_galaxy_frameset)
+ {
+ //parent.frames.galaxy_tools.update_recently_used();
+ }
+ %endif
+
+ if ( parent.handle_minwidth_hint ) {
+ parent.handle_minwidth_hint( -1 );
+ }
+
+ function main() {
+ // If called from outside the galaxy frameset, redirect there
+ %if tool.options.refresh:
+ if ( ! inside_galaxy_frameset ) {
+ setTimeout( "refresh()", 1000 );
+ document.getElementById( "refresh_message" ).style.display = "block";
+ }
+ %endif
+ }
+
+ function refresh() {
+ top.location.href = '${h.url_for( "/" )}';
+ }
+
+</script>
+
+</head>
+
+<body onLoad="main()">
+
+<div class="donemessagelarge">
+
+<p>The following job has been successfully added to the queue:</p>
+
+%for data in out_data.values():
+ <div style="padding: 10px"><b> ${data.hid}: ${data.name}</b></div>
+%endfor
+
+<p>
+You can check the status of queued jobs and view the resulting
+data by refreshing the <b>History</b> pane. When the job has been run
+the status will change from 'running' to 'finished' if completed
+successfully or 'error' if problems were encountered.
+</p>
+
+%if tool.options.refresh:
+<p id="refresh_message" style="display: none;">You are now being redirected back to <a href="${h.url_for( '/' )}">Galaxy</a></div>
+%endif
+
+</div>
+
+</body>
+
+</html>
diff -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 -r 35e476a0c0c4a453396010629030c77575fbec95 templates/webapps/galaxy/tool_form.mako
--- /dev/null
+++ b/templates/webapps/galaxy/tool_form.mako
@@ -0,0 +1,357 @@
+<%inherit file="/base.mako"/>
+<%namespace file="/message.mako" import="render_msg" />
+<%namespace file="/base_panels.mako" import="overlay" />
+
+<%def name="stylesheets()">
+ ${h.css( "autocomplete_tagging", "base", "panel_layout", "library" )}
+ <style type="text/css">
+ html, body {
+ background-color: #fff;
+ }
+ </style>
+</%def>
+
+<%def name="javascripts()">
+ ${parent.javascripts()}
+ ${h.js( "galaxy.panels", "libs/jquery/select2", "libs/jquery/jstorage" )}
+ <script type="text/javascript">
+ $(function() {
+ $(window).bind("refresh_on_change", function() {
+ $(':file').each( function() {
+ var file = $(this);
+ var file_value = file.val();
+ if (file_value) {
+ // disable file input, since we don't want to upload the file on refresh
+ var file_name = $(this).attr("name");
+ file.attr( { name: 'replaced_file_input_' + file_name, disabled: true } );
+ // create a new hidden field which stores the filename and has the original name of the file input
+ var new_file_input = $(document.createElement('input'));
+ new_file_input.attr( { "type": "hidden", "value": file_value, "name": file_name } );
+ file.after(new_file_input);
+ }
+ });
+ });
+
+ // For drilldown parameters: add expand/collapse buttons and collapse initially-collapsed elements
+ $( 'div.drilldown-container' ).each( function() {
+ $(this).find('span.form-toggle' ).each( function() {
+ var show_hide_click_elt = $(this);
+ var group_id = show_hide_click_elt.attr('id').substring( 0, show_hide_click_elt.attr('id').lastIndexOf( '-click' ) );
+ $('#' + group_id + '-container').each( function() {
+ var show_hide_elt = $(this);
+ if ( show_hide_click_elt.hasClass( 'toggle-expand' ) ) {
+ show_hide_elt.hide();
+ }
+ show_hide_click_elt.click( function() {
+ if ( show_hide_click_elt.hasClass("toggle") ){
+ show_hide_click_elt.addClass("toggle-expand");
+ show_hide_click_elt.removeClass("toggle");
+ show_hide_elt.slideUp( 'fast' );
+ }
+ else {
+ show_hide_click_elt.addClass("toggle");
+ show_hide_click_elt.removeClass("toggle-expand");
+ show_hide_elt.slideDown( 'fast' );
+ }
+ });
+ });
+ });
+ });
+
+ function checkUncheckAll( name, check ) {
+ $("input[name='" + name + "'][type='checkbox']").attr('checked', !!check);
+ }
+
+ // Inserts the Select All / Unselect All buttons for checkboxes
+ $("div.checkUncheckAllPlaceholder").each( function() {
+ var check_name = $(this).attr("checkbox_name");
+ select_link = $("<a class='action-button'></a>").text("Select All").click(function() {
+ checkUncheckAll(check_name, true);
+ });
+ unselect_link = $("<a class='action-button'></a>").text("Unselect All").click(function() {
+ checkUncheckAll(check_name, false);
+ });
+ $(this).append(select_link).append(" ").append(unselect_link);
+ });
+
+ $(".add-librarydataset").live("click", function() {
+ var link = $(this);
+ $.ajax({
+ url: "/visualization/list_libraries",
+ error: function(xhr, ajaxOptions, thrownError) { alert( "Grid failed" ); console.log(xhr, ajaxOptions, thrownError); },
+ success: function(table_html) {
+ show_modal(
+ "Select Library Dataset",
+ table_html, {
+ "Cancel": function() {
+ hide_modal();
+ },
+ "Select": function() {
+ var names = [];
+ var ids = [];
+ counter = 1;
+ $('input[name=ldda_ids]:checked').each(function() {
+ var name = $.trim( $(this).siblings("label").text() );
+ var id = $(this).val();
+ names.push( counter + ". " + name );
+ counter += 1;
+ ids.push(id);
+ });
+ link.html( names.join("<br/>") );
+ link.siblings("input[type=hidden]").val( ids.join("||") );
+ hide_modal();
+ }
+ }
+ );
+ }
+ });
+ });
+ });
+
+ %if not add_frame.debug:
+ if( window.name != "galaxy_main" ) {
+ location.replace( '${h.url_for( controller='root', action='index', tool_id=tool.id )}' );
+ }
+ %endif
+
+ </script>
+
+</%def>
+
+<%def name="do_inputs( inputs, tool_state, errors, prefix, other_values=None )">
+ <%
+ from galaxy.util.expressions import ExpressionContext
+ other_values = ExpressionContext( tool_state, other_values )
+ %>
+ %for input_index, input in enumerate( inputs.itervalues() ):
+ %if not input.visible:
+ <% pass %>
+ %elif input.type == "repeat":
+ <div class="repeat-group">
+ <div class="form-title-row"><strong>${input.title_plural}</strong>
+ %if input.help:
+ <div class="toolParamHelp" style="clear: both;">
+ ${input.help}
+ </div>
+ %endif
+ </div>
+ <%
+ repeat_state = tool_state[input.name]
+ num_repeats = len( repeat_state )
+ %>
+ %for i in range( num_repeats ):
+ <div class="repeat-group-item">
+ <%
+ if input.name in errors:
+ rep_errors = errors[input.name][i]
+ else:
+ rep_errors = dict()
+ index = repeat_state[i]['__index__']
+ %>
+ <div class="form-title-row"><strong>${input.title} ${i + 1}</strong></div>
+ ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
+ %if input.min < num_repeats:
+ <div class="form-row"><input type="submit" class="btn" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
+ %endif
+ </div>
+ %if rep_errors.has_key( '__index__' ):
+ <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${rep_errors['__index__']}</span></div>
+ %endif
+ %endfor
+ %if input.max > num_repeats:
+ <div class="form-row"><input type="submit" class="btn" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
+ %endif
+ </div>
+ %elif input.type == "conditional":
+ <%
+ group_state = tool_state[input.name]
+ group_errors = errors.get( input.name, {} )
+ current_case = group_state['__current_case__']
+ group_prefix = prefix + input.name + "|"
+ %>
+ %if input.value_ref_in_group:
+ ${row_for_param( group_prefix, input.test_param, group_state, group_errors, other_values )}
+ %endif
+ ${do_inputs( input.cases[current_case].inputs, group_state, group_errors, group_prefix, other_values )}
+ %elif input.type == "upload_dataset":
+ %if input.get_datatype( trans, other_values ).composite_type is None: #have non-composite upload appear as before
+ <%
+ if input.name in errors:
+ rep_errors = errors[input.name][0]
+ else:
+ rep_errors = dict()
+ %>
+ ${do_inputs( input.inputs, tool_state[input.name][0], rep_errors, prefix + input.name + "_" + str( 0 ) + "|", other_values )}
+ %else:
+ <div class="repeat-group">
+ <div class="form-title-row"><strong>${input.group_title( other_values )}</strong></div>
+ <%
+ repeat_state = tool_state[input.name]
+ %>
+ %for i in range( len( repeat_state ) ):
+ <div class="repeat-group-item">
+ <%
+ if input.name in errors:
+ rep_errors = errors[input.name][i]
+ else:
+ rep_errors = dict()
+ index = repeat_state[i]['__index__']
+ %>
+ <div class="form-title-row"><strong>File Contents for ${input.title_by_index( trans, i, other_values )}</strong></div>
+ ${do_inputs( input.inputs, repeat_state[i], rep_errors, prefix + input.name + "_" + str(index) + "|", other_values )}
+ ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_${index}_remove" value="Remove ${input.title} ${i+1}"></div>
+ </div>
+ %endfor
+ ##<div class="form-row"><input type="submit" name="${prefix}${input.name}_add" value="Add new ${input.title}"></div>
+ </div>
+ %endif
+ %else:
+ ${row_for_param( prefix, input, tool_state, errors, other_values )}
+ %endif
+ %endfor
+</%def>
+
+<%def name="row_for_param( prefix, param, parent_state, parent_errors, other_values )">
+ <%
+ if parent_errors.has_key( param.name ):
+ cls = "form-row form-row-error"
+ else:
+ cls = "form-row"
+
+ label = param.get_label()
+
+ field = param.get_html_field( trans, parent_state[ param.name ], other_values )
+ field.refresh_on_change = param.refresh_on_change
+
+ # Field may contain characters submitted by user and these characters may be unicode; handle non-ascii characters gracefully.
+ field_html = field.get_html( prefix )
+ if type( field_html ) is not unicode:
+ field_html = unicode( field_html, 'utf-8', 'replace' )
+
+ if param.type == "hidden":
+ return field_html
+ %>
+ <div class="${cls}">
+ %if label:
+ <label for="${param.name}">${label}:</label>
+ %endif
+ <div class="form-row-input">${field_html}</div>
+ %if parent_errors.has_key( param.name ):
+ <div class="form-row-error-message">
+ <div><img style="vertical-align: middle;" src="${h.url_for('/static/style/error_small.png')}"> <span style="vertical-align: middle;">${parent_errors[param.name]}</span></div>
+ </div>
+ %endif
+
+ %if param.help:
+ <div class="toolParamHelp" style="clear: both;">
+ ${param.help}
+ </div>
+ %endif
+
+ <div style="clear: both;"></div>
+
+ </div>
+</%def>
+
+<% overlay(visible=False) %>
+
+%if add_frame.from_noframe:
+ <div class="warningmessage">
+ <strong>Welcome to Galaxy</strong>
+ <hr/>
+ It appears that you found this tool from a link outside of Galaxy.
+ If you're not familiar with Galaxy, please consider visiting the
+ <a href="${h.url_for( controller='root' )}" target="_top">welcome page</a>.
+ To learn more about what Galaxy is and what it can do for you, please visit
+ the <a href="${add_frame.wiki_url}" target="_top">Galaxy wiki</a>.
+ </div>
+ <br/>
+%endif
+
+<%
+ # Render an error message if a dynamically generated select list is missing a required
+ # index file or entry in the tool_data_table_conf.xml file.
+ message = ""
+ params_with_missing_data_table_entry = tool.params_with_missing_data_table_entry
+ params_with_missing_index_file = tool.params_with_missing_index_file
+ if params_with_missing_data_table_entry:
+ param = params_with_missing_data_table_entry[0]
+ message += "Data table named '%s' is required by tool but not configured. " % param.options.missing_tool_data_table_name
+ if tool.params_with_missing_index_file:
+ param = params_with_missing_index_file[0]
+ message += "Index file named '%s' is required by tool but not available. " % param.options.missing_index_file
+
+ # Handle calculating the redirect url for the special case where we have nginx proxy
+ # upload and need to do url_for on the redirect portion of the tool action.
+ try:
+ tool_url = h.url_for(tool.action)
+ except AttributeError:
+ assert len(tool.action) == 2
+ tool_url = tool.action[0] + h.url_for(tool.action[1])
+%>
+
+<%
+ # Name of the tool in lower case
+ low_tool_name = tool.name.lower()
+%>
+
+%if tool_id_version_message:
+ ${render_msg( tool_id_version_message, 'warning' )}
+%endif
+
+<div class="toolForm" id="${tool.id}">
+ <form id="tool_form" name="tool_form" action="${tool_url}" enctype="${tool.enctype}" target="${tool.target}" method="${tool.method}">
+ %if tool.has_multiple_pages:
+ <div class="toolFormTitle">${tool.name} (step ${tool_state.page+1} of ${tool.npages})
+ %elif not tool_version_select_field:
+ <div class="toolFormTitle">${tool.name} (version ${tool.version})
+ %else:
+ <div class="toolFormTitle">${tool.name} ${tool_version_select_field.get_html()}
+ %endif
+ %if trans.app.config.biostar:
+ <!-- BioStar links -->
+ <a href="${trans.app.config.biostar}/new/post/tagged/${low_tool_name}" target="galaxy_main" class="icon-button general-question tooltip close-side-panels" data-original-title="Ask a tool related question"></a>
+ <a href="${trans.app.config.biostar}/show/tag/${low_tool_name}/" target="galaxy_main" class="icon-button tag-question tooltip close-side-panels" data-original-title="See tool related posts" ></a>
+ <!-- End of BioStar links -->
+ %endif
+ </div>
+ <div class="toolFormBody">
+ <input type="hidden" name="refresh" value="refresh">
+ <input type="hidden" name="tool_id" value="${tool.id}">
+ <input type="hidden" name="tool_state" value="${util.object_to_string( tool_state.encode( tool, app ) )}">
+ %if tool.display_by_page[tool_state.page]:
+ ${trans.fill_template_string( tool.display_by_page[tool_state.page], context=tool.get_param_html_map( trans, tool_state.page, tool_state.inputs ) )}
+ <input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute">
+ %else:
+ ${do_inputs( tool.inputs_by_page[ tool_state.page ], tool_state.inputs, errors, "" )}
+ <div class="form-row form-actions">
+ %if tool_state.page == tool.last_page:
+ <input type="submit" class="btn btn-primary" name="runtool_btn" value="Execute">
+ %else:
+ <input type="submit" class="btn btn-primary" name="runtool_btn" value="Next step">
+ %endif
+ </div>
+ %endif
+ </div>
+ </form>
+</div>
+%if tool.help:
+ <div class="toolHelp">
+ <div class="toolHelpBody">
+ <%
+ if tool.has_multiple_pages:
+ tool_help = tool.help_by_page[tool_state.page]
+ else:
+ tool_help = tool.help
+
+ # Help is Mako template, so render using current static path.
+ tool_help = tool_help.render( static_path=h.url_for( '/static' ) )
+
+ # Convert to unicode to display non-ascii characters.
+ if type( tool_help ) is not unicode:
+ tool_help = unicode( tool_help, 'utf-8')
+ %>
+ ${tool_help}
+ </div>
+ </div>
+%endif
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: james_taylor: template: Move templates used *only* by the galaxy webapp into templates/webapps/galaxy
by Bitbucket 03 Feb '13
by Bitbucket 03 Feb '13
03 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4c6e63dc04c9/
changeset: 4c6e63dc04c9
user: james_taylor
date: 2013-02-04 05:07:11
summary: template: Move templates used *only* by the galaxy webapp into templates/webapps/galaxy
affected #: 258 files
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/cloud/index.mako
--- a/templates/cloud/index.mako
+++ /dev/null
@@ -1,291 +0,0 @@
-<%inherit file="/webapps/galaxy/base_panels.mako"/>
-
-<%def name="init()">
-<%
- self.has_left_panel=False
- self.has_right_panel=False
- self.active_view="shared"
- self.message_box_visible=False
-%>
-</%def>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "autocomplete_tagging" )}
- <style type="text/css">
- #new_history_p{
- line-height:2.5em;
- margin:0em 0em .5em 0em;
- }
- #new_history_cbx{
- margin-right:.5em;
- }
- #new_history_input{
- display:none;
- line-height:1em;
- }
- #ec_button_container{
- float:right;
- }
- #hidden_options{
- display:none;
- }
- div.toolForm{
- margin-top: 10px;
- margin-bottom: 10px;
- }
- div.toolFormTitle{
- cursor:pointer;
- }
- .title_ul_text{
- text-decoration:underline;
- }
- .step-annotation {
- margin-top: 0.25em;
- font-weight: normal;
- font-size: 97%;
- }
- .workflow-annotation {
- margin-bottom: 1em;
- }
- #loading_indicator{
- position:fixed;
- top:40px;
- }
- </style>
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- var ACCOUNT_URL = "${h.url_for( controller='/cloudlaunch', action='get_account_info')}";
- var PKEY_DL_URL = "${h.url_for( controller='/cloudlaunch', action='get_pkey')}";
- var cloudlaunch_clusters = [];
-
- $(document).ready(function(){
- $('#id_existing_instance').change(function(){
- var ei_name = $(this).val();
- if (ei_name === "New Cluster"){
- //For new instances, need to see the cluster name field.
- $('#id_cluster_name').val("New Cluster")
- $('#cluster_name_wrapper').show('fast');
- }else{
- //Hide the Cluster Name field, but set the value
- $('#id_cluster_name').val($(this).val());
- $('#cluster_name_wrapper').hide('fast');
- }
- });
- //When id_secret and id_key are complete, submit to get_account_info
- $("#id_secret, #id_key_id").bind("paste input propertychange", function(){
- secret_el = $("#id_secret");
- key_el = $("#id_key_id");
- if (secret_el.val().length === 40 && key_el.val().length === 20){
- //Submit these to get_account_info, unhide fields, and update as appropriate
- $.ajax({type: "POST",
- url: ACCOUNT_URL,
- dataType: 'json',
- data: {key_id: key_el.val(),secret:secret_el.val()},
- success: function(result){
- cloudlaunch_clusters = result.clusters;
- var kplist = $("#id_keypair");
- var clusterlist = $("#id_existing_instance");
- kplist.find('option').remove();
- clusterlist.find('option').remove();
- //Update fields with appropriate elements
- clusterlist.append($('<option/>').val('New Cluster').text('New Cluster'));
- if (_.size(result.clusters) > 0){
- _.each(result.clusters, function(cluster, index){
- clusterlist.append($('<option/>').val(cluster.name).text(cluster.name));
- });
- $('#existing_instance_wrapper').show();
- }
- if (!_.include(result.keypairs, '${default_keypair}')){
- kplist.append($('<option/>').val('${default_keypair}').text('Create New - ${default_keypair}'));
- }
- _.each(result.keypairs, function(keypair, index){
- kplist.append($('<option/>').val(keypair).text(keypair));
- });
- $('#hidden_options').show('fast');
- }
- });
- }
- });
- $('#loading_indicator').ajaxStart(function(){
- $(this).show('fast');
- }).ajaxStop(function(){
- $(this).hide('fast');
- });
- $('form').ajaxForm({
- type: 'POST',
- dataType: 'json',
- beforeSubmit: function(data, form){
- if ($('#id_password').val() != $('#id_password_confirm').val()){
- //Passwords don't match.
- form.prepend('<div class="errormessage">Passwords do not match</div>');
- return false;
- }else{
- //Clear errors
- $('.errormessage').remove()
- //Hide the form, show pending box with spinner.
- $('#launchFormContainer').hide('fast');
- $('#responsePanel').show('fast');
- }
- //Dig up zone info for selected cluster, set hidden input.
- //This is not necessary to present to the user though the interface may prove useful.
- var ei_val = _.find(data, function(f_obj){return f_obj.name === 'existing_instance'});
- if( ei_val && (ei_val.value !== "New Cluster")){
- var cluster = _.find(cloudlaunch_clusters, function(cluster){return cluster.name === ei_val.value});
- var zdata = _.find(data, function(f_obj){return f_obj.name === 'zone'});
- zdata.value = cluster.zone;
- }
- },
- success: function(data){
- //Success Message, link to key download if required, link to server itself.
- $('#launchPending').hide('fast');
- //Set appropriate fields (dns, key, ami) and then display.
- if(data.kp_material_tag){
- var kp_download_link = $('<a/>').attr('href', PKEY_DL_URL + '?kp_material_tag=' + data.kp_material_tag)
- .attr('target','_blank')
- .text("Download your key now");
- $('#keypairInfo').append(kp_download_link);
- $('#keypairInfo').show();
- }
- $('.kp_name').text(data.kp_name);
- $('#instance_id').text(data.instance_id);
- $('#image_id').text(data.image_id);
- $('#instance_link').html($('<a/>')
- .attr('href', 'http://' + data.public_dns_name + '/cloud')
- .attr('target','_blank')
- .text(data.public_dns_name + '/cloud'));
- $('#instance_dns').text(data.public_dns_name);
- $('#launchSuccess').show('fast');
- },
- error: function(jqXHR, textStatus, errorThrown){
- $('#launchFormContainer').prepend('<div class="errormessage">' + errorThrown + " : " + jqXHR.responseText + '</div>');
- $('#responsePanel').hide('fast');
- $('#launchFormContainer').show('fast');
- }
- });
- });
- </script>
-</%def>
-
-<%def name="center_panel()">
- <div style="overflow: auto; height: 100%;">
- <div class="page-container" style="padding: 10px;">
- <div id="loading_indicator"></div>
- <h2>Launch a Galaxy Cloud Instance</h2>
- <div id="launchFormContainer" class="toolForm">
- <form id="cloudlaunch_form" action="${h.url_for( controller='/cloudlaunch', action='launch_instance')}" method="post">
-
- <p>To launch a Galaxy Cloud Cluster, enter your AWS Secret Key ID, and Secret Key. Galaxy will use
- these to present appropriate options for launching your cluster. Note that using this form to
- launch computational resources in the Amazon Cloud will result in costs to the account indicated
- above. See <a href="http://aws.amazon.com/ec2/pricing/">Amazon's pricing</a> for more information.
- options for launching your cluster.</p></p>
-
- <div class="form-row">
- <label for="id_key_id">Key ID</label>
- <input type="text" size="30" maxlength="20" name="key_id" id="id_key_id" value=""/><br/>
- <div class="toolParamHelp">
- This is the text string that uniquely identifies your account, found in the
- <a href="https://portal.aws.amazon.com/gp/aws/securityCredentials">Security Credentials section of the AWS Console</a>.
- </div>
- </div>
-
- <div class="form-row">
- <label for="id_secret">Secret Key</label>
- <input type="text" size="50" maxlength="40" name="secret" id="id_secret" value=""/><br/>
- <div class="toolParamHelp">
- This is your AWS Secret Key, also found in the <a href="https://portal.aws.amazon.com/gp/aws/securityCredentials">Security
-Credentials section of the AWS Console</a>. </div>
- </div>
-
- <div id="hidden_options">
- <div id='existing_instance_wrapper' style="display:none;" class="form-row">
- <label for="id_existing_instance">Instances in your account</label>
- <select name="existing_instance" id="id_existing_instance">
- </select>
- <input id='id_zone' type='hidden' name='zone' value=''/>
- </div>
- <div id='cluster_name_wrapper' class="form-row">
- <label for="id_cluster_name">Cluster Name</label>
- <input type="text" size="40" class="text-and-autocomplete-select" name="cluster_name" id="id_cluster_name"/><br/>
- <div class="toolParamHelp">
- This is the name for your cluster. You'll use this when you want to restart.
- </div>
- </div>
-
- <div class="form-row">
- <label for="id_password">Cluster Password</label>
- <input type="password" size="40" name="password" id="id_password"/><br/>
- </div>
-
- <div class="form-row">
- <label for="id_password_confirm">Cluster Password - Confirmation</label>
- <input type="password" size="40" name="password_confirm" id="id_password_confirm"/><br/>
- </div>
-
-
- <div class="form-row">
- <label for="id_keypair">Key Pair</label>
- <select name="keypair" id="id_keypair">
- <option name="Create" value="cloudman_keypair">cloudman_keypair</option>
- </select>
- </div>
-
- %if share_string:
- <input type='hidden' name='share_string' value='${share_string}'/>
- %else:
- <!-- DBEDIT temporary hide share string due to it being broken on the cloudman end -->
- <div class="form-row" style="display:none;">
- <label for="id_share_string">Instance Share String (optional)</label>
- <input type="text" size="120" name="share_string" id="id_share_string"/><br/>
- </div>
- %endif
-
- <div class="form-row">
- <label for="id_instance_type">Instance Type</label>
- <select name="instance_type" id="id_instance_type">
- <option value="m1.large">Large</option>
- <option value="m1.xlarge">Extra Large</option>
- <option value="m2.4xlarge">High-Memory Quadruple Extra Large</option>
- </select>
- </div>
- <div class="form-row">
- <p>Requesting the instance may take a moment, please be patient. Do not refresh your browser or navigate away from the page</p>
- <input type="submit" value="Submit" id="id_submit"/>
- </div>
- </div>
- <div class="form-row">
- <div id="loading_indicator" style="position:relative;left:10px;right:0px"></div>
- </div>
- </form>
- </div>
- <div id="responsePanel" class="toolForm" style="display:none;">
- <div id="launchPending">Launch Pending, please be patient.</div>
- <div id="launchSuccess" style="display:none;">
- <div id="keypairInfo" style="display:none;margin-bottom:20px;">
- <h3>Very Important Key Pair Information</h3>
- <p>A new key pair named <strong><span class="kp_name">kp_name</span></strong> has been created in your AWS
- account and will be used to access this instance via ssh. It is
- <strong>very important</strong> that you save the following private key
- as it is not saved on this Galaxy instance and will be permanently lost if not saved. Additionally, this link will
- only allow a single download, after which the key is removed from the Galaxy server permanently.<br/>
- </div>
- <div>
- <h3>Access Information</h3>
- <ul>
- <li>Your instance '<span id="instance_id">undefined</span>' has been successfully launched using the
- '<span id="image_id">undefined</span>' AMI.</li>
- <li>While it may take a few moments to boot, you will be able to access the cloud control
- panel at <span id="instance_link">undefined.</span>.</li>
- <li>SSH access is also available using your private key. From the terminal, you would execute something like:</br> `ssh -i <span class="kp_name">undefined</span>.pem ubuntu@<span
-id="instance_dns">undefined</span>`</li>
- </ul>
- </div>
- </div>
- </div>
- </div>
-</%def>
-
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/cloud/run.mako
--- a/templates/cloud/run.mako
+++ /dev/null
@@ -1,41 +0,0 @@
-<%inherit file="/webapps/galaxy/base_panels.mako"/>
-
-<%def name="init()">
-<%
- self.has_left_panel=False
- self.has_right_panel=False
- self.active_view="shared"
- self.message_box_visible=False
-%>
-</%def>
-
-
-<%def name="center_panel()">
- <div style="overflow: auto; height: 100%;">
- <div class="page-container" style="padding: 10px;">
- <h2>Launching a Galaxy Cloud Instance</h2>
-%if error:
- <p>${error}</p>
-%elif instance:
- %if kp_material:
- <h3>Very Important Key Pair Information</h3>
- <p>A new key pair named '${kp_name}' has been created in your AWS
- account and will be used to access this instance via ssh. It is
- <strong>very important</strong> that you save the following private key
- as it is not saved on this Galaxy instance and will be permanently lost
- once you leave this page. To do this, save the following key block as
- a plain text file named '${kp_name}'.</p>
- <pre>${kp_material}</pre>
- %endif
- <p>The instance '${instance.id} has been successfully launched using the
- '${instance.image_id}' AMI.<br/> Access it at <a
- href="http://${instance.public_dns_name}">http://${instance.public_dns_name}</a></p>
- <p>SSH access is available using your private key '${kp_name}'.</p>
-%else:
- <p> Unknown failure, no instance. Please refer to your AWS console at <a
- href="https://console.aws.amazon.com">https://console.aws.amazon.com</a></p>
-%endif
- </div>
- </div>
-</%def>
-
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/copy_view.mako
--- a/templates/dataset/copy_view.mako
+++ /dev/null
@@ -1,141 +0,0 @@
-<%inherit file="/base.mako"/>
-<%def name="title()">Copy History Items</%def>
-
-<%def name="javascripts()">
-
- ${parent.javascripts()}
-
- <script type="text/javascript">
- $(function() {
- $("#select-multiple").click(function() {
- $("#single-dest-select").val("");
- $("#single-destination").hide();
- $("#multiple-destination").show();
- });
- });
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- </script>
-
-</%def>
-
-%if error_msg:
- <p>
- <div class="errormessage">${error_msg}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-%if done_msg:
- <p>
- <div class="donemessage">${done_msg}</div>
- <div style="clear: both"></div>
- </p>
-%endif
-<p>
- <div class="infomessage">Copy any number of history items from one history to another.</div>
- <div style="clear: both"></div>
-</p>
-<p>
- <form method="post">
- <div class="toolForm" style="float: left; width: 45%; padding: 0px;">
- <div class="toolFormTitle">Source History:<br />
- <select id="source_history" name="source_history" refresh_on_change="true" style="font-weight: normal;">
- %for i, hist in enumerate(target_histories):
- <%
- selected = ""
- current_history_text = ""
- if hist == source_history:
- selected = "selected='selected'"
- if hist == current_history:
- current_history_text = " (current history)"
-
- %>
- <option value="${trans.security.encode_id(hist.id)}" ${selected}>
- ${i + 1}: ${h.truncate(util.unicodify( hist.name ), 30)}${current_history_text}
- </option>
- %endfor
- </select>
- </div>
- <div class="toolFormBody">
- %if len(source_datasets) > 0:
- %for data in source_datasets:
- <%
- checked = ""
- encoded_id = trans.security.encode_id(data.id)
- if data.id in source_dataset_ids:
- checked = " checked='checked'"
- %>
- <div class="form-row">
- <input type="checkbox" name="source_dataset_ids" id="dataset_${encoded_id}" value="${encoded_id}"${checked}/>
- <label for="dataset_${encoded_id}" style="display: inline;font-weight:normal;"> ${data.hid}: ${h.to_unicode(data.name)}</label>
- </div>
- %endfor
- %else:
- <div class="form-row">This history has no datasets.</div>
- %endif
- </div>
- </div>
- <div style="float: left; padding-left: 10px; font-size: 36px;">→</div>
- <div class="toolForm" style="float: right; width: 45%; padding: 0px;">
- <div class="toolFormTitle">Destination History:</div>
- <div class="toolFormBody">
- <div class="form-row" id="single-destination">
- <select id="single-dest-select" name="target_history_id">
- <option value=""></option>
- %for i, hist in enumerate(target_histories):
- <%
- encoded_id = trans.security.encode_id(hist.id)
- source_history_text = ""
- selected = ""
- if hist == source_history:
- source_history_text = " (source history)"
- if encoded_id == target_history_id:
- selected = " selected='selected'"
- %>
- <option value="${encoded_id}"${selected}>${i + 1}: ${h.truncate( util.unicodify( hist.name ), 30)}${source_history_text}</option>
- %endfor
- </select><br /><br />
- <a style="margin-left: 10px;" href="javascript:void(0);" id="select-multiple">Choose multiple histories</a>
- </div>
- <div id="multiple-destination" style="display: none;">
- %for i, hist in enumerate( target_histories ):
- <%
- cur_history_text = ""
- encoded_id = trans.security.encode_id(hist.id)
- if hist == source_history:
- cur_history_text = " <strong>(source history)</strong>"
- %>
- <div class="form-row">
- <input type="checkbox" name="target_history_ids" id="hist_${encoded_id}" value="${encoded_id}"/>
- <label for="hist_${encoded_id}" style="display: inline; font-weight:normal;">${i + 1}: ${ util.unicodify( hist.name ) }${cur_history_text}</label>
- </div>
- %endfor
- </div>
- %if trans.get_user():
- <%
- checked = ""
- if "create_new_history" in target_history_ids:
- checked = " checked='checked'"
- %>
- <hr />
- <div style="text-align: center; color: #888;">— OR —</div>
- <div class="form-row">
- <label for="new_history_name" style="display: inline; font-weight:normal;">New history named:</label>
- <input type="textbox" name="new_history_name" />
- </div>
- %endif
- </div>
- </div>
- <div style="clear: both"></div>
- <div class="form-row" align="center">
- <input type="submit" class="primary-button" name="do_copy" value="Copy History Items"/>
- </div>
- </form>
- </div>
-</p>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/display.mako
--- a/templates/dataset/display.mako
+++ /dev/null
@@ -1,111 +0,0 @@
-## Because HDAs do not have many of the properties that other sharable items have, we need to override most of the default code for display.
-<%inherit file="/display_base.mako"/>
-<%namespace file="/display_common.mako" import="*" />
-<%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" />
-
-<%def name="javascripts()">
- ${parent.javascripts()}
-</%def>
-
-<%def name="init()">
-<%
- self.has_left_panel=False
- self.has_right_panel=True
- self.message_box_visible=False
- self.active_view="user"
- self.overlay_visible=False
-%>
-</%def>
-
-<%def name="title()">
- Galaxy | ${get_class_display_name( item.__class__ )} | ${get_item_name( item ) | h}
-</%def>
-
-<%def name="render_item_links( data )">
- ## Provide links to save data and import dataset.
- <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}" class="icon-button disk tooltip" title="Save dataset"></a>
- <a
- href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( data.id ) )}"
- class="icon-button import tooltip"
- title="Import dataset"></a>
-</%def>
-
-<%def name="render_item( data, data_to_render )">
- %if truncated:
- <div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below. |
- <a href="${h.url_for( controller='dataset', action='display_by_username_and_slug', username=data.history.user.username, slug=trans.security.encode_id( data.id ), preview=False )}">Show all</a>
- </div>
- %endif
- ## TODO: why is the default font size so small?
- <pre style="font-size: 135%">${ data_to_render | h }</pre>
-</%def>
-
-
-<%def name="center_panel()">
- <div class="unified-panel-header" unselectable="on">
- <div class="unified-panel-header-inner">
- ${get_class_display_name( item.__class__ )}
- | ${get_item_name( item ) | h}
- </div>
- </div>
-
- <div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
- <div class="page-body">
- <div style="float: right">
- ${self.render_item_links( item )}
- </div>
- <div>
- ${self.render_item_header( item )}
- </div>
-
- ${self.render_item( item, item_data )}
- </div>
- </div>
- </div>
-</%def>
-
-<%def name="right_panel()">
- <div class="unified-panel-header" unselectable="on">
- <div class="unified-panel-header-inner">
- About this ${get_class_display_name( item.__class__ )}
- </div>
- </div>
-
- <div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
- <div style="padding: 10px;">
- <h4>Author</h4>
-
- <p>${item.history.user.username | h}</p>
-
- <div><img src="https://secure.gravatar.com/avatar/${h.md5(item.history.user.email)}?d=iden…"></div>
-
- ## Page meta.
-
- ## No links for datasets right now.
-
- ## Tags.
- <p>
- <h4>Tags</h4>
- <p>
- ## Community tags.
- <div>
- Community:
- ${render_community_tagging_element( tagged_item=item, tag_click_fn='community_tag_click', use_toggle_link=False )}
- %if len ( item.tags ) == 0:
- none
- %endif
- </div>
- ## Individual tags.
- <p>
- <div>
- Yours:
- ${render_individual_tagging_element( user=trans.get_user(), tagged_item=item, elt_context='view.mako', use_toggle_link=False, tag_click_fn='community_tag_click' )}
- </div>
- </div>
- </div>
- </div>
-
-</%def>
\ No newline at end of file
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/display_application/display.mako
--- a/templates/dataset/display_application/display.mako
+++ /dev/null
@@ -1,12 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%def name="title()">Display Application: ${display_link.link.display_application.name} ${display_link.link.name}</%def>
-%for message, status in msg:
- ${render_msg( message, status )}
-%endfor
-%if refresh:
-<%def name="metas()"><meta http-equiv="refresh" content="10" /></%def>
-<p>
-This page will <a href="${trans.request.url}">refresh</a> after 10 seconds.
-</p>
-%endif
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/edit_attributes.mako
--- a/templates/dataset/edit_attributes.mako
+++ /dev/null
@@ -1,202 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/message.mako" import="render_msg" />
-<%namespace file="/message.mako" name="message_ns" import="handle_refresh_frames" />
-
-<%def name="title()">${_('Edit Dataset Attributes')}</%def>
-
-<%def name="stylesheets()">
- ${h.css( "base", "autocomplete_tagging" )}
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- ${message_ns.handle_refresh_frames()}
- ${h.js( "libs/jquery/jquery.autocomplete", "galaxy.autocom_tagging" )}
-</%def>
-
-<%def name="datatype( dataset, datatypes )">
- <select name="datatype">
- %for ext in datatypes:
- %if dataset.ext == ext:
- <option value="${ext}" selected="yes">${_(ext)}</option>
- %else:
- <option value="${ext}">${_(ext)}</option>
- %endif
- %endfor
- </select>
-</%def>
-
-%if message:
- ${render_msg( message, status )}
-%endif
-
-
-<ul class="nav nav-tabs">
- <li class="active"><a href="#attributes" data-toggle="tab">Attributes</a></li>
- <li><a href="#convert" data-toggle="tab">Convert Format</a></li>
- <li><a href="#datatype" data-toggle="tab">Datatype</a></li>
- <li><a href="#permissions" data-toggle="tab">Permissions</a></li>
-</ul>
-
-<div class="tab-content">
-
-<div class="tab-pane active toolForm" id="attributes">
- <div class="toolFormTitle">${_('Edit Attributes')}</div>
- <div class="toolFormBody">
- <form name="edit_attributes" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
- <div class="form-row">
- <label>
- Name:
- </label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="name" value="${data.get_display_name() | h}" size="40"/>
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <label>
- Info:
- </label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <textarea name="info" cols="40" rows="2">${ util.unicodify( data.info ) | h}</textarea>
- </div>
- <div style="clear: both"></div>
- </div>
- %if trans.get_user() is not None:
- <div class="form-row">
- <label>
- Annotation / Notes:
- </label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <textarea name="annotation" cols="40" rows="2">${data_annotation | h}</textarea>
- </div>
- <div style="clear: both"></div>
- <div class="toolParamHelp">Add an annotation or notes to a dataset; annotations are available when a history is viewed.</div>
- </div>
- %endif
- %for name, spec in data.metadata.spec.items():
- %if spec.visible:
- <div class="form-row">
- <label>
- ${spec.desc}:
- </label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- ${data.metadata.get_html_by_name( name, trans=trans )}
- </div>
- <div style="clear: both"></div>
- </div>
- %endif
- %endfor
- <div class="form-row">
- <input type="submit" name="save" value="${_('Save')}"/>
- </div>
- </form>
- <form name="auto_detect" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="submit" name="detect" value="${_('Auto-detect')}"/>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- This will inspect the dataset and attempt to correct the above column values if they are not accurate.
- </div>
- </div>
- </form>
- %if data.missing_meta():
- <div class="form-row">
- <div class="errormessagesmall">${_('Required metadata values are missing. Some of these values may not be editable by the user. Selecting "Auto-detect" will attempt to fix these values.')}</div>
- </div>
- %endif
- </div>
-</div>
-
-<div class="tab-pane toolForm" id="convert">
- <div class="toolFormTitle">${_('Convert to new format')}</div>
- <div class="toolFormBody">
- <% converters = data.get_converter_types() %>
- %if len( converters ) > 0:
- <form name="convert_data" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
- <div class="form-row">
- <div style="float: left; width: 250px; margin-right: 10px;">
- <select name="target_type">
- %for key, value in converters.items():
- <option value="${key}">${value.name}</option>
- %endfor
- </select>
- </div>
- <div class="toolParamHelp" style="clear: both;">
- This will create a new dataset with the contents of this dataset converted to a new format.
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <input type="submit" name="convert_data" value="${_('Convert')}"/>
- </div>
- </form>
- %else:
- No conversions available
- %endif
- </div>
-</div>
-
-<div class="tab-pane toolForm" id="datatype">
- <div class="toolFormTitle">${_('Change data type')}</div>
- <div class="toolFormBody">
- %if data.datatype.allow_datatype_change:
- <form name="change_datatype" action="${h.url_for( controller='dataset', action='edit', dataset_id=dataset_id )}" method="post">
- <div class="form-row">
- <label>
- ${_('New Type')}:
- </label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- ${datatype( data, datatypes )}
- </div>
- <div class="toolParamHelp" style="clear: both;">
- ${_('This will change the datatype of the existing dataset but <i>not</i> modify its contents. Use this if Galaxy has incorrectly guessed the type of your dataset.')}
- </div>
- <div style="clear: both"></div>
- </div>
- <div class="form-row">
- <input type="submit" name="change" value="${_('Save')}"/>
- </div>
- </form>
- %else:
- <div class="form-row">
- <div class="warningmessagesmall">${_('Changing the datatype of this dataset is not allowed.')}</div>
- </div>
- %endif
- </div>
-</div>
-<p />
-
-<div class="tab-pane" id="permissions">
-%if trans.app.security_agent.can_manage_dataset( current_user_roles, data.dataset ):
- <%namespace file="/dataset/security_common.mako" import="render_permission_form" />
- ${render_permission_form( data.dataset, data.get_display_name(), h.url_for( controller='dataset', action='edit', dataset_id=dataset_id ), all_roles )}
-%elif trans.user:
- <div class="toolForm">
- <div class="toolFormTitle">View Permissions</div>
- <div class="toolFormBody">
- <div class="form-row">
- %if data.dataset.actions:
- <ul>
- %for action, roles in trans.app.security_agent.get_permissions( data.dataset ).items():
- %if roles:
- <li>${action.description}</li>
- <ul>
- %for role in roles:
- <li>${role.name}</li>
- %endfor
- </ul>
- %endif
- %endfor
- </ul>
- %else:
- <p>This dataset is accessible by everyone (it is public).</p>
- %endif
- </div>
- </div>
- </div>
-%else:
- Permissions not available (not logged in)
-%endif
-</div>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/embed.mako
--- a/templates/dataset/embed.mako
+++ /dev/null
@@ -1,19 +0,0 @@
-<%inherit file="/embed_base.mako"/>
-<%!
- from galaxy.web.framework.helpers import iff
-%>
-
-<%def name="render_item_links( dataset )">
- <a href="${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ), to_ext=dataset.ext )}" title="Save dataset" class="icon-button disk tooltip"></a>
- ## Links for importing and viewing an item.
- <a href="${h.url_for( controller='/dataset', action='imp', dataset_id=trans.security.encode_id( item.id ) )}" title="Import dataset" class="icon-button import tooltip"></a>
- <a class="icon-button go-to-full-screen tooltip" href="${h.url_for( controller='/dataset', action='display_by_username_and_slug', username=dataset.history.user.username, slug=trans.security.encode_id( dataset.id ) )}" title="Go to dataset"></a>
-
-</%def>
-
-<%def name="render_summary_content( dataset, data )">
-## <ul>
-## <li>Format : ${dataset.extension}
-## <pre>${dataset.peek}</pre>
-## </ul>
-</%def>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/errors.mako
--- a/templates/dataset/errors.mako
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-<html>
- <head>
- <title>Dataset generation errors</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <link href="/static/style/base.css" rel="stylesheet" type="text/css" />
- <style>
- pre
- {
- background: white;
- color: black;
- border: dotted black 1px;
- overflow: auto;
- padding: 10px;
- }
- </style>
- </head>
-
- <body>
- <h2>Dataset generation errors</h2>
- <p><b>Dataset ${hda.hid}: ${hda.display_name()}</b></p>
- <% job = hda.creating_job %>
- %if job:
-
- %if job.traceback:
- The Galaxy framework encountered the following error while attempting to run the tool:
- <pre>${ util.unicodify( job.traceback ) | h}</pre>
- %endif
- %if job.stderr or job.info:
- Tool execution generated the following error message:
- %if job.stderr:
- <pre>${ util.unicodify( job.stderr ) | h}</pre>
- %elif job.info:
- <pre>${ util.unicodify( job.info ) | h}</pre>
- %endif
- %else:
- Tool execution did not generate any error messages.
- %endif
- %if job.stdout:
- The tool produced the following additional output:
- <pre>${ util.unicodify( job.stdout ) | h}</pre>
- %endif
- %else:
- The tool did not create any additional job / error info.
- %endif
- <%
- if trans.user:
- user_email = trans.user.email
- else:
- user_email = ''
- %>
- <h2>Report this error to the Galaxy Team</h2>
- <p>
- The Galaxy team regularly reviews errors that occur in the application.
- However, if you would like to provide additional information (such as
- what you were trying to do when the error occurred) and a contact e-mail
- address, we will be better able to investigate your problem and get back
- to you.
- </p>
- <div class="toolForm">
- <div class="toolFormTitle">Error Report</div>
- <div class="toolFormBody">
- <form name="report_error" action="${h.url_for( action='report_error')}" method="post" >
- <input type="hidden" name="id" value="${hda.id}" />
- <div class="form-row">
- <label>Your email</label>
- <input type="text" name="email" size="40" value="${user_email}" />
- </div>
- <div class="form-row">
- <label>Message</label>
- <textarea name="message" rows="10" cols="40"></textarea>
- </div>
- <div class="form-row">
- <input type="submit" value="Report"/>
- </div>
- </form>
- </div>
- </div>
- </body>
-</html>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/grid.mako
--- a/templates/dataset/grid.mako
+++ /dev/null
@@ -1,1 +0,0 @@
-<%inherit file="/grid_base.mako"/>
\ No newline at end of file
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/item_content.mako
--- a/templates/dataset/item_content.mako
+++ /dev/null
@@ -1,3 +0,0 @@
-<%namespace file="/dataset/display.mako" import="*" />
-
-${render_item( item, item_data )}
\ No newline at end of file
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/large_file.mako
--- a/templates/dataset/large_file.mako
+++ /dev/null
@@ -1,11 +0,0 @@
-<%inherit file="/base.mako"/>
-
-<div class="warningmessagelarge">
- This dataset is large and only the first megabyte is shown below.<br />
- <a href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), filename='' )}">Show all</a> |
- <a href="${h.url_for( controller='dataset', action='display', dataset_id=trans.security.encode_id( data.id ), to_ext=data.ext )}">Save</a>
-</div>
-
-<pre>
-${ unicode( truncated_data, 'utf-8' ) | h }
-</pre>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/security_common.mako
--- a/templates/dataset/security_common.mako
+++ /dev/null
@@ -1,130 +0,0 @@
-<%def name="render_select( current_actions, action_key, action, roles )">
- <%
- import sets
- in_roles = sets.Set()
- for a in current_actions:
- if a.action == action.action:
- in_roles.add( a.role )
- out_roles = filter( lambda x: x not in in_roles, roles )
- %>
- <p>
- <b>${action.action}:</b> ${action.description}
- %if action == trans.app.security_agent.permitted_actions.DATASET_ACCESS:
- <br/>
- NOTE: Users must have every role associated with this dataset in order to access it
- %endif
- </p>
- <div style="width: 100%; white-space: nowrap;">
- <div style="float: left; width: 50%;">
- Roles associated:<br />
- <select name="${action_key}_in" id="${action_key}_in_select" class="in_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
- %for role in in_roles:
- <option value="${role.id}">${role.name}</option>
- %endfor
- </select><br />
- <div style="width: 98%; text-align: right"><input type="submit" id="${action_key}_remove_button" class="role_remove_button" value=">>"/></div>
- </div>
- <div style="width: 50%;">
- Roles not associated:<br />
- <select name="${action_key}_out" id="${action_key}_out_select" style="max-width: 98%; width: 98%; height: 150px; font-size: 100%;" multiple>
- %for role in out_roles:
- <option value="${role.id}">${role.name}</option>
- %endfor
- </select><br />
- <input type="submit" id="${action_key}_add_button" class="role_add_button" value="<<"/>
- </div>
- </div>
-</%def>
-
-## Any permission ( e.g., 'DATASET_ACCESS' ) included in the do_not_render param will not be rendered on the page.
-<%def name="render_permission_form( obj, obj_name, form_url, roles, do_not_render=[], all_roles=[] )">
- <%
- if isinstance( obj, trans.app.model.User ):
- current_actions = obj.default_permissions
- permitted_actions = trans.app.model.Dataset.permitted_actions.items()
- obj_str = 'user %s' % obj_name
- obj_type = 'dataset'
- elif isinstance( obj, trans.app.model.History ):
- current_actions = obj.default_permissions
- permitted_actions = trans.app.model.Dataset.permitted_actions.items()
- obj_str = 'history %s' % obj_name
- obj_type = 'dataset'
- elif isinstance( obj, trans.app.model.Dataset ):
- current_actions = obj.actions
- permitted_actions = trans.app.model.Dataset.permitted_actions.items()
- obj_str = obj_name
- obj_type = 'dataset'
- elif isinstance( obj, trans.app.model.LibraryDatasetDatasetAssociation ):
- current_actions = obj.actions + obj.dataset.actions
- permitted_actions = trans.app.model.Dataset.permitted_actions.items() + trans.app.model.Library.permitted_actions.items()
- obj_str = obj_name
- obj_type = 'dataset'
- elif isinstance( obj, trans.app.model.Library ):
- current_actions = obj.actions
- permitted_actions = trans.app.model.Library.permitted_actions.items()
- obj_str = 'library %s' % obj_name
- obj_type = 'library'
- elif isinstance( obj, trans.app.model.LibraryDataset ):
- current_actions = obj.actions
- permitted_actions = trans.app.model.Library.permitted_actions.items()
- obj_str = 'library dataset %s' % obj_name
- obj_type = 'library'
- elif isinstance( obj, trans.app.model.LibraryFolder ):
- current_actions = obj.actions
- permitted_actions = trans.app.model.Library.permitted_actions.items()
- obj_str = 'library folder %s' % obj_name
- obj_type = 'library'
- else:
- current_actions = []
- permitted_actions = {}.items()
- obj_str = 'unknown object %s' %obj_name
- obj_type = ''
- %>
- <script type="text/javascript">
- $( document ).ready( function () {
- $( '.role_add_button' ).click( function() {
- var action = this.id.substring( 0, this.id.lastIndexOf( '_add_button' ) )
- var in_select = '#' + action + '_in_select';
- var out_select = '#' + action + '_out_select';
- return !$( out_select + ' option:selected' ).remove().appendTo( in_select );
- });
- $( '.role_remove_button' ).click( function() {
- var action = this.id.substring( 0, this.id.lastIndexOf( '_remove_button' ) )
- var in_select = '#' + action + '_in_select';
- var out_select = '#' + action + '_out_select';
- return !$( in_select + ' option:selected' ).remove().appendTo( out_select );
- });
- $( 'form#edit_role_associations' ).submit( function() {
- $( '.in_select option' ).each(function( i ) {
- $( this ).attr( "selected", "selected" );
- });
- });
- });
- </script>
- <div class="toolForm">
- <div class="toolFormTitle">Manage ${obj_type} permissions on ${obj_str}</div>
- <div class="toolFormBody">
- <form name="edit_role_associations" id="edit_role_associations" action="${form_url}" method="post">
- <div class="form-row"></div>
- %for k, v in permitted_actions:
- %if k not in do_not_render:
- <div class="form-row">
- ## LIBRARY_ACCESS is a special case because we need to render all roles instead of
- ## roles derived from the roles associated with LIBRARY_ACCESS.
- <% render_all_roles = k == 'LIBRARY_ACCESS' %>
- %if render_all_roles:
- ${render_select( current_actions, k, v, all_roles )}
- %else:
- ${render_select( current_actions, k, v, roles )}
- %endif
- </div>
- %endif
- %endfor
- <div class="form-row">
- <input type="submit" name="update_roles_button" value="Save"/>
- </div>
- </form>
- </div>
- </div>
- <p/>
-</%def>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/dataset/tabular_chunked.mako
--- a/templates/dataset/tabular_chunked.mako
+++ /dev/null
@@ -1,103 +0,0 @@
-<%inherit file="/base.mako"/>
-
-
-<%def name="title()">Dataset Display</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- var DATASET_URL = "${h.url_for( controller='/dataset', action='display', dataset_id=trans.security.encode_id( dataset.id ))}";
- var COLUMN_NUMBER = ${column_number};
- var COLUMN_TYPES = ${column_types};
- var COLUMN_NAMES = ${column_names};
-
- var chunk = ${chunk};
- var current_chunk = 0;
-
- function renderCell(cell_contents, index, colspan){
- if (colspan !== undefined){
- return $('<td>').attr('colspan', colspan).addClass('stringalign').text(cell_contents);
- }
- else if (COLUMN_TYPES[index] == 'str' || COLUMN_TYPES[index] == 'list'){
- /* Left align all str columns, right align the rest */
- return $('<td>').addClass('stringalign').text(cell_contents);;
- }
- else{
- return $('<td>').text(cell_contents);
- }
- }
-
- function renderRow(line){
- /* Check length of cells to ensure this is a complete row. */
- var cells = line.split('\t');
- var row = $('<tr>');
- if (cells.length == COLUMN_NUMBER){
- $.each(cells, function(index, cell_contents){
- row.append(renderCell(cell_contents, index));
- });
- }
- else if(cells.length > COLUMN_NUMBER){
- /* SAM file or like format with optional metadata included */
- $.each(cells.slice(0, COLUMN_NUMBER -1), function(index, cell_contents){
- row.append(renderCell(cell_contents, index));
- });
- row.append(renderCell(cells.slice(COLUMN_NUMBER -1).join('\t'), COLUMN_NUMBER-1));
- }
- else if(COLUMN_NUMBER > 5 && cells.length == COLUMN_NUMBER - 1 ){
- /* SAM file or like format with optional metadata missing */
- $.each(cells, function(index, cell_contents){
- row.append(renderCell(cell_contents, index));
- });
- row.append($('<td>'));
- }
- else{
- /* Comment line, just return the one cell*/
- row.append(renderCell(line, 0, COLUMN_NUMBER));
- }
- return row;
- }
-
- function renderChunk(chunk){
- var table = $('#content_table');
- if (chunk.ck_data == ""){
- current_chunk = -1;
- }
- else if(chunk.ck_index === current_chunk + 1){
- if (current_chunk === 0 && COLUMN_NAMES){
- table.append('<tr><th>' + COLUMN_NAMES.join('</th><th>') + '</th></tr>');
- }
- var lines = chunk.ck_data.split('\n');
- $.each(lines, function(index, line){
- table.append(renderRow(line));
- });
- current_chunk = chunk.ck_index;
- }
- }
-
- $(document).ready(function(){
- renderChunk(chunk);
- $(window).scroll(function(){
- if ($(window).scrollTop() == $(document).height() - $(window).height()){
- if (current_chunk !== -1){
- $.getJSON(DATASET_URL,
- {chunk: current_chunk},
- function(result){renderChunk(result)});
- }
- }
- });
- $('#loading_indicator').ajaxStart(function(){
- $(this).show();
- }).ajaxStop(function(){
- $(this).hide();
- });
- });
- </script>
-</%def>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
-</%def>
-
-<div id="loading_indicator" ></div>
-<table id="content_table" cellpadding="0">
-</table>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/copy.mako
--- a/templates/history/copy.mako
+++ /dev/null
@@ -1,27 +0,0 @@
-<% _=n_ %>
-<%inherit file="/base.mako"/>
-<%def name="title()">Copy History</%def>
-
-<div class="toolForm">
- <div class="toolFormTitle">Copy History</div>
- <div class="toolFormBody">
- <form action="${h.url_for( controller='history', action='copy' )}" method="post" >
- <div class="form-row">
- %if id_argument is not None:
- <input type="hidden" name="id" value="${id_argument}">
- %endif
- You can make a copy of the history that includes all datasets in the original history or just the active
- (not deleted) datasets.
- </div>
- <div class="form-row">
- <input type="radio" name="copy_choice" value="activatable"> Copy all datasets, including deleted ones
- </div>
- <div class="form-row">
- <input type="radio" name="copy_choice" value="active"> Copy only active (not deleted) datasets
- </div>
- <div class="form-row">
- <input type="submit" name="copy_choice_button" value="Copy">
- </div>
- </form>
- </div>
-</div>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/display.mako
--- a/templates/history/display.mako
+++ /dev/null
@@ -1,84 +0,0 @@
-<%inherit file="/display_base.mako"/>
-<%namespace file="/root/history_common.mako" import="render_dataset" />
-
-## Set vars so that there's no need to change the code below.
-<%
- history = published_item
- datasets = published_item_data
-%>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
-</%def>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "history" )}
- <style type="text/css">
- .historyItemBody {
- display: none;
- }
- .column {
- float: left;
- padding: 10px;
- margin: 20px;
- background: #666;
- border: 5px solid #ccc;
- width: 300px;
- }
- </style>
-
- <noscript>
- <style>
- .historyItemBody {
- display: block;
- }
- </style>
- </noscript>
-</%def>
-
-<%def name="render_item_links( history )">
- <a
- href="${h.url_for( controller='/history', action='imp', id=trans.security.encode_id(history.id) )}"
- class="icon-button import"
- ## Needed to overwide initial width so that link is floated left appropriately.
- style="width: 100%"
- title="Import history">Import history</a>
-</%def>
-
-<%def name="render_item( history, datasets )">
- %if history.deleted:
- <div class="warningmessagesmall">
- ${_('You are currently viewing a deleted history!')}
- </div>
- <p></p>
- %endif
-
- %if not datasets:
- <div class="infomessagesmall" id="emptyHistoryMessage">
- %else:
- ## Render requested datasets, ordered from newest to oldest, including annotations.
- <table class="annotated-item">
- <tr><th>Dataset</th><th class="annotation">Annotation</th></tr>
- %for data in datasets:
- <tr>
- %if data.visible:
- <td>
- <div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
- </div>
- </td>
- <td class="annotation">
- %if hasattr( data, "annotation") and data.annotation is not None:
- ${data.annotation}
- %endif
- </td>
- %endif
- </tr>
- %endfor
- </table>
- <div class="infomessagesmall" id="emptyHistoryMessage" style="display:none;">
- %endif
- ${_("This history is empty.")}
- </div>
-</%def>
\ No newline at end of file
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/display_structured.mako
--- a/templates/history/display_structured.mako
+++ /dev/null
@@ -1,132 +0,0 @@
-<%inherit file="/base.mako"/>
-<%namespace file="/root/history_common.mako" import="render_dataset" />
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "history" )}
- <style type="text/css">
- body {
- background: white;
- padding: 5px;
- }
-
- .clickable {
- cursor: pointer;
- }
-
- .workflow {
- border: solid gray 1px;
- margin: 5px 0;
- border-left-width: 5px;
- }
-
- .workflow > .header {
- background: lightgray;
- padding: 5px 10px;
-
- font-weight: bold;
- }
-
- .workflow > .body {
- border-top: solid gray 1px;
- padding: 5px;
- }
-
- div.toolForm {
- margin: 5px 0;
- border-left-width: 5px;
- }
- div.toolFormBody {
- padding: 5px 5px;
- }
- </style>
-</%def>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- <script type="text/javascript">
- $(function(){
-
- $(".workflow, .tool").each( function() {
- var body = $(this).children( ".body" );
- $(this).children( ".header" ).click( function() {
- body.toggle();
- }).addClass( "clickable" );
- // body.hide();
- });
-
- $(".historyItem").each( function() {
- var id = this.id;
- var body = $(this).children( "div.historyItemBody" );
- var peek = body.find( "pre.peek" )
- $(this).children( ".historyItemTitleBar" ).find( ".historyItemTitle" ).wrap( "<a href='#'></a>" ).click( function() {
- if ( body.is(":visible") ) {
- // Hiding stuff here
- if ( $.browser.mozilla ) { peek.css( "overflow", "hidden" ) }
- body.slideUp( "fast" );
- } else {
- // Showing stuff here
- body.slideDown( "fast", function() {
- if ( $.browser.mozilla ) { peek.css( "overflow", "auto" ); }
- });
- }
- return false;
- });
- body.hide();
- });
- });
- </script>
-</%def>
-
-<%def name="render_item( entity, children )">
-<%
-entity_name = entity.__class__.__name__
-if entity_name == "HistoryDatasetAssociation":
- render_item_hda( entity, children )
-elif entity_name == "Job":
- render_item_job( entity, children )
-elif entity_name == "WorkflowInvocation":
- render_item_wf( entity, children )
-%>
-</%def>
-
-<%def name="render_item_hda( hda, children )">
- ${render_dataset( hda, hda.hid, display_structured=True )}
-</%def>
-
-<%def name="render_item_job( job, children )">
-
- <div class="tool toolForm">
- <%
- tool = trans.app.toolbox.get_tool( job.tool_id )
- if tool:
- tool_name = tool.name
- else:
- tool_name = "Unknown tool with id '%s'" % job.tool_id
- %>
- <div class="header toolFormTitle">Tool: ${tool_name}</div>
- <div class="body toolFormBody">
- %for e, c in reversed( children ):
- ${render_item( e, c )}
- %endfor
- </div>
- </div>
-
-</%def>
-
-<%def name="render_item_wf( wf, children )">
-
- <div class="workflow">
- <div class="header">Workflow: ${wf.workflow.name}</div>
- <div class="body">
- %for e, c in reversed( children ):
- ${render_item( e, c )}
- %endfor
- </div>
- </div>
-
-</%def>
-
-%for entity, children in items:
- ${render_item( entity, children )}
-%endfor
\ No newline at end of file
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/embed.mako
--- a/templates/history/embed.mako
+++ /dev/null
@@ -1,13 +0,0 @@
-<%inherit file="/embed_base.mako"/>
-<%!
- from galaxy.web.framework.helpers import iff
-%>
-
-<%def name="render_summary_content( history, datasets )">
-
-## <ul>
-## <% num_datasets = len ( datasets ) %>
-## <li>${num_datasets} dataset${iff( num_datasets != 1, "s", "" )}
-## <li>Operations: ...
-## </ul>
-</%def>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/grid.mako
--- a/templates/history/grid.mako
+++ /dev/null
@@ -1,25 +0,0 @@
-<%inherit file="../grid_base.mako"/>
-
-<%def name="grid_javascripts()">
- ${parent.grid_javascripts()}
- <script type="text/javascript">
- %if refresh_frames:
- %if 'history' in refresh_frames:
- if ( parent.frames && parent.frames.galaxy_history ) {
- parent.frames.galaxy_history.location.href="${h.url_for( controller='root', action='history')}";
- if ( parent.force_right_panel ) {
- parent.force_right_panel( 'show' );
- }
- }
- %endif
- %endif
- </script>
-</%def>
-
-<%def name="grid_body( grid )">
- ${self.make_grid( grid )}
- <br/>
- <div class="toolParamHelp" style="clear: both;">
- Histories that have been deleted for more than a time period specified by the Galaxy administrator(s) may be permanently deleted.
- </div>
-</%def>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/item_content.mako
--- a/templates/history/item_content.mako
+++ /dev/null
@@ -1,3 +0,0 @@
-<%namespace file="/history/display.mako" import="*" />
-
-${render_item( item, item_data )}
\ No newline at end of file
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/list_as_xml.mako
--- a/templates/history/list_as_xml.mako
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<history_ids>
- %for i, history in enumerate( t.user.histories ):
- <data id="${trans.security.encode_id( history.id )}" hid="${i+1}" num="${len(history.datasets)}" name="${history.name}" create="${history.create_time}" update="${history.update_time}" >
- </data>
- %endfor
-</history_ids>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/list_published.mako
--- a/templates/history/list_published.mako
+++ /dev/null
@@ -1,34 +0,0 @@
-<%inherit file="/webapps/galaxy/base_panels.mako"/>
-
-<%def name="init()">
-<%
- self.has_left_panel=False
- self.has_right_panel=False
- self.active_view="shared"
- self.message_box_visible=False
-%>
-</%def>
-
-<%def name="title()">
- Galaxy | Published Histories
-</%def>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- <style>
- .grid td {
- min-width: 100px;
- }
- </style>
-</%def>
-
-<%def name="center_panel()">
-
- <div style="overflow: auto; height: 100%;">
- <div class="page-container" style="padding: 10px;">
- ${h.to_unicode( grid )}
- </div>
- </div>
-
-
-</%def>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/options.mako
--- a/templates/history/options.mako
+++ /dev/null
@@ -1,32 +0,0 @@
-<% _=n_ %>
-<%inherit file="/base.mako"/>
-<%def name="title()">History options</%def>
-
-<h2>${_('History Options')}</h2>
-
-%if not user:
-<div class="infomessage">
- <div>${_('You must be ')}<a target="galaxy_main" href="${h.url_for( controller='user', action='login' )}">${_('logged in')}</a>${_(' to store or switch histories.')}</div>
-</div>
-%endif
-
-<ul>
- %if user:
- <li><a href="${h.url_for( controller='history', action='list')}" target="galaxy_main">Previously</a> stored histories</li>
- %if len( history.active_datasets ) > 0:
- <li><a href="${h.url_for( controller='root', action='history_new' )}">Create</a> a new empty history</li>
- <li><a href="${h.url_for( controller='workflow', action='build_from_current_history' )}">Construct workflow</a> from current history</li>
- <li><a href="${h.url_for( controller='history', action='copy', id=trans.security.encode_id( history.id ) )}">Copy</a> current history</li>
- %endif
- <li><a href="${h.url_for( controller='history', action='share' )}" target="galaxy_main">Share</a> current history</div>
- <li><a href="${h.url_for( controller='root', action='history_set_default_permissions' )}">Change default permissions</a> for current history</li>
- %endif
- %if len( history.activatable_datasets ) > 0:
- <li><a href="${h.url_for( controller='root', action='history', show_deleted=True)}" target="galaxy_history">Show deleted</a> datasets in current history</li>
- %endif
- <li><a href="${h.url_for( controller='history', action='rename', id=trans.security.encode_id( history.id ) )}" target="galaxy_main">Rename</a> current history (stored as "${history.name}")</li>
- <li><a href="${h.url_for( controller='history', action='delete_current' )}" confirm="Are you sure you want to delete the current history?">Delete</a> current history</div>
- %if user and user.histories_shared_by_others:
- <li><a href="${h.url_for( controller='history', action='list_shared')}" target="galaxy_main">Histories</a> shared with you by others</li>
- %endif
-</ul>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/permissions.mako
--- a/templates/history/permissions.mako
+++ /dev/null
@@ -1,8 +0,0 @@
-<%inherit file="/base.mako"/>
-<%def name="title()">Change Default Permissions on New Datasets in This History</%def>
-<%namespace file="/dataset/security_common.mako" import="render_permission_form" />
-
-%if trans.user:
- <% history = trans.get_history() %>
- ${render_permission_form( history, history.name, h.url_for(), trans.user.all_roles() )}
-%endif
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/rename.mako
--- a/templates/history/rename.mako
+++ /dev/null
@@ -1,38 +0,0 @@
-<%inherit file="/base.mako"/>
-<%def name="title()">${_('Rename History')}</%def>
-
-<div class="toolForm">
- <div class="toolFormTitle">${_('Rename')}</div>
- <div class="toolFormBody">
- <form action="${h.url_for( controller='history', action='rename' )}" method="post" >
- <div class="form-row">
- <table>
- <thead>
- <tr>
- <th>${_('Current Name')}</th>
- <th>${_('New Name')}</th>
- </tr>
- </thead>
- <tbody>
- %for history in histories:
- <tr>
- <td>
- <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- ${history.get_display_name() | h}
- </td>
- <td>
- <input type="text" name="name" value="${history.get_display_name() | h}" size="40">
- </td>
- </tr>
- %endfor
- </tbody>
- <tr>
- <td colspan="2">
- <input type="submit" name="history_rename_btn" value="${_('Rename Histories')}">
- </td>
- </tr>
- </table>
- </div>
- </form>
- </div>
-</div>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/share.mako
--- a/templates/history/share.mako
+++ /dev/null
@@ -1,192 +0,0 @@
-<% _=n_ %>
-<%inherit file="/base.mako"/>
-<%def name="title()">Share histories</%def>
-
-<div class="toolForm">
- <div class="toolFormTitle">Share ${len( histories)} histories</div>
- <div class="toolFormBody">
- %if not can_change and not cannot_change and not no_change_needed:
- ## We are sharing histories that contain only public datasets
- <form name='share' id='share' action="${h.url_for( action='share' )}" method="post" >
- <div class="form-title-row"><b>Histories to be shared:</b></div>
- <div class="form-row" style="padding-left: 2em;">
- <table width="100%">
- <thead>
- <th>${_('History Name')}</th>
- <th>${_('Number of Datasets')}</th>
- </thead>
- <tbody>
- %for history in histories:
- <tr>
- <td>
- <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- ${ util.unicodify( history.name )}
- </td>
- <td>
- %if len( history.datasets ) < 1:
- <div class="warningmark">${_('This history contains no data.')}</div>
- %else:
- ${len(history.datasets)}
- %endif
- </td>
- </tr>
- %endfor
- </tbody>
- </table>
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <label>Galaxy user emails with which to share histories</label>
- <div style="float: left; width: 250px; margin-right: 10px;">
- <input type="text" name="email" value="${email}" size="40">
- </div>
- <div class="toolParamHelp" style="clear: both;">
- Enter a Galaxy user email address or a comma-separated list of addresses if sharing with multiple users
- </div>
- </div>
- %if send_to_err:
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="errormessage">${send_to_err}</div>
- </div>
- %endif
- <div style="clear: both"></div>
- <div class="form-row">
- <input type="submit" name="share_button" value="Submit">
- </div>
- </form>
- %else:
- ## We are sharing restricted histories
- %if no_change_needed or can_change:
- <form name='share_restricted' id=share_restricted' action="${h.url_for( controller='history', action='share_restricted' )}" method="post">
- %if send_to_err:
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="errormessage">${send_to_err}</div>
- </div>
- %endif
- ## Needed for rebuilding dicts
- <input type="hidden" name="email" value="${email}" size="40">
- %for history in histories:
- <input type="hidden" name="id" value="${trans.security.encode_id( history.id )}">
- %endfor
- %if no_change_needed:
- ## no_change_needed looks like: {historyX : [hda, hda], historyY : [hda] }
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="donemessage">
- The following datasets can be shared with ${email} with no changes
- </div>
- </div>
- %for history, hdas in no_change_needed.items():
- <div class="form-row">
- <label>History</label>
- ${util.unicodify( history.name )}
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <label>Datasets</label>
- </div>
- %for hda in hdas:
- <div class="form-row">
- ${util.unicodify( hda.name )}
- %if hda.deleted:
- (deleted)
- %endif
- </div>
- %endfor
- %endfor
- %endif
- %if can_change:
- ## can_change looks like: {historyX : [hda, hda], historyY : [hda] }
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="warningmessage">
- The following datasets can be shared with ${email} by updating their permissions
- </div>
- </div>
- %for history, hdas in can_change.items():
- <div class="form-row">
- <label>History</label>
- ${util.unicodify( history.name )}
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <label>Datasets</label>
- </div>
- %for hda in hdas:
- <div class="form-row">
- ${util.unicodify( hda.name )}
- %if hda.deleted:
- (deleted)
- %endif
- </div>
- %endfor
- %endfor
- %endif
- %if cannot_change:
- ## cannot_change looks like: {historyX : [hda, hda], historyY : [hda] }
- <div style="clear: both"></div>
- <div class="form-row">
- <div class="errormessage">
- The following datasets cannot be shared with ${email} because you are not authorized to
- change the permissions on them
- </div>
- </div>
- %for history, hdas in cannot_change.items():
- <div class="form-row">
- <label>History</label>
- ${util.unicodify( history.name )}
- </div>
- <div style="clear: both"></div>
- <div class="form-row">
- <label>Datasets</label>
- </div>
- %for hda in hdas:
- <div class="form-row">
- ${util.unicodify( hda.name )}
- %if hda.deleted:
- (deleted)
- %endif
- </div>
- %endfor
- %endfor
- %endif
- <div class="toolFormTitle"></div>
- <div class="form-row">
- <label>How would you like to proceed?</label>
- </div>
- %if can_change:
- <div class="form-row">
- <input type="radio" name="action" value="public"> Make datasets public so anyone can access them
- %if cannot_change:
- (where possible)
- %endif
- </div>
- <div class="form-row">
- %if no_change_needed:
- <input type="radio" name="action" value="private"> Make datasets private to me and the user(s) with whom I am sharing
- %else:
- <input type="radio" name="action" value="private" checked> Make datasets private to me and the user(s) with whom I am sharing
- %endif
- %if cannot_change:
- (where possible)
- %endif
- </div>
- %endif
- %if no_change_needed:
- <div class="form-row">
- <input type="radio" name="action" value="share_anyway" checked> Share anyway
- %if can_change:
- (don't change any permissions)
- %endif
- </div>
- %endif
- <div class="form-row">
- <input type="submit" name="share_restricted_button" value="Go"><br/>
- </div>
- </form>
- %endif
- %endif
- </div>
-</div>
diff -r c714feaad11541377edd84af1179869c1a8e4f47 -r 4c6e63dc04c9bd2a82ecd11b8ffdf5b544a8e355 templates/history/view.mako
--- a/templates/history/view.mako
+++ /dev/null
@@ -1,140 +0,0 @@
-<%namespace file="/display_common.mako" import="get_history_link, get_controller_name" />
-<%namespace file="/root/history_common.mako" import="render_dataset" />
-<%namespace file="/tagging_common.mako" import="render_individual_tagging_element, render_community_tagging_element" />
-
-<%!
- def inherit(context):
- if context.get('use_panels'):
- return '/webapps/galaxy/base_panels.mako'
- else:
- return '/base.mako'
-%>
-<%inherit file="${inherit(context)}"/>
-
-<%def name="javascripts()">
- ${parent.javascripts()}
- ${h.js( "libs/jquery/jstorage" )}
- <script type="text/javascript">
- $(function() {
- init_history_items( $("div.historyItemWrapper"), false, "nochanges" );
- });
- </script>
-</%def>
-
-<%def name="stylesheets()">
- ${parent.stylesheets()}
- ${h.css( "history", "autocomplete_tagging" )}
- <style type="text/css">
- .historyItemContainer {
- padding-right: 3px;
- border-right-style: solid;
- border-right-color: #66AA66;
- }
- .page-body
- {
- padding: 10px;
- float: left;
- width: 65%;
- }
- .page-meta
- {
- float: right;
- width: 27%;
- padding: 0.5em;
- margin: 0.25em;
- vertical-align: text-top;
- border: 2px solid #DDDDDD;
- border-top: 4px solid #DDDDDD;
- }
- </style>
-
- <style>
- .historyItemBody {
- display: none;
- }
- </style>
-
- <noscript>
- <style>
- .historyItemBody {
- display: block;
- }
- </style>
- </noscript>
-</%def>
-
-<%def name="init()">
-<%
- self.has_left_panel=False
- self.has_right_panel=False
- self.message_box_visible=False
-%>
-</%def>
-
-<%def name="body()">
- ${center_panel()}
-</%def>
-
-<%def name="center_panel()">
- ## Get URL to other histories owned by user that owns this history.
- <%
- ##TODO: is there a better way to create this URL? Can't use 'f-username' as a key b/c it's not a valid identifier.
- href_to_published_histories = h.url_for( controller='/history', action='list_published')
- if history.user is not None:
- href_to_user_histories = h.url_for( controller='/history', action='list_published', xxx=history.user.username).replace( 'xxx', 'f-username')
- else:
- href_to_user_histories = h.url_for( controller='/history', action='list_published' )##should this instead be be None or empty string?
- %>
-
- <div class="unified-panel-header" unselectable="on">
- </div>
-
- <div class="unified-panel-body">
- <div style="overflow: auto; height: 100%;">
- ## Render view of history.
- <div id="top-links" class="historyLinks" style="padding: 0px 0px 5px 0px">
- %if not history.purged:
- <a href="${h.url_for( action='imp', id=trans.security.encode_id(history.id) )}">import and start using history</a> |
- <a href="${get_history_link( history )}">${_('refresh')}</a> |
- %endif
- %if show_deleted:
- <a href="${h.url_for( id=trans.security.encode_id(history.id), show_deleted=False, use_panels=use_panels )}">${_('hide deleted')}</a> |
- %else:
- <a href="${h.url_for( id=trans.security.encode_id(history.id), show_deleted=True, use_panels=use_panels )}">${_('show deleted')}</a> |
- %endif
- <a href="#" class="toggle">collapse all</a>
- </div>
-
- <div id="history-name-area" class="historyLinks" style="color: gray; font-weight: bold; padding: 0px 0px 5px 0px">
- <div id="history-name">${history.get_display_name()}</div>
- </div>
-
- %if history.deleted:
- <div class="warningmessagesmall">
- ${_('You are currently viewing a deleted history!')}
- </div>
- <p></p>
- %endif
-
- %if not datasets:
-
- <div class="infomessagesmall" id="emptyHistoryMessage">
-
- %else:
-
- ## Render requested datasets, ordered from newest to oldest
- %for data in datasets:
- %if data.visible:
- <div class="historyItemContainer visible-right-border" id="historyItemContainer-${data.id}">
- ${render_dataset( data, data.hid, show_deleted_on_refresh = show_deleted, for_editing=False )}
- </div>
- %endif
- %endfor
-
- <div class="infomessagesmall" id="emptyHistoryMessage" style="display:none;">
- %endif
- ${_("Your history is empty. Click 'Get Data' on the left pane to start")}
- </div>
- </div>
- </div>
-</%def>
This diff is so big that we needed to truncate the remainder.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: james_taylor: base_panels: no longer need to specify has_(left|right)_panel, determined depending on whether the blocks are set. Moved some CSS into base.css
by Bitbucket 03 Feb '13
by Bitbucket 03 Feb '13
03 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/c714feaad115/
changeset: c714feaad115
user: james_taylor
date: 2013-02-04 04:57:32
summary: base_panels: no longer need to specify has_(left|right)_panel, determined depending on whether the blocks are set. Moved some CSS into base.css
affected #: 6 files
diff -r d2b192832826f531e7702461826822dbb8179acb -r c714feaad11541377edd84af1179869c1a8e4f47 lib/galaxy/webapps/galaxy/controllers/library.py
--- a/lib/galaxy/webapps/galaxy/controllers/library.py
+++ b/lib/galaxy/webapps/galaxy/controllers/library.py
@@ -79,6 +79,7 @@
default_action=default_action,
message=message,
status=status )
+
@web.expose
def browse_libraries( self, trans, **kwd ):
if 'operation' in kwd:
diff -r d2b192832826f531e7702461826822dbb8179acb -r c714feaad11541377edd84af1179869c1a8e4f47 static/june_2007_style/base.less
--- a/static/june_2007_style/base.less
+++ b/static/june_2007_style/base.less
@@ -31,8 +31,19 @@
background-repeat: repeat-x;
background-position: top;
margin: 10px;
+
+ // For panel layout pages
+ &.full-content {
+ overflow: hidden;
+ margin: 0;
+ padding: 0;
+ width: 100%;
+ height: 100%;
+ }
+
}
+
img {
border: 0;
}
@@ -410,7 +421,7 @@
width:100%;
min-width:900px;
height:32px;
- // background: @masthead_bg;
+ background: @masthead_bg;
// color:#fff;
border-bottom: solid @layout_masthead_border 1px;
z-index: 15000;
diff -r d2b192832826f531e7702461826822dbb8179acb -r c714feaad11541377edd84af1179869c1a8e4f47 static/june_2007_style/blue/base.css
--- a/static/june_2007_style/blue/base.css
+++ b/static/june_2007_style/blue/base.css
@@ -892,7 +892,7 @@
.clear:after{clear:both;}
.clear:before,.clear:after{display:table;content:"";line-height:0;}
.clear:after{clear:both;}
-body{background:#ffffff;color:#303030;background-image:url(base_bg.png);background-repeat:repeat-x;background-position:top;margin:10px;}
+body{background:#ffffff;color:#303030;background-image:url(base_bg.png);background-repeat:repeat-x;background-position:top;margin:10px;}body.full-content{overflow:hidden;margin:0;padding:0;width:100%;height:100%;}
img{border:0;}
a,a:link,a:visited,a:active{text-decoration:underline;color:#303030;}
.nav-tabs a{text-decoration:none;}
@@ -936,7 +936,7 @@
.panel-warning-message{background-image:url(warn_small.png);background-color:#ffffcc;}
.panel-done-message{background-image:url(ok_small.png);background-color:#ccffcc;}
.panel-info-message{background-image:url(info_small.png);background-color:#d9edf7;}
-#masthead{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;overflow:visible;margin-bottom:16px;*position:relative;*z-index:2;position:absolute;top:0;left:0;width:100%;min-width:900px;height:32px;border-bottom:solid #444444 1px;z-index:15000;padding:0;}#masthead .nav{z-index:10000;background-color:#2c3143;}
+#masthead{-webkit-border-radius:0;-moz-border-radius:0;border-radius:0;overflow:visible;margin-bottom:16px;*position:relative;*z-index:2;position:absolute;top:0;left:0;width:100%;min-width:900px;height:32px;background:#2c3143;border-bottom:solid #444444 1px;z-index:15000;padding:0;}#masthead .nav{z-index:10000;background-color:#2c3143;}
#masthead .nav>li>a{padding:8px 10px 8px;cursor:pointer;}#masthead .nav>li>a:hover{color:gold;}
#masthead .dropdown-menu a,#masthead .dropdown-menu a:hover{text-decoration:none;}
#masthead .dropdown-toggle .caret{margin-top:7px;}
diff -r d2b192832826f531e7702461826822dbb8179acb -r c714feaad11541377edd84af1179869c1a8e4f47 static/june_2007_style/galaxy_bootstrap.less
--- a/static/june_2007_style/galaxy_bootstrap.less
+++ b/static/june_2007_style/galaxy_bootstrap.less
@@ -107,7 +107,6 @@
margin-left: -330px;
}
-
.modal:after {
content: "";
height: 0px;
@@ -115,8 +114,7 @@
top: 50px;
display: block;
border: solid transparent 1px;
-};
-
+}
.modal-body {
height: auto;
@@ -203,4 +201,4 @@
border-width: 0 @tooltipArrowWidth @tooltipArrowWidth;
border-bottom-color: @tooltipArrowColor;
}
-}
\ No newline at end of file
+}
diff -r d2b192832826f531e7702461826822dbb8179acb -r c714feaad11541377edd84af1179869c1a8e4f47 templates/base/base_panels.mako
--- a/templates/base/base_panels.mako
+++ b/templates/base/base_panels.mako
@@ -1,8 +1,8 @@
<!DOCTYPE HTML><%
- self.has_left_panel=True
- self.has_right_panel=True
+ self.has_left_panel = hasattr( self, 'left_panel' )
+ self.has_right_panel = hasattr( self, 'right_panel' )
self.message_box_visible=False
self.overlay_visible=False
self.message_box_class=""
@@ -17,15 +17,8 @@
## Default stylesheets
<%def name="stylesheets()">
- ${h.css('base','panel_layout','jquery.rating')}
+ ${h.css('base','jquery.rating')}
<style type="text/css">
- body, html {
- overflow: hidden;
- margin: 0;
- padding: 0;
- width: 100%;
- height: 100%;
- }
#center {
%if not self.has_left_panel:
left: 0 !important;
@@ -270,7 +263,7 @@
${self.javascripts()}
</head>
- <body scroll="no" class="${self.body_class}">
+ <body scroll="no" class="full-content ${self.body_class}">
%if self.require_javascript:
<noscript><div class="overlay overlay-background">
diff -r d2b192832826f531e7702461826822dbb8179acb -r c714feaad11541377edd84af1179869c1a8e4f47 templates/workflow/index.mako
--- a/templates/workflow/index.mako
+++ b/templates/workflow/index.mako
@@ -2,10 +2,7 @@
<%def name="init()"><%
- self.has_left_panel=False
- self.has_right_panel=False
self.active_view="workflow"
- self.message_box_visible=False
%></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
02 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/d2b192832826/
changeset: d2b192832826
user: james_taylor
date: 2013-02-03 01:39:42
summary: Customize errormiddleware with a better appearence for internal server errors, show sentry ID is enabled, modify sentry middleware to store id in environment and pass request_id with log messages
affected #: 3 files
diff -r fc99a36f9d2195bc742f6e557ae56b7b61ad6766 -r d2b192832826f531e7702461826822dbb8179acb lib/galaxy/web/framework/middleware/error.py
--- /dev/null
+++ b/lib/galaxy/web/framework/middleware/error.py
@@ -0,0 +1,484 @@
+# Like many things, this started life as part of Paste
+
+# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
+# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
+
+"""
+Error handler middleware
+
+When an exception is thrown from the wrapper application, this logs
+the exception and displays an error page.
+"""
+import sys
+import traceback
+import cgi
+try:
+ from cStringIO import StringIO
+except ImportError:
+ from StringIO import StringIO
+from paste.exceptions import formatter, collector, reporter
+from paste import wsgilib
+from paste import request
+
+__all__ = ['ErrorMiddleware', 'handle_exception']
+
+class _NoDefault(object):
+ def __repr__(self):
+ return '<NoDefault>'
+NoDefault = _NoDefault()
+
+class ErrorMiddleware(object):
+
+ """
+ Error handling middleware
+
+ Usage::
+
+ error_catching_wsgi_app = ErrorMiddleware(wsgi_app)
+
+ Settings:
+
+ ``debug``:
+ If true, then tracebacks will be shown in the browser.
+
+ ``error_email``:
+ an email address (or list of addresses) to send exception
+ reports to
+
+ ``error_log``:
+ a filename to append tracebacks to
+
+ ``show_exceptions_in_wsgi_errors``:
+ If true, then errors will be printed to ``wsgi.errors``
+ (frequently a server error log, or stderr).
+
+ ``from_address``, ``smtp_server``, ``error_subject_prefix``, ``smtp_username``, ``smtp_password``, ``smtp_use_tls``:
+ variables to control the emailed exception reports
+
+ ``error_message``:
+ When debug mode is off, the error message to show to users.
+
+ ``xmlhttp_key``:
+ When this key (default ``_``) is in the request GET variables
+ (not POST!), expect that this is an XMLHttpRequest, and the
+ response should be more minimal; it should not be a complete
+ HTML page.
+
+ Environment Configuration:
+
+ ``paste.throw_errors``:
+ If this setting in the request environment is true, then this
+ middleware is disabled. This can be useful in a testing situation
+ where you don't want errors to be caught and transformed.
+
+ ``paste.expected_exceptions``:
+ When this middleware encounters an exception listed in this
+ environment variable and when the ``start_response`` has not
+ yet occurred, the exception will be re-raised instead of being
+ caught. This should generally be set by middleware that may
+ (but probably shouldn't be) installed above this middleware,
+ and wants to get certain exceptions. Exceptions raised after
+ ``start_response`` have been called are always caught since
+ by definition they are no longer expected.
+
+ """
+
+ def __init__(self, application, global_conf=None,
+ debug=NoDefault,
+ error_email=None,
+ error_log=None,
+ show_exceptions_in_wsgi_errors=NoDefault,
+ from_address=None,
+ smtp_server=None,
+ smtp_username=None,
+ smtp_password=None,
+ smtp_use_tls=False,
+ error_subject_prefix=None,
+ error_message=None,
+ xmlhttp_key=None):
+ from paste.util import converters
+ self.application = application
+ # @@: global_conf should be handled elsewhere in a separate
+ # function for the entry point
+ if global_conf is None:
+ global_conf = {}
+ if debug is NoDefault:
+ debug = converters.asbool(global_conf.get('debug'))
+ if show_exceptions_in_wsgi_errors is NoDefault:
+ show_exceptions_in_wsgi_errors = converters.asbool(global_conf.get('show_exceptions_in_wsgi_errors'))
+ self.debug_mode = converters.asbool(debug)
+ if error_email is None:
+ error_email = (global_conf.get('error_email')
+ or global_conf.get('admin_email')
+ or global_conf.get('webmaster_email')
+ or global_conf.get('sysadmin_email'))
+ self.error_email = converters.aslist(error_email)
+ self.error_log = error_log
+ self.show_exceptions_in_wsgi_errors = show_exceptions_in_wsgi_errors
+ if from_address is None:
+ from_address = global_conf.get('error_from_address', 'errors@localhost')
+ self.from_address = from_address
+ if smtp_server is None:
+ smtp_server = global_conf.get('smtp_server', 'localhost')
+ self.smtp_server = smtp_server
+ self.smtp_username = smtp_username or global_conf.get('smtp_username')
+ self.smtp_password = smtp_password or global_conf.get('smtp_password')
+ self.smtp_use_tls = smtp_use_tls or converters.asbool(global_conf.get('smtp_use_tls'))
+ self.error_subject_prefix = error_subject_prefix or ''
+ if error_message is None:
+ error_message = global_conf.get('error_message')
+ self.error_message = error_message
+ if xmlhttp_key is None:
+ xmlhttp_key = global_conf.get('xmlhttp_key', '_')
+ self.xmlhttp_key = xmlhttp_key
+
+ def __call__(self, environ, start_response):
+ """
+ The WSGI application interface.
+ """
+ # We want to be careful about not sending headers twice,
+ # and the content type that the app has committed to (if there
+ # is an exception in the iterator body of the response)
+ if environ.get('paste.throw_errors'):
+ return self.application(environ, start_response)
+ environ['paste.throw_errors'] = True
+
+ try:
+ __traceback_supplement__ = Supplement, self, environ
+ sr_checker = ResponseStartChecker(start_response)
+ app_iter = self.application(environ, sr_checker)
+ return self.make_catching_iter(app_iter, environ, sr_checker)
+ except:
+ exc_info = sys.exc_info()
+ try:
+ for expect in environ.get('paste.expected_exceptions', []):
+ if isinstance(exc_info[1], expect):
+ raise
+ start_response('500 Internal Server Error',
+ [('content-type', 'text/html')],
+ exc_info)
+ # @@: it would be nice to deal with bad content types here
+ response = self.exception_handler(exc_info, environ)
+ return [response]
+ finally:
+ # clean up locals...
+ exc_info = None
+
+ def make_catching_iter(self, app_iter, environ, sr_checker):
+ if isinstance(app_iter, (list, tuple)):
+ # These don't raise
+ return app_iter
+ return CatchingIter(app_iter, environ, sr_checker, self)
+
+ def exception_handler(self, exc_info, environ):
+ simple_html_error = False
+ if self.xmlhttp_key:
+ get_vars = wsgilib.parse_querystring(environ)
+ if dict(get_vars).get(self.xmlhttp_key):
+ simple_html_error = True
+ return handle_exception(
+ exc_info, environ['wsgi.errors'],
+ html=True,
+ debug_mode=self.debug_mode,
+ error_email=self.error_email,
+ error_log=self.error_log,
+ show_exceptions_in_wsgi_errors=self.show_exceptions_in_wsgi_errors,
+ error_email_from=self.from_address,
+ smtp_server=self.smtp_server,
+ smtp_username=self.smtp_username,
+ smtp_password=self.smtp_password,
+ smtp_use_tls=self.smtp_use_tls,
+ error_subject_prefix=self.error_subject_prefix,
+ error_message=self.error_message,
+ simple_html_error=simple_html_error,
+ environ=environ)
+
+class ResponseStartChecker(object):
+ def __init__(self, start_response):
+ self.start_response = start_response
+ self.response_started = False
+
+ def __call__(self, *args):
+ self.response_started = True
+ self.start_response(*args)
+
+class CatchingIter(object):
+
+ """
+ A wrapper around the application iterator that will catch
+ exceptions raised by the a generator, or by the close method, and
+ display or report as necessary.
+ """
+
+ def __init__(self, app_iter, environ, start_checker, error_middleware):
+ self.app_iterable = app_iter
+ self.app_iterator = iter(app_iter)
+ self.environ = environ
+ self.start_checker = start_checker
+ self.error_middleware = error_middleware
+ self.closed = False
+
+ def __iter__(self):
+ return self
+
+ def next(self):
+ __traceback_supplement__ = (
+ Supplement, self.error_middleware, self.environ)
+ if self.closed:
+ raise StopIteration
+ try:
+ return self.app_iterator.next()
+ except StopIteration:
+ self.closed = True
+ close_response = self._close()
+ if close_response is not None:
+ return close_response
+ else:
+ raise StopIteration
+ except:
+ self.closed = True
+ close_response = self._close()
+ exc_info = sys.exc_info()
+ response = self.error_middleware.exception_handler(
+ exc_info, self.environ)
+ if close_response is not None:
+ response += (
+ '<hr noshade>Error in .close():<br>%s'
+ % close_response)
+
+ if not self.start_checker.response_started:
+ self.start_checker('500 Internal Server Error',
+ [('content-type', 'text/html')],
+ exc_info)
+
+ return response
+
+ def close(self):
+ # This should at least print something to stderr if the
+ # close method fails at this point
+ if not self.closed:
+ self._close()
+
+ def _close(self):
+ """Close and return any error message"""
+ if not hasattr(self.app_iterable, 'close'):
+ return None
+ try:
+ self.app_iterable.close()
+ return None
+ except:
+ close_response = self.error_middleware.exception_handler(
+ sys.exc_info(), self.environ)
+ return close_response
+
+
+class Supplement(object):
+
+ """
+ This is a supplement used to display standard WSGI information in
+ the traceback.
+ """
+
+ def __init__(self, middleware, environ):
+ self.middleware = middleware
+ self.environ = environ
+ self.source_url = request.construct_url(environ)
+
+ def extraData(self):
+ data = {}
+ cgi_vars = data[('extra', 'CGI Variables')] = {}
+ wsgi_vars = data[('extra', 'WSGI Variables')] = {}
+ hide_vars = ['paste.config', 'wsgi.errors', 'wsgi.input',
+ 'wsgi.multithread', 'wsgi.multiprocess',
+ 'wsgi.run_once', 'wsgi.version',
+ 'wsgi.url_scheme']
+ for name, value in self.environ.items():
+ if name.upper() == name:
+ if value:
+ cgi_vars[name] = value
+ elif name not in hide_vars:
+ wsgi_vars[name] = value
+ if self.environ['wsgi.version'] != (1, 0):
+ wsgi_vars['wsgi.version'] = self.environ['wsgi.version']
+ proc_desc = tuple([int(bool(self.environ[key]))
+ for key in ('wsgi.multiprocess',
+ 'wsgi.multithread',
+ 'wsgi.run_once')])
+ wsgi_vars['wsgi process'] = self.process_combos[proc_desc]
+ wsgi_vars['application'] = self.middleware.application
+ if 'paste.config' in self.environ:
+ data[('extra', 'Configuration')] = dict(self.environ['paste.config'])
+ return data
+
+ process_combos = {
+ # multiprocess, multithread, run_once
+ (0, 0, 0): 'Non-concurrent server',
+ (0, 1, 0): 'Multithreaded',
+ (1, 0, 0): 'Multiprocess',
+ (1, 1, 0): 'Multi process AND threads (?)',
+ (0, 0, 1): 'Non-concurrent CGI',
+ (0, 1, 1): 'Multithread CGI (?)',
+ (1, 0, 1): 'CGI',
+ (1, 1, 1): 'Multi thread/process CGI (?)',
+ }
+
+def handle_exception(exc_info, error_stream, html=True,
+ debug_mode=False,
+ error_email=None,
+ error_log=None,
+ show_exceptions_in_wsgi_errors=False,
+ error_email_from='errors@localhost',
+ smtp_server='localhost',
+ smtp_username=None,
+ smtp_password=None,
+ smtp_use_tls=False,
+ error_subject_prefix='',
+ error_message=None,
+ simple_html_error=False,
+ environ=None
+ ):
+ """
+ For exception handling outside of a web context
+
+ Use like::
+
+ import sys
+ from paste.exceptions.errormiddleware import handle_exception
+ try:
+ do stuff
+ except:
+ handle_exception(
+ sys.exc_info(), sys.stderr, html=False, ...other config...)
+
+ If you want to report, but not fully catch the exception, call
+ ``raise`` after ``handle_exception``, which (when given no argument)
+ will reraise the exception.
+ """
+ reported = False
+ exc_data = collector.collect_exception(*exc_info)
+ extra_data = ''
+ if error_email:
+ rep = reporter.EmailReporter(
+ to_addresses=error_email,
+ from_address=error_email_from,
+ smtp_server=smtp_server,
+ smtp_username=smtp_username,
+ smtp_password=smtp_password,
+ smtp_use_tls=smtp_use_tls,
+ subject_prefix=error_subject_prefix)
+ rep_err = send_report(rep, exc_data, html=html)
+ if rep_err:
+ extra_data += rep_err
+ else:
+ reported = True
+ if error_log:
+ rep = reporter.LogReporter(
+ filename=error_log)
+ rep_err = send_report(rep, exc_data, html=html)
+ if rep_err:
+ extra_data += rep_err
+ else:
+ reported = True
+ if show_exceptions_in_wsgi_errors:
+ rep = reporter.FileReporter(
+ file=error_stream)
+ rep_err = send_report(rep, exc_data, html=html)
+ if rep_err:
+ extra_data += rep_err
+ else:
+ reported = True
+ else:
+ error_stream.write('Error - %s: %s\n' % (
+ exc_data.exception_type, exc_data.exception_value))
+ if html:
+ if debug_mode and simple_html_error:
+ return_error = formatter.format_html(
+ exc_data, include_hidden_frames=False,
+ include_reusable=False, show_extra_data=False)
+ reported = True
+ elif debug_mode and not simple_html_error:
+ error_html = formatter.format_html(
+ exc_data,
+ include_hidden_frames=True,
+ include_reusable=False)
+ head_html = formatter.error_css + formatter.hide_display_js
+ return_error = error_template(
+ head_html, error_html, extra_data)
+ extra_data = ''
+ reported = True
+ else:
+ msg = error_message or '''
+ An error occurred.
+ '''
+ extra = "<p><b>The error has been logged to our team.</b>"
+ if 'sentry_event_id' in environ:
+ extra += " If you want to contact us about this error, please reference the following<br><br>"
+ extra += "<b><large>GURU MEDITATION: #" + environ['sentry_event_id'] + "</large></b>"
+ extra += "</p>"
+ return_error = error_template('', msg, extra)
+ else:
+ return_error = None
+ if not reported and error_stream:
+ err_report = formatter.format_text(exc_data, show_hidden_frames=True)
+ err_report += '\n' + '-'*60 + '\n'
+ error_stream.write(err_report)
+ if extra_data:
+ error_stream.write(extra_data)
+ return return_error
+
+def send_report(rep, exc_data, html=True):
+ try:
+ rep.report(exc_data)
+ except:
+ output = StringIO()
+ traceback.print_exc(file=output)
+ if html:
+ return """
+ <p>Additionally an error occurred while sending the %s report:
+
+ <pre>%s</pre>
+ </p>""" % (
+ cgi.escape(str(rep)), output.getvalue())
+ else:
+ return (
+ "Additionally an error occurred while sending the "
+ "%s report:\n%s" % (str(rep), output.getvalue()))
+ else:
+ return ''
+
+def error_template(head_html, exception, extra):
+ return '''
+ <!DOCTYPE HTML>
+ <html>
+ <head>
+ <style type="text/css">
+ body { color: #303030; background: #dfe5f9; font-family:"Lucida Grande",verdana,arial,helvetica,sans-serif; font-size:12px; line-height:16px; }
+ .content { max-width: 720px; margin: auto; margin-top: 50px; }
+ </style>
+ <title>Internal Server Error</title>
+ %s
+ </head>
+ <body>
+ <div class="content">
+ <h1>Internal Server Error</h1>
+
+ <h2>Galaxy was unable to sucessfully complete your request</h2>
+
+ <p>%s</p>
+
+ This may be an intermittent problem due to load or other unpredictable factors, reloading the page may address the problem.
+
+ %s
+ </div>
+ </body>
+ </html>''' % (head_html, exception, extra)
+
+def make_error_middleware(app, global_conf, **kw):
+ return ErrorMiddleware(app, global_conf=global_conf, **kw)
+
+doc_lines = ErrorMiddleware.__doc__.splitlines(True)
+for i in range(len(doc_lines)):
+ if doc_lines[i].strip().startswith('Settings'):
+ make_error_middleware.__doc__ = ''.join(doc_lines[i:])
+ break
+del i, doc_lines
\ No newline at end of file
diff -r fc99a36f9d2195bc742f6e557ae56b7b61ad6766 -r d2b192832826f531e7702461826822dbb8179acb lib/galaxy/web/framework/middleware/sentry.py
--- /dev/null
+++ b/lib/galaxy/web/framework/middleware/sentry.py
@@ -0,0 +1,70 @@
+"""
+raven.middleware
+~~~~~~~~~~~~~~~~~~~~~~~~
+
+:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
+:license: BSD, see LICENSE for more details.
+"""
+
+import galaxy.eggs; galaxy.eggs.require( "raven" )
+
+from raven import Client
+from raven.utils.wsgi import get_current_url, get_headers, \
+ get_environ
+
+class Sentry(object):
+ """
+ A WSGI middleware which will attempt to capture any
+ uncaught exceptions and send them to Sentry.
+
+ >>> from raven.base import Client
+ >>> application = Sentry(application, Client())
+ """
+ def __init__(self, application, dsn):
+ self.application = application
+ self.client = Client( dsn )
+
+ def __call__(self, environ, start_response):
+ try:
+ iterable = self.application(environ, start_response)
+ except Exception:
+ self.handle_exception(environ)
+ raise
+
+ try:
+ for event in iterable:
+ yield event
+ except Exception:
+ self.handle_exception(environ)
+ raise
+ finally:
+ # wsgi spec requires iterable to call close if it exists
+ # see http://blog.dscpl.com.au/2012/10/obligations-for-calling-close-on.html
+ if iterable and hasattr(iterable, 'close') and callable(iterable.close):
+ try:
+ iterable.close()
+ except Exception:
+ self.handle_exception(environ)
+
+ def handle_exception(self, environ):
+ event_id = self.client.captureException(
+ data={
+ 'sentry.interfaces.Http': {
+ 'method': environ.get('REQUEST_METHOD'),
+ 'url': get_current_url(environ, strip_querystring=True),
+ 'query_string': environ.get('QUERY_STRING'),
+ # TODO
+ # 'data': environ.get('wsgi.input'),
+ 'headers': dict(get_headers(environ)),
+ 'env': dict(get_environ(environ)),
+ }
+ },
+ # Galaxy: add request id from environment if available
+ extra={
+ 'request_id': environ.get( 'request_id', 'Unknown' )
+ }
+ )
+ # Galaxy: store event_id in environment so we can show it to the user
+ environ['sentry_event_id'] = event_id[0]
+
+ return event_id
\ No newline at end of file
diff -r fc99a36f9d2195bc742f6e557ae56b7b61ad6766 -r d2b192832826f531e7702461826822dbb8179acb lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -242,12 +242,10 @@
log.debug( "Enabling 'recursive' middleware" )
# If sentry logging is enabled, log here before propogating up to
# the error middleware
- sentry_url = conf.get( 'sentry_url', None )
- if sentry_url:
- pkg_resources.require( "raven")
- from raven import Client
- from raven.middleware import Sentry
- app = Sentry( app, Client( sentry_url ) )
+ sentry_dsn = conf.get( 'sentry_dsn', None )
+ if sentry_dsn:
+ from galaxy.web.framework.middleware.sentry import Sentry
+ app = Sentry( app, sentry_dsn )
# Various debug middleware that can only be turned on if the debug
# flag is set, either because they are insecure or greatly hurt
# performance
@@ -275,11 +273,11 @@
# Not in interactive debug mode, just use the regular error middleware
if sys.version_info[:2] >= ( 2, 6 ):
warnings.filterwarnings( 'ignore', '.*', DeprecationWarning, '.*serial_number_generator', 11, True )
- from paste.exceptions import errormiddleware
+ import galaxy.web.framework.middleware.error
warnings.filters.pop()
else:
- from paste.exceptions import errormiddleware
- app = errormiddleware.ErrorMiddleware( app, conf )
+ import galaxy.web.framework.middleware.error
+ app = galaxy.web.framework.middleware.error.ErrorMiddleware( app, conf )
log.debug( "Enabling 'error' middleware" )
# Transaction logging (apache access.log style)
if asbool( conf.get( 'use_translogger', True ) ):
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
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/fc99a36f9d21/
changeset: fc99a36f9d21
user: james_taylor
date: 2013-02-03 00:29:05
summary: Fix leftover debug code
affected #: 2 files
diff -r 708d0ccee63fc75eb88e5dc3a9e0d6d3e5ff72e7 -r fc99a36f9d2195bc742f6e557ae56b7b61ad6766 templates/base.mako
--- a/templates/base.mako
+++ b/templates/base.mako
@@ -54,7 +54,7 @@
${h.js(
"mvc/ui"
)}
-
+
<script type="text/javascript">
// console protection
window.console = window.console || {
diff -r 708d0ccee63fc75eb88e5dc3a9e0d6d3e5ff72e7 -r fc99a36f9d2195bc742f6e557ae56b7b61ad6766 templates/root/tool_menu.mako
--- a/templates/root/tool_menu.mako
+++ b/templates/root/tool_menu.mako
@@ -74,7 +74,7 @@
});
*/
- $( '.tooltip' ).tooltip().foasdasdasdoo();
+ $( '.tooltip' ).tooltip();
// TODO: is this necessary?
$( "a[minsizehint]" ).click( function() {
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: james_taylor: Support for using Sentry for error logging. If sentry_dsn is set in
by Bitbucket 02 Feb '13
by Bitbucket 02 Feb '13
02 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/708d0ccee63f/
changeset: 708d0ccee63f
user: james_taylor
date: 2013-02-02 23:56:55
summary: Support for using Sentry for error logging. If sentry_dsn is s=
et in
universe_wsgi.ini, then:
- A middleware will be installed that send thrown exceptions to sentry
- All logging messages of level WARN and above will be sent to sentry
- All pages extending base/base_panels will have javascript errors
captured and sent to sentry
affected #: 11 files
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 eggs.ini
--- a/eggs.ini
+++ b/eggs.ini
@@ -66,6 +66,7 @@
wchartype =3D 0.1
Whoosh =3D 0.3.18
; fluent_logger =3D 0.3.3
+raven =3D 3.1.8
=20
; extra version information
[tags]
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 lib/galaxy/config.py
--- a/lib/galaxy/config.py
+++ b/lib/galaxy/config.py
@@ -2,7 +2,7 @@
Universe configuration builder.
"""
=20
-import sys, os, tempfile
+import sys, os, tempfile, re
import logging, logging.config
import ConfigParser
from datetime import timedelta
@@ -261,11 +261,24 @@
self.api_folders =3D string_as_bool( kwargs.get( 'api_folders', Fa=
lse ) )
# This is for testing new library browsing capabilities.
self.new_lib_browse =3D string_as_bool( kwargs.get( 'new_lib_brows=
e', False ) )
+ # Error logging with sentry
+ self.sentry_dsn =3D kwargs.get( 'sentry_dsn', None )
# Logging with fluentd
self.fluent_log =3D string_as_bool( kwargs.get( 'fluent_log', Fals=
e ) )
self.fluent_host =3D kwargs.get( 'fluent_host', 'localhost' )
self.fluent_port =3D int( kwargs.get( 'fluent_port', 24224 ) )
=20
+ @property
+ def sentry_dsn_public( self ):
+ """
+ Sentry URL with private key removed for use in client side scripts=
,=20
+ sentry server will need to be configured to accept events
+ """
+ if self.sentry_dsn:
+ return re.sub( r"^([^:/?#]+:)?//(\w+):(\w+)", r"\1//\2", self.=
sentry_dsn )
+ else:
+ return None
+
def __read_tool_job_config( self, global_conf_parser, section, key ):
try:
tool_runners_config =3D global_conf_parser.items( section )
@@ -387,8 +400,7 @@
=20
def configure_logging( config ):
"""
- Allow some basic logging configuration to be read from the cherrpy
- config.
+ Allow some basic logging configuration to be read from ini file.
"""
# PasteScript will have already configured the logger if the appropria=
te
# sections were found in the config file, so we do nothing if the
@@ -420,3 +432,10 @@
# Hook everything up
handler.setFormatter( formatter )
root.addHandler( handler )
+ # If sentry is configured, also log to it
+ if config.sentry_dsn:
+ pkg_resources.require( "raven" )
+ from raven.handlers.logging import SentryHandler
+ sentry_handler =3D SentryHandler( config.sentry_dsn )
+ sentry_handler.setLevel( logging.WARN )
+ root.addHandler( sentry_handler )
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 lib/galaxy/web/framework/base.py
--- a/lib/galaxy/web/framework/base.py
+++ b/lib/galaxy/web/framework/base.py
@@ -9,7 +9,6 @@
import sys
import tarfile
import threading
-import uuid
=20
from Cookie import SimpleCookie
=20
@@ -70,9 +69,6 @@
self.mapper.explicit =3D False
self.api_mapper =3D routes.Mapper()
self.transaction_factory =3D DefaultWebTransaction
- # Each request will have a unique id. Since we are assuming
- # a threaded model for the moment we can store that here
- self.request_id =3D threading.local()
# Set if trace logging is enabled
self.trace_logger =3D None
def add_ui_controller( self, controller_name, controller ):
@@ -124,7 +120,7 @@
and calls it.
"""
# Immediately create request_id which we will use for logging
- self.request_id =3D request_id =3D uuid.uuid1().hex
+ request_id =3D environ.get( 'request_id', 'unknown' )
if self.trace_logger:
self.trace_logger.context_set( "request_id", request_id )
self.trace( message=3D"Starting request" )
@@ -136,6 +132,8 @@
self.trace_logger.context_remove( "request_id" )
=20
def handle_request( self, environ, start_response ):
+ # Grab the request_id (should have been set by middleware)
+ request_id =3D environ.get( 'request_id', 'unknown' )
# Map url using routes
path_info =3D environ.get( 'PATH_INFO', '' )
map =3D self.mapper.match( path_info, environ )
@@ -157,6 +155,7 @@
rc.environ =3D environ
# Setup the transaction
trans =3D self.transaction_factory( environ )
+ trans.request_id =3D request_id
rc.redirect =3D trans.response.send_redirect
# Get the controller class
controller_name =3D map.pop( 'controller', None )
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 lib/galaxy/webapps/galaxy/buildapp.py
--- a/lib/galaxy/webapps/galaxy/buildapp.py
+++ b/lib/galaxy/webapps/galaxy/buildapp.py
@@ -240,6 +240,14 @@
from paste import recursive
app =3D recursive.RecursiveMiddleware( app, conf )
log.debug( "Enabling 'recursive' middleware" )
+ # If sentry logging is enabled, log here before propogating up to
+ # the error middleware
+ sentry_url =3D conf.get( 'sentry_url', None )
+ if sentry_url:
+ pkg_resources.require( "raven")
+ from raven import Client
+ from raven.middleware import Sentry
+ app =3D Sentry( app, Client( sentry_url ) )
# Various debug middleware that can only be turned on if the debug
# flag is set, either because they are insecure or greatly hurt
# performance
@@ -254,12 +262,6 @@
from paste.debug import profile
app =3D profile.ProfileMiddleware( app, conf )
log.debug( "Enabling 'profile' middleware" )
- # Middleware that intercepts print statements and shows them on the
- # returned page
- if asbool( conf.get( 'use_printdebug', True ) ):
- from paste.debug import prints
- app =3D prints.PrintDebugMiddleware( app, conf )
- log.debug( "Enabling 'print debug' middleware" )
if debug and asbool( conf.get( 'use_interactive', False ) ):
# Interactive exception debugging, scary dangerous if publicly
# accessible, if not enabled we'll use the regular error printing
@@ -288,6 +290,10 @@
from galaxy.web.framework.middleware.xforwardedhost import XForwardedH=
ostMiddleware
app =3D XForwardedHostMiddleware( app )
log.debug( "Enabling 'x-forwarded-host' middleware" )
+ # Request ID middleware
+ from galaxy.web.framework.middleware.request_id import RequestIDMiddle=
ware
+ app =3D RequestIDMiddleware( app )
+ log.debug( "Enabling 'Request ID' middleware" )
return app
=20
def wrap_in_static( app, global_conf, **local_conf ):
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 static/scripts/libs/raven.js
--- /dev/null
+++ b/static/scripts/libs/raven.js
@@ -0,0 +1,438 @@
+(function(){
+
+// Raven.js
+//
+// Originally based on the Arecibo JavaScript client.
+//
+// Requires:
+// * TraceKit (included in the full and minified distribution files)
+
+'use strict';
+
+// First, check for JSON support
+// If there is no JSON, we no-op the core features of Raven
+// since JSON is required to encode the payload
+var _Raven =3D window.Raven,
+ hasJSON =3D !isUndefined(window.JSON),
+ globalServer,
+ globalUser,
+ globalKey,
+ globalProject,
+ globalOptions =3D {
+ logger: 'javascript',
+ ignoreErrors: [],
+ ignoreUrls: []
+ };
+
+var TK =3D TraceKit.noConflict();
+
+// Disable Tracekit's remote fetching by default
+TK.remoteFetching =3D false;
+
+/*
+ * The core Raven object
+ */
+var Raven =3D {
+ VERSION: '@VERSION',
+
+ /*
+ * Raven.noConflict()
+ *
+ * Allow multiple versions of Raven to be installed.
+ */
+ noConflict: function() {
+ window.Raven =3D _Raven;
+ return Raven;
+ },
+
+ /*
+ * Raven.config()
+ *
+ * Configure raven with a DSN and extra options
+ */
+ config: function(dsn, options) {
+ var uri =3D parseUri(dsn),
+ lastSlash =3D uri.path.lastIndexOf('/'),
+ path =3D uri.path.substr(1, lastSlash);
+
+ // merge in options
+ if (options) {
+ each(options, function(key, value){
+ globalOptions[key] =3D value;
+ });
+ }
+
+ // "Script error." is hard coded into browsers for errors that it =
can't read.
+ // this is the result of a script being pulled in from an external=
domain and CORS.
+ globalOptions.ignoreErrors.push('Script error.');
+
+ globalKey =3D uri.user;
+ globalProject =3D ~~uri.path.substr(lastSlash + 1);
+
+ // assemble the endpoint from the uri pieces
+ globalServer =3D uri.protocol + '://' + uri.host +
+ (uri.port ? ':' + uri.port : '') +
+ '/' + path + 'api/' + globalProject + '/store/';
+
+ if (globalOptions.fetchContext) {
+ TK.remoteFetching =3D true;
+ }
+
+ // return for chaining
+ return Raven;
+ },
+
+ /*
+ * Raven.install()
+ *
+ * Installs a global window.onerror error handler
+ * to capture and report uncaught exceptions.
+ */
+ install: function() {
+ if (!isSetup()) return;
+
+ TK.report.subscribe(handleStackInfo);
+
+ return Raven;
+ },
+
+ /*
+ * Raven.context()
+ *
+ * Wrap code within a context so Raven can capture errors
+ * reliably across domains that is executed immediately.
+ */
+ context: function(options, func, args) {
+ if (isFunction(options)) {
+ args =3D func;
+ func =3D options;
+ options =3D undefined;
+ }
+
+ Raven.wrap(options, func).apply(this, args);
+ },
+
+ /* Raven.wrap()
+ *
+ * Wrap code within a context and returns back a new function to be ex=
ecuted
+ */
+ wrap: function(options, func) {
+ // options is optional
+ if (isFunction(options)) {
+ func =3D options;
+ options =3D undefined;
+ }
+
+ return function() {
+ try {
+ func.apply(this, arguments);
+ } catch(e) {
+ Raven.captureException(e, options);
+ }
+ };
+ },
+
+ /*
+ * Raven.uninstall()
+ *
+ * Uninstalls the global error handler.
+ */
+ uninstall: function() {
+ TK.report.unsubscribe(handleStackInfo);
+
+ return Raven;
+ },
+
+ /*
+ * Raven.captureException()
+ *
+ * Manually capture an exception and send it over to Sentry
+ */
+ captureException: function(ex, options) {
+ // TraceKit.report will re-raise any exception passed to it,
+ // which means you have to wrap it in try/catch. Instead, we
+ // can wrap it here and only re-raise if TraceKit.report
+ // raises an exception different from the one we asked to
+ // report on.
+ try {
+ TK.report(ex, options);
+ } catch(ex1) {
+ if(ex !=3D=3D ex1) {
+ throw ex1;
+ }
+ }
+
+ return Raven;
+ },
+
+ /*
+ * Raven.captureMessage()
+ *
+ * Manually send a message to Sentry
+ */
+ captureMessage: function(msg, options) {
+ // Fire away!
+ send(
+ arrayMerge({
+ message: msg
+ }, options)
+ );
+
+ return Raven;
+ },
+
+ /*
+ * Raven.setUser()
+ *
+ * Set/clear a user to be sent along with the payload.
+ */
+ setUser: function(user) {
+ globalUser =3D user;
+
+ return Raven;
+ }
+};
+
+var uriKeys =3D 'source protocol authority userInfo user password host por=
t relative path directory file query anchor'.split(' '),
+ uriPattern =3D /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:((=
[^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.=
[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;
+
+/**** Private functions ****/
+function parseUri(str) {
+ var m =3D uriPattern.exec(str),
+ uri =3D {},
+ i =3D 14;
+
+ while (i--) uri[uriKeys[i]] =3D m[i] || '';
+
+ return uri;
+}
+
+function isUndefined(what) {
+ return typeof what =3D=3D=3D 'undefined';
+}
+
+function isFunction(what) {
+ return typeof what =3D=3D=3D 'function';
+}
+
+function each(obj, callback) {
+ var i, j;
+
+ if (obj.length =3D=3D=3D undefined) {
+ for (i in obj) {
+ if (obj.hasOwnProperty(i)) {
+ callback.call(null, i, obj[i]);
+ }
+ }
+ } else {
+ for (i =3D 0, j =3D obj.length; i < j; i++) {
+ callback.call(null, i, obj[i]);
+ }
+ }
+}
+
+var cachedAuth;
+
+function getAuthQueryString() {
+ if (cachedAuth) return cachedAuth;
+
+ var qs =3D [
+ 'sentry_version=3D2.0',
+ 'sentry_client=3Draven-js/' + Raven.VERSION
+ ];
+ if (globalKey) {
+ qs.push('sentry_key=3D' + globalKey);
+ }
+
+ cachedAuth =3D '?' + qs.join('&');
+ return cachedAuth;
+}
+
+function handleStackInfo(stackInfo, options) {
+ var frames =3D [], i =3D 0, j =3D stackInfo.stack && stackInfo.stack.l=
ength || 0, frame;
+
+ for (; i < j; i++) {
+ frame =3D normalizeFrame(stackInfo.stack[i]);
+ if (frame) {
+ frames.push(frame);
+ }
+ }
+
+ processException(
+ stackInfo.name,
+ stackInfo.message,
+ stackInfo.url,
+ stackInfo.lineno,
+ frames,
+ options
+ );
+}
+
+function normalizeFrame(frame) {
+ if (!frame.url) return;
+
+ // normalize the frames data
+ var normalized =3D {
+ filename: frame.url,
+ lineno: frame.line,
+ colno: frame.column,
+ 'function': frame.func || '?'
+ }, context =3D extractContextFromFrame(frame);
+
+ if (context) {
+ var i =3D 3, keys =3D ['pre_context', 'context_line', 'post_contex=
t'];
+ while (i--) normalized[keys[i]] =3D context[i];
+ }
+
+ normalized.in_app =3D !/(Raven|TraceKit)\./.test(normalized['function'=
]);
+
+ return normalized;
+}
+
+function extractContextFromFrame(frame) {
+ // immediately check if we should even attempt to parse a context
+ if (!frame.context || !globalOptions.fetchContext) return;
+
+ var context =3D frame.context,
+ pivot =3D ~~(context.length / 2),
+ i =3D context.length, isMinified =3D false;
+
+ while (i--) {
+ // We're making a guess to see if the source is minified or not.
+ // To do that, we make the assumption if *any* of the lines passed
+ // in are greater than 300 characters long, we bail.
+ // Sentry will see that there isn't a context
+ if (context[i].length > 300) {
+ isMinified =3D true;
+ break;
+ }
+ }
+
+ if (isMinified) {
+ // The source is minified and we don't know which column. Fuck it.
+ if (isUndefined(frame.column)) return;
+
+ // If the source is minified and has a frame column
+ // we take a chunk of the offending line to hopefully shed some li=
ght
+ return [
+ [], // no pre_context
+ context[pivot].substr(frame.column, 50), // grab 50 characters=
, starting at the offending column
+ [] // no post_context
+ ];
+ }
+
+ return [
+ context.slice(0, pivot), // pre_context
+ context[pivot], // context_line
+ context.slice(pivot + 1) // post_context
+ ];
+}
+
+function processException(type, message, fileurl, lineno, frames, options)=
{
+ var stacktrace, label, i;
+
+ // IE8 really doesn't have Array.prototype.indexOf
+ // Filter out a message that matches our ignore list
+ i =3D globalOptions.ignoreErrors.length;
+ while (i--) {
+ if (message =3D=3D=3D globalOptions.ignoreErrors[i]) {
+ return;
+ }
+ }
+
+ if (frames && frames.length) {
+ stacktrace =3D {frames: frames};
+ fileurl =3D fileurl || frames[0].filename;
+ } else if (fileurl) {
+ stacktrace =3D {
+ frames: [{
+ filename: fileurl,
+ lineno: lineno
+ }]
+ };
+ }
+
+ i =3D globalOptions.ignoreUrls.length;
+ while (i--) {
+ if (globalOptions.ignoreUrls[i].test(fileurl)) {
+ return;
+ }
+ }
+
+ label =3D lineno ? message + ' at ' + lineno : message;
+
+ // Fire away!
+ send(
+ arrayMerge({
+ 'sentry.interfaces.Exception': {
+ type: type,
+ value: message
+ },
+ 'sentry.interfaces.Stacktrace': stacktrace,
+ culprit: fileurl,
+ message: label
+ }, options)
+ );
+}
+
+function arrayMerge(arr1, arr2) {
+ if (!arr2) {
+ return arr1;
+ }
+ each(arr2, function(key, value){
+ arr1[key] =3D value;
+ });
+ return arr1;
+}
+
+function getHttpData() {
+ var http =3D {
+ url: window.location.href,
+ headers: {
+ 'User-Agent': navigator.userAgent
+ }
+ };
+
+ if (window.document.referrer) {
+ http.headers.Referer =3D window.document.referrer;
+ }
+
+ return http;
+}
+
+function send(data) {
+ if (!isSetup()) return;
+
+ data =3D arrayMerge({
+ project: globalProject,
+ logger: globalOptions.logger,
+ site: globalOptions.site,
+ platform: 'javascript',
+ 'sentry.interfaces.Http': getHttpData()
+ }, data );
+
+ if (globalUser) data['sentry.interfaces.User'] =3D globalUser;
+
+ if (isFunction(globalOptions.dataCallback)) {
+ data =3D globalOptions.dataCallback(data);
+ }
+
+ makeRequest(data);
+}
+
+function makeRequest(data) {
+ new Image().src =3D globalServer + getAuthQueryString() + '&sentry_dat=
a=3D' + encodeURIComponent(JSON.stringify(data));
+}
+
+function isSetup() {
+ if (!hasJSON) return false; // needs JSON support
+ if (!globalServer) {
+ console.error("Error: Raven has not been configured.");
+ return false;
+ }
+ return true;
+}
+
+window.Raven =3D Raven;
+
+})();
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 static/scripts/libs/tracekit.js
--- /dev/null
+++ b/static/scripts/libs/tracekit.js
@@ -0,0 +1,1210 @@
+/*
+ TraceKit - Cross brower stack traces - github.com/occ/TraceKit
+ MIT license
+*/
+
+;(function(window, undefined) {
+
+
+var TraceKit =3D {};
+var _oldTraceKit =3D window.TraceKit;
+
+/**
+ * TraceKit.noConflict: Export TraceKit out to another variable
+ * Example: var TK =3D TraceKit.noConflict()
+ */
+TraceKit.noConflict =3D function noConflict() {
+ window.TraceKit =3D _oldTraceKit;
+ return TraceKit;
+};
+
+/**
+ * TraceKit._has, a better form of hasOwnProperty
+ * Example: TraceKit._has(MainHostObject, property) =3D=3D=3D true/false
+ *
+ * @param {Object} host object to check property
+ * @param {string} key to check
+ */
+TraceKit._has =3D function _has(object, key) {
+ return Object.prototype.hasOwnProperty.call(object, key);
+};
+
+/**
+ * TraceKit.report: cross-browser processing of unhandled exceptions
+ *
+ * Syntax:
+ * TraceKit.report.subscribe(function(stackInfo) { ... })
+ * TraceKit.report.unsubscribe(function(stackInfo) { ... })
+ * TraceKit.report(exception)
+ * try { ...code... } catch(ex) { TraceKit.report(ex); }
+ *
+ * Supports:
+ * - Firefox: full stack trace with line numbers, plus column number
+ * on top frame; column number is not guaranteed
+ * - Opera: full stack trace with line and column numbers
+ * - Chrome: full stack trace with line and column numbers
+ * - Safari: line and column number for the top frame only; some frames
+ * may be missing, and column number is not guaranteed
+ * - IE: line and column number for the top frame only; some frames
+ * may be missing, and column number is not guaranteed
+ *
+ * In theory, TraceKit should work on all of the following versions:
+ * - IE5.5+ (only 8.0 tested)
+ * - Firefox 0.9+ (only 3.5+ tested)
+ * - Opera 7+ (only 10.50 tested; versions 9 and earlier may require
+ * Exceptions Have Stacktrace to be enabled in opera:config)
+ * - Safari 3+ (only 4+ tested)
+ * - Chrome 1+ (only 5+ tested)
+ * - Konqueror 3.5+ (untested)
+ *
+ * Requires TraceKit.computeStackTrace.
+ *
+ * Tries to catch all unhandled exceptions and report them to the
+ * subscribed handlers. Please note that TraceKit.report will rethrow the
+ * exception. This is REQUIRED in order to get a useful stack trace in IE.
+ * If the exception does not reach the top of the browser, you will only
+ * get a stack trace from the point where TraceKit.report was called.
+ *
+ * Handlers receive a stackInfo object as described in the
+ * TraceKit.computeStackTrace docs.
+ */
+TraceKit.report =3D (function reportModuleWrapper() {
+ var handlers =3D [],
+ lastException =3D null,
+ lastExceptionStack =3D null;
+
+ /**
+ * Add a crash handler.
+ * @param {Function} handler
+ */
+ function subscribe(handler) {
+ handlers.push(handler);
+ }
+
+ /**
+ * Remove a crash handler.
+ * @param {Function} handler
+ */
+ function unsubscribe(handler) {
+ for (var i =3D handlers.length - 1; i >=3D 0; --i) {
+ if (handlers[i] =3D=3D=3D handler) {
+ handlers.splice(i, 1);
+ }
+ }
+ }
+
+ /**
+ * Dispatch stack information to all handlers.
+ * @param {Object.<string, *>} stack
+ */
+ function notifyHandlers(stack, windowError) {
+ var exception =3D null;
+ if (windowError && !TraceKit.collectWindowErrors) {
+ return;
+ }
+ for (var i in handlers) {
+ if (TraceKit._has(handlers, i)) {
+ try {
+ handlers[i].apply(null, [stack].concat(Array.prototype=
.slice.call(arguments, 2)));
+ } catch (inner) {
+ exception =3D inner;
+ }
+ }
+ }
+
+ if (exception) {
+ throw exception;
+ }
+ }
+
+ var _oldOnerrorHandler =3D window.onerror;
+
+ /**
+ * Ensures all global unhandled exceptions are recorded.
+ * Supported by Gecko and IE.
+ * @param {string} message Error message.
+ * @param {string} url URL of script that generated the exception.
+ * @param {(number|string)} lineNo The line number at which the error
+ * occurred.
+ */
+ window.onerror =3D function traceKitWindowOnError(message, url, lineNo=
) {
+ var stack =3D null;
+
+ if (lastExceptionStack) {
+ TraceKit.computeStackTrace.augmentStackTraceWithInitialElement=
(lastExceptionStack, url, lineNo, message);
+ stack =3D lastExceptionStack;
+ lastExceptionStack =3D null;
+ lastException =3D null;
+ } else {
+ var location =3D {
+ 'url': url,
+ 'line': lineNo
+ };
+ location.func =3D TraceKit.computeStackTrace.guessFunctionName=
(location.url, location.line);
+ location.context =3D TraceKit.computeStackTrace.gatherContext(=
location.url, location.line);
+ stack =3D {
+ 'mode': 'onerror',
+ 'message': message,
+ 'url': document.location.href,
+ 'stack': [location],
+ 'useragent': navigator.userAgent
+ };
+ }
+
+ notifyHandlers(stack, 'from window.onerror');
+
+ if (_oldOnerrorHandler) {
+ return _oldOnerrorHandler.apply(this, arguments);
+ }
+
+ return false;
+ };
+
+ /**
+ * Reports an unhandled Error to TraceKit.
+ * @param {Error} ex
+ */
+ function report(ex) {
+ var args =3D Array.prototype.slice.call(arguments, 1);
+ if (lastExceptionStack) {
+ if (lastException =3D=3D=3D ex) {
+ return; // already caught by an inner catch block, ignore
+ } else {
+ var s =3D lastExceptionStack;
+ lastExceptionStack =3D null;
+ lastException =3D null;
+ notifyHandlers.apply(null, [s, null].concat(args));
+ }
+ }
+
+ var stack =3D TraceKit.computeStackTrace(ex);
+ lastExceptionStack =3D stack;
+ lastException =3D ex;
+
+ // If the stack trace is incomplete, wait for 2 seconds for
+ // slow slow IE to see if onerror occurs or not before reporting
+ // this exception; otherwise, we will end up with an incomplete
+ // stack trace
+ window.setTimeout(function () {
+ if (lastException =3D=3D=3D ex) {
+ lastExceptionStack =3D null;
+ lastException =3D null;
+ notifyHandlers.apply(null, [stack, null].concat(args));
+ }
+ }, (stack.incomplete ? 2000 : 0));
+
+ throw ex; // re-throw to propagate to the top level (and cause win=
dow.onerror)
+ }
+
+ report.subscribe =3D subscribe;
+ report.unsubscribe =3D unsubscribe;
+ return report;
+}());
+
+/**
+ * TraceKit.computeStackTrace: cross-browser stack traces in JavaScript
+ *
+ * Syntax:
+ * s =3D TraceKit.computeStackTrace.ofCaller([depth])
+ * s =3D TraceKit.computeStackTrace(exception) // consider using TraceKi=
t.report instead (see below)
+ * Returns:
+ * s.name - exception name
+ * s.message - exception message
+ * s.stack[i].url - JavaScript or HTML file URL
+ * s.stack[i].func - function name, or empty for anonymous functions=
(if guessing did not work)
+ * s.stack[i].args - arguments passed to the function, if known
+ * s.stack[i].line - line number, if known
+ * s.stack[i].column - column number, if known
+ * s.stack[i].context - an array of source code lines; the middle eleme=
nt corresponds to the correct line#
+ * s.mode - 'stack', 'stacktrace', 'multiline', 'callers', =
'onerror', or 'failed' -- method used to collect the stack trace
+ *
+ * Supports:
+ * - Firefox: full stack trace with line numbers and unreliable column
+ * number on top frame
+ * - Opera 10: full stack trace with line and column numbers
+ * - Opera 9-: full stack trace with line numbers
+ * - Chrome: full stack trace with line and column numbers
+ * - Safari: line and column number for the topmost stacktrace element
+ * only
+ * - IE: no line numbers whatsoever
+ *
+ * Tries to guess names of anonymous functions by looking for assignments
+ * in the source code. In IE and Safari, we have to guess source file names
+ * by searching for function bodies inside all page scripts. This will not
+ * work for scripts that are loaded cross-domain.
+ * Here be dragons: some function names may be guessed incorrectly, and
+ * duplicate functions may be mismatched.
+ *
+ * TraceKit.computeStackTrace should only be used for tracing purposes.
+ * Logging of unhandled exceptions should be done with TraceKit.report,
+ * which builds on top of TraceKit.computeStackTrace and provides better
+ * IE support by utilizing the window.onerror event to retrieve information
+ * about the top of the stack.
+ *
+ * Note: In IE and Safari, no stack trace is recorded on the Error object,
+ * so computeStackTrace instead walks its *own* chain of callers.
+ * This means that:
+ * * in Safari, some methods may be missing from the stack trace;
+ * * in IE, the topmost function in the stack trace will always be the
+ * caller of computeStackTrace.
+ *
+ * This is okay for tracing (because you are likely to be calling
+ * computeStackTrace from the function you want to be the topmost element
+ * of the stack trace anyway), but not okay for logging unhandled
+ * exceptions (because your catch block will likely be far away from the
+ * inner function that actually caused the exception).
+ *
+ * Tracing example:
+ * function trace(message) {
+ * var stackInfo =3D TraceKit.computeStackTrace.ofCaller();
+ * var data =3D message + "\n";
+ * for(var i in stackInfo.stack) {
+ * var item =3D stackInfo.stack[i];
+ * data +=3D (item.func || '[anonymous]') + "() in " + item.ur=
l + ":" + (item.line || '0') + "\n";
+ * }
+ * if (window.console)
+ * console.info(data);
+ * else
+ * alert(data);
+ * }
+ */
+TraceKit.computeStackTrace =3D (function computeStackTraceWrapper() {
+ var debug =3D false,
+ sourceCache =3D {};
+
+ /**
+ * Attempts to retrieve source code via XMLHttpRequest, which is used
+ * to look up anonymous function names.
+ * @param {string} url URL of source code.
+ * @return {string} Source contents.
+ */
+ function loadSource(url) {
+ if (!TraceKit.remoteFetching) { //Only attempt request if remoteFe=
tching is on.
+ return '';
+ }
+ try {
+ var XMLHttpRequestWrapper;
+
+ if (typeof (XMLHttpRequest) =3D=3D=3D 'undefined') { // IE 5.x=
-6.x:
+ XMLHttpRequestWrapper =3D function IEXMLHttpRequestSub() {
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP.6.0');
+ } catch (e) {}
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP.3.0');
+ } catch (e) {}
+ try {
+ return new ActiveXObject('Msxml2.XMLHTTP');
+ } catch (e) {}
+ try {
+ return new ActiveXObject('Microsoft.XMLHTTP');
+ } catch (e) {}
+ throw new Error('No XHR.');
+ };
+ } else {
+ XMLHttpRequestWrapper =3D XMLHttpRequest;
+ }
+ =20
+ var request =3D new XMLHttpRequestWrapper();
+ request.open('GET', url, false);
+ request.send('');
+ return request.responseText;
+ } catch (e) {
+ return '';
+ }
+ }
+
+ /**
+ * Retrieves source code from the source code cache.
+ * @param {string} url URL of source code.
+ * @return {Array.<string>} Source contents.
+ */
+ function getSource(url) {
+ if (!TraceKit._has(sourceCache, url)) {
+ // URL needs to be able to fetched within the acceptable domai=
n. Otherwise,
+ // cross-domain errors will be triggered.
+ var source;
+ if (url.indexOf(document.domain) !=3D=3D -1) {
+ source =3D loadSource(url);
+ } else {
+ source =3D [];
+ }
+ sourceCache[url] =3D source.length ? source.split('\n') : [];
+ }
+
+ return sourceCache[url];
+ }
+
+ /**
+ * Tries to use an externally loaded copy of source code to determine
+ * the name of a function by looking at the name of the variable it was
+ * assigned to, if any.
+ * @param {string} url URL of source code.
+ * @param {(string|number)} lineNo Line number in source code.
+ * @return {string} The function name, if discoverable.
+ */
+ function guessFunctionName(url, lineNo) {
+ var reFunctionArgNames =3D /function ([^(]*)\(([^)]*)\)/,
+ reGuessFunction =3D /['"]?([0-9A-Za-z$_]+)['"]?\s*[:=3D]\s*(fu=
nction|eval|new Function)/,
+ line =3D '',
+ maxLines =3D 10,
+ source =3D getSource(url),
+ m;
+
+ if (!source.length) {
+ return '?';
+ }
+
+ // Walk backwards from the first line in the function until we fin=
d the line which
+ // matches the pattern above, which is the function definition
+ for (var i =3D 0; i < maxLines; ++i) {
+ line =3D source[lineNo - i] + line;
+
+ if (line !=3D=3D undefined) {
+ if ((m =3D reGuessFunction.exec(line))) {
+ return m[1];
+ } else if ((m =3D reFunctionArgNames.exec(line))) {
+ return m[1];
+ }
+ }
+ }
+
+ return '?';
+ }
+
+ /**
+ * Retrieves the surrounding lines from where an exception occurred.
+ * @param {string} url URL of source code.
+ * @param {(string|number)} line Line number in source code to centre
+ * around for context.
+ * @return {?Array.<string>} Lines of source code.
+ */
+ function gatherContext(url, line) {
+ var source =3D getSource(url);
+
+ if (!source.length) {
+ return null;
+ }
+
+ var context =3D [],
+ // linesBefore & linesAfter are inclusive with the offending l=
ine.
+ // if linesOfContext is even, there will be one extra line
+ // *before* the offending line.
+ linesBefore =3D Math.floor(TraceKit.linesOfContext / 2),
+ // Add one extra line if linesOfContext is odd
+ linesAfter =3D linesBefore + (TraceKit.linesOfContext % 2),
+ start =3D Math.max(0, line - linesBefore - 1),
+ end =3D Math.min(source.length, line + linesAfter - 1);
+
+ line -=3D 1; // convert to 0-based index
+
+ for (var i =3D start; i < end; ++i) {
+ if (typeof (source[i]) !=3D=3D 'undefined') {
+ context.push(source[i]);
+ }
+ }
+
+ return context.length > 0 ? context : null;
+ }
+
+ /**
+ * Escapes special characters, except for whitespace, in a string to be
+ * used inside a regular expression as a string literal.
+ * @param {string} text The string.
+ * @return {string} The escaped string literal.
+ */
+ function escapeRegExp(text) {
+ return text.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g, '\\$&');
+ }
+
+ /**
+ * Escapes special characters in a string to be used inside a regular
+ * expression as a string literal. Also ensures that HTML entities will
+ * be matched the same as their literal friends.
+ * @param {string} body The string.
+ * @return {string} The escaped string.
+ */
+ function escapeCodeAsRegExpForMatchingInsideHTML(body) {
+ return escapeRegExp(body).replace('<', '(?:<|<)').replace('>', =
'(?:>|>)').replace('&', '(?:&|&)').replace('"', '(?:"|")').repl=
ace(/\s+/g, '\\s+');
+ }
+
+ /**
+ * Determines where a code fragment occurs in the source code.
+ * @param {RegExp} re The function definition.
+ * @param {Array.<string>} urls A list of URLs to search.
+ * @return {?Object.<string, (string|number)>} An object containing
+ * the url, line, and column number of the defined function.
+ */
+ function findSourceInUrls(re, urls) {
+ var source, m;
+ for (var i =3D 0, j =3D urls.length; i < j; ++i) {
+ // console.log('searching', urls[i]);
+ if ((source =3D getSource(urls[i])).length) {
+ source =3D source.join('\n');
+ if ((m =3D re.exec(source))) {
+ // console.log('Found function in ' + urls[i]);
+
+ return {
+ 'url': urls[i],
+ 'line': source.substring(0, m.index).split('\n').l=
ength,
+ 'column': m.index - source.lastIndexOf('\n', m.ind=
ex) - 1
+ };
+ }
+ }
+ }
+
+ // console.log('no match');
+
+ return null;
+ }
+
+ /**
+ * Determines at which column a code fragment occurs on a line of the
+ * source code.
+ * @param {string} fragment The code fragment.
+ * @param {string} url The URL to search.
+ * @param {(string|number)} line The line number to examine.
+ * @return {?number} The column number.
+ */
+ function findSourceInLine(fragment, url, line) {
+ var source =3D getSource(url),
+ re =3D new RegExp('\\b' + escapeRegExp(fragment) + '\\b'),
+ m;
+
+ line -=3D 1;
+
+ if (source && source.length > line && (m =3D re.exec(source[line])=
)) {
+ return m.index;
+ }
+
+ return null;
+ }
+
+ /**
+ * Determines where a function was defined within the source code.
+ * @param {(Function|string)} func A function reference or serialized
+ * function definition.
+ * @return {?Object.<string, (string|number)>} An object containing
+ * the url, line, and column number of the defined function.
+ */
+ function findSourceByFunctionBody(func) {
+ var urls =3D [window.location.href],
+ scripts =3D document.getElementsByTagName('script'),
+ body,
+ code =3D '' + func,
+ codeRE =3D /^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*=
(\S[\s\S]*\S)\s*\}\s*$/,
+ eventRE =3D /^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]=
*\S)\s*\}\s*$/,
+ re,
+ parts,
+ result;
+
+ for (var i =3D 0; i < scripts.length; ++i) {
+ var script =3D scripts[i];
+ if (script.src) {
+ urls.push(script.src);
+ }
+ }
+
+ if (!(parts =3D codeRE.exec(code))) {
+ re =3D new RegExp(escapeRegExp(code).replace(/\s+/g, '\\s+'));
+ }
+
+ // not sure if this is really necessary, but I don=E2=80=99t have =
a test
+ // corpus large enough to confirm that and it was in the original.
+ else {
+ var name =3D parts[1] ? '\\s+' + parts[1] : '',
+ args =3D parts[2].split(',').join('\\s*,\\s*');
+
+ body =3D escapeRegExp(parts[3]).replace(/;$/, ';?'); // semico=
lon is inserted if the function ends with a comment.replace(/\s+/g, '\\s+');
+ re =3D new RegExp('function' + name + '\\s*\\(\\s*' + args + '=
\\s*\\)\\s*{\\s*' + body + '\\s*}');
+ }
+
+ // look for a normal function definition
+ if ((result =3D findSourceInUrls(re, urls))) {
+ return result;
+ }
+
+ // look for an old-school event handler function
+ if ((parts =3D eventRE.exec(code))) {
+ var event =3D parts[1];
+ body =3D escapeCodeAsRegExpForMatchingInsideHTML(parts[2]);
+
+ // look for a function defined in HTML as an onXXX handler
+ re =3D new RegExp('on' + event + '=3D[\\\'"]\\s*' + body + '\\=
s*[\\\'"]', 'i');
+
+ if ((result =3D findSourceInUrls(re, urls[0]))) {
+ return result;
+ }
+
+ // look for ???
+ re =3D new RegExp(body);
+
+ if ((result =3D findSourceInUrls(re, urls))) {
+ return result;
+ }
+ }
+
+ return null;
+ }
+
+ // Contents of Exception in various browsers.
+ //
+ // SAFARI:
+ // ex.message =3D Can't find variable: qq
+ // ex.line =3D 59
+ // ex.sourceId =3D 580238192
+ // ex.sourceURL =3D http://...
+ // ex.expressionBeginOffset =3D 96
+ // ex.expressionCaretOffset =3D 98
+ // ex.expressionEndOffset =3D 98
+ // ex.name =3D ReferenceError
+ //
+ // FIREFOX:
+ // ex.message =3D qq is not defined
+ // ex.fileName =3D http://...
+ // ex.lineNumber =3D 59
+ // ex.stack =3D ...stack trace... (see the example below)
+ // ex.name =3D ReferenceError
+ //
+ // CHROME:
+ // ex.message =3D qq is not defined
+ // ex.name =3D ReferenceError
+ // ex.type =3D not_defined
+ // ex.arguments =3D ['aa']
+ // ex.stack =3D ...stack trace...
+ //
+ // INTERNET EXPLORER:
+ // ex.message =3D ...
+ // ex.name =3D ReferenceError
+ //
+ // OPERA:
+ // ex.message =3D ...message... (see the example below)
+ // ex.name =3D ReferenceError
+ // ex.opera#sourceloc =3D 11 (pretty much useless, duplicates the inf=
o in ex.message)
+ // ex.stacktrace =3D n/a; see 'opera:config#UserPrefs|Exceptions Have =
Stacktrace'
+
+ /**
+ * Computes stack trace information from the stack property.
+ * Chrome and Gecko use this property.
+ * @param {Error} ex
+ * @return {?Object.<string, *>} Stack trace information.
+ */
+ function computeStackTraceFromStackProp(ex) {
+ if (!ex.stack) {
+ return null;
+ }
+
+ var chrome =3D /^\s*at (?:((?:\[object object\])?\S+) )?\(?((?:fil=
e|http|https):.*?):(\d+)(?::(\d+))?\)?\s*$/i,
+ gecko =3D /^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\=
d+)(?::(\d+))?\s*$/i,
+ lines =3D ex.stack.split('\n'),
+ stack =3D [],
+ parts,
+ element,
+ reference =3D /^(.*) is undefined$/.exec(ex.message);
+
+ for (var i =3D 0, j =3D lines.length; i < j; ++i) {
+ if ((parts =3D gecko.exec(lines[i]))) {
+ element =3D {
+ 'url': parts[3],
+ 'func': parts[1] || '?',
+ 'args': parts[2] ? parts[2].split(',') : '',
+ 'line': +parts[4],
+ 'column': parts[5] ? +parts[5] : null
+ };
+ } else if ((parts =3D chrome.exec(lines[i]))) {
+ element =3D {
+ 'url': parts[2],
+ 'func': parts[1] || '?',
+ 'line': +parts[3],
+ 'column': parts[4] ? +parts[4] : null
+ };
+ } else {
+ continue;
+ }
+
+ if (!element.func && element.line) {
+ element.func =3D guessFunctionName(element.url, element.li=
ne);
+ }
+
+ if (element.line) {
+ element.context =3D gatherContext(element.url, element.lin=
e);
+ }
+
+ stack.push(element);
+ }
+
+ if (stack[0] && stack[0].line && !stack[0].column && reference) {
+ stack[0].column =3D findSourceInLine(reference[1], stack[0].ur=
l, stack[0].line);
+ }
+
+ if (!stack.length) {
+ return null;
+ }
+
+ return {
+ 'mode': 'stack',
+ 'name': ex.name,
+ 'message': ex.message,
+ 'url': document.location.href,
+ 'stack': stack,
+ 'useragent': navigator.userAgent
+ };
+ }
+
+ /**
+ * Computes stack trace information from the stacktrace property.
+ * Opera 10 uses this property.
+ * @param {Error} ex
+ * @return {?Object.<string, *>} Stack trace information.
+ */
+ function computeStackTraceFromStacktraceProp(ex) {
+ // Access and store the stacktrace property before doing ANYTHING
+ // else to it because Opera is not very good at providing it
+ // reliably in other circumstances.
+ var stacktrace =3D ex.stacktrace;
+
+ var testRE =3D / line (\d+), column (\d+) in (?:<anonymous functio=
n: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,
+ lines =3D stacktrace.split('\n'),
+ stack =3D [],
+ parts;
+
+ for (var i =3D 0, j =3D lines.length; i < j; i +=3D 2) {
+ if ((parts =3D testRE.exec(lines[i]))) {
+ var element =3D {
+ 'line': +parts[1],
+ 'column': +parts[2],
+ 'func': parts[3] || parts[4],
+ 'args': parts[5] ? parts[5].split(',') : [],
+ 'url': parts[6]
+ };
+
+ if (!element.func && element.line) {
+ element.func =3D guessFunctionName(element.url, elemen=
t.line);
+ }
+ if (element.line) {
+ try {
+ element.context =3D gatherContext(element.url, ele=
ment.line);
+ } catch (exc) {}
+ }
+
+ if (!element.context) {
+ element.context =3D [lines[i + 1]];
+ }
+
+ stack.push(element);
+ }
+ }
+
+ if (!stack.length) {
+ return null;
+ }
+
+ return {
+ 'mode': 'stacktrace',
+ 'name': ex.name,
+ 'message': ex.message,
+ 'url': document.location.href,
+ 'stack': stack,
+ 'useragent': navigator.userAgent
+ };
+ }
+
+ /**
+ * NOT TESTED.
+ * Computes stack trace information from an error message that includes
+ * the stack trace.
+ * Opera 9 and earlier use this method if the option to show stack
+ * traces is turned on in opera:config.
+ * @param {Error} ex
+ * @return {?Object.<string, *>} Stack information.
+ */
+ function computeStackTraceFromOperaMultiLineMessage(ex) {
+ // Opera includes a stack trace into the exception message. An exa=
mple is:
+ //
+ // Statement on line 3: Undefined variable: undefinedFunc
+ // Backtrace:
+ // Line 3 of linked script file://localhost/Users/andreyvit/Proj=
ects/TraceKit/javascript-client/sample.js: In function zzz
+ // undefinedFunc(a);
+ // Line 7 of inline#1 script in file://localhost/Users/andreyvit=
/Projects/TraceKit/javascript-client/sample.html: In function yyy
+ // zzz(x, y, z);
+ // Line 3 of inline#1 script in file://localhost/Users/andreyvit=
/Projects/TraceKit/javascript-client/sample.html: In function xxx
+ // yyy(a, a, a);
+ // Line 1 of function script
+ // try { xxx('hi'); return false; } catch(ex) { TraceKit.repor=
t(ex); }
+ // ...
+
+ var lines =3D ex.message.split('\n');
+ if (lines.length < 4) {
+ return null;
+ }
+
+ var lineRE1 =3D /^\s*Line (\d+) of linked script ((?:file|http|htt=
ps)\S+)(?:: in function (\S+))?\s*$/i,
+ lineRE2 =3D /^\s*Line (\d+) of inline#(\d+) script in ((?:file=
|http|https)\S+)(?:: in function (\S+))?\s*$/i,
+ lineRE3 =3D /^\s*Line (\d+) of function script\s*$/i,
+ stack =3D [],
+ scripts =3D document.getElementsByTagName('script'),
+ inlineScriptBlocks =3D [],
+ parts,
+ i,
+ len,
+ source;
+
+ for (i in scripts) {
+ if (TraceKit._has(scripts, i) && !scripts[i].src) {
+ inlineScriptBlocks.push(scripts[i]);
+ }
+ }
+
+ for (i =3D 2, len =3D lines.length; i < len; i +=3D 2) {
+ var item =3D null;
+ if ((parts =3D lineRE1.exec(lines[i]))) {
+ item =3D {
+ 'url': parts[2],
+ 'func': parts[3],
+ 'line': +parts[1]
+ };
+ } else if ((parts =3D lineRE2.exec(lines[i]))) {
+ item =3D {
+ 'url': parts[3],
+ 'func': parts[4]
+ };
+ var relativeLine =3D (+parts[1]); // relative to the start=
of the <SCRIPT> block
+ var script =3D inlineScriptBlocks[parts[2] - 1];
+ if (script) {
+ source =3D getSource(item.url);
+ if (source) {
+ source =3D source.join('\n');
+ var pos =3D source.indexOf(script.innerText);
+ if (pos >=3D 0) {
+ item.line =3D relativeLine + source.substring(=
0, pos).split('\n').length;
+ }
+ }
+ }
+ } else if ((parts =3D lineRE3.exec(lines[i]))) {
+ var url =3D window.location.href.replace(/#.*$/, ''),
+ line =3D parts[1];
+ var re =3D new RegExp(escapeCodeAsRegExpForMatchingInsideH=
TML(lines[i + 1]));
+ source =3D findSourceInUrls(re, [url]);
+ item =3D {
+ 'url': url,
+ 'line': source ? source.line : line,
+ 'func': ''
+ };
+ }
+
+ if (item) {
+ if (!item.func) {
+ item.func =3D guessFunctionName(item.url, item.line);
+ }
+ var context =3D gatherContext(item.url, item.line);
+ var midline =3D (context ? context[Math.floor(context.leng=
th / 2)] : null);
+ if (context && midline.replace(/^\s*/, '') =3D=3D=3D lines=
[i + 1].replace(/^\s*/, '')) {
+ item.context =3D context;
+ } else {
+ // if (context) alert("Context mismatch. Correct midli=
ne:\n" + lines[i+1] + "\n\nMidline:\n" + midline + "\n\nContext:\n" + conte=
xt.join("\n") + "\n\nURL:\n" + item.url);
+ item.context =3D [lines[i + 1]];
+ }
+ stack.push(item);
+ }
+ }
+ if (!stack.length) {
+ return null; // could not parse multiline exception message as=
Opera stack trace
+ }
+
+ return {
+ 'mode': 'multiline',
+ 'name': ex.name,
+ 'message': lines[0],
+ 'url': document.location.href,
+ 'stack': stack,
+ 'useragent': navigator.userAgent
+ };
+ }
+
+ /**
+ * Adds information about the first frame to incomplete stack traces.
+ * Safari and IE require this to get complete data on the first frame.
+ * @param {Object.<string, *>} stackInfo Stack trace information from
+ * one of the compute* methods.
+ * @param {string} url The URL of the script that caused an error.
+ * @param {(number|string)} lineNo The line number of the script that
+ * caused an error.
+ * @param {string=3D} message The error generated by the browser, which
+ * hopefully contains the name of the object that caused the error.
+ * @return {boolean} Whether or not the stack information was
+ * augmented.
+ */
+ function augmentStackTraceWithInitialElement(stackInfo, url, lineNo, m=
essage) {
+ var initial =3D {
+ 'url': url,
+ 'line': lineNo
+ };
+
+ if (initial.url && initial.line) {
+ stackInfo.incomplete =3D false;
+
+ if (!initial.func) {
+ initial.func =3D guessFunctionName(initial.url, initial.li=
ne);
+ }
+
+ if (!initial.context) {
+ initial.context =3D gatherContext(initial.url, initial.lin=
e);
+ }
+
+ var reference =3D / '([^']+)' /.exec(message);
+ if (reference) {
+ initial.column =3D findSourceInLine(reference[1], initial.=
url, initial.line);
+ }
+
+ if (stackInfo.stack.length > 0) {
+ if (stackInfo.stack[0].url =3D=3D=3D initial.url) {
+ if (stackInfo.stack[0].line =3D=3D=3D initial.line) {
+ return false; // already in stack trace
+ } else if (!stackInfo.stack[0].line && stackInfo.stack=
[0].func =3D=3D=3D initial.func) {
+ stackInfo.stack[0].line =3D initial.line;
+ stackInfo.stack[0].context =3D initial.context;
+ return false;
+ }
+ }
+ }
+
+ stackInfo.stack.unshift(initial);
+ stackInfo.partial =3D true;
+ return true;
+ } else {
+ stackInfo.incomplete =3D true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Computes stack trace information by walking the arguments.caller
+ * chain at the time the exception occurred. This will cause earlier
+ * frames to be missed but is the only way to get any stack trace in
+ * Safari and IE. The top frame is restored by
+ * {@link augmentStackTraceWithInitialElement}.
+ * @param {Error} ex
+ * @return {?Object.<string, *>} Stack trace information.
+ */
+ function computeStackTraceByWalkingCallerChain(ex, depth) {
+ var functionName =3D /function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-=
9\xA0-\uFFFF]*)?\s*\(/i,
+ stack =3D [],
+ funcs =3D {},
+ recursion =3D false,
+ parts,
+ item,
+ source;
+
+ for (var curr =3D computeStackTraceByWalkingCallerChain.caller; cu=
rr && !recursion; curr =3D curr.caller) {
+ if (curr =3D=3D=3D computeStackTrace || curr =3D=3D=3D TraceKi=
t.report) {
+ // console.log('skipping internal function');
+ continue;
+ }
+
+ item =3D {
+ 'url': null,
+ 'func': '?',
+ 'line': null,
+ 'column': null
+ };
+
+ if (curr.name) {
+ item.func =3D curr.name;
+ } else if ((parts =3D functionName.exec(curr.toString()))) {
+ item.func =3D parts[1];
+ }
+
+ if ((source =3D findSourceByFunctionBody(curr))) {
+ item.url =3D source.url;
+ item.line =3D source.line;
+
+ if (item.func =3D=3D=3D '?') {
+ item.func =3D guessFunctionName(item.url, item.line);
+ }
+
+ var reference =3D / '([^']+)' /.exec(ex.message || ex.desc=
ription);
+ if (reference) {
+ item.column =3D findSourceInLine(reference[1], source.=
url, source.line);
+ }
+ }
+
+ if (funcs['' + curr]) {
+ recursion =3D true;
+ }else{
+ funcs['' + curr] =3D true;
+ }
+
+ stack.push(item);
+ }
+
+ if (depth) {
+ // console.log('depth is ' + depth);
+ // console.log('stack is ' + stack.length);
+ stack.splice(0, depth);
+ }
+
+ var result =3D {
+ 'mode': 'callers',
+ 'name': ex.name,
+ 'message': ex.message,
+ 'url': document.location.href,
+ 'stack': stack,
+ 'useragent': navigator.userAgent
+ };
+ augmentStackTraceWithInitialElement(result, ex.sourceURL || ex.fil=
eName, ex.line || ex.lineNumber, ex.message || ex.description);
+ return result;
+ }
+
+ /**
+ * Computes a stack trace for an exception.
+ * @param {Error} ex
+ * @param {(string|number)=3D} depth
+ */
+ function computeStackTrace(ex, depth) {
+ var stack =3D null;
+ depth =3D (depth =3D=3D null ? 0 : +depth);
+
+ try {
+ // This must be tried first because Opera 10 *destroys*
+ // its stacktrace property if you try to access the stack
+ // property first!!
+ stack =3D computeStackTraceFromStacktraceProp(ex);
+ if (stack) {
+ return stack;
+ }
+ } catch (e) {
+ if (debug) {
+ throw e;
+ }
+ }
+
+ try {
+ stack =3D computeStackTraceFromStackProp(ex);
+ if (stack) {
+ return stack;
+ }
+ } catch (e) {
+ if (debug) {
+ throw e;
+ }
+ }
+
+ try {
+ stack =3D computeStackTraceFromOperaMultiLineMessage(ex);
+ if (stack) {
+ return stack;
+ }
+ } catch (e) {
+ if (debug) {
+ throw e;
+ }
+ }
+
+ try {
+ stack =3D computeStackTraceByWalkingCallerChain(ex, depth + 1);
+ if (stack) {
+ return stack;
+ }
+ } catch (e) {
+ if (debug) {
+ throw e;
+ }
+ }
+
+ return {
+ 'mode': 'failed'
+ };
+ }
+
+ /**
+ * Logs a stacktrace starting from the previous call and working down.
+ * @param {(number|string)=3D} depth How many frames deep to trace.
+ * @return {Object.<string, *>} Stack trace information.
+ */
+ function computeStackTraceOfCaller(depth) {
+ depth =3D (depth =3D=3D null ? 0 : +depth) + 1; // "+ 1" because "=
ofCaller" should drop one frame
+ try {
+ throw new Error();
+ } catch (ex) {
+ return computeStackTrace(ex, depth + 1);
+ }
+
+ return null;
+ }
+
+ computeStackTrace.augmentStackTraceWithInitialElement =3D augmentStack=
TraceWithInitialElement;
+ computeStackTrace.guessFunctionName =3D guessFunctionName;
+ computeStackTrace.gatherContext =3D gatherContext;
+ computeStackTrace.ofCaller =3D computeStackTraceOfCaller;
+
+ return computeStackTrace;
+}());
+
+/**
+ * Extends support for global error handling for asynchronous browser
+ * functions. Adopted from Closure Library's errorhandler.js
+ */
+(function extendToAsynchronousCallbacks(w) {
+ var _helper =3D function _helper(fnName) {
+ var originalFn =3D w[fnName];
+ w[fnName] =3D function traceKitAsyncExtension() {
+ // Make a copy of the arguments
+ var args =3D Array.prototype.slice.call(arguments, 0);
+ var originalCallback =3D args[0];
+ if (typeof (originalCallback) =3D=3D=3D 'function') {
+ args[0] =3D function traceKitArgsZero() {
+ try {
+ originalCallback.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+ }
+ // IE < 9 doesn't support .call/.apply on setInterval/setTimeo=
ut, but it
+ // also only supports 2 argument and doesn't care what "this" =
is, so we
+ // can just call the original function directly.
+ if (originalFn.apply) {
+ return originalFn.apply(this, args);
+ } else {
+ return originalFn(args[0], args[1]);
+ }
+ };
+ };
+
+ _helper('setTimeout');
+ _helper('setInterval');
+}(window));
+
+/**
+ * Extended support for backtraces and global error handling for most
+ * asynchronous jQuery functions.
+ */
+(function traceKitAsyncForjQuery($) {
+
+ // quit if jQuery isn't on the page
+ if (!$) {
+ return;
+ }
+
+ var _oldEventAdd =3D $.event.add;
+ $.event.add =3D function traceKitEventAdd(elem, types, handler, data, =
selector) {
+ var _handler;
+
+ if (handler.handler) {
+ _handler =3D handler.handler;
+ handler.handler =3D function traceKitHandler() {
+ try {
+ return _handler.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+ } else {
+ _handler =3D handler;
+ handler =3D function apply_handler() {
+ try {
+ return _handler.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+ }
+
+ // If the handler we are attaching doesn=E2=80=99t have the same g=
uid as
+ // the original, it will never be removed when someone tries to
+ // unbind the original function later. Technically as a result of
+ // this our guids are no longer globally unique, but whatever, that
+ // never hurt anybody RIGHT?!
+ if (_handler.guid) {
+ handler.guid =3D _handler.guid;
+ } else {
+ handler.guid =3D _handler.guid =3D $.guid++;
+ }
+
+ return _oldEventAdd.call(this, elem, types, handler, data, selecto=
r);
+ };
+
+ var _oldReady =3D $.fn.ready;
+ $.fn.ready =3D function traceKitjQueryReadyWrapper(fn) {
+ var _fn =3D function () {
+ try {
+ return fn.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+
+ return _oldReady.call(this, _fn);
+ };
+
+ var _oldAjax =3D $.ajax;
+ $.ajax =3D function traceKitAjaxWrapper(s) {
+ if ($.isFunction(s.complete)) {
+ var _oldComplete =3D s.complete;
+ s.complete =3D function traceKitjQueryComplete() {
+ try {
+ return _oldComplete.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+ }
+
+ if ($.isFunction(s.error)) {
+ var _oldError =3D s.error;
+ s.error =3D function traceKitjQueryError() {
+ try {
+ return _oldError.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+ }
+
+ if ($.isFunction(s.success)) {
+ var _oldSuccess =3D s.success;
+ s.success =3D function traceKitjQuerySuccess() {
+ try {
+ return _oldSuccess.apply(this, arguments);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+ }
+
+ try {
+ return _oldAjax.call(this, s);
+ } catch (e) {
+ TraceKit.report(e);
+ throw e;
+ }
+ };
+
+}(window.jQuery));
+
+//Default options:
+if (!TraceKit.remoteFetching) {
+ TraceKit.remoteFetching =3D true;
+}
+if (!TraceKit.collectWindowErrors) {
+ TraceKit.collectWindowErrors =3D true;
+}
+if (!TraceKit.linesOfContext || TraceKit.linesOfContext < 1) {
+ // 5 lines before, the offending line, 5 lines after
+ TraceKit.linesOfContext =3D 11;
+}
+
+
+
+// Export to global object
+window.TraceKit =3D TraceKit;
+
+}(window));
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 static/scripts/packed/libs/raven.js
--- /dev/null
+++ b/static/scripts/packed/libs/raven.js
@@ -0,0 +1,1 @@
+(function(){var x=3Dwindow.Raven,u=3D!h(window.JSON),e,o,p,q,f=3D{logger:"=
javascript",ignoreErrors:[],ignoreUrls:[]};var z=3DTraceKit.noConflict();z.=
remoteFetching=3Dfalse;var n=3D{VERSION:"@VERSION",noConflict:function(){wi=
ndow.Raven=3Dx;return n},config:function(C,B){var D=3Dv(C),A=3DD.path.lastI=
ndexOf("/"),E=3DD.path.substr(1,A);if(B){j(B,function(F,G){f[F]=3DG})}f.ign=
oreErrors.push("Script error.");p=3DD.user;q=3D~~D.path.substr(A+1);e=3DD.p=
rotocol+"://"+D.host+(D.port?":"+D.port:"")+"/"+E+"api/"+q+"/store/";if(f.f=
etchContext){z.remoteFetching=3Dtrue}return n},install:function(){if(!s()){=
return}z.report.subscribe(m);return n},context:function(B,C,A){if(c(B)){A=
=3DC;C=3DB;B=3Dundefined}n.wrap(B,C).apply(this,A)},wrap:function(A,B){if(c=
(A)){B=3DA;A=3Dundefined}return function(){try{B.apply(this,arguments)}catc=
h(C){n.captureException(C,A)}}},uninstall:function(){z.report.unsubscribe(m=
);return n},captureException:function(B,A){try{z.report(B,A)}catch(C){if(B!=
=3D=3DC){throw C}}return n},captureMessage:function(B,A){l(r({message:B},A)=
);return n},setUser:function(A){o=3DA;return n}};var b=3D"source protocol a=
uthority userInfo user password host port relative path directory file quer=
y anchor".split(" "),a=3D/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?(=
(?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\=
/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/;funct=
ion v(D){var A=3Da.exec(D),C=3D{},B=3D14;while(B--){C[b[B]]=3DA[B]||""}retu=
rn C}function h(A){return typeof A=3D=3D=3D"undefined"}function c(A){return=
typeof A=3D=3D=3D"function"}function j(C,D){var B,A;if(C.length=3D=3D=3Dun=
defined){for(B in C){if(C.hasOwnProperty(B)){D.call(null,B,C[B])}}}else{for=
(B=3D0,A=3DC.length;B<A;B++){D.call(null,B,C[B])}}}var g;function d(){if(g)=
{return g}var A=3D["sentry_version=3D2.0","sentry_client=3Draven-js/"+n.VER=
SION];if(p){A.push("sentry_key=3D"+p)}g=3D"?"+A.join("&");return g}function=
m(D,B){var F=3D[],C=3D0,A=3DD.stack&&D.stack.length||0,E;for(;C<A;C++){E=
=3Dk(D.stack[C]);if(E){F.push(E)}}i(D.name,D.message,D.url,D.lineno,F,B)}fu=
nction k(E){if(!E.url){return}var D=3D{filename:E.url,lineno:E.line,colno:E=
.column,"function":E.func||"?"},B=3Dw(E);if(B){var A=3D3,C=3D["pre_context"=
,"context_line","post_context"];while(A--){D[C[A]]=3DB[A]}}D.in_app=3D!/(Ra=
ven|TraceKit)\./.test(D["function"]);return D}function w(E){if(!E.context||=
!f.fetchContext){return}var C=3DE.context,A=3D~~(C.length/2),B=3DC.length,D=
=3Dfalse;while(B--){if(C[B].length>300){D=3Dtrue;break}}if(D){if(h(E.column=
)){return}return[[],C[A].substr(E.column,50),[]]}return[C.slice(0,A),C[A],C=
.slice(A+1)]}function i(D,H,F,A,C,I){var G,E,B;B=3Df.ignoreErrors.length;wh=
ile(B--){if(H=3D=3D=3Df.ignoreErrors[B]){return}}if(C&&C.length){G=3D{frame=
s:C};F=3DF||C[0].filename}else{if(F){G=3D{frames:[{filename:F,lineno:A}]}}}=
B=3Df.ignoreUrls.length;while(B--){if(f.ignoreUrls[B].test(F)){return}}E=3D=
A?H+" at "+A:H;l(r({"sentry.interfaces.Exception":{type:D,value:H},"sentry.=
interfaces.Stacktrace":G,culprit:F,message:E},I))}function r(B,A){if(!A){re=
turn B}j(A,function(C,D){B[C]=3DD});return B}function y(){var A=3D{url:wind=
ow.location.href,headers:{"User-Agent":navigator.userAgent}};if(window.docu=
ment.referrer){A.headers.Referer=3Dwindow.document.referrer}return A}functi=
on l(A){if(!s()){return}A=3Dr({project:q,logger:f.logger,site:f.site,platfo=
rm:"javascript","sentry.interfaces.Http":y()},A);if(o){A["sentry.interfaces=
.User"]=3Do}if(c(f.dataCallback)){A=3Df.dataCallback(A)}t(A)}function t(A){=
new Image().src=3De+d()+"&sentry_data=3D"+encodeURIComponent(JSON.stringify=
(A))}function s(){if(!u){return false}if(!e){console.error("Error: Raven ha=
s not been configured.");return false}return true}window.Raven=3Dn})();
\ No newline at end of file
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 static/scripts/packed/libs/tracekit.js
--- /dev/null
+++ b/static/scripts/packed/libs/tracekit.js
@@ -0,0 +1,1 @@
+(function(h,d){var e=3D{};var j=3Dh.TraceKit;e.noConflict=3Dfunction g(){h=
.TraceKit=3Dj;return e};e._has=3Dfunction a(k,l){return Object.prototype.ha=
sOwnProperty.call(k,l)};e.report=3D(function i(){var k=3D[],o=3Dnull,q=3Dnu=
ll;function l(t){k.push(t)}function r(u){for(var t=3Dk.length-1;t>=3D0;--t)=
{if(k[t]=3D=3D=3Du){k.splice(t,1)}}}function p(t,v){var x=3Dnull;if(v&&!e.c=
ollectWindowErrors){return}for(var w in k){if(e._has(k,w)){try{k[w].apply(n=
ull,[t].concat(Array.prototype.slice.call(arguments,2)))}catch(u){x=3Du}}}i=
f(x){throw x}}var s=3Dh.onerror;h.onerror=3Dfunction n(w,v,x){var t=3Dnull;=
if(q){e.computeStackTrace.augmentStackTraceWithInitialElement(q,v,x,w);t=3D=
q;q=3Dnull;o=3Dnull}else{var u=3D{url:v,line:x};u.func=3De.computeStackTrac=
e.guessFunctionName(u.url,u.line);u.context=3De.computeStackTrace.gatherCon=
text(u.url,u.line);t=3D{mode:"onerror",message:w,url:document.location.href=
,stack:[u],useragent:navigator.userAgent}}p(t,"from window.onerror");if(s){=
return s.apply(this,arguments)}return false};function m(v){var u=3DArray.pr=
ototype.slice.call(arguments,1);if(q){if(o=3D=3D=3Dv){return}else{var w=3Dq=
;q=3Dnull;o=3Dnull;p.apply(null,[w,null].concat(u))}}var t=3De.computeStack=
Trace(v);q=3Dt;o=3Dv;h.setTimeout(function(){if(o=3D=3D=3Dv){q=3Dnull;o=3Dn=
ull;p.apply(null,[t,null].concat(u))}},(t.incomplete?2000:0));throw v}m.sub=
scribe=3Dl;m.unsubscribe=3Dr;return m}());e.computeStackTrace=3D(function b=
(){var u=3Dfalse,q=3D{};function l(D){if(!e.remoteFetching){return""}try{va=
r C;if(typeof(XMLHttpRequest)=3D=3D=3D"undefined"){C=3Dfunction E(){try{ret=
urn new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(H){}try{return new Active=
XObject("Msxml2.XMLHTTP.3.0")}catch(H){}try{return new ActiveXObject("Msxml=
2.XMLHTTP")}catch(H){}try{return new ActiveXObject("Microsoft.XMLHTTP")}cat=
ch(H){}throw new Error("No XHR.")}}else{C=3DXMLHttpRequest}var F=3Dnew C();=
F.open("GET",D,false);F.send("");return F.responseText}catch(G){return""}}f=
unction t(C){if(!e._has(q,C)){var D;if(C.indexOf(document.domain)!=3D=3D-1)=
{D=3Dl(C)}else{D=3D[]}q[C]=3DD.length?D.split("\n"):[]}return q[C]}function=
z(D,F){var J=3D/function ([^(]*)\(([^)]*)\)/,G=3D/['"]?([0-9A-Za-z$_]+)['"=
]?\s*[:=3D]\s*(function|eval|new Function)/,K=3D"",I=3D10,C=3Dt(D),E;if(!C.=
length){return"?"}for(var H=3D0;H<I;++H){K=3DC[F-H]+K;if(K!=3D=3Dd){if((E=
=3DG.exec(K))){return E[1]}else{if((E=3DJ.exec(K))){return E[1]}}}}return"?=
"}function B(E,K){var D=3Dt(E);if(!D.length){return null}var G=3D[],J=3DMat=
h.floor(e.linesOfContext/2),C=3DJ+(e.linesOfContext%2),F=3DMath.max(0,K-J-1=
),H=3DMath.min(D.length,K+C-1);K-=3D1;for(var I=3DF;I<H;++I){if(typeof(D[I]=
)!=3D=3D"undefined"){G.push(D[I])}}return G.length>0?G:null}function m(C){r=
eturn C.replace(/[\-\[\]{}()*+?.,\\\^$|#]/g,"\\$&")}function x(C){return m(=
C).replace("<","(?:<|<)").replace(">","(?:>|>)").replace("&","(?:&|&a=
mp;)").replace('"','(?:"|")').replace(/\s+/g,"\\s+")}function o(F,H){v=
ar G,C;for(var E=3D0,D=3DH.length;E<D;++E){if((G=3Dt(H[E])).length){G=3DG.j=
oin("\n");if((C=3DF.exec(G))){return{url:H[E],line:G.substring(0,C.index).s=
plit("\n").length,column:C.index-G.lastIndexOf("\n",C.index)-1}}}}return nu=
ll}function A(F,E,D){var H=3Dt(E),G=3Dnew RegExp("\\b"+m(F)+"\\b"),C;D-=3D1=
;if(H&&H.length>D&&(C=3DG.exec(H[D]))){return C.index}return null}function =
v(H){var N=3D[h.location.href],I=3Ddocument.getElementsByTagName("script"),=
L,F=3D""+H,E=3D/^function(?:\s+([\w$]+))?\s*\(([\w\s,]*)\)\s*\{\s*(\S[\s\S]=
*\S)\s*\}\s*$/,G=3D/^function on([\w$]+)\s*\(event\)\s*\{\s*(\S[\s\S]*\S)\s=
*\}\s*$/,P,J,Q;for(var K=3D0;K<I.length;++K){var O=3DI[K];if(O.src){N.push(=
O.src)}}if(!(J=3DE.exec(F))){P=3Dnew RegExp(m(F).replace(/\s+/g,"\\s+"))}el=
se{var D=3DJ[1]?"\\s+"+J[1]:"",M=3DJ[2].split(",").join("\\s*,\\s*");L=3Dm(=
J[3]).replace(/;$/,";?");P=3Dnew RegExp("function"+D+"\\s*\\(\\s*"+M+"\\s*\=
\)\\s*{\\s*"+L+"\\s*}")}if((Q=3Do(P,N))){return Q}if((J=3DG.exec(F))){var C=
=3DJ[1];L=3Dx(J[2]);P=3Dnew RegExp("on"+C+"=3D[\\'\"]\\s*"+L+"\\s*[\\'\"]",=
"i");if((Q=3Do(P,N[0]))){return Q}P=3Dnew RegExp(L);if((Q=3Do(P,N))){return=
Q}}return null}function w(J){if(!J.stack){return null}var I=3D/^\s*at (?:(=
(?:\[object object\])?\S+) )?\(?((?:file|http|https):.*?):(\d+)(?::(\d+))?\=
)?\s*$/i,C=3D/^\s*(\S*)(?:\((.*?)\))?@((?:file|http|https).*?):(\d+)(?::(\d=
+))?\s*$/i,L=3DJ.stack.split("\n"),K=3D[],F,H,D=3D/^(.*) is undefined$/.exe=
c(J.message);for(var G=3D0,E=3DL.length;G<E;++G){if((F=3DC.exec(L[G]))){H=
=3D{url:F[3],func:F[1]||"?",args:F[2]?F[2].split(","):"",line:+F[4],column:=
F[5]?+F[5]:null}}else{if((F=3DI.exec(L[G]))){H=3D{url:F[2],func:F[1]||"?",l=
ine:+F[3],column:F[4]?+F[4]:null}}else{continue}}if(!H.func&&H.line){H.func=
=3Dz(H.url,H.line)}if(H.line){H.context=3DB(H.url,H.line)}K.push(H)}if(K[0]=
&&K[0].line&&!K[0].column&&D){K[0].column=3DA(D[1],K[0].url,K[0].line)}if(!=
K.length){return null}return{mode:"stack",name:J.name,message:J.message,url=
:document.location.href,stack:K,useragent:navigator.userAgent}}function s(H=
){var J=3DH.stacktrace;var G=3D/ line (\d+), column (\d+) in (?:<anonymous =
function: ([^>]+)>|([^\)]+))\((.*)\) in (.*):\s*$/i,L=3DJ.split("\n"),I=3D[=
],C;for(var F=3D0,D=3DL.length;F<D;F+=3D2){if((C=3DG.exec(L[F]))){var E=3D{=
line:+C[1],column:+C[2],func:C[3]||C[4],args:C[5]?C[5].split(","):[],url:C[=
6]};if(!E.func&&E.line){E.func=3Dz(E.url,E.line)}if(E.line){try{E.context=
=3DB(E.url,E.line)}catch(K){}}if(!E.context){E.context=3D[L[F+1]]}I.push(E)=
}}if(!I.length){return null}return{mode:"stacktrace",name:H.name,message:H.=
message,url:document.location.href,stack:I,useragent:navigator.userAgent}}f=
unction p(U){var E=3DU.message.split("\n");if(E.length<4){return null}var G=
=3D/^\s*Line (\d+) of linked script ((?:file|http|https)\S+)(?:: in functio=
n (\S+))?\s*$/i,F=3D/^\s*Line (\d+) of inline#(\d+) script in ((?:file|http=
|https)\S+)(?:: in function (\S+))?\s*$/i,C=3D/^\s*Line (\d+) of function s=
cript\s*$/i,L=3D[],I=3Ddocument.getElementsByTagName("script"),T=3D[],P,R,S=
,Q;for(R in I){if(e._has(I,R)&&!I[R].src){T.push(I[R])}}for(R=3D2,S=3DE.len=
gth;R<S;R+=3D2){var V=3Dnull;if((P=3DG.exec(E[R]))){V=3D{url:P[2],func:P[3]=
,line:+P[1]}}else{if((P=3DF.exec(E[R]))){V=3D{url:P[3],func:P[4]};var D=3D(=
+P[1]);var W=3DT[P[2]-1];if(W){Q=3Dt(V.url);if(Q){Q=3DQ.join("\n");var K=3D=
Q.indexOf(W.innerText);if(K>=3D0){V.line=3DD+Q.substring(0,K).split("\n").l=
ength}}}}else{if((P=3DC.exec(E[R]))){var J=3Dh.location.href.replace(/#.*$/=
,""),M=3DP[1];var O=3Dnew RegExp(x(E[R+1]));Q=3Do(O,[J]);V=3D{url:J,line:Q?=
Q.line:M,func:""}}}}if(V){if(!V.func){V.func=3Dz(V.url,V.line)}var H=3DB(V.=
url,V.line);var N=3D(H?H[Math.floor(H.length/2)]:null);if(H&&N.replace(/^\s=
*/,"")=3D=3D=3DE[R+1].replace(/^\s*/,"")){V.context=3DH}else{V.context=3D[E=
[R+1]]}L.push(V)}}if(!L.length){return null}return{mode:"multiline",name:U.=
name,message:E[0],url:document.location.href,stack:L,useragent:navigator.us=
erAgent}}function y(G,E,H,F){var D=3D{url:E,line:H};if(D.url&&D.line){G.inc=
omplete=3Dfalse;if(!D.func){D.func=3Dz(D.url,D.line)}if(!D.context){D.conte=
xt=3DB(D.url,D.line)}var C=3D/ '([^']+)' /.exec(F);if(C){D.column=3DA(C[1],=
D.url,D.line)}if(G.stack.length>0){if(G.stack[0].url=3D=3D=3DD.url){if(G.st=
ack[0].line=3D=3D=3DD.line){return false}else{if(!G.stack[0].line&&G.stack[=
0].func=3D=3D=3DD.func){G.stack[0].line=3DD.line;G.stack[0].context=3DD.con=
text;return false}}}}G.stack.unshift(D);G.partial=3Dtrue;return true}else{G=
.incomplete=3Dtrue}return false}function n(J,H){var I=3D/function\s+([_$a-z=
A-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,K=3D[],D=3D{},F=3Dfalse,G=
,L,C;for(var N=3Dn.caller;N&&!F;N=3DN.caller){if(N=3D=3D=3Dr||N=3D=3D=3De.r=
eport){continue}L=3D{url:null,func:"?",line:null,column:null};if(N.name){L.=
func=3DN.name}else{if((G=3DI.exec(N.toString()))){L.func=3DG[1]}}if((C=3Dv(=
N))){L.url=3DC.url;L.line=3DC.line;if(L.func=3D=3D=3D"?"){L.func=3Dz(L.url,=
L.line)}var E=3D/ '([^']+)' /.exec(J.message||J.description);if(E){L.column=
=3DA(E[1],C.url,C.line)}}if(D[""+N]){F=3Dtrue}else{D[""+N]=3Dtrue}K.push(L)=
}if(H){K.splice(0,H)}var M=3D{mode:"callers",name:J.name,message:J.message,=
url:document.location.href,stack:K,useragent:navigator.userAgent};y(M,J.sou=
rceURL||J.fileName,J.line||J.lineNumber,J.message||J.description);return M}=
function r(D,F){var C=3Dnull;F=3D(F=3D=3Dnull?0:+F);try{C=3Ds(D);if(C){retu=
rn C}}catch(E){if(u){throw E}}try{C=3Dw(D);if(C){return C}}catch(E){if(u){t=
hrow E}}try{C=3Dp(D);if(C){return C}}catch(E){if(u){throw E}}try{C=3Dn(D,F+=
1);if(C){return C}}catch(E){if(u){throw E}}return{mode:"failed"}}function k=
(D){D=3D(D=3D=3Dnull?0:+D)+1;try{throw new Error()}catch(C){return r(C,D+1)=
}return null}r.augmentStackTraceWithInitialElement=3Dy;r.guessFunctionName=
=3Dz;r.gatherContext=3DB;r.ofCaller=3Dk;return r}());(function f(k){var l=
=3Dfunction l(o){var n=3Dk[o];k[o]=3Dfunction m(){var p=3DArray.prototype.s=
lice.call(arguments,0);var r=3Dp[0];if(typeof(r)=3D=3D=3D"function"){p[0]=
=3Dfunction q(){try{r.apply(this,arguments)}catch(s){e.report(s);throw s}}}=
if(n.apply){return n.apply(this,p)}else{return n(p[0],p[1])}}};l("setTimeou=
t");l("setInterval")}(h));(function c(q){if(!q){return}var p=3Dq.event.add;=
q.event.add=3Dfunction n(w,u,v,x,r){var s;if(v.handler){s=3Dv.handler;v.han=
dler=3Dfunction t(){try{return s.apply(this,arguments)}catch(z){e.report(z)=
;throw z}}}else{s=3Dv;v=3Dfunction y(){try{return s.apply(this,arguments)}c=
atch(z){e.report(z);throw z}}}if(s.guid){v.guid=3Ds.guid}else{v.guid=3Ds.gu=
id=3Dq.guid++}return p.call(this,w,u,v,x,r)};var l=3Dq.fn.ready;q.fn.ready=
=3Dfunction k(r){var s=3Dfunction(){try{return r.apply(this,arguments)}catc=
h(t){e.report(t);throw t}};return l.call(this,s)};var o=3Dq.ajax;q.ajax=3Df=
unction m(x){if(q.isFunction(x.complete)){var v=3Dx.complete;x.complete=3Df=
unction u(){try{return v.apply(this,arguments)}catch(s){e.report(s);throw s=
}}}if(q.isFunction(x.error)){var r=3Dx.error;x.error=3Dfunction z(){try{ret=
urn r.apply(this,arguments)}catch(s){e.report(s);throw s}}}if(q.isFunction(=
x.success)){var w=3Dx.success;x.success=3Dfunction t(){try{return w.apply(t=
his,arguments)}catch(s){e.report(s);throw s}}}try{return o.call(this,x)}cat=
ch(y){e.report(y);throw y}}}(h.jQuery));if(!e.remoteFetching){e.remoteFetch=
ing=3Dtrue}if(!e.collectWindowErrors){e.collectWindowErrors=3Dtrue}if(!e.li=
nesOfContext||e.linesOfContext<1){e.linesOfContext=3D11}h.TraceKit=3De}(win=
dow));
\ No newline at end of file
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 templates/base.mako
--- a/templates/base.mako
+++ b/templates/base.mako
@@ -24,6 +24,17 @@
## Default javascripts
<%def name=3D"javascripts()">
=20
+ ## Send errors to Sntry server if configured
+ %if app.config.sentry_dsn:
+ ${h.js( "libs/tracekit", "libs/raven" )}
+ <script>
+ Raven.config('${app.config.sentry_dsn_public}').install();
+ %if trans.user:
+ Raven.setUser( { email: "${trans.user.email}" } );
+ %endif
+ </script>
+ %endif
+
${h.js(
"libs/jquery/jquery",
"libs/jquery/select2",
@@ -54,7 +65,7 @@
error : function(){},
assert : function(){}
};
- =20
+
// Set up needed paths.
var galaxy_paths =3D new GalaxyPaths({
root_path: '${h.url_for( "/" )}',
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 templates/base/base_panels.mako
--- a/templates/base/base_panels.mako
+++ b/templates/base/base_panels.mako
@@ -45,9 +45,18 @@
=20
## Default javascripts
<%def name=3D"javascripts()">
- <!--[if lt IE 7]>
- ${h.js( 'libs/IE/IE7', 'libs/IE/ie7-recalc' )}
- <![endif]-->
+
+ ## Send errors to Sntry server if configured
+ %if app.config.sentry_dsn:
+ ${h.js( "libs/tracekit", "libs/raven" )}
+ <script>
+ Raven.config('${app.config.sentry_dsn_public}').install();
+ %if trans.user:
+ Raven.setUser( { email: "${trans.user.email}" } );
+ %endif
+ </script>
+ %endif
+
${h.js(
'libs/jquery/jquery',
'libs/json2',
diff -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 -r 708d0ccee63fc75eb88e5dc=
3a9e0d6d3e5ff72e7 templates/root/tool_menu.mako
--- a/templates/root/tool_menu.mako
+++ b/templates/root/tool_menu.mako
@@ -74,7 +74,7 @@
});
*/
=20
- $( '.tooltip' ).tooltip();
+ $( '.tooltip' ).tooltip().foasdasdasdoo();
=20
// TODO: is this necessary?
$( "a[minsizehint]" ).click( function() {
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: james_taylor: jobs: Fix LWR after merge (merged backwards?)
by Bitbucket 02 Feb '13
by Bitbucket 02 Feb '13
02 Feb '13
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/7950ce95b276/
changeset: 7950ce95b276
user: james_taylor
date: 2013-02-02 22:37:28
summary: jobs: Fix LWR after merge (merged backwards?)
affected #: 1 file
diff -r fa1a29005dcaf5e3146f063f0bdc1fea36a7549c -r 7950ce95b2769f2fb63bfc8a549ee9bc9fdcbed2 lib/galaxy/jobs/runners/lwr.py
--- a/lib/galaxy/jobs/runners/lwr.py
+++ b/lib/galaxy/jobs/runners/lwr.py
@@ -41,227 +41,7 @@
return None
return job_state
- job_config = client.setup()
-
- self.new_working_directory = job_config['working_directory']
- self.new_outputs_directory = job_config['outputs_directory']
- self.remote_path_separator = job_config['path_separator']
-
- self.__initialize_referenced_tool_files()
- self.__upload_tool_files()
- self.__upload_input_files()
- self.__initialize_output_file_renames()
- self.__initialize_config_file_renames()
- self.__rewrite_and_upload_config_files()
- self.__rewrite_command_line()
-
- def __initialize_referenced_tool_files(self):
- pattern = r"(%s%s\S+)" % (self.tool_dir, os.sep)
- referenced_tool_files = []
- referenced_tool_files += re.findall(pattern, self.command_line)
- if self.config_files != None:
- for config_file in self.config_files:
- referenced_tool_files += re.findall(pattern, self.__read(config_file))
- self.referenced_tool_files = referenced_tool_files
-
- def __upload_tool_files(self):
- for referenced_tool_file in self.referenced_tool_files:
- tool_upload_response = self.client.upload_tool_file(referenced_tool_file)
- self.file_renames[referenced_tool_file] = tool_upload_response['path']
-
- def __upload_input_files(self):
- for input_file in self.input_files:
- input_upload_response = self.client.upload_input(input_file)
- self.file_renames[input_file] = input_upload_response['path']
-
- def __initialize_output_file_renames(self):
- for output_file in self.output_files:
- self.file_renames[output_file] = r'%s%s%s' % (self.new_outputs_directory,
- self.remote_path_separator,
- os.path.basename(output_file))
-
- def __initialize_config_file_renames(self):
- for config_file in self.config_files:
- self.file_renames[config_file] = r'%s%s%s' % (self.new_working_directory,
- self.remote_path_separator,
- os.path.basename(config_file))
-
- def __rewrite_paths(self, contents):
- new_contents = contents
- for local_path, remote_path in self.file_renames.iteritems():
- new_contents = new_contents.replace(local_path, remote_path)
- return new_contents
-
- def __rewrite_and_upload_config_files(self):
- for config_file in self.config_files:
- config_contents = self.__read(config_file)
- new_config_contents = self.__rewrite_paths(config_contents)
- self.client.upload_config_file(config_file, new_config_contents)
-
- def __rewrite_command_line(self):
- self.rewritten_command_line = self.__rewrite_paths(self.command_line)
-
- def get_rewritten_command_line(self):
- return self.rewritten_command_line
-
- def __read(self, path):
- input = open(path, "r")
- try:
- return input.read()
- finally:
- input.close()
-
-
-
-class Client(object):
- """
- """
- """
- """
- def __init__(self, remote_host, job_id, private_key=None):
- if not remote_host.endswith("/"):
- remote_host = remote_host + "/"
- ## If we don't have an explicit private_key defined, check for
- ## one embedded in the URL. A URL of the form
- ## https://moo@cow:8913 will try to contact https://cow:8913
- ## with a private key of moo
- private_key_format = "https?://(.*)@.*/?"
- private_key_match= re.match(private_key_format, remote_host)
- if not private_key and private_key_match:
- private_key = private_key_match.group(1)
- remote_host = remote_host.replace("%s@" % private_key, '', 1)
- self.remote_host = remote_host
- self.job_id = job_id
- self.private_key = private_key
-
- def url_open(self, request, data):
- return urllib2.urlopen(request, data)
-
- def __build_url(self, command, args):
- if self.private_key:
- args["private_key"] = self.private_key
- data = urllib.urlencode(args)
- url = self.remote_host + command + "?" + data
- return url
-
- def __raw_execute(self, command, args = {}, data = None):
- url = self.__build_url(command, args)
- request = urllib2.Request(url=url, data=data)
- response = self.url_open(request, data)
- return response
-
- def __raw_execute_and_parse(self, command, args = {}, data = None):
- response = self.__raw_execute(command, args, data)
- return simplejson.loads(response.read())
-
- def __upload_file(self, action, path, contents = None):
- """ """
- input = open(path, 'rb')
- try:
- mmapped_input = mmap.mmap(input.fileno(), 0, access = mmap.ACCESS_READ)
- return self.__upload_contents(action, path, mmapped_input)
- finally:
- input.close()
-
- def __upload_contents(self, action, path, contents):
- name = os.path.basename(path)
- args = {"job_id" : self.job_id, "name" : name}
- return self.__raw_execute_and_parse(action, args, contents)
-
- def upload_tool_file(self, path):
- return self.__upload_file("upload_tool_file", path)
-
- def upload_input(self, path):
- return self.__upload_file("upload_input", path)
-
- def upload_config_file(self, path, contents):
- return self.__upload_contents("upload_config_file", path, contents)
-
- def download_output(self, path):
- """ """
- name = os.path.basename(path)
- response = self.__raw_execute('download_output', {'name' : name,
- "job_id" : self.job_id})
- output = open(path, 'wb')
- try:
- while True:
- buffer = response.read(1024)
- if buffer == "":
- break
- output.write(buffer)
- finally:
- output.close()
-
- def launch(self, command_line):
- """ """
- return self.__raw_execute("launch", {"command_line" : command_line,
- "job_id" : self.job_id})
-
- def kill(self):
- return self.__raw_execute("kill", {"job_id" : self.job_id})
-
- def wait(self):
- """ """
- while True:
- check_complete_response = self.__raw_execute_and_parse("check_complete", {"job_id" : self.job_id })
- complete = check_complete_response["complete"] == "true"
- if complete:
- return check_complete_response
- time.sleep(1)
-
- def clean(self):
- self.__raw_execute("clean", { "job_id" : self.job_id })
-
- def setup(self):
- return self.__raw_execute_and_parse("setup", { "job_id" : self.job_id })
-
-
-
-class LwrJobRunner( BaseJobRunner ):
- """
- Lwr Job Runner
- """
- STOP_SIGNAL = object()
- def __init__( self, app ):
- """Start the job runner with 'nworkers' worker threads"""
- self.app = app
- self.sa_session = app.model.context
-
- # start workers
- self.queue = Queue()
- self.threads = []
- nworkers = app.config.local_job_queue_workers
- log.info( "starting workers" )
- for i in range( nworkers ):
- worker = threading.Thread( name=( "LwrJobRunner.thread-%d" % i ), target=self.run_next )
- worker.setDaemon( True )
- worker.start()
- self.threads.append( worker )
- log.debug( "%d workers ready", nworkers )
-
- def run_next( self ):
- """Run the next job, waiting until one is available if neccesary"""
- while 1:
- job_wrapper = self.queue.get()
- if job_wrapper is self.STOP_SIGNAL:
- return
- try:
- self.run_job( job_wrapper )
- except:
- log.exception( "Uncaught exception running job" )
-
- def determine_lwr_url(self, url):
- lwr_url = url[ len( 'lwr://' ) : ]
- return lwr_url
-
- def get_client_from_wrapper(self, job_wrapper):
- return self.get_client( job_wrapper.get_job_runner_url(), job_wrapper.job_id )
-
- def get_client(self, job_runner, job_id):
- lwr_url = self.determine_lwr_url( job_runner )
- return Client(lwr_url, job_id)
-
- def run_job( self, job_wrapper ):
+ def queue_job(self, job_wrapper):
stderr = stdout = command_line = ''
runner_url = job_wrapper.get_job_runner_url()
@@ -458,4 +238,4 @@
elif job.get_state() == model.Job.states.QUEUED:
# LWR doesn't queue currently, so this indicates galaxy was shutoff while
# job was being staged. Not sure how to recover from that.
- job_state.job_wrapper.fail( "This job was killed when Galaxy was restarted. Please retry the job." )
+ job_state.job_wrapper.fail( "This job was killed when Galaxy was restarted. Please retry the job." )
\ 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