1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/738839e77188/
Changeset: 738839e77188
User: dan
Date: 2013-12-10 16:54:51
Summary: Fix for using GALAXY_TEST_DB_TEMPLATE with htTp not specified in all lower case.
Affected #: 1 file
diff -r 340344bf17e72072f268d21f420585e76af3ce70 -r 738839e77188c2f42d956998f38daea619f3c35e scripts/functional_tests.py
--- a/scripts/functional_tests.py
+++ b/scripts/functional_tests.py
@@ -182,7 +182,7 @@
if os.path.exists( source ):
shutil.copy( source, db_path )
assert os.path.exists( db_path )
- elif source.startswith("http"):
+ elif source.lower().startswith( "http" ):
urllib.urlretrieve( source, db_path )
else:
raise Exception( "Failed to copy database template from source %s" % source )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/340344bf17e7/
Changeset: 340344bf17e7
User: carlfeberhard
Date: 2013-12-10 16:46:20
Summary: History panel: pass link target to create_scatterplot_action_fn
Affected #: 2 files
diff -r 3bf805dfa14eb150e90c1aab565eb22b8ab3d9b8 -r 340344bf17e72072f268d21f420585e76af3ce70 static/scripts/mvc/dataset/hda-edit.js
--- a/static/scripts/mvc/dataset/hda-edit.js
+++ b/static/scripts/mvc/dataset/hda-edit.js
@@ -190,13 +190,14 @@
// map a function to each visualization in the icon's attributes
// create a popupmenu from that map
+ var hdaView = this;
/** @inner */
function create_viz_action( visualization ) {
switch( visualization ){
case 'trackster':
return create_trackster_action_fn( visualization_url, params, dbkey );
case 'scatterplot':
- return create_scatterplot_action_fn( visualization_url, params );
+ return create_scatterplot_action_fn( visualization_url, params, hdaView.linkTarget );
default:
return function(){// add widget
Galaxy.frame.add(
@@ -368,15 +369,13 @@
* @returns function that loads the scatterplot
*/
//TODO: should be imported from scatterplot.js OR abstracted to 'load this in the galaxy_main frame'
-function create_scatterplot_action_fn( url, params ){
+function create_scatterplot_action_fn( url, params, target ){
action = function() {
- // add widget
- Galaxy.frame.add(
- {
+ Galaxy.frame.add({
title : "Scatterplot",
type : "url",
content : url + '/scatterplot?' + $.param(params),
- target : this.linkTarget,
+ target : target,
scratchbook : true
});
diff -r 3bf805dfa14eb150e90c1aab565eb22b8ab3d9b8 -r 340344bf17e72072f268d21f420585e76af3ce70 static/scripts/packed/mvc/dataset/hda-edit.js
--- a/static/scripts/packed/mvc/dataset/hda-edit.js
+++ b/static/scripts/packed/mvc/dataset/hda-edit.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),l=this.urls.visualization,j={},m={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){m.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});function k(n){switch(n){case"trackster":return b(l,m,i);case"scatterplot":return e(l,m);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:l+"/"+n+"?"+$.param(m)})}}}if(g.length===1){h.attr("data-original-title",g[0]);h.click(k(g[0]))}else{_.each(g,function(o){var n=o.charAt(0).toUpperCase()+o.slice(1);j[_l(n)]=k(o)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))})},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="'+this.linkTarget+'">?</a>').attr("href",this.urls.edit))}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(h),target:this.linkTarget,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
+define(["mvc/dataset/hda-model","mvc/dataset/hda-base"],function(d,a){var f=a.HDABaseView.extend(LoggableMixin).extend({initialize:function(g){a.HDABaseView.prototype.initialize.call(this,g);this.hasUser=g.hasUser;this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton,this._render_rerunButton]},_render_titleButtons:function(){return a.HDABaseView.prototype._render_titleButtons.call(this).concat([this._render_editButton(),this._render_deleteButton()])},_render_editButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var i=this.model.get("purged"),g=this.model.get("deleted"),h={title:_l("Edit Attributes"),href:this.urls.edit,target:this.linkTarget,classes:"dataset-edit"};if(g||i){h.disabled=true;if(i){h.title=_l("Cannot edit attributes of datasets removed from disk")}else{if(g){h.title=_l("Undelete dataset to edit attributes")}}}else{if(this.model.get("state")===d.HistoryDatasetAssociation.STATES.UPLOAD){h.disabled=true;h.title=_l("This dataset must finish uploading before it can be edited")}}h.faIcon="fa-pencil";return faIconButton(h)},_render_deleteButton:function(){if((this.model.get("state")===d.HistoryDatasetAssociation.STATES.NEW)||(this.model.get("state")===d.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(!this.model.get("accessible"))){return null}var g=this,h={title:_l("Delete"),classes:"dataset-delete",onclick:function(){g.$el.find(".icon-btn.dataset-delete").trigger("mouseout");g.model["delete"]()}};if(this.model.get("deleted")||this.model.get("purged")){h={title:_l("Dataset is already deleted"),disabled:true}}h.faIcon="fa-times";return faIconButton(h)},_render_errButton:function(){if(this.model.get("state")!==d.HistoryDatasetAssociation.STATES.ERROR){return null}return faIconButton({title:_l("View or report this error"),href:this.urls.report_error,target:this.linkTarget,faIcon:"fa-bug"})},_render_rerunButton:function(){return faIconButton({title:_l("Run this job again"),href:this.urls.rerun,target:this.linkTarget,faIcon:"fa-refresh"})},_render_visualizationsButton:function(){var g=this.model.get("visualizations");if((!this.hasUser)||(!this.model.hasData())||(_.isEmpty(g))){return null}if(_.isObject(g[0])){return this._render_visualizationsFrameworkButton(g)}if(!this.urls.visualization){return null}var i=this.model.get("dbkey"),m=this.urls.visualization,j={},n={dataset_id:this.model.get("id"),hda_ldda:"hda"};if(i){n.dbkey=i}var h=faIconButton({title:_l("Visualize"),href:this.urls.visualization,faIcon:"fa-bar-chart-o"});var l=this;function k(o){switch(o){case"trackster":return b(m,n,i);case"scatterplot":return e(m,n,l.linkTarget);default:return function(){Galaxy.frame.add({title:"Visualization",type:"url",content:m+"/"+o+"?"+$.param(n)})}}}if(g.length===1){h.attr("data-original-title",g[0]);h.click(k(g[0]))}else{_.each(g,function(p){var o=p.charAt(0).toUpperCase()+p.slice(1);j[_l(o)]=k(p)});make_popupmenu(h,j)}return h},_render_visualizationsFrameworkButton:function(g){if(!(this.model.hasData())||!(g&&!_.isEmpty(g))){return null}var i=faIconButton({title:_l("Visualize"),faIcon:"fa-bar-chart-o"});i.addClass("visualize-icon");if(_.keys(g).length===1){i.attr("title",_.keys(g)[0]);i.attr("href",_.values(g)[0])}else{var j=[];_.each(g,function(k){j.push(k)});var h=new PopupMenu(i,j)}return i},_render_body_failed_metadata:function(){var h=$("<a/>").attr({href:this.urls.edit,target:this.linkTarget}).text(_l("set it manually or retry auto-detection")),g=$("<span/>").text(". "+_l("You may be able to")+" ").append(h),i=a.HDABaseView.prototype._render_body_failed_metadata.call(this);i.find(".warningmessagesmall strong").append(g);return i},_render_body_error:function(){var g=a.HDABaseView.prototype._render_body_error.call(this);g.find(".dataset-actions .left").prepend(this._render_errButton());return g},_render_body_ok:function(){var g=a.HDABaseView.prototype._render_body_ok.call(this);if(this.model.isDeletedOrPurged()){return g}this.makeDbkeyEditLink(g);if(this.hasUser){g.find(".dataset-actions .left").append(this._render_visualizationsButton());this._renderTags(g);this._renderAnnotation(g)}return g},_renderTags:function(g){this.tagsEditor=new TagsEditor({model:this.model,el:g.find(".tags-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset tags"),classes:"dataset-tag-btn",faIcon:"fa-tags"}).appendTo(g.find(".dataset-actions .right"))})},_renderAnnotation:function(g){this.annotationEditor=new AnnotationEditor({model:this.model,el:g.find(".annotation-display"),onshowFirstTime:function(){this.render()},$activator:faIconButton({title:_l("Edit dataset annotation"),classes:"dataset-annotate-btn",faIcon:"fa-comment"}).appendTo(g.find(".dataset-actions .right"))})},makeDbkeyEditLink:function(g){if(this.model.get("metadata_dbkey")==="?"&&!this.model.isDeletedOrPurged()){g.find(".dataset-dbkey .value").replaceWith($('<a target="'+this.linkTarget+'">?</a>').attr("href",this.urls.edit))}},events:_.extend(_.clone(a.HDABaseView.prototype.events),{"click .dataset-undelete":function(g){this.model.undelete();return false},"click .dataset-unhide":function(g){this.model.unhide();return false},"click .dataset-purge":"confirmPurge"}),confirmPurge:function c(g){this.model.purge();return false},toString:function(){var g=(this.model)?(this.model+""):("(no model)");return"HDAView("+g+")"}});function e(g,i,h){action=function(){Galaxy.frame.add({title:"Scatterplot",type:"url",content:g+"/scatterplot?"+$.param(i),target:h,scratchbook:true});$("div.popmenu-wrapper").remove();return false};return action}function b(g,i,h){return function(){var j={};if(h){j["f-dbkey"]=h}$.ajax({url:g+"/list_tracks?"+$.param(j),dataType:"html",error:function(){alert(("Could not add this dataset to browser")+".")},success:function(k){var l=window.parent;l.Galaxy.modal.show({title:"View Data in a New or Saved Visualization",buttons:{Cancel:function(){l.Galaxy.modal.hide()},"View in saved visualization":function(){l.Galaxy.modal.show({title:"Add Data to Saved Visualization",body:k,buttons:{Cancel:function(){l.Galaxy.modal.hide()},"Add to visualization":function(){$(l.document).find("input[name=id]:checked").each(function(){l.Galaxy.modal.hide();var m=$(this).val();i.id=m;l.Galaxy.frame.add({title:"Trackster",type:"url",content:g+"/trackster?"+$.param(i),scratchbook:true})})}}})},"View in new visualization":function(){l.Galaxy.modal.hide();var m=g+"/trackster?"+$.param(i);l.Galaxy.frame.add({title:"Trackster",type:"url",content:m,scratchbook:true})}}})}});return false}}return{HDAEditView:f}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3bf805dfa14e/
Changeset: 3bf805dfa14e
User: greg
Date: 2013-12-10 16:38:45
Summary: Always return a list for the value of the tool_test_results column in the Tool Shed's repository_metadata table.
Affected #: 1 file
diff -r 6c8d175a4c241a192962bf40f578b223bf3299f1 -r 3bf805dfa14eb150e90c1aab565eb22b8ab3d9b8 test/install_and_test_tool_shed_repositories/functional_tests.py
--- a/test/install_and_test_tool_shed_repositories/functional_tests.py
+++ b/test/install_and_test_tool_shed_repositories/functional_tests.py
@@ -49,6 +49,7 @@
from datetime import datetime
from galaxy.app import UniverseApplication
from galaxy.util import asbool
+from galaxy.util import listify
from galaxy.util import unicodify
from galaxy.util.json import from_json_string
from galaxy.util.json import to_json_string
@@ -465,7 +466,9 @@
repository_metadata, error_message = json_from_url( api_url )
if error_message:
return None, error_message
- tool_test_results = repository_metadata.get( 'tool_test_results', [] )
+ # The tool_test_results used to be stored as a single dictionary rather than a list, but we currently
+ # return a list.
+ tool_test_results = listify( repository_metadata.get( 'tool_test_results', [] ) )
return tool_test_results, error_message
def get_webapp_global_conf():
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/98eff59e4510/
Changeset: 98eff59e4510
User: carlfeberhard
Date: 2013-12-10 16:00:22
Summary: Masthead: move Galaxy.currUser out of ready function (bootstrap)
Affected #: 1 file
diff -r 4fbe7028d3a9104d0ad313cadb766ec64c877295 -r 98eff59e4510c3a3137de7e5df38120bcda9be7f templates/webapps/galaxy/galaxy.masthead.mako
--- a/templates/webapps/galaxy/galaxy.masthead.mako
+++ b/templates/webapps/galaxy/galaxy.masthead.mako
@@ -68,6 +68,11 @@
## load the frame manager
<script type="text/javascript">
+ if( !window.Galaxy ){
+ window.Galaxy = {};
+ }
+ ## fetch the current user data from trans
+ Galaxy.currUser = new User(${ h.to_json_string( get_user_json(), indent=2 ) });
## load additional style sheet
if (window != window.top)
@@ -85,9 +90,6 @@
## get configuration
var masthead_config = ${ h.to_json_string( masthead_config ) };
- ## set up the quota meter (And fetch the current user data from trans)
- Galaxy.currUser = new User(masthead_config.user.json);
-
## load global galaxy objects
Galaxy.masthead = new mod_masthead.GalaxyMasthead(masthead_config);
Galaxy.modal = new mod_modal.GalaxyModal();
@@ -102,6 +104,7 @@
## add upload plugin
##Galaxy.upload = new mod_upload.GalaxyUpload(masthead_config);
+ ## set up the quota meter (And fetch the current user data from trans)
## add quota meter to masthead
Galaxy.quotaMeter = new UserQuotaMeter({
model : Galaxy.currUser,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/4fbe7028d3a9/
Changeset: 4fbe7028d3a9
User: greg
Date: 2013-12-10 15:48:50
Summary: Further restrict when the tool_functionally_correct column will be set to False in the Tool Shed's repository_metadata table.
Affected #: 1 file
diff -r f7d0ed0413ea4f8ff4473b7bc97a49e8fb16b8f5 -r 4fbe7028d3a9104d0ad313cadb766ec64c877295 lib/tool_shed/scripts/check_repositories_for_functional_tests.py
--- a/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
+++ b/lib/tool_shed/scripts/check_repositories_for_functional_tests.py
@@ -282,11 +282,10 @@
# In the install and test script, this behavior is slightly different, since we do want to always run functional
# tests on the most recent downloadable changeset revision.
if should_set_do_not_test_flag( app, repository, changeset_revision, testable_revision ):
- print "# Setting do_not_test to True on revision %s of repository %s because it is missing test components" % \
- ( changeset_revision, name )
+ print "# Setting do_not_test to True on revision %s of %s owned by %s because it is missing test components" % \
+ ( changeset_revision, name, owner )
print "# and it is not the latest downloadable revision."
repository_metadata.do_not_test = True
- repository_metadata.tools_functionally_correct = False
if not testable_revision:
# Even though some tools may be missing test components, it may be possible to test other tools. Since the
# install and test framework filters out repositories marked as missing test components, we'll set it only if
@@ -294,6 +293,9 @@
print '# Setting missing_test_components to True for revision %s of %s owned by %s because all tools are missing test components.' % \
( changeset_revision, name, owner )
repository_metadata.missing_test_components = True
+ print "# Setting tools_functionally_correct to False on revision %s of %s owned by %s because it is missing test components" % \
+ ( changeset_revision, name, owner )
+ repository_metadata.tools_functionally_correct = False
tool_test_results_dict[ 'missing_test_components' ] = missing_test_components
# Store only the configured number of test runs.
num_tool_test_results_saved = int( app.config.num_tool_test_results_saved )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
5 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/3f05316ce541/
Changeset: 3f05316ce541
Branch: fretn/fix-for-two-issues-the-secondary-user-1385478183593
User: fretn
Date: 2013-11-26 16:04:57
Summary: Fix for two issues
- The secondary user groups are not assigned to the user
- When the json file is on a NFS share where root access is not allowed this script fails with a "error: JobTemplate file (/path/to/jsonfile) doesn't exist" error
To fix the first we have to go through all the groups of the user in set_user(uid) and assign them with os.setgroups()
The second one is fixed by removing the check if the json file exists in the function validate_paramters and move that check to a new function which is called after set_user(uid). Because its possible that the new user (the one in uid) has access to that file but root hasn't
Affected #: 1 file
diff -r 359a822b2e5da89973ce042942a9a10dd2b229e1 -r 3f05316ce541248c18ebc0700e1bb64e77e23e79 scripts/drmaa_external_runner.py
--- a/scripts/drmaa_external_runner.py
+++ b/scripts/drmaa_external_runner.py
@@ -53,6 +53,14 @@
sys.stderr.write("error: User name (%s) is not valid.\n" % username)
exit(1)
return pw.pw_uid
+
+def json_file_exists(json_filename):
+ if not os.path.exists(json_filename):
+ sys.stderr.write("error: JobTemplate file (%s) doesn't exist\n" % ( json_filename ) )
+ exit(1)
+
+ return True
+
def validate_paramters():
if len(sys.argv)<3:
sys.stderr.write("usage: %s [USER-ID] [JSON-JOB-TEMPLATE-FILE]\n" % sys.argv[0])
@@ -70,10 +78,6 @@
sys.stderr.write("error: userid must not be 0 (root)\n")
exit(1)
- if not os.path.exists(json_filename):
- sys.stderr.write("error: JobTemplate file (%s) doesn't exist\n" % ( json_filename ) )
- exit(1)
-
return uid, json_filename
def set_user(uid):
@@ -81,8 +85,15 @@
# Get user's default group and set it to current process to make sure file permissions are inherited correctly
# Solves issue with permission denied for JSON files
gid = pwd.getpwuid(uid).pw_gid
+ import grp
os.setgid(gid)
+ # Added lines to assure read/write permission for groups
+ user = pwd.getpwuid(uid).pw_name
+ groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
+
+ os.setgroups(groups)
os.setuid(uid)
+
except OSError, e:
if e.errno == errno.EPERM:
sys.stderr.write("error: setuid(%d) failed: permission denied. Did you setup 'sudo' correctly for this script?\n" % uid )
@@ -97,7 +108,8 @@
exit(1)
def main():
userid, json_filename = validate_paramters()
- set_user(userid)
+ set_user(userid)
+ json_file_exists(json_filename)
s = drmaa.Session()
s.initialize()
jt = s.createJobTemplate()
https://bitbucket.org/galaxy/galaxy-central/commits/9368ca5624c8/
Changeset: 9368ca5624c8
User: jmchilton
Date: 2013-12-10 15:29:16
Summary: Merge pull request #267.
Affected #: 1 file
diff -r 292d68d7e6a101b4a8df06a9f09aa3d16403e14e -r 9368ca5624c8d7a2a84a6007e3a53a317a3e6a91 scripts/drmaa_external_runner.py
--- a/scripts/drmaa_external_runner.py
+++ b/scripts/drmaa_external_runner.py
@@ -53,6 +53,14 @@
sys.stderr.write("error: User name (%s) is not valid.\n" % username)
exit(1)
return pw.pw_uid
+
+def json_file_exists(json_filename):
+ if not os.path.exists(json_filename):
+ sys.stderr.write("error: JobTemplate file (%s) doesn't exist\n" % ( json_filename ) )
+ exit(1)
+
+ return True
+
def validate_paramters():
if len(sys.argv)<3:
sys.stderr.write("usage: %s [USER-ID] [JSON-JOB-TEMPLATE-FILE]\n" % sys.argv[0])
@@ -70,10 +78,6 @@
sys.stderr.write("error: userid must not be 0 (root)\n")
exit(1)
- if not os.path.exists(json_filename):
- sys.stderr.write("error: JobTemplate file (%s) doesn't exist\n" % ( json_filename ) )
- exit(1)
-
return uid, json_filename
def set_user(uid):
@@ -81,8 +85,15 @@
# Get user's default group and set it to current process to make sure file permissions are inherited correctly
# Solves issue with permission denied for JSON files
gid = pwd.getpwuid(uid).pw_gid
+ import grp
os.setgid(gid)
+ # Added lines to assure read/write permission for groups
+ user = pwd.getpwuid(uid).pw_name
+ groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
+
+ os.setgroups(groups)
os.setuid(uid)
+
except OSError, e:
if e.errno == errno.EPERM:
sys.stderr.write("error: setuid(%d) failed: permission denied. Did you setup 'sudo' correctly for this script?\n" % uid )
@@ -97,7 +108,8 @@
exit(1)
def main():
userid, json_filename = validate_paramters()
- set_user(userid)
+ set_user(userid)
+ json_file_exists(json_filename)
s = drmaa.Session()
s.initialize()
jt = s.createJobTemplate()
https://bitbucket.org/galaxy/galaxy-central/commits/14487c8ad2ac/
Changeset: 14487c8ad2ac
User: jmchilton
Date: 2013-12-10 15:02:17
Summary: PEP-8 fixes for scripts/drmaa_external_runner.py.
Affected #: 1 file
diff -r 9368ca5624c8d7a2a84a6007e3a53a317a3e6a91 -r 14487c8ad2ac94bc51e62b3bb1c8ad5b37c8bc89 scripts/drmaa_external_runner.py
--- a/scripts/drmaa_external_runner.py
+++ b/scripts/drmaa_external_runner.py
@@ -14,7 +14,7 @@
#import simplejson as json
#import drmaa
new_path = [ os.path.join( os.getcwd(), "lib" ) ]
-new_path.extend( sys.path[1:] ) # remove scripts/ from the path
+new_path.extend( sys.path[1:] ) # remove scripts/ from the path
sys.path = new_path
from galaxy import eggs
@@ -25,27 +25,30 @@
import drmaa
DRMAA_jobTemplate_attributes = [ 'args', 'remoteCommand', 'outputPath', 'errorPath', 'nativeSpecification',
- 'jobName','email','project' ]
+ 'jobName', 'email', 'project' ]
+
def load_job_template_from_file(jt, filename):
- f = open(filename,'r')
+ f = open(filename, 'r')
data = json.load(f)
for attr in DRMAA_jobTemplate_attributes:
if attr in data:
setattr(jt, attr, data[attr])
+
def valid_numeric_userid(userid):
try:
uid = int(userid)
except:
return False
try:
- pw = pwd.getpwuid(uid)
+ pwd.getpwuid(uid)
except KeyError:
sys.stderr.write("error: User-ID (%d) is not valid.\n" % uid)
exit(1)
return True
+
def get_user_id_by_name(username):
try:
pw = pwd.getpwnam(username)
@@ -53,16 +56,19 @@
sys.stderr.write("error: User name (%s) is not valid.\n" % username)
exit(1)
return pw.pw_uid
-
+
+
def json_file_exists(json_filename):
if not os.path.exists(json_filename):
sys.stderr.write("error: JobTemplate file (%s) doesn't exist\n" % ( json_filename ) )
exit(1)
-
+
return True
+
def validate_paramters():
- if len(sys.argv)<3:
+
+ if len(sys.argv) < 3:
sys.stderr.write("usage: %s [USER-ID] [JSON-JOB-TEMPLATE-FILE]\n" % sys.argv[0])
exit(1)
@@ -80,6 +86,7 @@
return uid, json_filename
+
def set_user(uid):
try:
# Get user's default group and set it to current process to make sure file permissions are inherited correctly
@@ -96,16 +103,20 @@
except OSError, e:
if e.errno == errno.EPERM:
- sys.stderr.write("error: setuid(%d) failed: permission denied. Did you setup 'sudo' correctly for this script?\n" % uid )
+ sys.stderr.write( "error: setuid(%d) failed: permission denied. Did you setup 'sudo' correctly for this script?\n" % uid )
exit(1)
else:
pass
- if os.getuid()==0:
- sys.stderr.write("error: UID is 0 (root) after changing user. This script should not be run as root. aborting.\n" )
+
+ if os.getuid() == 0:
+ sys.stderr.write( "error: UID is 0 (root) after changing user. This script should not be run as root. aborting.\n" )
exit(1)
- if os.geteuid()==0:
- sys.stderr.write("error: EUID is 0 (root) after changing user. This script should not be run as root. aborting.\n" )
+
+ if os.geteuid() == 0:
+ sys.stderr.write( "error: EUID is 0 (root) after changing user. This script should not be run as root. aborting.\n" )
exit(1)
+
+
def main():
userid, json_filename = validate_paramters()
set_user(userid)
@@ -124,4 +135,3 @@
if __name__ == "__main__":
main()
-
https://bitbucket.org/galaxy/galaxy-central/commits/f7d0ed0413ea/
Changeset: f7d0ed0413ea
User: jmchilton
Date: 2013-12-10 15:26:22
Summary: Rework contribution from pull request #267 to be optional.
To obtain the behavior (assigning all groups for a given user for each job submission) change the property - 'drmaa_external_runjob_script' from 'scripts/drmaa_external_runner.py' to 'scripts/drmaa_external_runner.py --assign_all_groups'.
Making this optional because my concern is that this could be an expensive operation on some clusters.
Affected #: 2 files
diff -r 14487c8ad2ac94bc51e62b3bb1c8ad5b37c8bc89 -r f7d0ed0413ea4f8ff4473b7bc97a49e8fb16b8f5 lib/galaxy/jobs/runners/drmaa.py
--- a/lib/galaxy/jobs/runners/drmaa.py
+++ b/lib/galaxy/jobs/runners/drmaa.py
@@ -302,7 +302,15 @@
The external script will be run with sudo, and will setuid() to the specified user.
Effectively, will QSUB as a different user (then the one used by Galaxy).
"""
- p = subprocess.Popen([ '/usr/bin/sudo', '-E', self.external_runJob_script, str(username), jobtemplate_filename ],
+ script_parts = self.external_runJob_script.split()
+ script = script_parts[0]
+ command = [ '/usr/bin/sudo', '-E', script]
+ for script_argument in script_parts[1:]:
+ command.append(script_argument)
+
+ command.extend( [ str(username), jobtemplate_filename ] )
+ log.info("Running command %s" % command)
+ p = subprocess.Popen(command,
shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
(stdoutdata, stderrdata) = p.communicate()
exitcode = p.returncode
diff -r 14487c8ad2ac94bc51e62b3bb1c8ad5b37c8bc89 -r f7d0ed0413ea4f8ff4473b7bc97a49e8fb16b8f5 scripts/drmaa_external_runner.py
--- a/scripts/drmaa_external_runner.py
+++ b/scripts/drmaa_external_runner.py
@@ -67,6 +67,10 @@
def validate_paramters():
+ assign_all_groups = False
+ if "--assign_all_groups" in sys.argv:
+ assign_all_groups = True
+ sys.argv.remove("--assign_all_groups")
if len(sys.argv) < 3:
sys.stderr.write("usage: %s [USER-ID] [JSON-JOB-TEMPLATE-FILE]\n" % sys.argv[0])
@@ -84,21 +88,22 @@
sys.stderr.write("error: userid must not be 0 (root)\n")
exit(1)
- return uid, json_filename
+ return uid, json_filename, assign_all_groups
-def set_user(uid):
+def set_user(uid, assign_all_groups):
try:
# Get user's default group and set it to current process to make sure file permissions are inherited correctly
# Solves issue with permission denied for JSON files
gid = pwd.getpwuid(uid).pw_gid
import grp
os.setgid(gid)
- # Added lines to assure read/write permission for groups
- user = pwd.getpwuid(uid).pw_name
- groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
+ if assign_all_groups:
+ # Added lines to assure read/write permission for groups
+ user = pwd.getpwuid(uid).pw_name
+ groups = [g.gr_gid for g in grp.getgrall() if user in g.gr_mem]
- os.setgroups(groups)
+ os.setgroups(groups)
os.setuid(uid)
except OSError, e:
@@ -118,8 +123,8 @@
def main():
- userid, json_filename = validate_paramters()
- set_user(userid)
+ userid, json_filename, assign_all_groups = validate_paramters()
+ set_user(userid, assign_all_groups)
json_file_exists(json_filename)
s = drmaa.Session()
s.initialize()
https://bitbucket.org/galaxy/galaxy-central/commits/b8efe5c848f0/
Changeset: b8efe5c848f0
Branch: fretn/fix-for-two-issues-the-secondary-user-1385478183593
User: jmchilton
Date: 2013-12-10 15:36:12
Summary: Close branch.
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 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/142006369d22/
Changeset: 142006369d22
User: carlfeberhard
Date: 2013-12-09 21:46:59
Summary: History panel: allow HDAs to be draggable
Affected #: 2 files
diff -r 44c9f3a305ccbf31b7338d966a62f06f94e10a07 -r 142006369d22f60a12c4573a782bbb30c58efbb9 static/scripts/mvc/dataset/hda-base.js
--- a/static/scripts/mvc/dataset/hda-base.js
+++ b/static/scripts/mvc/dataset/hda-base.js
@@ -47,6 +47,9 @@
this.selected = attributes.selected || false;
/** is the body of this hda view expanded/not. */
this.expanded = attributes.expanded || false;
+ /** is the body of this hda view expanded/not. */
+ this.draggable = attributes.draggable || false;
+
this._setUpListeners();
},
@@ -118,6 +121,7 @@
if( this.model.inReadyState() ){
this.trigger( 'rendered:ready', view );
}
+ if( this.draggable ){ this.draggableOn(); }
next();
});
return this;
@@ -399,7 +403,11 @@
'click .dataset-title-bar' : 'toggleBodyVisibility',
'keydown .dataset-title-bar' : 'toggleBodyVisibility',
// toggle selected state
- 'click .dataset-selector' : 'toggleSelect'
+ 'click .dataset-selector' : 'toggleSelect',
+
+ // dragging - don't work, originalEvent === null
+ //'dragstart .dataset-title-bar' : 'dragStartHandler',
+ //'dragend .dataset-title-bar' : 'dragEndHandler'
},
/** Show or hide the body/details of an HDA.
@@ -573,6 +581,48 @@
}
},
+ // ......................................................................... drag/drop
+ draggableOn : function(){
+ this.draggable = true;
+ //TODO: I have no idea why this doesn't work with the events hash or jq.on()...
+ //this.$el.find( '.dataset-title-bar' )
+ // .attr( 'draggable', true )
+ // .bind( 'dragstart', this.dragStartHandler, false )
+ // .bind( 'dragend', this.dragEndHandler, false );
+ this.dragStartHandler = _.bind( this._dragStartHandler, this );
+ this.dragEndHandler = _.bind( this._dragEndHandler, this );
+
+ var titleBar = this.$el.find( '.dataset-title-bar' ).attr( 'draggable', true ).get(0);
+ titleBar.addEventListener( 'dragstart', this.dragStartHandler, false );
+ titleBar.addEventListener( 'dragend', this.dragEndHandler, false );
+ },
+ draggableOff : function(){
+ this.draggable = false;
+ var titleBar = this.$el.find( '.dataset-title-bar' ).attr( 'draggable', false ).get(0);
+ titleBar.removeEventListener( 'dragstart', this.dragStartHandler, false );
+ titleBar.removeEventListener( 'dragend', this.dragEndHandler, false );
+ },
+ toggleDraggable : function(){
+ if( this.draggable ){
+ this.draggableOff();
+ } else {
+ this.draggableOn();
+ }
+ },
+ _dragStartHandler : function( event ){
+ //console.debug( 'dragStartHandler:', this, event, arguments )
+ this.trigger( 'dragstart', this );
+ event.dataTransfer.effectAllowed = 'move';
+ //TODO: all except IE: should be 'application/json', IE: must be 'text'
+ event.dataTransfer.setData( 'text', JSON.stringify( this.model.toJSON() ) );
+ return false;
+ },
+ _dragEndHandler : function( event ){
+ this.trigger( 'dragend', this );
+ //console.debug( 'dragEndHandler:', event )
+ return false;
+ },
+
// ......................................................................... removal
/** Remove this view's html from the DOM and remove all event listeners.
* @param {Function} callback an optional function called when removal is done
diff -r 44c9f3a305ccbf31b7338d966a62f06f94e10a07 -r 142006369d22f60a12c4573a782bbb30c58efbb9 static/scripts/packed/mvc/dataset/hda-base.js
--- a/static/scripts/packed/mvc/dataset/hda-base.js
+++ b/static/scripts/packed/mvc/dataset/hda-base.js
@@ -1,1 +1,1 @@
-define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.selectable=c.selectable||false;this.selected=c.selected||false;this.expanded=c.expanded||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());if(this.selectable){this.showSelector(0)}f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:"galaxy_main",classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}this._setUpBehaviors(d);if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect"},toggleBodyVisibility:function(f,d){var c=32,e=13;if((f.type==="keydown")&&!(f.keyCode===c||f.keyCode===e)){return true}var g=this.$el.find(".dataset-body");d=(d===undefined)?(!g.is(":visible")):(d);if(d){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var c=this;function d(){c.$el.children(".dataset-body").replaceWith(c._render_body());c.$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},showSelector:function(e){if(this.$el.find(".dataset-selector").css("display")!=="none"){return}e=(e!==undefined)?(e):(this.fxSpeed);if(this.selected){this.select(null,true)}var d=this,c=32;if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeOut(e,f)});this.$el.queue("fx",function(f){$(this).find(".dataset-selector").show().animate({width:c},e,f);$(this).find(".dataset-title-bar").animate({"margin-left":c},e,f);d.selectable=true;d.trigger("selectable",true,d)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:c});this.$el.find(".dataset-title-bar").show().css({"margin-left":c});d.selectable=true;d.trigger("selectable",true,d)}},hideSelector:function(c){c=(c!==undefined)?(c):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(c){this.$el.queue("fx",function(d){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},c,function(){$(this).hide();d()})});this.$el.queue("fx",function(d){$(this).find(".dataset-primary-actions").fadeIn(c,d)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(c){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(c)}else{this.hideSelector(c)}},select:function(c){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(c){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(c){if(this.selected){this.deselect(c)}else{this.select(c)}},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
+define(["mvc/dataset/hda-model"],function(b){var a=Backbone.View.extend(LoggableMixin).extend({tagName:"div",className:"dataset hda history-panel-hda",id:function(){return"hda-"+this.model.get("id")},fxSpeed:"fast",initialize:function(c){if(c.logger){this.logger=this.model.logger=c.logger}this.log(this+".initialize:",c);this.defaultPrimaryActionButtonRenderers=[this._render_showParamsButton];this.selectable=c.selectable||false;this.selected=c.selected||false;this.expanded=c.expanded||false;this.draggable=c.draggable||false;this._setUpListeners()},_setUpListeners:function(){this.model.on("change",function(d,c){if(this.model.changedAttributes().state&&this.model.inReadyState()&&this.expanded&&!this.model.hasDetails()){this.model.fetch()}else{this.render()}},this)},render:function(e){e=(e===undefined)?(true):(e);var c=this;this.$el.find("[title]").tooltip("destroy");this.urls=this.model.urls();var d=$(a.templates.skeleton(this.model.toJSON()));d.find(".dataset-primary-actions").append(this._render_titleButtons());d.children(".dataset-body").replaceWith(this._render_body());this._setUpBehaviors(d);if(e){$(c).queue(function(f){this.$el.fadeOut(c.fxSpeed,f)})}$(c).queue(function(f){this.$el.empty().attr("class",c.className).addClass("state-"+c.model.get("state")).append(d.children());if(this.selectable){this.showSelector(0)}f()});if(e){$(c).queue(function(f){this.$el.fadeIn(c.fxSpeed,f)})}$(c).queue(function(f){this.trigger("rendered",c);if(this.model.inReadyState()){this.trigger("rendered:ready",c)}if(this.draggable){this.draggableOn()}f()});return this},_setUpBehaviors:function(c){c=c||this.$el;make_popup_menus(c);c.find("[title]").tooltip({placement:"bottom"})},_render_titleButtons:function(){return[this._render_displayButton()]},_render_displayButton:function(){if((this.model.get("state")===b.HistoryDatasetAssociation.STATES.NOT_VIEWABLE)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.DISCARDED)||(this.model.get("state")===b.HistoryDatasetAssociation.STATES.NEW)||(!this.model.get("accessible"))){return null}var d={target:"galaxy_main",classes:"dataset-display"};if(this.model.get("purged")){d.disabled=true;d.title=_l("Cannot display datasets removed from disk")}else{if(this.model.get("state")===b.HistoryDatasetAssociation.STATES.UPLOAD){d.disabled=true;d.title=_l("This dataset must finish uploading before it can be viewed")}else{d.title=_l("View data");d.href=this.urls.display;var c=this;d.onclick=function(){Galaxy.frame.add({title:"Data Viewer: "+c.model.get("name"),type:"url",target:"galaxy_main",content:c.urls.display})}}}d.faIcon="fa-eye";return faIconButton(d)},_render_downloadButton:function(){if(this.model.get("purged")||!this.model.hasData()){return null}var d=this.urls,e=this.model.get("meta_files");if(_.isEmpty(e)){return $(['<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>',"</a>"].join(""))}var f="dataset-"+this.model.get("id")+"-popup",c=['<div popupmenu="'+f+'">','<a href="'+d.download+'">',_l("Download Dataset"),"</a>","<a>"+_l("Additional Files")+"</a>",_.map(e,function(g){return['<a class="action-button" href="',d.meta_download+g.file_type,'">',_l("Download")," ",g.file_type,"</a>"].join("")}).join("\n"),"</div>",'<div class="icon-btn-group">','<a href="'+d.download+'" title="'+_l("Download")+'" class="icon-btn">','<span class="fa fa-floppy-o"></span>','</a><a class="icon-btn popup" id="'+f+'">','<span class="fa fa-caret-down"></span>',"</a>","</div>"].join("\n");return $(c)},_render_showParamsButton:function(){return faIconButton({title:_l("View details"),href:this.urls.show_params,target:"galaxy_main",faIcon:"fa-info-circle"})},_render_body:function(){var d=$('<div>Error: unknown dataset state "'+this.model.get("state")+'".</div>'),c=this["_render_body_"+this.model.get("state")];if(_.isFunction(c)){d=c.call(this)}this._setUpBehaviors(d);if(this.expanded){d.show()}return d},_render_stateBodyHelper:function(c,f){f=f||[];var d=this,e=$(a.templates.body(_.extend(this.model.toJSON(),{body:c})));e.find(".dataset-actions .left").append(_.map(f,function(g){return g.call(d)}));return e},_render_body_new:function(){return this._render_stateBodyHelper("<div>"+_l("This is a new dataset and not all of its data are available yet")+"</div>")},_render_body_noPermission:function(){return this._render_stateBodyHelper("<div>"+_l("You do not have permission to view this dataset")+"</div>")},_render_body_discarded:function(){return this._render_stateBodyHelper("<div>"+_l("The job creating this dataset was cancelled before completion")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_queued:function(){return this._render_stateBodyHelper("<div>"+_l("This job is waiting to run")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_upload:function(){return this._render_stateBodyHelper("<div>"+_l("This dataset is currently uploading")+"</div>")},_render_body_setting_metadata:function(){return this._render_stateBodyHelper("<div>"+_l("Metadata is being auto-detected")+"</div>")},_render_body_running:function(){return this._render_stateBodyHelper("<div>"+_l("This job is currently running")+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_paused:function(){return this._render_stateBodyHelper("<div>"+_l('This job is paused. Use the "Resume Paused Jobs" in the history menu to resume')+"</div>",this.defaultPrimaryActionButtonRenderers)},_render_body_error:function(){var c=['<span class="help-text">',_l("An error occurred with this dataset"),":</span>",'<div class="job-error-text">',$.trim(this.model.get("misc_info")),"</div>"].join("");if(!this.model.get("purged")){c="<div>"+this.model.get("misc_blurb")+"</div>"+c}return this._render_stateBodyHelper(c,this.defaultPrimaryActionButtonRenderers.concat([this._render_downloadButton]))},_render_body_empty:function(){return this._render_stateBodyHelper("<div>"+_l("No data")+": <i>"+this.model.get("misc_blurb")+"</i></div>",this.defaultPrimaryActionButtonRenderers)},_render_body_failed_metadata:function(){var c=$('<div class="warningmessagesmall"></div>').append($("<strong/>").text(_l("An error occurred setting the metadata for this dataset"))),d=this._render_body_ok();d.prepend(c);return d},_render_body_ok:function(){var c=this,e=$(a.templates.body(this.model.toJSON())),d=[this._render_downloadButton].concat(this.defaultPrimaryActionButtonRenderers);e.find(".dataset-actions .left").append(_.map(d,function(f){return f.call(c)}));if(this.model.isDeletedOrPurged()){return e}return e},events:{"click .dataset-title-bar":"toggleBodyVisibility","keydown .dataset-title-bar":"toggleBodyVisibility","click .dataset-selector":"toggleSelect",},toggleBodyVisibility:function(f,d){var c=32,e=13;if((f.type==="keydown")&&!(f.keyCode===c||f.keyCode===e)){return true}var g=this.$el.find(".dataset-body");d=(d===undefined)?(!g.is(":visible")):(d);if(d){this.expandBody()}else{this.collapseBody()}return false},expandBody:function(){var c=this;function d(){c.$el.children(".dataset-body").replaceWith(c._render_body());c.$el.children(".dataset-body").slideDown(c.fxSpeed,function(){c.expanded=true;c.trigger("body-expanded",c.model.get("id"))})}if(this.model.inReadyState()&&!this.model.hasDetails()){this.model.fetch({silent:true}).always(function(e){d()})}else{d()}},collapseBody:function(){var c=this;this.$el.children(".dataset-body").slideUp(c.fxSpeed,function(){c.expanded=false;c.trigger("body-collapsed",c.model.get("id"))})},showSelector:function(e){if(this.$el.find(".dataset-selector").css("display")!=="none"){return}e=(e!==undefined)?(e):(this.fxSpeed);if(this.selected){this.select(null,true)}var d=this,c=32;if(e){this.$el.queue("fx",function(f){$(this).find(".dataset-primary-actions").fadeOut(e,f)});this.$el.queue("fx",function(f){$(this).find(".dataset-selector").show().animate({width:c},e,f);$(this).find(".dataset-title-bar").animate({"margin-left":c},e,f);d.selectable=true;d.trigger("selectable",true,d)})}else{this.$el.find(".dataset-primary-actions").hide();this.$el.find(".dataset-selector").show().css({width:c});this.$el.find(".dataset-title-bar").show().css({"margin-left":c});d.selectable=true;d.trigger("selectable",true,d)}},hideSelector:function(c){c=(c!==undefined)?(c):(this.fxSpeed);this.selectable=false;this.trigger("selectable",false,this);if(c){this.$el.queue("fx",function(d){$(this).find(".dataset-title-bar").show().css({"margin-left":"0"});$(this).find(".dataset-selector").animate({width:"0px"},c,function(){$(this).hide();d()})});this.$el.queue("fx",function(d){$(this).find(".dataset-primary-actions").fadeIn(c,d)})}else{$(this).find(".dataset-selector").css({width:"0px"}).hide();$(this).find(".dataset-primary-actions").show()}},toggleSelector:function(c){if(!this.$el.find(".dataset-selector").is(":visible")){this.showSelector(c)}else{this.hideSelector(c)}},select:function(c){this.$el.find(".dataset-selector span").removeClass("fa-square-o").addClass("fa-check-square-o");if(!this.selected){this.trigger("selected",this);this.selected=true}return false},deselect:function(c){this.$el.find(".dataset-selector span").removeClass("fa-check-square-o").addClass("fa-square-o");if(this.selected){this.trigger("de-selected",this);this.selected=false}return false},toggleSelect:function(c){if(this.selected){this.deselect(c)}else{this.select(c)}},draggableOn:function(){this.draggable=true;this.dragStartHandler=_.bind(this._dragStartHandler,this);this.dragEndHandler=_.bind(this._dragEndHandler,this);var c=this.$el.find(".dataset-title-bar").attr("draggable",true).get(0);c.addEventListener("dragstart",this.dragStartHandler,false);c.addEventListener("dragend",this.dragEndHandler,false)},draggableOff:function(){this.draggable=false;var c=this.$el.find(".dataset-title-bar").attr("draggable",false).get(0);c.removeEventListener("dragstart",this.dragStartHandler,false);c.removeEventListener("dragend",this.dragEndHandler,false)},toggleDraggable:function(){if(this.draggable){this.draggableOff()}else{this.draggableOn()}},_dragStartHandler:function(c){this.trigger("dragstart",this);c.dataTransfer.effectAllowed="move";c.dataTransfer.setData("text",JSON.stringify(this.model.toJSON()));return false},_dragEndHandler:function(c){this.trigger("dragend",this);return false},remove:function(d){var c=this;this.$el.fadeOut(c.fxSpeed,function(){c.$el.remove();c.off();if(d){d()}})},toString:function(){var c=(this.model)?(this.model+""):("(no model)");return"HDABaseView("+c+")"}});a.templates={skeleton:Handlebars.templates["template-hda-skeleton"],body:Handlebars.templates["template-hda-body"]};return{HDABaseView:a}});
\ No newline at end of file
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.