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 2014
- 1 participants
- 192 discussions
2 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/aefe5cf99f92/
Changeset: aefe5cf99f92
Branch: next-stable
User: abretaud
Date: 2014-02-07 11:51:41
Summary: Fix crash when recovering jobs of a removed tool
Affected #: 1 file
diff -r deea87095946ea32d28491b44a120bbc94683150 -r aefe5cf99f92eaa3a401f3f7a9edf9dce4027ed1 lib/galaxy/jobs/handler.py
--- a/lib/galaxy/jobs/handler.py
+++ b/lib/galaxy/jobs/handler.py
@@ -107,7 +107,7 @@
if job.tool_id not in self.app.toolbox.tools_by_id:
log.warning( "(%s) Tool '%s' removed from tool config, unable to recover job" % ( job.id, job.tool_id ) )
JobWrapper( job, self ).fail( 'This tool was disabled before the job completed. Please contact your Galaxy administrator.' )
- if job.job_runner_name is not None and job.job_runner_external_id is None:
+ elif job.job_runner_name is not None and job.job_runner_external_id is None:
# This could happen during certain revisions of Galaxy where a runner URL was persisted before the job was dispatched to a runner.
log.debug( "(%s) Job runner assigned but no external ID recorded, adding to the job handler queue" % job.id )
job.job_runner_name = None
https://bitbucket.org/galaxy/galaxy-central/commits/5e2a4255cf09/
Changeset: 5e2a4255cf09
User: natefoo
Date: 2014-02-07 15:27:14
Summary: merge.
Affected #: 0 files
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: abretaud: Fix crash when recovering jobs of a removed tool
by commits-noreply@bitbucket.org 07 Feb '14
by commits-noreply@bitbucket.org 07 Feb '14
07 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/f6f6529b8ca1/
Changeset: f6f6529b8ca1
User: abretaud
Date: 2014-02-07 11:51:41
Summary: Fix crash when recovering jobs of a removed tool
Affected #: 1 file
diff -r 086e594d372cc58a823f061c3a008a60c0c33472 -r f6f6529b8ca14267bdd3c4ab1fcd2343dffc08dd lib/galaxy/jobs/handler.py
--- a/lib/galaxy/jobs/handler.py
+++ b/lib/galaxy/jobs/handler.py
@@ -107,7 +107,7 @@
if job.tool_id not in self.app.toolbox.tools_by_id:
log.warning( "(%s) Tool '%s' removed from tool config, unable to recover job" % ( job.id, job.tool_id ) )
JobWrapper( job, self ).fail( 'This tool was disabled before the job completed. Please contact your Galaxy administrator.' )
- if job.job_runner_name is not None and job.job_runner_external_id is None:
+ elif job.job_runner_name is not None and job.job_runner_external_id is None:
# This could happen during certain revisions of Galaxy where a runner URL was persisted before the job was dispatched to a runner.
log.debug( "(%s) Job runner assigned but no external ID recorded, adding to the job handler queue" % job.id )
job.job_runner_name = None
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/086e594d372c/
Changeset: 086e594d372c
User: guerler
Date: 2014-02-07 06:06:55
Summary: Merge
Affected #: 1 file
diff -r dc69ee2333c21cdc24d6b5855355fd5a08a8ab53 -r 086e594d372cc58a823f061c3a008a60c0c33472 lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py
+++ b/lib/galaxy/web/framework/helpers/grids.py
@@ -777,7 +777,7 @@
return dict( operation=self.label, id=item.id )
def allowed( self, item ):
if self.condition:
- return self.condition( item )
+ return bool(self.condition( item ))
else:
return 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
commit/galaxy-central: guerler: Grids: Convert ill defined conditions to boolean
by commits-noreply@bitbucket.org 06 Feb '14
by commits-noreply@bitbucket.org 06 Feb '14
06 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/deea87095946/
Changeset: deea87095946
Branch: next-stable
User: guerler
Date: 2014-02-07 06:05:02
Summary: Grids: Convert ill defined conditions to boolean
Affected #: 1 file
diff -r d5ce503c01b7e5520133014d0927b3d062eb9705 -r deea87095946ea32d28491b44a120bbc94683150 lib/galaxy/web/framework/helpers/grids.py
--- a/lib/galaxy/web/framework/helpers/grids.py
+++ b/lib/galaxy/web/framework/helpers/grids.py
@@ -768,7 +768,7 @@
return dict( operation=self.label, id=item.id )
def allowed( self, item ):
if self.condition:
- return self.condition( item )
+ return bool(self.condition( item ))
else:
return 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
commit/galaxy-central: guerler: Add default parameter to quota undelete grid action
by commits-noreply@bitbucket.org 06 Feb '14
by commits-noreply@bitbucket.org 06 Feb '14
06 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/dc69ee2333c2/
Changeset: dc69ee2333c2
User: guerler
Date: 2014-02-07 04:37:40
Summary: Add default parameter to quota undelete grid action
Affected #: 1 file
diff -r 4ede9ee8278e18df75a3d79b7a6b133274b058b6 -r dc69ee2333c21cdc24d6b5855355fd5a08a8ab53 lib/galaxy/actions/admin.py
--- a/lib/galaxy/actions/admin.py
+++ b/lib/galaxy/actions/admin.py
@@ -150,7 +150,7 @@
message += ', '.join( names )
return message
- def _undelete_quota( self, quota, params ):
+ def _undelete_quota( self, quota, params = None):
quotas = util.listify( quota )
names = []
for q in quotas:
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: guerler: Fix undelete action in quota grid
by commits-noreply@bitbucket.org 06 Feb '14
by commits-noreply@bitbucket.org 06 Feb '14
06 Feb '14
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4ede9ee8278e/
Changeset: 4ede9ee8278e
User: guerler
Date: 2014-02-07 04:34:44
Summary: Fix undelete action in quota grid
Affected #: 1 file
diff -r a2739727943039f4c8f74194491396ffa1299267 -r 4ede9ee8278e18df75a3d79b7a6b133274b058b6 lib/galaxy/actions/admin.py
--- a/lib/galaxy/actions/admin.py
+++ b/lib/galaxy/actions/admin.py
@@ -150,7 +150,7 @@
message += ', '.join( names )
return message
- def _undelete_quota( self, quota ):
+ def _undelete_quota( self, quota, params ):
quotas = util.listify( quota )
names = []
for q in quotas:
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/d5ce503c01b7/
Changeset: d5ce503c01b7
Branch: next-stable
User: jeremy goecks
Date: 2014-02-07 03:41:32
Summary: Prioritize gene id over transcript id for interval name in GFF data provider.
Affected #: 1 file
diff -r 54508df431ac564f4ddaf37e3c647f5b18576cbf -r d5ce503c01b7e5520133014d0927b3d062eb9705 lib/galaxy/datatypes/util/gff_util.py
--- a/lib/galaxy/datatypes/util/gff_util.py
+++ b/lib/galaxy/datatypes/util/gff_util.py
@@ -75,7 +75,7 @@
# Preference for name: GTF, GFF3, GFF.
for attr_name in [
# GTF:
- 'transcript_id', 'gene_id',
+ 'gene_id', 'transcript_id',
# GFF3:
'ID', 'id',
# GFF (TODO):
https://bitbucket.org/galaxy/galaxy-central/commits/a27397279430/
Changeset: a27397279430
User: jeremy goecks
Date: 2014-02-07 03:42:29
Summary: Merge next-stable to default
Affected #: 1 file
diff -r d92f65506e1cdc46b29aa0049d04bf2fb4179742 -r a2739727943039f4c8f74194491396ffa1299267 lib/galaxy/datatypes/util/gff_util.py
--- a/lib/galaxy/datatypes/util/gff_util.py
+++ b/lib/galaxy/datatypes/util/gff_util.py
@@ -75,7 +75,7 @@
# Preference for name: GTF, GFF3, GFF.
for attr_name in [
# GTF:
- 'transcript_id', 'gene_id',
+ 'gene_id', 'transcript_id',
# GFF3:
'ID', 'id',
# GFF (TODO):
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/54508df431ac/
Changeset: 54508df431ac
Branch: next-stable
User: jmchilton
Date: 2014-02-07 00:08:36
Summary: Fix documentation on normalize remote user e-mail.
Listed values should be unmodified defaults.
Affected #: 1 file
diff -r 0a9053d624bb0bf253b51b99f07cb600b3fb3490 -r 54508df431ac564f4ddaf37e3c647f5b18576cbf universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -602,9 +602,9 @@
#remote_user_logout_href = None
# If your proxy and/or authentication source does not normalize e-mail
-# addresses or user names being passed to Galaxy - enable the following option
-# to force these to lower case.
-#normalize_remote_user_email = True
+# addresses or user names being passed to Galaxy - set the following option
+# to True to force these to lower case.
+#normalize_remote_user_email = False
# Administrative users - set this to a comma-separated list of valid Galaxy
# users (email addresses). These users will have access to the Admin section
https://bitbucket.org/galaxy/galaxy-central/commits/d92f65506e1c/
Changeset: d92f65506e1c
User: jmchilton
Date: 2014-02-07 00:08:58
Summary: Merge next-stable.
Affected #: 1 file
diff -r d282cb8daecb0748350a6ea69164071854fdaf60 -r d92f65506e1cdc46b29aa0049d04bf2fb4179742 universe_wsgi.ini.sample
--- a/universe_wsgi.ini.sample
+++ b/universe_wsgi.ini.sample
@@ -602,9 +602,9 @@
#remote_user_logout_href = None
# If your proxy and/or authentication source does not normalize e-mail
-# addresses or user names being passed to Galaxy - enable the following option
-# to force these to lower case.
-#normalize_remote_user_email = True
+# addresses or user names being passed to Galaxy - set the following option
+# to True to force these to lower case.
+#normalize_remote_user_email = False
# Administrative users - set this to a comma-separated list of valid Galaxy
# users (email addresses). These users will have access to the Admin section
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/0a9053d624bb/
Changeset: 0a9053d624bb
Branch: next-stable
User: carlfeberhard
Date: 2014-02-06 22:55:05
Summary: Move misc_info trimming to server side (causing UI flash on updates); Correctly handle wide misc info scrolling
Affected #: 5 files
diff -r ca4c4a24bd6a853993fc171394c0d2da75fc8829 -r 0a9053d624bb0bf253b51b99f07cb600b3fb3490 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1799,7 +1799,7 @@
update_time = hda.update_time.isoformat(),
data_type = hda.ext,
genome_build = hda.dbkey,
- misc_info = hda.info,
+ misc_info = hda.info.strip() if isinstance( hda.info, basestring ) else hda.info,
misc_blurb = hda.blurb )
# add tags string list
diff -r ca4c4a24bd6a853993fc171394c0d2da75fc8829 -r 0a9053d624bb0bf253b51b99f07cb600b3fb3490 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -115,13 +115,6 @@
},
// ........................................................................ common queries
- toJSON : function(){
- var json = Backbone.Model.prototype.toJSON.call( this );
- //HACK: this should be done on the server side when setting
- json.misc_info = jQuery.trim( json.misc_info );
- return json;
- },
-
/** Is this hda deleted or purged? */
isDeletedOrPurged : function(){
return ( this.get( 'deleted' ) || this.get( 'purged' ) );
diff -r ca4c4a24bd6a853993fc171394c0d2da75fc8829 -r 0a9053d624bb0bf253b51b99f07cb600b3fb3490 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},toJSON:function(){var h=Backbone.Model.prototype.toJSON.call(this);h.misc_info=jQuery.trim(h.misc_info);return h},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},h)},undelete:function a(h){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},h)},hide:function b(h){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},h)},unhide:function g(h){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},h)},purge:function f(h){if(this.get("purged")){return jQuery.when()}h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set({deleted:true,purged:true})});j.fail(function(o,k,n){var l=_l("Unable to purge dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})});return j},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){j=j.replace(/"/g,"");return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
+define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},h)},undelete:function a(h){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},h)},hide:function b(h){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},h)},unhide:function g(h){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},h)},purge:function f(h){if(this.get("purged")){return jQuery.when()}h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set({deleted:true,purged:true})});j.fail(function(o,k,n){var l=_l("Unable to purge dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})});return j},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){j=j.replace(/"/g,"");return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
diff -r ca4c4a24bd6a853993fc171394c0d2da75fc8829 -r 0a9053d624bb0bf253b51b99f07cb600b3fb3490 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1593,7 +1593,7 @@
.history-panel .dataset .dataset-body .dataset-summary .dataset-datatype,.history-panel .dataset .dataset-body .dataset-summary .dataset-dbkey{display:inline}.history-panel .dataset .dataset-body .dataset-summary .dataset-datatype .value,.history-panel .dataset .dataset-body .dataset-summary .dataset-dbkey .value{font-weight:bold}
.history-panel .dataset .dataset-body .dataset-summary .dataset-datatype .value:after{content:',';font-weight:normal;color:#555}
.history-panel .dataset .dataset-body .dataset-summary .dataset-dbkey:after{content:' ';display:block;margin-bottom:8px}
-.history-panel .dataset .dataset-body .dataset-summary .dataset-info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px}.history-panel .dataset .dataset-body .dataset-summary .dataset-info .value{white-space:pre-line}
+.history-panel .dataset .dataset-body .dataset-summary .dataset-info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto}.history-panel .dataset .dataset-body .dataset-summary .dataset-info .value{white-space:pre-line}
.history-panel .dataset .dataset-body .dataset-summary .job-error-text{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto;white-space:pre}
.history-panel .dataset .dataset-body .dataset-actions .left{display:inline-block;float:left}.history-panel .dataset .dataset-body .dataset-actions .left .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.history-panel .dataset .dataset-body .dataset-actions .left .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
diff -r ca4c4a24bd6a853993fc171394c0d2da75fc8829 -r 0a9053d624bb0bf253b51b99f07cb600b3fb3490 static/style/src/less/history.less
--- a/static/style/src/less/history.less
+++ b/static/style/src/less/history.less
@@ -216,6 +216,7 @@
}
.dataset-info {
.info-section;
+ overflow: auto;
.value {
white-space: pre-line;
}
https://bitbucket.org/galaxy/galaxy-central/commits/d282cb8daecb/
Changeset: d282cb8daecb
User: carlfeberhard
Date: 2014-02-06 22:55:28
Summary: merge
Affected #: 5 files
diff -r c2fbf6fc1213eda63f56611635857e58388e2f0e -r d282cb8daecb0748350a6ea69164071854fdaf60 lib/galaxy/model/__init__.py
--- a/lib/galaxy/model/__init__.py
+++ b/lib/galaxy/model/__init__.py
@@ -1826,7 +1826,7 @@
update_time = hda.update_time.isoformat(),
data_type = hda.ext,
genome_build = hda.dbkey,
- misc_info = hda.info,
+ misc_info = hda.info.strip() if isinstance( hda.info, basestring ) else hda.info,
misc_blurb = hda.blurb )
# add tags string list
diff -r c2fbf6fc1213eda63f56611635857e58388e2f0e -r d282cb8daecb0748350a6ea69164071854fdaf60 static/scripts/mvc/dataset/hda-model.js
--- a/static/scripts/mvc/dataset/hda-model.js
+++ b/static/scripts/mvc/dataset/hda-model.js
@@ -115,13 +115,6 @@
},
// ........................................................................ common queries
- toJSON : function(){
- var json = Backbone.Model.prototype.toJSON.call( this );
- //HACK: this should be done on the server side when setting
- json.misc_info = jQuery.trim( json.misc_info );
- return json;
- },
-
/** Is this hda deleted or purged? */
isDeletedOrPurged : function(){
return ( this.get( 'deleted' ) || this.get( 'purged' ) );
diff -r c2fbf6fc1213eda63f56611635857e58388e2f0e -r d282cb8daecb0748350a6ea69164071854fdaf60 static/scripts/packed/mvc/dataset/hda-model.js
--- a/static/scripts/packed/mvc/dataset/hda-model.js
+++ b/static/scripts/packed/mvc/dataset/hda-model.js
@@ -1,1 +1,1 @@
-define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},toJSON:function(){var h=Backbone.Model.prototype.toJSON.call(this);h.misc_info=jQuery.trim(h.misc_info);return h},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},h)},undelete:function a(h){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},h)},hide:function b(h){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},h)},unhide:function g(h){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},h)},purge:function f(h){if(this.get("purged")){return jQuery.when()}h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set({deleted:true,purged:true})});j.fail(function(o,k,n){var l=_l("Unable to purge dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})});return j},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){j=j.replace(/"/g,"");return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
+define([],function(){var d=Backbone.Model.extend(LoggableMixin).extend({defaults:{history_id:null,model_class:"HistoryDatasetAssociation",hid:0,id:null,name:"(unnamed dataset)",state:"new",deleted:false,visible:true,accessible:true,purged:false,data_type:"",file_size:0,file_ext:"",meta_files:[],misc_blurb:"",misc_info:"",tags:[],annotation:""},urlRoot:galaxy_config.root+"api/histories/",url:function(){return this.urlRoot+this.get("history_id")+"/contents/"+this.get("id")},urls:function(){var i=this.get("id");if(!i){return{}}var h={purge:galaxy_config.root+"datasets/"+i+"/purge_async",display:galaxy_config.root+"datasets/"+i+"/display/?preview=True",edit:galaxy_config.root+"datasets/"+i+"/edit",download:galaxy_config.root+"datasets/"+i+"/display?to_ext="+this.get("file_ext"),report_error:galaxy_config.root+"dataset/errors?id="+i,rerun:galaxy_config.root+"tool_runner/rerun?id="+i,show_params:galaxy_config.root+"datasets/"+i+"/show_params",visualization:galaxy_config.root+"visualization",annotation:{get:galaxy_config.root+"dataset/get_annotation_async?id="+i,set:galaxy_config.root+"dataset/annotate_async?id="+i},meta_download:galaxy_config.root+"dataset/get_metadata_file?hda_id="+i+"&metadata_name="};return h},initialize:function(h){this.log(this+".initialize",this.attributes);this.log("\tparent history_id: "+this.get("history_id"));if(!this.get("accessible")){this.set("state",d.STATES.NOT_VIEWABLE)}this._setUpListeners()},_setUpListeners:function(){this.on("change:state",function(i,h){this.log(this+" has changed state:",i,h);if(this.inReadyState()){this.trigger("state:ready",i,h,this.previous("state"))}})},isDeletedOrPurged:function(){return(this.get("deleted")||this.get("purged"))},isVisible:function(i,j){var h=true;if((!i)&&(this.get("deleted")||this.get("purged"))){h=false}if((!j)&&(!this.get("visible"))){h=false}return h},hidden:function(){return !this.get("visible")},inReadyState:function(){var h=_.contains(d.READY_STATES,this.get("state"));return(this.isDeletedOrPurged()||h)},hasDetails:function(){return _.has(this.attributes,"genome_build")},hasData:function(){return(this.get("file_size")>0)},"delete":function c(h){if(this.get("deleted")){return jQuery.when()}return this.save({deleted:true},h)},undelete:function a(h){if(!this.get("deleted")||this.get("purged")){return jQuery.when()}return this.save({deleted:false},h)},hide:function b(h){if(!this.get("visible")){return jQuery.when()}return this.save({visible:false},h)},unhide:function g(h){if(this.get("visible")){return jQuery.when()}return this.save({visible:true},h)},purge:function f(h){if(this.get("purged")){return jQuery.when()}h=h||{};h.url=galaxy_config.root+"datasets/"+this.get("id")+"/purge_async";var i=this,j=jQuery.ajax(h);j.done(function(m,k,l){i.set({deleted:true,purged:true})});j.fail(function(o,k,n){var l=_l("Unable to purge dataset");var m=("Removal of datasets by users is not allowed in this Galaxy instance");if(o.responseJSON&&o.responseJSON.error){l=o.responseJSON.error}else{if(o.responseText.indexOf(m)!==-1){l=m}}o.responseText=l;i.trigger("error",i,o,h,_l(l),{error:l})});return j},searchAttributes:["name","file_ext","genome_build","misc_blurb","misc_info","annotation","tags"],searchAliases:{title:"name",format:"file_ext",database:"genome_build",blurb:"misc_blurb",description:"misc_blurb",info:"misc_info",tag:"tags"},searchAttribute:function(j,h){var i=this.get(j);if(!h||(i===undefined||i===null)){return false}if(_.isArray(i)){return this._searchArrayAttribute(i,h)}return(i.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)},_searchArrayAttribute:function(i,h){h=h.toLowerCase();return _.any(i,function(j){return(j.toString().toLowerCase().indexOf(h.toLowerCase())!==-1)})},search:function(h){var i=this;return _.filter(this.searchAttributes,function(j){return i.searchAttribute(j,h)})},matches:function(i){var k="=",h=i.split(k);if(h.length>=2){var j=h[0];j=this.searchAliases[j]||j;return this.searchAttribute(j,h[1])}return !!this.search(i).length},matchesAll:function(i){var h=this;i=i.match(/(".*"|\w*=".*"|\S*)/g).filter(function(j){return !!j});return _.all(i,function(j){j=j.replace(/"/g,"");return h.matches(j)})},toString:function(){var h=this.get("id")||"";if(this.get("name")){h=this.get("hid")+' :"'+this.get("name")+'",'+h}return"HDA("+h+")"}});d.STATES={UPLOAD:"upload",QUEUED:"queued",RUNNING:"running",SETTING_METADATA:"setting_metadata",NEW:"new",EMPTY:"empty",OK:"ok",PAUSED:"paused",FAILED_METADATA:"failed_metadata",NOT_VIEWABLE:"noPermission",DISCARDED:"discarded",ERROR:"error"};d.READY_STATES=[d.STATES.NEW,d.STATES.OK,d.STATES.EMPTY,d.STATES.PAUSED,d.STATES.FAILED_METADATA,d.STATES.NOT_VIEWABLE,d.STATES.DISCARDED,d.STATES.ERROR];d.NOT_READY_STATES=[d.STATES.UPLOAD,d.STATES.QUEUED,d.STATES.RUNNING,d.STATES.SETTING_METADATA];var e=Backbone.Collection.extend(LoggableMixin).extend({model:d,urlRoot:galaxy_config.root+"api/histories",url:function(){return this.urlRoot+"/"+this.historyId+"/contents"},initialize:function(i,h){h=h||{};this.historyId=h.historyId},ids:function(){return this.map(function(h){return h.id})},notReady:function(){return this.filter(function(h){return !h.inReadyState()})},running:function(){var h=[];this.each(function(i){if(!i.inReadyState()){h.push(i.get("id"))}});return h},getByHid:function(h){return _.first(this.filter(function(i){return i.get("hid")===h}))},getVisible:function(h,k,j){j=j||[];var i=new e(this.filter(function(l){return l.isVisible(h,k)}));_.each(j,function(l){if(!_.isFunction(l)){return}i=new e(i.filter(l))});return i},haveDetails:function(){return this.all(function(h){return h.hasDetails()})},fetchAllDetails:function(i){i=i||{};var h={details:"all"};i.data=(i.data)?(_.extend(i.data,h)):(h);return this.fetch(i)},ajaxQueue:function(k,j){var i=jQuery.Deferred(),h=this.length,m=[];if(!h){i.resolve([]);return i}var l=this.chain().reverse().map(function(o,n){return function(){var p=k.call(o,j);p.done(function(q){i.notify({curr:n,total:h,response:q,model:o})});p.always(function(q){m.push(q);if(l.length){l.shift()()}else{i.resolve(m)}})}}).value();l.shift()();return i},matches:function(h){return this.filter(function(i){return i.matches(h)})},set:function(j,h){var i=this;j=_.map(j,function(l){var m=i.get(l.id);if(!m){return l}var k=m.toJSON();_.extend(k,l);return k});Backbone.Collection.prototype.set.call(this,j,h)},toString:function(){return(["HDACollection(",[this.historyId,this.length].join(),")"].join(""))}});return{HistoryDatasetAssociation:d,HDACollection:e}});
\ No newline at end of file
diff -r c2fbf6fc1213eda63f56611635857e58388e2f0e -r d282cb8daecb0748350a6ea69164071854fdaf60 static/style/blue/base.css
--- a/static/style/blue/base.css
+++ b/static/style/blue/base.css
@@ -1594,7 +1594,7 @@
.history-panel .dataset .dataset-body .dataset-summary .dataset-datatype,.history-panel .dataset .dataset-body .dataset-summary .dataset-dbkey{display:inline}.history-panel .dataset .dataset-body .dataset-summary .dataset-datatype .value,.history-panel .dataset .dataset-body .dataset-summary .dataset-dbkey .value{font-weight:bold}
.history-panel .dataset .dataset-body .dataset-summary .dataset-datatype .value:after{content:',';font-weight:normal;color:#555}
.history-panel .dataset .dataset-body .dataset-summary .dataset-dbkey:after{content:' ';display:block;margin-bottom:8px}
-.history-panel .dataset .dataset-body .dataset-summary .dataset-info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px}.history-panel .dataset .dataset-body .dataset-summary .dataset-info .value{white-space:pre-line}
+.history-panel .dataset .dataset-body .dataset-summary .dataset-info{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto}.history-panel .dataset .dataset-body .dataset-summary .dataset-info .value{white-space:pre-line}
.history-panel .dataset .dataset-body .dataset-summary .job-error-text{border-radius:3px;border:1px solid rgba(153,153,153,0.30000000000000004);padding:4px;overflow:auto;white-space:pre}
.history-panel .dataset .dataset-body .dataset-actions .left{display:inline-block;float:left}.history-panel .dataset .dataset-body .dataset-actions .left .icon-btn:not(:last-child){margin:0px;border-radius:0px;border-right:none}
.history-panel .dataset .dataset-body .dataset-actions .left .icon-btn:first-child{margin-right:0px;border-top-left-radius:3px;border-bottom-left-radius:3px}
diff -r c2fbf6fc1213eda63f56611635857e58388e2f0e -r d282cb8daecb0748350a6ea69164071854fdaf60 static/style/src/less/history.less
--- a/static/style/src/less/history.less
+++ b/static/style/src/less/history.less
@@ -216,6 +216,7 @@
}
.dataset-info {
.info-section;
+ overflow: auto;
.value {
white-space: pre-line;
}
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
4 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/2b1b1b0ac9f8/
Changeset: 2b1b1b0ac9f8
User: jmchilton
Date: 2014-02-05 22:20:31
Summary: Create replacement dict creation in worfklow controllers once.
Both recalculated this per step, brings the actual run code closer together - which will make subsequent changeset diff cleaner.
Affected #: 2 files
diff -r 99beec4c3a338249ab661a7edc3e30ee115486e9 -r 2b1b1b0ac9f8a2f6a452bb41807baac9d3c827ca lib/galaxy/webapps/galaxy/api/workflows.py
--- a/lib/galaxy/webapps/galaxy/api/workflows.py
+++ b/lib/galaxy/webapps/galaxy/api/workflows.py
@@ -267,6 +267,9 @@
outputs = util.odict.odict()
rval['history'] = trans.security.encode_id(history.id)
rval['outputs'] = []
+
+ replacement_dict = payload.get('replacement_params', {})
+
for step in workflow.steps:
job = None
if step.type == 'tool' or step.type is None:
@@ -281,11 +284,9 @@
job, out_data = tool.execute( trans, step.state.inputs, history=history)
outputs[ step.id ] = out_data
- # Do post-job actions.
- replacement_params = payload.get('replacement_params', {})
for pja in step.post_job_actions:
if pja.action_type in ActionBox.immediate_actions:
- ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict=replacement_params)
+ ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict=replacement_dict)
else:
job.add_post_job_action(pja)
diff -r 99beec4c3a338249ab661a7edc3e30ee115486e9 -r 2b1b1b0ac9f8a2f6a452bb41807baac9d3c827ca lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -1373,6 +1373,13 @@
workflow_invocation = model.WorkflowInvocation()
workflow_invocation.workflow = workflow
outputs = odict()
+
+ # Build replacement dict for this workflow execution.
+ replacement_dict = {}
+ for k, v in kwargs.iteritems():
+ if k.startswith('wf_parm|'):
+ replacement_dict[k[8:]] = v
+
for i, step in enumerate( workflow.steps ):
# Execute module
job = None
@@ -1401,10 +1408,6 @@
# Create new PJA associations with the created job, to be run on completion.
# PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
# Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
- replacement_dict = {}
- for k, v in kwargs.iteritems():
- if k.startswith('wf_parm|'):
- replacement_dict[k[8:]] = v
for pja in step.post_job_actions:
if pja.action_type in ActionBox.immediate_actions:
ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict)
https://bitbucket.org/galaxy/galaxy-central/commits/b8f7b6c1daf3/
Changeset: b8f7b6c1daf3
User: jmchilton
Date: 2014-02-05 22:20:31
Summary: Refactor out common code for running workflows.
This probably results in some bug fixes for the API workflow running - such as running tools with multiple=true data input parameters.
Affected #: 3 files
diff -r 2b1b1b0ac9f8a2f6a452bb41807baac9d3c827ca -r b8f7b6c1daf3834b71dfc1fb73b3d8004b924211 lib/galaxy/webapps/galaxy/api/workflows.py
--- a/lib/galaxy/webapps/galaxy/api/workflows.py
+++ b/lib/galaxy/webapps/galaxy/api/workflows.py
@@ -9,11 +9,10 @@
from galaxy import exceptions
from galaxy import util
from galaxy import web
-from galaxy.tools.parameters import visit_input_values, DataToolParameter
from galaxy.web import _future_expose_api as expose_api
from galaxy.web.base.controller import BaseAPIController, url_for, UsesStoredWorkflowMixin
from galaxy.workflow.modules import module_factory
-from galaxy.jobs.actions.post import ActionBox
+from galaxy.workflow.run import invoke
log = logging.getLogger(__name__)
@@ -237,6 +236,14 @@
rval = {}
for step in workflow.steps:
step_errors = None
+ input_connections_by_name = {}
+ for conn in step.input_connections:
+ input_name = conn.input_name
+ if not input_name in input_connections_by_name:
+ input_connections_by_name[input_name] = []
+ input_connections_by_name[input_name].append(conn)
+ step.input_connections_by_name = input_connections_by_name
+
if step.type == 'tool' or step.type is None:
step.module = module_factory.from_workflow_step( trans, step )
# Check for missing parameters
@@ -259,50 +266,30 @@
return "Workflow cannot be run because an expected input step '%s' has no input dataset." % step.id
step.module = module_factory.from_workflow_step( trans, step )
step.state = step.module.get_runtime_state()
- step.input_connections_by_name = dict( ( conn.input_name, conn ) for conn in step.input_connections )
# Run each step, connecting outputs to inputs
- workflow_invocation = self.app.model.WorkflowInvocation()
- workflow_invocation.workflow = workflow
outputs = util.odict.odict()
rval['history'] = trans.security.encode_id(history.id)
rval['outputs'] = []
replacement_dict = payload.get('replacement_params', {})
+ outputs = invoke(
+ trans=trans,
+ workflow=workflow,
+ target_history=history,
+ replacement_dict=replacement_dict,
+ ds_map=ds_map,
+ )
+ trans.sa_session.flush()
+
+ # Build legacy output - should probably include more information from
+ # outputs.
for step in workflow.steps:
- job = None
if step.type == 'tool' or step.type is None:
- tool = self.app.toolbox.get_tool( step.tool_id )
+ for v in outputs[ step.id ].itervalues():
+ rval[ 'outputs' ].append( trans.security.encode_id( v.id ) )
- def callback( input, value, prefixed_name, prefixed_label ):
- if isinstance( input, DataToolParameter ):
- if prefixed_name in step.input_connections_by_name:
- conn = step.input_connections_by_name[ prefixed_name ]
- return outputs[ conn.output_step.id ][ conn.output_name ]
- visit_input_values( tool.inputs, step.state.inputs, callback )
- job, out_data = tool.execute( trans, step.state.inputs, history=history)
- outputs[ step.id ] = out_data
-
- for pja in step.post_job_actions:
- if pja.action_type in ActionBox.immediate_actions:
- ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict=replacement_dict)
- else:
- job.add_post_job_action(pja)
-
- for v in out_data.itervalues():
- rval['outputs'].append(trans.security.encode_id(v.id))
- else:
- #This is an input step. Use the dataset inputs from ds_map.
- job, out_data = step.module.execute( trans, step.state)
- outputs[step.id] = out_data
- outputs[step.id]['output'] = ds_map[str(step.id)]['hda']
- workflow_invocation_step = self.app.model.WorkflowInvocationStep()
- workflow_invocation_step.workflow_invocation = workflow_invocation
- workflow_invocation_step.workflow_step = step
- workflow_invocation_step.job = job
- trans.sa_session.add( workflow_invocation )
- trans.sa_session.flush()
return rval
@web.expose_api
diff -r 2b1b1b0ac9f8a2f6a452bb41807baac9d3c827ca -r b8f7b6c1daf3834b71dfc1fb73b3d8004b924211 lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -18,7 +18,6 @@
from galaxy import util
from galaxy import web
from galaxy.datatypes.data import Data
-from galaxy.jobs.actions.post import ActionBox
from galaxy.model.item_attrs import UsesItemRatings
from galaxy.model.mapping import desc
from galaxy.tools.parameters import visit_input_values
@@ -33,6 +32,7 @@
from galaxy.web.framework.helpers import grids, time_ago
from galaxy.web.framework.helpers import to_unicode
from galaxy.workflow.modules import module_factory
+from galaxy.workflow.run import invoke
class StoredWorkflowListGrid( grids.Grid ):
@@ -1369,10 +1369,6 @@
target_history = new_history
else:
target_history = trans.get_history()
- # Run each step, connecting outputs to inputs
- workflow_invocation = model.WorkflowInvocation()
- workflow_invocation.workflow = workflow
- outputs = odict()
# Build replacement dict for this workflow execution.
replacement_dict = {}
@@ -1380,54 +1376,14 @@
if k.startswith('wf_parm|'):
replacement_dict[k[8:]] = v
- for i, step in enumerate( workflow.steps ):
- # Execute module
- job = None
- if step.type == 'tool' or step.type is None:
- tool = trans.app.toolbox.get_tool( step.tool_id )
+ outputs = invoke(
+ trans=trans,
+ workflow=workflow,
+ target_history=target_history,
+ replacement_dict=replacement_dict,
+ copy_inputs_to_history=new_history is not None
+ )
- # Connect up
- def callback( input, value, prefixed_name, prefixed_label ):
- replacement = None
- if isinstance( input, DataToolParameter ):
- if prefixed_name in step.input_connections_by_name:
- conn = step.input_connections_by_name[ prefixed_name ]
- if input.multiple:
- replacement = [outputs[ c.output_step.id ][ c.output_name ] for c in conn]
- else:
- replacement = outputs[ conn[0].output_step.id ][ conn[0].output_name ]
- return replacement
- try:
- # Replace DummyDatasets with historydatasetassociations
- visit_input_values( tool.inputs, step.state.inputs, callback )
- except KeyError, k:
- error( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
- # Execute it
- job, out_data = tool.execute( trans, step.state.inputs, history=target_history)
- outputs[ step.id ] = out_data
- # Create new PJA associations with the created job, to be run on completion.
- # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
- # Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
- for pja in step.post_job_actions:
- if pja.action_type in ActionBox.immediate_actions:
- ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict)
- else:
- job.add_post_job_action(pja)
- else:
- job, out_data = step.module.execute( trans, step.state )
- outputs[ step.id ] = out_data
- if new_history:
- for input_dataset_hda in out_data.values():
- new_hda = input_dataset_hda.copy( copy_children=True )
- new_history.add_dataset(new_hda)
- outputs[ step.id ]['input_ds_copy'] = new_hda
- # Record invocation
- workflow_invocation_step = model.WorkflowInvocationStep()
- workflow_invocation_step.workflow_invocation = workflow_invocation
- workflow_invocation_step.workflow_step = step
- workflow_invocation_step.job = job
- # All jobs ran successfully, so we can save now
- trans.sa_session.add( workflow_invocation )
invocations.append({'outputs': outputs,
'new_history': new_history})
trans.sa_session.flush()
diff -r 2b1b1b0ac9f8a2f6a452bb41807baac9d3c827ca -r b8f7b6c1daf3834b71dfc1fb73b3d8004b924211 lib/galaxy/workflow/run.py
--- /dev/null
+++ b/lib/galaxy/workflow/run.py
@@ -0,0 +1,108 @@
+from galaxy import model
+from galaxy import exceptions
+
+from galaxy.jobs.actions.post import ActionBox
+
+from galaxy.tools.parameters.basic import DataToolParameter
+from galaxy.tools.parameters import visit_input_values
+from galaxy.util.odict import odict
+
+
+def invoke( trans, workflow, target_history, replacement_dict, copy_inputs_to_history=False, ds_map={} ):
+ """ Run the supplied workflow in the supplied target_history.
+ """
+ return WorkflowInvoker(
+ trans,
+ workflow,
+ target_history,
+ replacement_dict,
+ copy_inputs_to_history=copy_inputs_to_history,
+ ds_map=ds_map,
+ ).invoke()
+
+
+class WorkflowInvoker( object ):
+
+ def __init__( self, trans, workflow, target_history, replacement_dict, copy_inputs_to_history, ds_map ):
+ self.trans = trans
+ self.workflow = workflow
+ self.target_history = target_history
+ self.replacement_dict = replacement_dict
+ self.copy_inputs_to_history = copy_inputs_to_history
+ self.ds_map = ds_map
+
+ self.outputs = odict()
+
+ def invoke( self ):
+ workflow_invocation = model.WorkflowInvocation()
+ workflow_invocation.workflow = self.workflow
+
+ for step in self.workflow.steps:
+ job = None
+ job = self._invoke_step( step )
+ # Record invocation
+ workflow_invocation_step = model.WorkflowInvocationStep()
+ workflow_invocation_step.workflow_invocation = workflow_invocation
+ workflow_invocation_step.workflow_step = step
+ workflow_invocation_step.job = job
+
+ # All jobs ran successfully, so we can save now
+ self.trans.sa_session.add( workflow_invocation )
+
+ # Not flushing in here, because web controller may create multiple
+ # invokations.
+ return self.outputs
+
+ def _invoke_step( self, step ):
+ trans = self.trans
+ outputs = self.outputs
+ target_history = self.target_history
+ replacement_dict = self.replacement_dict
+
+ if step.type == 'tool' or step.type is None:
+ tool = trans.app.toolbox.get_tool( step.tool_id )
+
+ # Connect up
+ def callback( input, value, prefixed_name, prefixed_label ):
+ replacement = None
+ if isinstance( input, DataToolParameter ):
+ if prefixed_name in step.input_connections_by_name:
+ conn = step.input_connections_by_name[ prefixed_name ]
+ if input.multiple:
+ replacement = [outputs[ c.output_step.id ][ c.output_name ] for c in conn]
+ else:
+ replacement = outputs[ conn[0].output_step.id ][ conn[0].output_name ]
+ return replacement
+ try:
+ # Replace DummyDatasets with historydatasetassociations
+ visit_input_values( tool.inputs, step.state.inputs, callback )
+ except KeyError, k:
+ raise exceptions.MessageException( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
+ # Execute it
+ job, out_data = tool.execute( trans, step.state.inputs, history=target_history)
+ outputs[ step.id ] = out_data
+ # Create new PJA associations with the created job, to be run on completion.
+ # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
+ # Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
+ for pja in step.post_job_actions:
+ if pja.action_type in ActionBox.immediate_actions:
+ ActionBox.execute( trans.app, trans.sa_session, pja, job, replacement_dict )
+ else:
+ job.add_post_job_action(pja)
+ else:
+ job, out_data = step.module.execute( trans, step.state )
+ outputs[ step.id ] = out_data
+
+ # Web controller may set copy_inputs_to_history, API controller always sets
+ # ds_map.
+ if self.copy_inputs_to_history:
+ for input_dataset_hda in out_data.values():
+ new_hda = input_dataset_hda.copy( copy_children=True )
+ target_history.add_dataset(new_hda)
+ outputs[ step.id ]['input_ds_copy'] = new_hda
+ if self.ds_map:
+ outputs[step.id]['output'] = self.ds_map[ str( step.id ) ][ 'hda' ]
+
+ return job
+
+__all__ = [ invoke ]
https://bitbucket.org/galaxy/galaxy-central/commits/f263f13f1e6c/
Changeset: f263f13f1e6c
User: jmchilton
Date: 2014-02-05 22:20:31
Summary: Refactor 2 paths of workflow step invokation into helper functions.
Affected #: 1 file
diff -r b8f7b6c1daf3834b71dfc1fb73b3d8004b924211 -r f263f13f1e6c52de6f9b2990a9fe60cf1eef714d lib/galaxy/workflow/run.py
--- a/lib/galaxy/workflow/run.py
+++ b/lib/galaxy/workflow/run.py
@@ -54,55 +54,66 @@
return self.outputs
def _invoke_step( self, step ):
- trans = self.trans
- outputs = self.outputs
- target_history = self.target_history
- replacement_dict = self.replacement_dict
-
if step.type == 'tool' or step.type is None:
- tool = trans.app.toolbox.get_tool( step.tool_id )
-
- # Connect up
- def callback( input, value, prefixed_name, prefixed_label ):
- replacement = None
- if isinstance( input, DataToolParameter ):
- if prefixed_name in step.input_connections_by_name:
- conn = step.input_connections_by_name[ prefixed_name ]
- if input.multiple:
- replacement = [outputs[ c.output_step.id ][ c.output_name ] for c in conn]
- else:
- replacement = outputs[ conn[0].output_step.id ][ conn[0].output_name ]
- return replacement
- try:
- # Replace DummyDatasets with historydatasetassociations
- visit_input_values( tool.inputs, step.state.inputs, callback )
- except KeyError, k:
- raise exceptions.MessageException( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
- # Execute it
- job, out_data = tool.execute( trans, step.state.inputs, history=target_history)
- outputs[ step.id ] = out_data
- # Create new PJA associations with the created job, to be run on completion.
- # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
- # Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
- for pja in step.post_job_actions:
- if pja.action_type in ActionBox.immediate_actions:
- ActionBox.execute( trans.app, trans.sa_session, pja, job, replacement_dict )
- else:
- job.add_post_job_action(pja)
+ job = self._execute_tool_step( step )
else:
- job, out_data = step.module.execute( trans, step.state )
- outputs[ step.id ] = out_data
-
- # Web controller may set copy_inputs_to_history, API controller always sets
- # ds_map.
- if self.copy_inputs_to_history:
- for input_dataset_hda in out_data.values():
- new_hda = input_dataset_hda.copy( copy_children=True )
- target_history.add_dataset(new_hda)
- outputs[ step.id ]['input_ds_copy'] = new_hda
- if self.ds_map:
- outputs[step.id]['output'] = self.ds_map[ str( step.id ) ][ 'hda' ]
+ job = self._execute_input_step( step )
return job
+ def _execute_tool_step( self, step ):
+ trans = self.trans
+ outputs = self.outputs
+ replacement_dict = self.replacement_dict
+
+ tool = trans.app.toolbox.get_tool( step.tool_id )
+
+ # Connect up
+ def callback( input, value, prefixed_name, prefixed_label ):
+ replacement = None
+ if isinstance( input, DataToolParameter ):
+ if prefixed_name in step.input_connections_by_name:
+ conn = step.input_connections_by_name[ prefixed_name ]
+ if input.multiple:
+ replacement = [outputs[ c.output_step.id ][ c.output_name ] for c in conn]
+ else:
+ replacement = outputs[ conn[0].output_step.id ][ conn[0].output_name ]
+ return replacement
+ try:
+ # Replace DummyDatasets with historydatasetassociations
+ visit_input_values( tool.inputs, step.state.inputs, callback )
+ except KeyError, k:
+ raise exceptions.MessageException( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
+ # Execute it
+ job, out_data = tool.execute( trans, step.state.inputs, history=self.target_history)
+ outputs[ step.id ] = out_data
+ # Create new PJA associations with the created job, to be run on completion.
+ # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
+ # Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
+ for pja in step.post_job_actions:
+ if pja.action_type in ActionBox.immediate_actions:
+ ActionBox.execute( trans.app, trans.sa_session, pja, job, replacement_dict )
+ else:
+ job.add_post_job_action(pja)
+
+ return job
+
+ def _execute_input_step( self, step ):
+ trans = self.trans
+ outputs = self.outputs
+
+ job, out_data = step.module.execute( trans, step.state )
+ outputs[ step.id ] = out_data
+
+ # Web controller may set copy_inputs_to_history, API controller always sets
+ # ds_map.
+ if self.copy_inputs_to_history:
+ for input_dataset_hda in out_data.values():
+ new_hda = input_dataset_hda.copy( copy_children=True )
+ self.target_history.add_dataset(new_hda)
+ outputs[ step.id ]['input_ds_copy'] = new_hda
+ if self.ds_map:
+ outputs[step.id]['output'] = self.ds_map[ str( step.id ) ][ 'hda' ]
+ return job
+
__all__ = [ invoke ]
https://bitbucket.org/galaxy/galaxy-central/commits/c2fbf6fc1213/
Changeset: c2fbf6fc1213
User: jmchilton
Date: 2014-02-06 22:00:51
Summary: Merged in jmchilton/galaxy-central-fork-1 (pull request #320)
Refactor common workflow run functionality out of controllers
Affected #: 3 files
diff -r b2206f4ca10f8cec7c37f43f80fc24f0b93b420b -r c2fbf6fc1213eda63f56611635857e58388e2f0e lib/galaxy/webapps/galaxy/api/workflows.py
--- a/lib/galaxy/webapps/galaxy/api/workflows.py
+++ b/lib/galaxy/webapps/galaxy/api/workflows.py
@@ -9,11 +9,10 @@
from galaxy import exceptions
from galaxy import util
from galaxy import web
-from galaxy.tools.parameters import visit_input_values, DataToolParameter
from galaxy.web import _future_expose_api as expose_api
from galaxy.web.base.controller import BaseAPIController, url_for, UsesStoredWorkflowMixin
from galaxy.workflow.modules import module_factory
-from galaxy.jobs.actions.post import ActionBox
+from galaxy.workflow.run import invoke
log = logging.getLogger(__name__)
@@ -237,6 +236,14 @@
rval = {}
for step in workflow.steps:
step_errors = None
+ input_connections_by_name = {}
+ for conn in step.input_connections:
+ input_name = conn.input_name
+ if not input_name in input_connections_by_name:
+ input_connections_by_name[input_name] = []
+ input_connections_by_name[input_name].append(conn)
+ step.input_connections_by_name = input_connections_by_name
+
if step.type == 'tool' or step.type is None:
step.module = module_factory.from_workflow_step( trans, step )
# Check for missing parameters
@@ -259,49 +266,30 @@
return "Workflow cannot be run because an expected input step '%s' has no input dataset." % step.id
step.module = module_factory.from_workflow_step( trans, step )
step.state = step.module.get_runtime_state()
- step.input_connections_by_name = dict( ( conn.input_name, conn ) for conn in step.input_connections )
# Run each step, connecting outputs to inputs
- workflow_invocation = self.app.model.WorkflowInvocation()
- workflow_invocation.workflow = workflow
outputs = util.odict.odict()
rval['history'] = trans.security.encode_id(history.id)
rval['outputs'] = []
+
+ replacement_dict = payload.get('replacement_params', {})
+
+ outputs = invoke(
+ trans=trans,
+ workflow=workflow,
+ target_history=history,
+ replacement_dict=replacement_dict,
+ ds_map=ds_map,
+ )
+ trans.sa_session.flush()
+
+ # Build legacy output - should probably include more information from
+ # outputs.
for step in workflow.steps:
- job = None
if step.type == 'tool' or step.type is None:
- tool = self.app.toolbox.get_tool( step.tool_id )
+ for v in outputs[ step.id ].itervalues():
+ rval[ 'outputs' ].append( trans.security.encode_id( v.id ) )
- def callback( input, value, prefixed_name, prefixed_label ):
- if isinstance( input, DataToolParameter ):
- if prefixed_name in step.input_connections_by_name:
- conn = step.input_connections_by_name[ prefixed_name ]
- return outputs[ conn.output_step.id ][ conn.output_name ]
- visit_input_values( tool.inputs, step.state.inputs, callback )
- job, out_data = tool.execute( trans, step.state.inputs, history=history)
- outputs[ step.id ] = out_data
-
- # Do post-job actions.
- replacement_params = payload.get('replacement_params', {})
- for pja in step.post_job_actions:
- if pja.action_type in ActionBox.immediate_actions:
- ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict=replacement_params)
- else:
- job.add_post_job_action(pja)
-
- for v in out_data.itervalues():
- rval['outputs'].append(trans.security.encode_id(v.id))
- else:
- #This is an input step. Use the dataset inputs from ds_map.
- job, out_data = step.module.execute( trans, step.state)
- outputs[step.id] = out_data
- outputs[step.id]['output'] = ds_map[str(step.id)]['hda']
- workflow_invocation_step = self.app.model.WorkflowInvocationStep()
- workflow_invocation_step.workflow_invocation = workflow_invocation
- workflow_invocation_step.workflow_step = step
- workflow_invocation_step.job = job
- trans.sa_session.add( workflow_invocation )
- trans.sa_session.flush()
return rval
@web.expose_api
diff -r b2206f4ca10f8cec7c37f43f80fc24f0b93b420b -r c2fbf6fc1213eda63f56611635857e58388e2f0e lib/galaxy/webapps/galaxy/controllers/workflow.py
--- a/lib/galaxy/webapps/galaxy/controllers/workflow.py
+++ b/lib/galaxy/webapps/galaxy/controllers/workflow.py
@@ -18,7 +18,6 @@
from galaxy import util
from galaxy import web
from galaxy.datatypes.data import Data
-from galaxy.jobs.actions.post import ActionBox
from galaxy.model.item_attrs import UsesItemRatings
from galaxy.model.mapping import desc
from galaxy.tools.parameters import visit_input_values
@@ -33,6 +32,7 @@
from galaxy.web.framework.helpers import grids, time_ago
from galaxy.web.framework.helpers import to_unicode
from galaxy.workflow.modules import module_factory
+from galaxy.workflow.run import invoke
class StoredWorkflowListGrid( grids.Grid ):
@@ -1369,62 +1369,21 @@
target_history = new_history
else:
target_history = trans.get_history()
- # Run each step, connecting outputs to inputs
- workflow_invocation = model.WorkflowInvocation()
- workflow_invocation.workflow = workflow
- outputs = odict()
- for i, step in enumerate( workflow.steps ):
- # Execute module
- job = None
- if step.type == 'tool' or step.type is None:
- tool = trans.app.toolbox.get_tool( step.tool_id )
- # Connect up
- def callback( input, value, prefixed_name, prefixed_label ):
- replacement = None
- if isinstance( input, DataToolParameter ):
- if prefixed_name in step.input_connections_by_name:
- conn = step.input_connections_by_name[ prefixed_name ]
- if input.multiple:
- replacement = [outputs[ c.output_step.id ][ c.output_name ] for c in conn]
- else:
- replacement = outputs[ conn[0].output_step.id ][ conn[0].output_name ]
- return replacement
- try:
- # Replace DummyDatasets with historydatasetassociations
- visit_input_values( tool.inputs, step.state.inputs, callback )
- except KeyError, k:
- error( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
- # Execute it
- job, out_data = tool.execute( trans, step.state.inputs, history=target_history)
- outputs[ step.id ] = out_data
- # Create new PJA associations with the created job, to be run on completion.
- # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
- # Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
- replacement_dict = {}
- for k, v in kwargs.iteritems():
- if k.startswith('wf_parm|'):
- replacement_dict[k[8:]] = v
- for pja in step.post_job_actions:
- if pja.action_type in ActionBox.immediate_actions:
- ActionBox.execute(trans.app, trans.sa_session, pja, job, replacement_dict)
- else:
- job.add_post_job_action(pja)
- else:
- job, out_data = step.module.execute( trans, step.state )
- outputs[ step.id ] = out_data
- if new_history:
- for input_dataset_hda in out_data.values():
- new_hda = input_dataset_hda.copy( copy_children=True )
- new_history.add_dataset(new_hda)
- outputs[ step.id ]['input_ds_copy'] = new_hda
- # Record invocation
- workflow_invocation_step = model.WorkflowInvocationStep()
- workflow_invocation_step.workflow_invocation = workflow_invocation
- workflow_invocation_step.workflow_step = step
- workflow_invocation_step.job = job
- # All jobs ran successfully, so we can save now
- trans.sa_session.add( workflow_invocation )
+ # Build replacement dict for this workflow execution.
+ replacement_dict = {}
+ for k, v in kwargs.iteritems():
+ if k.startswith('wf_parm|'):
+ replacement_dict[k[8:]] = v
+
+ outputs = invoke(
+ trans=trans,
+ workflow=workflow,
+ target_history=target_history,
+ replacement_dict=replacement_dict,
+ copy_inputs_to_history=new_history is not None
+ )
+
invocations.append({'outputs': outputs,
'new_history': new_history})
trans.sa_session.flush()
diff -r b2206f4ca10f8cec7c37f43f80fc24f0b93b420b -r c2fbf6fc1213eda63f56611635857e58388e2f0e lib/galaxy/workflow/run.py
--- /dev/null
+++ b/lib/galaxy/workflow/run.py
@@ -0,0 +1,119 @@
+from galaxy import model
+from galaxy import exceptions
+
+from galaxy.jobs.actions.post import ActionBox
+
+from galaxy.tools.parameters.basic import DataToolParameter
+from galaxy.tools.parameters import visit_input_values
+from galaxy.util.odict import odict
+
+
+def invoke( trans, workflow, target_history, replacement_dict, copy_inputs_to_history=False, ds_map={} ):
+ """ Run the supplied workflow in the supplied target_history.
+ """
+ return WorkflowInvoker(
+ trans,
+ workflow,
+ target_history,
+ replacement_dict,
+ copy_inputs_to_history=copy_inputs_to_history,
+ ds_map=ds_map,
+ ).invoke()
+
+
+class WorkflowInvoker( object ):
+
+ def __init__( self, trans, workflow, target_history, replacement_dict, copy_inputs_to_history, ds_map ):
+ self.trans = trans
+ self.workflow = workflow
+ self.target_history = target_history
+ self.replacement_dict = replacement_dict
+ self.copy_inputs_to_history = copy_inputs_to_history
+ self.ds_map = ds_map
+
+ self.outputs = odict()
+
+ def invoke( self ):
+ workflow_invocation = model.WorkflowInvocation()
+ workflow_invocation.workflow = self.workflow
+
+ for step in self.workflow.steps:
+ job = None
+ job = self._invoke_step( step )
+ # Record invocation
+ workflow_invocation_step = model.WorkflowInvocationStep()
+ workflow_invocation_step.workflow_invocation = workflow_invocation
+ workflow_invocation_step.workflow_step = step
+ workflow_invocation_step.job = job
+
+ # All jobs ran successfully, so we can save now
+ self.trans.sa_session.add( workflow_invocation )
+
+ # Not flushing in here, because web controller may create multiple
+ # invokations.
+ return self.outputs
+
+ def _invoke_step( self, step ):
+ if step.type == 'tool' or step.type is None:
+ job = self._execute_tool_step( step )
+ else:
+ job = self._execute_input_step( step )
+
+ return job
+
+ def _execute_tool_step( self, step ):
+ trans = self.trans
+ outputs = self.outputs
+ replacement_dict = self.replacement_dict
+
+ tool = trans.app.toolbox.get_tool( step.tool_id )
+
+ # Connect up
+ def callback( input, value, prefixed_name, prefixed_label ):
+ replacement = None
+ if isinstance( input, DataToolParameter ):
+ if prefixed_name in step.input_connections_by_name:
+ conn = step.input_connections_by_name[ prefixed_name ]
+ if input.multiple:
+ replacement = [outputs[ c.output_step.id ][ c.output_name ] for c in conn]
+ else:
+ replacement = outputs[ conn[0].output_step.id ][ conn[0].output_name ]
+ return replacement
+ try:
+ # Replace DummyDatasets with historydatasetassociations
+ visit_input_values( tool.inputs, step.state.inputs, callback )
+ except KeyError, k:
+ raise exceptions.MessageException( "Error due to input mapping of '%s' in '%s'. A common cause of this is conditional outputs that cannot be determined until runtime, please review your workflow." % (tool.name, k.message))
+ # Execute it
+ job, out_data = tool.execute( trans, step.state.inputs, history=self.target_history)
+ outputs[ step.id ] = out_data
+ # Create new PJA associations with the created job, to be run on completion.
+ # PJA Parameter Replacement (only applies to immediate actions-- rename specifically, for now)
+ # Pass along replacement dict with the execution of the PJA so we don't have to modify the object.
+ for pja in step.post_job_actions:
+ if pja.action_type in ActionBox.immediate_actions:
+ ActionBox.execute( trans.app, trans.sa_session, pja, job, replacement_dict )
+ else:
+ job.add_post_job_action(pja)
+
+ return job
+
+ def _execute_input_step( self, step ):
+ trans = self.trans
+ outputs = self.outputs
+
+ job, out_data = step.module.execute( trans, step.state )
+ outputs[ step.id ] = out_data
+
+ # Web controller may set copy_inputs_to_history, API controller always sets
+ # ds_map.
+ if self.copy_inputs_to_history:
+ for input_dataset_hda in out_data.values():
+ new_hda = input_dataset_hda.copy( copy_children=True )
+ self.target_history.add_dataset(new_hda)
+ outputs[ step.id ]['input_ds_copy'] = new_hda
+ if self.ds_map:
+ outputs[step.id]['output'] = self.ds_map[ str( step.id ) ][ 'hda' ]
+ return job
+
+__all__ = [ invoke ]
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