1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/95bcb99ad2b4/
Changeset: 95bcb99ad2b4
User: jmchilton
Date: 2014-09-26 14:49:43+00:00
Summary: Fix data column parameters pointed at multiple data parameters.
Before it would just die with an unhelpful server side exception - now it attempts to build, validate, and use a useful set of columns.
Affected #: 4 files
diff -r d27e8692adadf069e30d454cdb7a634526a6ba45 -r 95bcb99ad2b467ca0176a1e5e747bb18cd3cc61f lib/galaxy/tools/parameters/basic.py
--- a/lib/galaxy/tools/parameters/basic.py
+++ b/lib/galaxy/tools/parameters/basic.py
@@ -1170,34 +1170,47 @@
Generate a select list containing the columns of the associated
dataset (if found).
"""
- column_list = []
# No value indicates a configuration error, the named DataToolParameter
# must preceed this parameter in the config
assert self.data_ref in other_values, "Value for associated DataToolParameter not found"
# Get the value of the associated DataToolParameter (a dataset)
dataset = other_values[ self.data_ref ]
# Check if a dataset is selected
- if dataset is None or dataset == '':
+ if dataset is None or dataset == '' or dataset == []:
# NOTE: Both of these values indicate that no dataset is selected.
# However, 'None' indicates that the dataset is optional
# while '' indicates that it is not. Currently column
# parameters do not work well with optional datasets
- return column_list
- # Generate options
- if not dataset.metadata.columns:
- if self.accept_default:
- column_list.append( self.default_value or '1' )
- return column_list
- if not self.force_select:
+ return []
+ column_list = None
+ for dataset in util.listify( dataset ):
+ # Handle columns not available.
+ if not dataset.metadata.columns:
+ default_column_list = []
+ if self.accept_default:
+ default_column_list.append( self.default_value or '1' )
+ return default_column_list
+
+ # Build up possible columns for this dataset
+ this_column_list = []
+ if self.numerical:
+ # If numerical was requested, filter columns based on metadata
+ for i, col in enumerate( dataset.metadata.column_types ):
+ if col == 'int' or col == 'float':
+ this_column_list.append( str( i + 1 ) )
+ else:
+ for i in range(0, dataset.metadata.columns):
+ this_column_list.append( str( i + 1 ) )
+
+ # Take the intersection of these columns with the other columns.
+ if column_list is None:
+ column_list = this_column_list
+ else:
+ column_list = filter(lambda c: c in this_column_list, column_list)
+
+ if not self.force_select and 'None' not in column_list:
column_list.append( 'None' )
- if self.numerical:
- # If numerical was requested, filter columns based on metadata
- for i, col in enumerate( dataset.metadata.column_types ):
- if col == 'int' or col == 'float':
- column_list.append( str( i + 1 ) )
- else:
- for i in range(0, dataset.metadata.columns):
- column_list.append( str( i + 1 ) )
+
return column_list
def get_options( self, trans, other_values ):
@@ -1249,14 +1262,15 @@
if self.data_ref not in context:
return False
# Get the selected dataset if selected
- dataset = context[ self.data_ref ]
- if dataset:
- # Check if the dataset does not have the expected metadata for columns
- if not dataset.metadata.columns:
- # Only allow late validation if the dataset is not yet ready
- # (since we have reason to expect the metadata to be ready eventually)
- if dataset.is_pending or not dataset.datatype.matches_any( self.ref_input.formats ):
- return True
+ datasets = util.listify( context[ self.data_ref ] )
+ for dataset in datasets:
+ if dataset:
+ # Check if the dataset does not have the expected metadata for columns
+ if not dataset.metadata.columns:
+ # Only allow late validation if the dataset is not yet ready
+ # (since we have reason to expect the metadata to be ready eventually)
+ if dataset.is_pending or not dataset.datatype.matches_any( self.ref_input.formats ):
+ return True
# No late validation
return False
diff -r d27e8692adadf069e30d454cdb7a634526a6ba45 -r 95bcb99ad2b467ca0176a1e5e747bb18cd3cc61f test/functional/tools/column_multi_param.xml
--- /dev/null
+++ b/test/functional/tools/column_multi_param.xml
@@ -0,0 +1,25 @@
+<tool id="column_multi_param" name="Column Param Multi">
+ <command>
+ #for $input in $input1#
+ cut -f '$col' '$input' >> 'col_output';
+ #end for#
+ </command>
+ <inputs>
+ <param type="data" format="tabular" name="input1" label="Input 1" multiple="true" />
+ <param name="col" type="data_column" data_ref="input1" label="Column to Use" />
+ </inputs>
+ <outputs>
+ <data name="output1" type="tabular" from_work_dir="col_output" />
+ </outputs>
+ <tests>
+ <test>
+ <param name="input1" value="2.tabular,2.tabular" />
+ <param name="col" value="2" />
+ <output name="outpu1">
+ <assert_contents>
+ <has_line line="68" />
+ </assert_contents>
+ </output>
+ </test>
+ </tests>
+</tool>
diff -r d27e8692adadf069e30d454cdb7a634526a6ba45 -r 95bcb99ad2b467ca0176a1e5e747bb18cd3cc61f test/functional/tools/column_param.xml
--- /dev/null
+++ b/test/functional/tools/column_param.xml
@@ -0,0 +1,23 @@
+<tool id="column_param" name="Column Param">
+ <command>
+ cut -f '$col' '$input1' > 'col_output'
+ </command>
+ <inputs>
+ <param type="data" format="tabular" name="input1" label="Input 1" />
+ <param name="col" type="data_column" data_ref="input1" label="Column to Use" />
+ </inputs>
+ <outputs>
+ <data name="output1" type="tabular" from_work_dir="col_output" />
+ </outputs>
+ <tests>
+ <test>
+ <param name="input1" value="2.tabular" />
+ <param name="col" value="2" />
+ <output name="output1">
+ <assert_contents>
+ <has_line line="68" />
+ </assert_contents>
+ </output>
+ </test>
+ </tests>
+</tool>
diff -r d27e8692adadf069e30d454cdb7a634526a6ba45 -r 95bcb99ad2b467ca0176a1e5e747bb18cd3cc61f test/functional/tools/samples_tool_conf.xml
--- a/test/functional/tools/samples_tool_conf.xml
+++ b/test/functional/tools/samples_tool_conf.xml
@@ -20,6 +20,8 @@
<tool file="parallelism_optional.xml" /><tool file="implicit_default_conds.xml" /><tool file="multi_data_param.xml" />
+ <tool file="column_param.xml" />
+ <tool file="column_multi_param.xml" /><tool file="special_params.xml" /><tool file="validation_default.xml" /><tool file="validation_sanitizer.xml" />
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/38f6cf2629ef/
Changeset: 38f6cf2629ef
User: jmchilton
Date: 2014-09-26 13:29:53+00:00
Summary: Tool test case demonstrating wrapping multiple data params in new meta-parameter wrapper.
./run_tests.sh -with_framework_test_tools -api test/api/test_tools.py:ToolsTestCase.test_multidata_param
It was what was requested, but I am not sure I love this behavior - seems like for consistency that should maybe be a list of lists? I can see the other side of the argument though.
Affected #: 1 file
diff -r f52d7d6d64a671039a85959e1c720445f0ee672e -r 38f6cf2629efd071b4e7cc3e420a4e5081ad51e0 test/api/test_tools.py
--- a/test/api/test_tools.py
+++ b/test/api/test_tools.py
@@ -106,6 +106,23 @@
output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output )
assert output1_content == "--ex1,ex2"
+ @skip_without_tool( "multi_data_param" )
+ def test_multidata_param( self ):
+ history_id = self.dataset_populator.new_history()
+ hda1 = dataset_to_param( self.dataset_populator.new_dataset( history_id, content='1\t2\t3' ) )
+ hda2 = dataset_to_param( self.dataset_populator.new_dataset( history_id, content='4\t5\t6' ) )
+ inputs = {
+ "f1": { 'batch': False, 'values': [ hda1, hda2 ] },
+ "f2": { 'batch': False, 'values': [ hda2, hda1 ] },
+ }
+ response = self._run( "multi_data_param", history_id, inputs, assert_ok=True )
+ output1 = response[ "outputs" ][ 0 ]
+ output2 = response[ "outputs" ][ 1 ]
+ output1_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output1 )
+ output2_content = self.dataset_populator.get_history_dataset_content( history_id, dataset=output2 )
+ assert output1_content == "1\t2\t3\n4\t5\t6\n", output1_content
+ assert output2_content == "4\t5\t6\n1\t2\t3\n", output2_content
+
@skip_without_tool( "cat1" )
def test_run_cat1( self ):
# Run simple non-upload tool with an input data parameter.
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/f02fcf8a931c/
Changeset: f02fcf8a931c
User: guerler
Date: 2014-09-25 20:14:56+00:00
Summary: ToolForm: Improve validation, minor fixes
Affected #: 12 files
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 client/galaxy/scripts/mvc/tools/tools-jobs.js
--- a/client/galaxy/scripts/mvc/tools/tools-jobs.js
+++ b/client/galaxy/scripts/mvc/tools/tools-jobs.js
@@ -46,18 +46,35 @@
console.debug(response);
if (response && response.message && response.message.data) {
var error_messages = self.app.tree.matchResponse(response.message.data);
- for (var id in error_messages) {
- var error_text = error_messages[id];
- if (!error_text) {
- error_text = 'Please verify this parameter.';
- }
- self.app.element_list[id].error(error_text);
+ for (var input_id in error_messages) {
+ self._foundError(input_id, error_messages[input_id]);
}
}
}
);
},
+ /** Highlight and scroll to error
+ */
+ _foundError: function (input_id, message) {
+ // get input field
+ var input_element = this.app.element_list[input_id];
+
+ // mark error
+ input_element.error(message || 'Please verify this parameter.');
+
+ // set flag
+ if (this.valid) {
+ // scroll to first input element
+ $(this.app.container).animate({
+ scrollTop: input_element.$el.offset().top - 20
+ }, 500);
+
+ // set error flag
+ this.valid = false;
+ }
+ },
+
/** Validate job definition
*/
_validation: function(job_def) {
@@ -65,30 +82,7 @@
var job_inputs = job_def.inputs;
// validation flag
- var valid = true;
-
- // link this
- var self = this;
-
- /** Highlight and scroll to error */
- function foundError (input_id, message) {
- // get input field
- var input_element = self.app.element_list[input_id];
-
- // mark error
- input_element.error(message || 'Please verify this parameter.');
-
- // set flag
- if (valid) {
- // scroll to first input element
- $(self.app.container).animate({
- scrollTop: input_element.$el.offset().top - 20
- }, 500);
-
- // set error flag
- valid = false;
- }
- }
+ this.valid = true;
// counter for values declared in batch mode
var n_values = -1;
@@ -105,7 +99,7 @@
// check basic field validation
if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
- foundError(input_id);
+ this._foundError(input_id);
}
// check if input field is in batch mode
@@ -115,15 +109,15 @@
n_values = n;
} else {
if (n_values !== n) {
- foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
+ this._foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
}
}
}
}
- // return result
- return valid;
+ // return validation result
+ return this.valid;
},
/** Refreshes the history panel
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 client/galaxy/scripts/mvc/tools/tools-section.js
--- a/client/galaxy/scripts/mvc/tools/tools-section.js
+++ b/client/galaxy/scripts/mvc/tools/tools-section.js
@@ -540,6 +540,10 @@
/** Slider field
*/
_field_slider: function(input_def) {
+ // set min/max
+ input_def.min = input_def.min || 0;
+ input_def.max = input_def.max || 100000;
+
// calculate step size
var step = 1;
if (input_def.type == 'float') {
@@ -549,8 +553,8 @@
// create slider
return new Ui.Slider.View({
id : 'field-' + input_def.id,
- min : input_def.min || 0,
- max : input_def.max || 1000,
+ min : input_def.min,
+ max : input_def.max,
step : step
});
},
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 client/galaxy/scripts/mvc/ui/ui-options.js
--- a/client/galaxy/scripts/mvc/ui/ui-options.js
+++ b/client/galaxy/scripts/mvc/ui/ui-options.js
@@ -114,7 +114,7 @@
current = [current];
}
for (var i in current) {
- if (current[i] === 'null' || !current[i]) {
+ if (current[i] === 'null') {
return false;
}
}
@@ -149,7 +149,7 @@
// get selected values
var selected = this.$el.find(':checked');
if (selected.length == 0) {
- return null;
+ return 'null';
}
// return multiple or single value
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 client/galaxy/scripts/mvc/ui/ui-select-default.js
--- a/client/galaxy/scripts/mvc/ui/ui-select-default.js
+++ b/client/galaxy/scripts/mvc/ui/ui-select-default.js
@@ -91,7 +91,7 @@
current = [current];
}
for (var i in current) {
- if (current[i] === 'null' || !current[i]) {
+ if (current[i] === 'null') {
return false;
}
}
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/mvc/tools/tools-jobs.js
--- a/static/scripts/mvc/tools/tools-jobs.js
+++ b/static/scripts/mvc/tools/tools-jobs.js
@@ -46,18 +46,35 @@
console.debug(response);
if (response && response.message && response.message.data) {
var error_messages = self.app.tree.matchResponse(response.message.data);
- for (var id in error_messages) {
- var error_text = error_messages[id];
- if (!error_text) {
- error_text = 'Please verify this parameter.';
- }
- self.app.element_list[id].error(error_text);
+ for (var input_id in error_messages) {
+ self._foundError(input_id, error_messages[input_id]);
}
}
}
);
},
+ /** Highlight and scroll to error
+ */
+ _foundError: function (input_id, message) {
+ // get input field
+ var input_element = this.app.element_list[input_id];
+
+ // mark error
+ input_element.error(message || 'Please verify this parameter.');
+
+ // set flag
+ if (this.valid) {
+ // scroll to first input element
+ $(this.app.container).animate({
+ scrollTop: input_element.$el.offset().top - 20
+ }, 500);
+
+ // set error flag
+ this.valid = false;
+ }
+ },
+
/** Validate job definition
*/
_validation: function(job_def) {
@@ -65,30 +82,7 @@
var job_inputs = job_def.inputs;
// validation flag
- var valid = true;
-
- // link this
- var self = this;
-
- /** Highlight and scroll to error */
- function foundError (input_id, message) {
- // get input field
- var input_element = self.app.element_list[input_id];
-
- // mark error
- input_element.error(message || 'Please verify this parameter.');
-
- // set flag
- if (valid) {
- // scroll to first input element
- $(self.app.container).animate({
- scrollTop: input_element.$el.offset().top - 20
- }, 500);
-
- // set error flag
- valid = false;
- }
- }
+ this.valid = true;
// counter for values declared in batch mode
var n_values = -1;
@@ -105,7 +99,7 @@
// check basic field validation
if (input_def && !input_def.optional && input_field && input_field.validate && !input_field.validate()) {
- foundError(input_id);
+ this._foundError(input_id);
}
// check if input field is in batch mode
@@ -115,15 +109,15 @@
n_values = n;
} else {
if (n_values !== n) {
- foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
+ this._foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + n_values + '</b>.');
}
}
}
}
- // return result
- return valid;
+ // return validation result
+ return this.valid;
},
/** Refreshes the history panel
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/mvc/tools/tools-section.js
--- a/static/scripts/mvc/tools/tools-section.js
+++ b/static/scripts/mvc/tools/tools-section.js
@@ -540,6 +540,10 @@
/** Slider field
*/
_field_slider: function(input_def) {
+ // set min/max
+ input_def.min = input_def.min || 0;
+ input_def.max = input_def.max || 100000;
+
// calculate step size
var step = 1;
if (input_def.type == 'float') {
@@ -549,8 +553,8 @@
// create slider
return new Ui.Slider.View({
id : 'field-' + input_def.id,
- min : input_def.min || 0,
- max : input_def.max || 1000,
+ min : input_def.min,
+ max : input_def.max,
step : step
});
},
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/mvc/ui/ui-options.js
--- a/static/scripts/mvc/ui/ui-options.js
+++ b/static/scripts/mvc/ui/ui-options.js
@@ -114,7 +114,7 @@
current = [current];
}
for (var i in current) {
- if (current[i] === 'null' || !current[i]) {
+ if (current[i] === 'null') {
return false;
}
}
@@ -149,7 +149,7 @@
// get selected values
var selected = this.$el.find(':checked');
if (selected.length == 0) {
- return null;
+ return 'null';
}
// return multiple or single value
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/mvc/ui/ui-select-default.js
--- a/static/scripts/mvc/ui/ui-select-default.js
+++ b/static/scripts/mvc/ui/ui-select-default.js
@@ -91,7 +91,7 @@
current = [current];
}
for (var i in current) {
- if (current[i] === 'null' || !current[i]) {
+ if (current[i] === 'null') {
return false;
}
}
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/packed/mvc/tools/tools-jobs.js
--- a/static/scripts/packed/mvc/tools/tools-jobs.js
+++ b/static/scripts/packed/mvc/tools/tools-jobs.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.log(d);b.request("POST",galaxy_config.root+"api/tools",d,function(e){c.app.message(a.success(e));c._refreshHdas()},function(e){console.debug(e);if(e&&e.message&&e.message.data){var h=c.app.tree.matchResponse(e.message.data);for(var g in h){var f=h[g];if(!f){f="Please verify this parameter."}c.app.element_list[g].error(f)}}})},_validation:function(h){var e=h.inputs;var c=true;var o=this;function m(n,p){var q=o.app.element_list[n];q.error(p||"Please verify this parameter.");if(c){$(o.app.container).animate({scrollTop:q.$el.offset().top-20},500);c=false}}var l=-1;for(var k in e){var f=e[k];var j=this.app.tree.match(k);var d=this.app.field_list[j];var i=this.app.input_list[j];if(i&&!i.optional&&d&&d.validate&&!d.validate()){m(j)}if(f.batch){var g=f.values.length;if(l===-1){l=g}else{if(l!==g){m(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+g+"</b> selection(s) while a previous field contains <b>"+l+"</b>.")}}}}return c},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
+define(["utils/utils","mvc/tools/tools-template"],function(b,a){return Backbone.Model.extend({initialize:function(d,c){this.app=d;this.options=b.merge(c,this.optionsDefault)},submit:function(){var c=this;var d={tool_id:this.app.options.id,inputs:this.app.tree.finalize()};this.app.reset();if(!this._validation(d)){console.debug("tools-jobs::submit - Submission canceled. Validation failed.");return}console.log(d);b.request("POST",galaxy_config.root+"api/tools",d,function(e){c.app.message(a.success(e));c._refreshHdas()},function(e){console.debug(e);if(e&&e.message&&e.message.data){var g=c.app.tree.matchResponse(e.message.data);for(var f in g){c._foundError(f,g[f])}}})},_foundError:function(c,d){var e=this.app.element_list[c];e.error(d||"Please verify this parameter.");if(this.valid){$(this.app.container).animate({scrollTop:e.$el.offset().top-20},500);this.valid=false}},_validation:function(g){var c=g.inputs;this.valid=true;var k=-1;for(var i in c){var e=c[i];var j=this.app.tree.match(i);var d=this.app.field_list[j];var h=this.app.input_list[j];if(h&&!h.optional&&d&&d.validate&&!d.validate()){this._foundError(j)}if(e.batch){var f=e.values.length;if(k===-1){k=f}else{if(k!==f){this._foundError(j,"Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>"+f+"</b> selection(s) while a previous field contains <b>"+k+"</b>.")}}}}return this.valid},_refreshHdas:function(){if(parent.Galaxy&&parent.Galaxy.currHistoryPanel){parent.Galaxy.currHistoryPanel.refreshContents()}}})});
\ No newline at end of file
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/packed/mvc/tools/tools-section.js
--- a/static/scripts/packed/mvc/tools/tools-section.js
+++ b/static/scripts/packed/mvc/tools/tools-section.js
@@ -1,1 +1,1 @@
-define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-dataset"],function(d,a,g,c,b){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new a.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._field_text(h);break;case"select":i=this._field_select(h);break;case"data":i=this._field_data(h);break;case"data_column":i=this._field_select(h);break;case"conditional":i=this._field_conditional(h);break;case"hidden":i=this._field_hidden(h);break;case"integer":i=this._field_slider(h);break;case"float":i=this._field_slider(h);break;case"boolean":i=this._field_boolean(h);break}if(!i){if(h.options){i=this._field_select(h)}else{i=this._field_text(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_field_conditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_field_data:function(h){var i=this;var j=h.id;return new b.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(l){var v=l.values[0].id;var t=i.app.tree.references(j,"data_column");if(t.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}var o=i.app.datasets.filter(v);var x=null;if(o){console.debug("tool-form::field_data() - Selected dataset "+v+".");x=o.get("metadata_column_types");if(!x){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+v+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+v+".")}for(var p in t){var r=i.app.input_list[t[p]];var s=i.app.field_list[t[p]];if(!r||!s){console.debug("tool-form::field_data() - FAILED: Column not found.")}var n=r.numerical;var m=[];for(var w in x){var u=x[w];var k=(parseInt(w)+1);var q="Text";if(u=="int"||u=="float"){q="Number"}if(u=="int"||u=="float"||!n){m.push({label:"Column: "+k+" ["+q+"]",value:k})}}if(s){s.update(m);if(!s.exists(s.value())){s.value(s.first())}}}}})},_field_select:function(h){var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_field_text:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_field_slider:function(h){var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min||0,max:h.max||1000,step:i})},_field_hidden:function(h){return new g.Hidden({id:"field-"+h.id})},_field_boolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
+define(["utils/utils","mvc/ui/ui-table","mvc/ui/ui-misc","mvc/tools/tools-repeat","mvc/tools/tools-select-dataset"],function(d,a,g,c,b){var e=Backbone.View.extend({initialize:function(h){this.setElement(this._template(h))},error:function(h){this.$el.find(".ui-table-form-error-text").html(h);this.$el.find(".ui-table-form-error").fadeIn();this.$el.addClass("ui-error")},reset:function(){this.$el.find(".ui-table-form-error").hide();this.$el.removeClass("ui-error")},_template:function(h){var i=$('<div class="ui-table-element"/>');i.append('<div class="ui-table-form-error ui-error"><span class="fa fa-arrow-down"/><span class="ui-table-form-error-text"></div>');if(h.label){i.append('<div class="ui-table-form-title-strong">'+h.label+"</div>")}i.append(h.$el);if(h.help){i.append('<div class="ui-table-form-info">'+h.help+"</div>")}return i}});var f=Backbone.View.extend({initialize:function(i,h){this.app=i;this.inputs=h.inputs;h.cls_tr="section-row";this.table=new a.View(h);this.setElement(this.table.$el);this.render()},render:function(){this.table.delAll();for(var h in this.inputs){this._add(this.inputs[h])}},_add:function(j){var i=this;var h=jQuery.extend(true,{},j);h.id=d.uuid();this.app.input_list[h.id]=h;var k=h.type;switch(k){case"conditional":this._addConditional(h);break;case"repeat":this._addRepeat(h);break;default:this._addRow(k,h)}},_addConditional:function(h){h.label=h.test_param.label;h.value=h.test_param.value;var j=this._addRow("conditional",h);for(var l in h.cases){var k=h.id+"-section-"+l;var m=new f(this.app,{inputs:h.cases[l].inputs,cls:"ui-table-plain"});m.$el.addClass("ui-table-form-section");this.table.add(m.$el);this.table.append(k)}},_addRepeat:function(h){var j=this;var n=0;var m=new c.View({title_new:h.title,max:h.max,onnew:function(){var i=h.id+"-section-"+(n++);var q=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:i,title:h.title,$el:q.$el,ondel:function(){m.del(i);m.retitle(h.title);j.app.refresh()}});m.retitle(h.title);j.app.refresh()}});for(var l=0;l<h.min;l++){var k=h.id+"-section-"+(n++);var p=new f(j.app,{inputs:h.inputs,cls:"ui-table-plain"});m.add({id:k,title:h.title,$el:p.$el})}m.retitle(h.title);var o=new e({label:h.title,help:h.help,$el:m.$el});o.$el.addClass("ui-table-form-section");this.table.add(o.$el);this.table.append(h.id)},_addRow:function(j,h){var l=h.id;var i=null;switch(j){case"text":i=this._field_text(h);break;case"select":i=this._field_select(h);break;case"data":i=this._field_data(h);break;case"data_column":i=this._field_select(h);break;case"conditional":i=this._field_conditional(h);break;case"hidden":i=this._field_hidden(h);break;case"integer":i=this._field_slider(h);break;case"float":i=this._field_slider(h);break;case"boolean":i=this._field_boolean(h);break}if(!i){if(h.options){i=this._field_select(h)}else{i=this._field_text(h)}console.debug("tools-form::_addRow() : Auto matched field type ("+j+").")}if(h.value!==undefined){i.value(h.value)}this.app.field_list[l]=i;var k=new e({label:h.label,help:h.help,$el:i.$el});this.app.element_list[l]=k;this.table.add(k.$el);this.table.append(l);return this.table.get(l)},_field_conditional:function(h){var j=this;var k=[];for(var l in h.test_param.options){var m=h.test_param.options[l];k.push({label:m[0],value:m[1]})}return new g.Select.View({id:"field-"+h.id,data:k,onchange:function(u){for(var s in h.cases){var o=h.cases[s];var r=h.id+"-section-"+s;var n=j.table.get(r);var q=false;for(var p in o.inputs){var t=o.inputs[p].type;if(t&&t!=="hidden"){q=true;break}}if(o.value==u&&q){n.fadeIn("fast")}else{n.hide()}}}})},_field_data:function(h){var i=this;var j=h.id;return new b.View(this.app,{id:"field-"+j,extensions:h.extensions,multiple:h.multiple,onchange:function(l){var v=l.values[0].id;var t=i.app.tree.references(j,"data_column");if(t.length<=0){console.debug("tool-form::field_data() - Data column parameters unavailable.");return}var o=i.app.datasets.filter(v);var x=null;if(o){console.debug("tool-form::field_data() - Selected dataset "+v+".");x=o.get("metadata_column_types");if(!x){console.debug("tool-form::field_data() - FAILED: Could not find metadata for dataset "+v+".")}}else{console.debug("tool-form::field_data() - FAILED: Could not find dataset "+v+".")}for(var p in t){var r=i.app.input_list[t[p]];var s=i.app.field_list[t[p]];if(!r||!s){console.debug("tool-form::field_data() - FAILED: Column not found.")}var n=r.numerical;var m=[];for(var w in x){var u=x[w];var k=(parseInt(w)+1);var q="Text";if(u=="int"||u=="float"){q="Number"}if(u=="int"||u=="float"||!n){m.push({label:"Column: "+k+" ["+q+"]",value:k})}}if(s){s.update(m);if(!s.exists(s.value())){s.value(s.first())}}}}})},_field_select:function(h){var j=[];for(var k in h.options){var l=h.options[k];j.push({label:l[0],value:l[1]})}var m=g.Select;switch(h.display){case"checkboxes":m=g.Checkbox;break;case"radio":m=g.Radio;break}return new m.View({id:"field-"+h.id,data:j,multiple:h.multiple})},_field_text:function(h){return new g.Input({id:"field-"+h.id,area:h.area})},_field_slider:function(h){h.min=h.min||0;h.max=h.max||100000;var i=1;if(h.type=="float"){i=(h.max-h.min)/10000}return new g.Slider.View({id:"field-"+h.id,min:h.min,max:h.max,step:i})},_field_hidden:function(h){return new g.Hidden({id:"field-"+h.id})},_field_boolean:function(h){return new g.RadioButton.View({id:"field-"+h.id,data:[{label:"Yes",value:"true"},{label:"No",value:"false"}]})}});return{View:f}});
\ No newline at end of file
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/packed/mvc/ui/ui-options.js
--- a/static/scripts/packed/mvc/ui/ui-options.js
+++ b/static/scripts/packed/mvc/ui/ui-options.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),empty:"No data available"};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$error=$(this._templateError(g));this.$options=$(this._template(g));this.$el.append(this.$error);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$el.find(".ui-option").remove();for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if(g[f]==="null"||!g[f]){return false}}return true},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){var f=this.$el.find(".ui-option").length;if(f==0){this.$error.show();this.$options.hide()}else{this.$error.hide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return null}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_templateError:function(f){return'<div class="ui-error" style="display: none;">'+f.empty+"</div>"}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(typeof f==="string"){f=[f]}if(f!==undefined){this.$el.find("input").prop("checked",false);for(var g in f){this.$el.find("input[value="+f[g]+"]").prop("checked",true)}}return this._getValue()},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"},_template:function(){return'<div class="ui-options"/>'}});var c={};c.View=d.View.extend({initialize:function(f){f.multiple=true;d.View.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
+define(["utils/utils"],function(b){var a=Backbone.View.extend({initialize:function(g){this.optionsDefault={value:[],visible:true,data:[],id:b.uuid(),empty:"No data available"};this.options=b.merge(g,this.optionsDefault);this.setElement("<div/>");this.$error=$(this._templateError(g));this.$options=$(this._template(g));this.$el.append(this.$error);this.$el.append(this.$options);if(!this.options.visible){this.$el.hide()}this.update(this.options.data);if(this.options.value){this.value(this.options.value)}var f=this;this.on("change",function(){f._change()})},update:function(g){var j=this._getValue();this.$el.find(".ui-option").remove();for(var h in g){var i=$(this._templateOption(g[h]));i.addClass("ui-option");this.$options.append(i)}var f=this;this.$el.find("input").on("change",function(){f.value(f._getValue());f._change()});this._refresh();this.value(j)},exists:function(g){if(typeof g==="string"){g=[g]}for(var f in g){if(this.$el.find('input[value="'+g[f]+'"]').length>0){return true}}return false},first:function(){var f=this.$el.find("input");if(f.length>0){return f.val()}else{return undefined}},validate:function(){var g=this.value();if(!(g instanceof Array)){g=[g]}for(var f in g){if(g[f]==="null"){return false}}return true},_change:function(){if(this.options.onchange){this.options.onchange(this._getValue())}},_refresh:function(){var f=this.$el.find(".ui-option").length;if(f==0){this.$error.show();this.$options.hide()}else{this.$error.hide();this.$options.css("display","inline-block")}},_getValue:function(){var g=this.$el.find(":checked");if(g.length==0){return"null"}if(this.options.multiple){var f=[];g.each(function(){f.push($(this).val())});return f}else{return g.val()}},_templateError:function(f){return'<div class="ui-error" style="display: none;">'+f.empty+"</div>"}});var d={};d.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(typeof f==="string"){f=[f]}if(f!==undefined){this.$el.find("input").prop("checked",false);for(var g in f){this.$el.find("input[value="+f[g]+"]").prop("checked",true)}}return this._getValue()},_templateOption:function(f){return'<div><input type="radio" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"},_template:function(){return'<div class="ui-options"/>'}});var c={};c.View=d.View.extend({initialize:function(f){f.multiple=true;d.View.prototype.initialize.call(this,f)},_templateOption:function(f){return'<div><input type="checkbox" name="'+this.options.id+'" value="'+f.value+'"/>'+f.label+"<br></div>"}});var e={};e.View=a.extend({initialize:function(f){a.prototype.initialize.call(this,f)},value:function(f){if(f!==undefined){this.$el.find("input").prop("checked",false);this.$el.find("label").removeClass("active");this.$el.find('[value="'+f+'"]').prop("checked",true).closest("label").addClass("active")}return this._getValue()},_templateOption:function(g){var f='<label class="btn btn-default">';if(g.icon){f+='<i class="fa '+g.icon+'"/>'}f+='<input type="radio" name="'+this.options.id+'" value="'+g.value+'">'+g.label+"</label>";return f},_template:function(){return'<div class="btn-group ui-radiobutton" data-toggle="buttons"/>'}});return{Radio:d,RadioButton:e,Checkbox:c}});
\ No newline at end of file
diff -r 82f8d68414f5c9a0e5aeaaabca85cf7044e06183 -r f02fcf8a931c4862cfb6698da0e097d68c8025c6 static/scripts/packed/mvc/ui/ui-select-default.js
--- a/static/scripts/packed/mvc/ui/ui-select-default.js
+++ b/static/scripts/packed/mvc/ui/ui-select-default.js
@@ -1,1 +1,1 @@
-define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find("#select");this.$icon=this.$el.find("#icon");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if(d[c]==="null"||!d[c]){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down");this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin");this.$select.hide()},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><div class="button"><i id="icon"/></div><select id="select" class="select '+c.cls+" "+c.id+'"></select></div>'}});return{View:b}});
\ No newline at end of file
+define(["utils/utils"],function(a){var b=Backbone.View.extend({optionsDefault:{id:"",cls:"",empty:"No data available",visible:true,wait:false,multiple:false},initialize:function(d){this.options=a.merge(d,this.optionsDefault);this.setElement(this._template(this.options));this.$select=this.$el.find("#select");this.$icon=this.$el.find("#icon");if(this.options.multiple){this.$select.prop("multiple",true);this.$select.addClass("ui-select-multiple");this.$icon.remove()}else{this.$el.addClass("ui-select")}this.update(this.options.data);if(!this.options.visible){this.hide()}if(this.options.wait){this.wait()}else{this.show()}var c=this;this.$select.on("change",function(){c._change()});this.on("change",function(){c._change()})},value:function(c){if(c!==undefined){this.$select.val(c)}return this.$select.val()},first:function(){var c=this.$select.find("option");if(c.length>0){return c.val()}else{return undefined}},validate:function(){var d=this.value();if(!(d instanceof Array)){d=[d]}for(var c in d){if(d[c]==="null"){return false}}return true},text:function(){return this.$select.find("option:selected").text()},show:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-caret-down");this.$select.show();this.$el.show()},hide:function(){this.$el.hide()},wait:function(){this.$icon.removeClass();this.$icon.addClass("fa fa-spinner fa-spin");this.$select.hide()},disabled:function(){return this.$select.is(":disabled")},enable:function(){this.$select.prop("disabled",false)},disable:function(){this.$select.prop("disabled",true)},add:function(c){this.$select.append(this._templateOption(c));this._refresh()},del:function(c){this.$select.find("option[value="+c+"]").remove();this.$select.trigger("change");this._refresh()},update:function(c){var e=this.$select.val();this.$select.find("option").remove();for(var d in c){this.$select.append(this._templateOption(c[d]))}this._refresh();this.$select.val(e);if(!this.$select.val()){this.$select.val(this.first())}},setOnChange:function(c){this.options.onchange=c},exists:function(c){return this.$select.find('option[value="'+c+'"]').length>0},_change:function(){if(this.options.onchange){this.options.onchange(this.$select.val())}},_refresh:function(){this.$select.find("option[value=null]").remove();var c=this.$select.find("option").length;if(c==0){this.disable();this.$select.append(this._templateOption({value:"null",label:this.options.empty}))}else{this.enable()}},_templateOption:function(c){return'<option value="'+c.value+'">'+c.label+"</option>"},_template:function(c){return'<div id="'+c.id+'"><div class="button"><i id="icon"/></div><select id="select" class="select '+c.cls+" "+c.id+'"></select></div>'}});return{View:b}});
\ No newline at end of file
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
3 new commits in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/commits/a0880211749b/
Changeset: a0880211749b
Branch: next-stable
User: saketkc
Date: 2014-09-25 06:10:51+00:00
Summary: Update tool_list to reflect recent change in use of envirnoment variables
tool_list.py now makese use of GALAXY_TEST_TOOL_CONF and exits throwing an appropriate error
Affected #: 1 file
diff -r 5296d69134bddeb11246c70347d83c6073da646f -r a0880211749b1f65c4fa78f9c121fa2234decc67 tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -1,9 +1,15 @@
-import os,sys
+import os
+import sys
#--------read tool_conf.xml to get all the tool xml file names-----------
onoff = 1
tool_list = []
-for line in open("tool_conf.xml", "r"):
+tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'config/tool_conf.xml' )
+if not os.path.isfile(tool_conf_file):
+ sys.stderr.write( "Tool config file not found: {}\n".format(tool_conf_file) )
+ sys.exit(1)
+
+for line in open(tool_conf_file, "r"):
if line.find("<!--") != -1:
onoff = 0
if line.find("file") != -1 and onoff==1:
https://bitbucket.org/galaxy/galaxy-central/commits/f3284eb7ec21/
Changeset: f3284eb7ec21
Branch: next-stable
User: jmchilton
Date: 2014-09-25 13:00:38+00:00
Summary: Fixes to tool_list.py for legacy configurations and modified tool confs.
Now uses roughly the same order of precedence as Galaxy proper's config.
Affected #: 1 file
diff -r a0880211749b1f65c4fa78f9c121fa2234decc67 -r f3284eb7ec210d50a3e9f2c0d393cffcb24894da tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -4,8 +4,15 @@
#--------read tool_conf.xml to get all the tool xml file names-----------
onoff = 1
tool_list = []
-tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'config/tool_conf.xml' )
-if not os.path.isfile(tool_conf_file):
+tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', None )
+
+if tool_conf_file is None:
+ for possible_tool_file in [ 'config/tool_conf.xml', 'tool_conf.xml', 'config/tool_conf.xml.sample' ]:
+ tool_conf_file = possible_tool_file
+ if os.path.isfile( possible_tool_file ):
+ break
+
+if tool_conf_file is None or not os.path.isfile(tool_conf_file):
sys.stderr.write( "Tool config file not found: {}\n".format(tool_conf_file) )
sys.exit(1)
https://bitbucket.org/galaxy/galaxy-central/commits/1db1d66229db/
Changeset: 1db1d66229db
User: jmchilton
Date: 2014-09-25 13:03:21+00:00
Summary: Merge latest next-stable.
Affected #: 1 file
diff -r bcd98385d0af97c1dd5d4ba7944da49ff28158e1 -r 1db1d66229db79f633f70b6f5b52d339cdb2dbb4 tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -4,8 +4,15 @@
#--------read tool_conf.xml to get all the tool xml file names-----------
onoff = 1
tool_list = []
-tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'config/tool_conf.xml' )
-if not os.path.isfile(tool_conf_file):
+tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', None )
+
+if tool_conf_file is None:
+ for possible_tool_file in [ 'config/tool_conf.xml', 'tool_conf.xml', 'config/tool_conf.xml.sample' ]:
+ tool_conf_file = possible_tool_file
+ if os.path.isfile( possible_tool_file ):
+ break
+
+if tool_conf_file is None or not os.path.isfile(tool_conf_file):
sys.stderr.write( "Tool config file not found: {}\n".format(tool_conf_file) )
sys.exit(1)
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/bcd98385d0af/
Changeset: bcd98385d0af
User: saketkc
Date: 2014-09-25 06:10:51+00:00
Summary: Update tool_list to reflect recent change in use of envirnoment variables
tool_list.py now makese use of GALAXY_TEST_TOOL_CONF and exits throwing an appropriate error
Affected #: 1 file
diff -r a3d10d4db962d762d045bf3e46163508d3572e95 -r bcd98385d0af97c1dd5d4ba7944da49ff28158e1 tool_list.py
--- a/tool_list.py
+++ b/tool_list.py
@@ -1,9 +1,15 @@
-import os,sys
+import os
+import sys
#--------read tool_conf.xml to get all the tool xml file names-----------
onoff = 1
tool_list = []
-for line in open("tool_conf.xml", "r"):
+tool_conf_file = os.environ.get( 'GALAXY_TEST_TOOL_CONF', 'config/tool_conf.xml' )
+if not os.path.isfile(tool_conf_file):
+ sys.stderr.write( "Tool config file not found: {}\n".format(tool_conf_file) )
+ sys.exit(1)
+
+for line in open(tool_conf_file, "r"):
if line.find("<!--") != -1:
onoff = 0
if line.find("file") != -1 and onoff==1:
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.