galaxy-commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
September 2012
- 1 participants
- 161 discussions
commit/galaxy-central: jgoecks: Add requireJS support for data, visualization, tools and update dependencies.
by Bitbucket 21 Sep '12
by Bitbucket 21 Sep '12
21 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/040555fcc6b5/
changeset: 040555fcc6b5
user: jgoecks
date: 2012-09-21 16:12:01
summary: Add requireJS support for data, visualization, tools and update dependencies.
affected #: 11 files
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 static/scripts/mvc/data.js
--- a/static/scripts/mvc/data.js
+++ b/static/scripts/mvc/data.js
@@ -1,3 +1,4 @@
+define(["libs/backbone/backbone-relational"], function() {
/**
* A dataset. In Galaxy, datasets are associated with a history, so
* this object is also known as a HistoryDatasetAssociation.
@@ -17,3 +18,9 @@
model: Dataset
});
+return {
+ Dataset: Dataset,
+ DatasetCollection: DatasetCollection
+};
+
+});
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 static/scripts/mvc/tools.js
--- a/static/scripts/mvc/tools.js
+++ b/static/scripts/mvc/tools.js
@@ -6,39 +6,8 @@
* and models can be used without views.
*/
-// FIXME: copied from visualization module; remove once a module has been created from tools.
-var ServerStateDeferred = Backbone.Model.extend({
- defaults: {
- ajax_settings: {},
- interval: 1000,
- success_fn: function(result) { return true; }
- },
-
- /**
- * Returns a deferred that resolves when success function returns true.
- */
- go: function() {
- var deferred = $.Deferred(),
- self = this,
- ajax_settings = self.get('ajax_settings'),
- success_fn = self.get('success_fn'),
- interval = self.get('interval'),
- _go = function() {
- $.ajax(ajax_settings).success(function(result) {
- if (success_fn(result)) {
- // Result is good, so resolve.
- deferred.resolve(result);
- }
- else {
- // Result not good, try again.
- setTimeout(_go, interval);
- }
- });
- };
- _go();
- return deferred;
- }
-});
+ define( ["libs/underscore", "viz/trackster/util", "mvc/data", "libs/backbone/backbone-relational" ],
+ function(_, util, data) {
/**
* Simple base model for any visible element. Includes useful attributes and ability
@@ -64,6 +33,47 @@
});
/**
+ * A tool input.
+ */
+var ToolInput = Backbone.RelationalModel.extend({
+ defaults: {
+ name: null,
+ label: null,
+ type: null,
+ value: null,
+ num_samples: 5
+ },
+
+ initialize: function() {
+ this.attributes.html = unescape(this.attributes.html);
+ },
+
+ copy: function() {
+ return new ToolInput(this.toJSON());
+ },
+
+ /**
+ * Returns samples from a tool input.
+ */
+ get_samples: function() {
+ var type = this.get('type'),
+ samples = null;
+ if (type === 'number') {
+ samples = d3.scale.linear()
+ .domain([this.get('min'), this.get('max')])
+ .ticks(this.get('num_samples'));
+ }
+ else if (type === 'select') {
+ samples = _.map(this.get('options'), function(option) {
+ return option[0];
+ });
+ }
+
+ return samples;
+ }
+});
+
+/**
* A Galaxy tool.
*/
var Tool = BaseModel.extend({
@@ -78,7 +88,7 @@
{
type: Backbone.HasMany,
key: 'inputs',
- relatedModel: 'ToolInput',
+ relatedModel: ToolInput,
reverseRelation: {
key: 'tool',
includeInJSON: false
@@ -176,7 +186,7 @@
// deferred to ensure that job is run. Also use deferred that
// resolves to outputs from tool.
var run_deferred = $.Deferred(),
- ss_deferred = new ServerStateDeferred({
+ ss_deferred = new util.ServerStateDeferred({
ajax_settings: {
url: this.urlRoot,
data: JSON.stringify(payload),
@@ -192,54 +202,13 @@
// Run job and resolve run_deferred to tool outputs.
$.when(ss_deferred.go()).then(function(result) {
- run_deferred.resolve(new DatasetCollection().reset(result));
+ run_deferred.resolve(new data.DatasetCollection().reset(result));
});
return run_deferred;
}
});
/**
- * A tool input.
- */
-var ToolInput = Backbone.RelationalModel.extend({
- defaults: {
- name: null,
- label: null,
- type: null,
- value: null,
- num_samples: 5
- },
-
- initialize: function() {
- this.attributes.html = unescape(this.attributes.html);
- },
-
- copy: function() {
- return new ToolInput(this.toJSON());
- },
-
- /**
- * Returns samples from a tool input.
- */
- get_samples: function() {
- var type = this.get('type'),
- samples = null;
- if (type === 'number') {
- samples = d3.scale.linear()
- .domain([this.get('min'), this.get('max')])
- .ticks(this.get('num_samples'));
- }
- else if (type === 'select') {
- samples = _.map(this.get('options'), function(option) {
- return option[0];
- });
- }
-
- return samples;
- }
-});
-
-/**
* Wrap collection of tools for fast access/manipulation.
*/
var ToolCollection = Backbone.Collection.extend({
@@ -723,4 +692,15 @@
$('#left').width("650px");
});
}
-});
\ No newline at end of file
+});
+
+// Exports
+return {
+ Tool: Tool,
+ ToolSearch: ToolSearch,
+ ToolPanel: ToolPanel,
+ ToolPanelView: ToolPanelView,
+ ToolFormView: ToolFormView
+};
+
+});
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 static/scripts/viz/sweepster.js
--- a/static/scripts/viz/sweepster.js
+++ b/static/scripts/viz/sweepster.js
@@ -3,7 +3,8 @@
* genomic visualization.
*/
-define( ["libs/d3", "viz/trackster/util", "viz/visualization", "viz/trackster/tracks"], function( d3, util, visualization, tracks ) {
+define(["libs/d3", "viz/trackster/util", "viz/visualization", "viz/trackster/tracks", "mvc/tools", "mvc/data"],
+ function(d3, util, visualization, tracks, tools, data) {
/**
* A collection of tool input settings. Object is useful for keeping a list of settings
@@ -318,12 +319,12 @@
{
type: Backbone.HasOne,
key: 'dataset',
- relatedModel: Dataset
+ relatedModel: data.Dataset
},
{
type: Backbone.HasOne,
key: 'tool',
- relatedModel: Tool
+ relatedModel: tools.Tool
},
{
type: Backbone.HasMany,
@@ -571,7 +572,7 @@
render: function() {
// Start with tool form view.
- var tool_form_view = new ToolFormView({
+ var tool_form_view = new tools.ToolFormView({
model: this.model.get('tool')
});
tool_form_view.render();
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 static/scripts/viz/trackster/tracks.js
--- a/static/scripts/viz/trackster/tracks.js
+++ b/static/scripts/viz/trackster/tracks.js
@@ -1,4 +1,6 @@
-define( ["libs/underscore", "viz/visualization", "viz/trackster/util", "viz/trackster/slotting", "viz/trackster/painters" ], function( _, visualization, util, slotting, painters ) {
+define( ["libs/underscore", "viz/visualization", "viz/trackster/util",
+ "viz/trackster/slotting", "viz/trackster/painters", "mvc/data" ],
+ function( _, visualization, util, slotting, painters, data ) {
var extend = _.extend;
var get_random_color = util.get_random_color;
@@ -878,7 +880,7 @@
// Deferred object that indicates when view's chrom data has been loaded.
this.load_chroms_deferred = null;
this.init();
- this.canvas_manager = new CanvasManager( this.container.get(0).ownerDocument );
+ this.canvas_manager = new visualization.CanvasManager( this.container.get(0).ownerDocument );
this.reset();
};
_.extend( View.prototype, Backbone.Events);
@@ -1749,7 +1751,7 @@
this.run(url_params, new_track,
// Success callback.
function(track_data) {
- new_track.set_dataset(new Dataset(track_data));
+ new_track.set_dataset(new data.Dataset(track_data));
new_track.tiles_div.text("Running job.");
new_track.init();
}
@@ -1761,7 +1763,7 @@
run: function(url_params, new_track, success_callback) {
// Run tool.
url_params.inputs = this.get_param_values_dict();
- var ss_deferred = new ServerStateDeferred({
+ var ss_deferred = new util.ServerStateDeferred({
ajax_settings: {
url: galaxy_paths.get('tool_url'),
data: JSON.stringify(url_params),
@@ -2655,7 +2657,7 @@
.css({'height': ERROR_PADDING-1, 'width': canvas.width}).prependTo(this.html_elt);
// Handle message; only message currently is that only the first N elements are displayed.
- var tile_region = new GenomeRegion({
+ var tile_region = new visualization.GenomeRegion({
chrom: track.view.chrom,
start: this.low,
end: this.high
@@ -2817,7 +2819,7 @@
//
// Attribute init.
//
- this.dataset = new Dataset({
+ this.dataset = new data.Dataset({
id: obj_dict.dataset_id,
hda_ldda: obj_dict.hda_ldda
});
@@ -2928,13 +2930,13 @@
ok_fn = function() {
var regions_to_use = $('select[name="regions"] option:selected').val(),
regions,
- view_region = new GenomeRegion({
+ view_region = new visualization.GenomeRegion({
chrom: view.chrom,
start: view.low,
end: view.high
}),
bookmarked_regions = _.map($(".bookmark"), function(elt) {
- return new GenomeRegion({from_str: $(elt).children(".position").text()});
+ return new visualization.GenomeRegion({from_str: $(elt).children(".position").text()});
});
// Get regions for visualization.
@@ -3634,7 +3636,7 @@
tile_length = Math.ceil( TILE_SIZE * resolution ),
// Tile high cannot be larger than view.max_high, which the chromosome length.
tile_high = (tile_low + tile_length <= this.view.max_high ? tile_low + tile_length : this.view.max_high);
- return new GenomeRegion({
+ return new visualization.GenomeRegion({
chrom: this.view.chrom,
start: tile_low,
end: tile_high
@@ -3691,7 +3693,7 @@
self.data_query_wait = DEFAULT_DATA_QUERY_WAIT;
// Reset data URL when dataset indexing has completed/when not pending.
- var ss_deferred = new ServerStateDeferred({
+ var ss_deferred = new util.ServerStateDeferred({
url: self.dataset_state_url,
url_params: {dataset_id : self.dataset_id, hda_ldda: self.hda_ldda},
interval: self.data_query_wait,
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 static/scripts/viz/trackster/util.js
--- a/static/scripts/viz/trackster/util.js
+++ b/static/scripts/viz/trackster/util.js
@@ -3,6 +3,43 @@
exports = {};
/**
+ * Implementation of a server-state based deferred. Server is repeatedly polled, and when
+ * condition is met, deferred is resolved.
+ */
+exports.ServerStateDeferred = Backbone.Model.extend({
+ defaults: {
+ ajax_settings: {},
+ interval: 1000,
+ success_fn: function(result) { return true; }
+ },
+
+ /**
+ * Returns a deferred that resolves when success function returns true.
+ */
+ go: function() {
+ var deferred = $.Deferred(),
+ self = this,
+ ajax_settings = self.get('ajax_settings'),
+ success_fn = self.get('success_fn'),
+ interval = self.get('interval'),
+ _go = function() {
+ $.ajax(ajax_settings).success(function(result) {
+ if (success_fn(result)) {
+ // Result is good, so resolve.
+ deferred.resolve(result);
+ }
+ else {
+ // Result not good, try again.
+ setTimeout(_go, interval);
+ }
+ });
+ };
+ _go();
+ return deferred;
+ }
+});
+
+/**
* Returns a random color in hexadecimal format that is sufficiently different from a single color
* or set of colors.
* @param colors a color or list of colors in the format '#RRGGBB'
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 static/scripts/viz/visualization.js
--- a/static/scripts/viz/visualization.js
+++ b/static/scripts/viz/visualization.js
@@ -1,4 +1,4 @@
-(function(){
+define( ["mvc/data", "viz/trackster/util" ], function(data, util) {
/**
* Model, view, and controller objects for Galaxy visualization framework.
@@ -20,45 +20,6 @@
// --------- Models ---------
/**
- * Implementation of a server-state based deferred. Server is repeatedly polled, and when
- * condition is met, deferred is resolved.
- */
-var ServerStateDeferred = Backbone.Model.extend({
- defaults: {
- ajax_settings: {},
- interval: 1000,
- success_fn: function(result) { return true; }
- },
-
- /**
- * Returns a deferred that resolves when success function returns true.
- */
- go: function() {
- var deferred = $.Deferred(),
- self = this,
- ajax_settings = self.get('ajax_settings'),
- success_fn = self.get('success_fn'),
- interval = self.get('interval'),
- _go = function() {
- $.ajax(ajax_settings).success(function(result) {
- if (success_fn(result)) {
- // Result is good, so resolve.
- deferred.resolve(result);
- }
- else {
- // Result not good, try again.
- setTimeout(_go, interval);
- }
- });
- };
- _go();
- return deferred;
- }
-});
-
-// TODO: move to Backbone
-
-/**
* Canvas manager is used to create canvases, for browsers, this deals with
* backward comparibility using excanvas, as well as providing a pattern cache
*/
@@ -189,7 +150,7 @@
data_is_ready: function() {
var dataset = this.get('dataset'),
ready_deferred = $.Deferred(),
- ss_deferred = new ServerStateDeferred({
+ ss_deferred = new util.ServerStateDeferred({
ajax_settings: {
url: this.get('dataset').url(),
data: {
@@ -622,7 +583,7 @@
* A track of data in a genome visualization.
*/
// TODO: rename to Track and merge with Trackster's Track object.
-var BackboneTrack = Dataset.extend({
+var BackboneTrack = data.Dataset.extend({
initialize: function(options) {
// Dataset id is unique ID for now.
@@ -783,39 +744,23 @@
});
};
-// ---- Exports ----
+return {
+ BrowserBookmark: BrowserBookmark,
+ BrowserBookmarkCollection: BrowserBookmarkCollection,
+ Cache: Cache,
+ CanvasManager: CanvasManager,
+ Genome: Genome,
+ GenomeDataManager: GenomeDataManager,
+ GenomeRegion: GenomeRegion,
+ GenomeRegionCollection: GenomeRegionCollection,
+ GenomeVisualization: GenomeVisualization,
+ GenomeWideBigWigData: GenomeWideBigWigData,
+ GenomeWideSummaryTreeData: GenomeWideSummaryTreeData,
+ ReferenceTrackDataManager: ReferenceTrackDataManager,
+ TrackBrowserRouter: TrackBrowserRouter,
+ TrackConfig: TrackConfig,
+ Visualization: Visualization,
+ add_datasets: add_datasets
+};
-var exports = (function() {
- if ( typeof module !== 'undefined' && module.exports ) {
- // CommonJS
- return module.exports;
- } else if ( typeof define === 'function' && define.amd ) {
- // AMD
- exports = {};
- define( function() { return exports; } );
- return exports;
- } else {
- // Browser global
- return window;
- }
-})();
-
-exports.BrowserBookmark = BrowserBookmark;
-exports.BrowserBookmarkCollection = BrowserBookmarkCollection;
-exports.Cache = Cache;
-exports.CanvasManager = CanvasManager;
-exports.Genome = Genome;
-exports.GenomeDataManager = GenomeDataManager;
-exports.GenomeRegion = GenomeRegion;
-exports.GenomeRegionCollection = GenomeRegionCollection;
-exports.GenomeVisualization = GenomeVisualization;
-exports.GenomeWideBigWigData = GenomeWideBigWigData;
-exports.GenomeWideSummaryTreeData = GenomeWideSummaryTreeData;
-exports.ReferenceTrackDataManager = ReferenceTrackDataManager;
-exports.ServerStateDeferred = ServerStateDeferred;
-exports.TrackBrowserRouter = TrackBrowserRouter;
-exports.TrackConfig = TrackConfig;
-exports.Visualization = Visualization;
-exports.add_datasets = add_datasets;
-
-}).call(this);
\ No newline at end of file
+});
\ No newline at end of file
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 templates/root/tool_menu.mako
--- a/templates/root/tool_menu.mako
+++ b/templates/root/tool_menu.mako
@@ -17,7 +17,7 @@
<%def name="javascripts()">
${parent.javascripts()}
${h.templates( "tool_link", "panel_section", "tool_search" )}
- ${h.js( "galaxy.autocom_tagging", "mvc/tools" )}
+ ${h.js( "libs/require", "galaxy.autocom_tagging" )}
<%
# Set up for creating tool panel.
@@ -29,51 +29,64 @@
%><script type="text/javascript">
- // Init. on document load.
- var tool_panel, tool_panel_view, tool_search;
- $(function() {
- // Set up search.
- tool_search = new ToolSearch( {spinner_url: "${h.url_for('/static/images/loading_small_white_bg.gif')}",
- search_url: "${h.url_for( controller='root', action='tool_search' )}",
- hidden: ${tool_search_hidden} } );
-
- // Set up tool panel.
- tool_panel = new ToolPanel( { tool_search: tool_search } );
- tool_panel.reset( tool_panel.parse( ${h.to_json_string( dictified_panel )} ) );
-
- // Set up tool panel view and initialize.
- tool_panel_view = new ToolPanelView( {collection: tool_panel} );
- tool_panel_view.render();
- $('body').prepend(tool_panel_view.$el);
-
- // Minsize init hint.
- $( "a[minsizehint]" ).click( function() {
- if ( parent.handle_minwidth_hint ) {
- parent.handle_minwidth_hint( $(this).attr( "minsizehint" ) );
+
+ require.config({
+ baseUrl: "${h.url_for('/static/scripts')}",
+ shim: {
+ "libs/underscore": { exports: "_" }
}
+ });
+
+ require(["mvc/tools"], function(tools) {
+
+ // Init. on document load.
+ var tool_panel, tool_panel_view, tool_search;
+ $(function() {
+ // Set up search.
+ tool_search = new tools.ToolSearch(
+ { spinner_url: "${h.url_for('/static/images/loading_small_white_bg.gif')}",
+ search_url: "${h.url_for( controller='root', action='tool_search' )}",
+ hidden: ${tool_search_hidden} } );
+
+ // Set up tool panel.
+ tool_panel = new tools.ToolPanel( { tool_search: tool_search } );
+ tool_panel.reset( tool_panel.parse( ${h.to_json_string( dictified_panel )} ) );
+
+ // Set up tool panel view and initialize.
+ tool_panel_view = new tools.ToolPanelView( {collection: tool_panel} );
+ tool_panel_view.render();
+ $('body').prepend(tool_panel_view.$el);
+
+ // Minsize init hint.
+ $( "a[minsizehint]" ).click( function() {
+ if ( parent.handle_minwidth_hint ) {
+ parent.handle_minwidth_hint( $(this).attr( "minsizehint" ) );
+ }
+ });
+
+ // Log clicks on tools.
+ /*
+ $("div.toolTitle > a").click( function() {
+ var tool_title = $(this).attr('id').split("-")[1];
+ var section_title = $.trim( $(this).parents("div.toolSectionWrapper").find("div.toolSectionTitle").text() );
+ var search_active = $(this).parents("div.toolTitle").hasClass("search_match");
+
+ // Log action.
+ galaxy_async.log_user_action("tool_menu_click." + tool_title, section_title,
+ JSON.stringify({"search_active" : search_active}));
+ });
+ */
+
+ $( '.tooltip' ).tooltip();
+
+ // TODO: is this necessary?
+ $( "a[minsizehint]" ).click( function() {
+ if ( parent.handle_minwidth_hint ) {
+ parent.handle_minwidth_hint( $(this).attr( "minsizehint" ) );
+ }
+ });
});
-
- // Log clicks on tools.
- /*
- $("div.toolTitle > a").click( function() {
- var tool_title = $(this).attr('id').split("-")[1];
- var section_title = $.trim( $(this).parents("div.toolSectionWrapper").find("div.toolSectionTitle").text() );
- var search_active = $(this).parents("div.toolTitle").hasClass("search_match");
-
- // Log action.
- galaxy_async.log_user_action("tool_menu_click." + tool_title, section_title,
- JSON.stringify({"search_active" : search_active}));
- });
- */
-
- $( '.tooltip' ).tooltip();
-
- // TODO: is this necessary?
- $( "a[minsizehint]" ).click( function() {
- if ( parent.handle_minwidth_hint ) {
- parent.handle_minwidth_hint( $(this).attr( "minsizehint" ) );
- }
- });
+
});
</script></%def>
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 templates/tracks/browser.mako
--- a/templates/tracks/browser.mako
+++ b/templates/tracks/browser.mako
@@ -32,10 +32,12 @@
baseUrl: "${h.url_for('/static/scripts') }",
shim: {
"libs/underscore": { exports: "_" },
- "libs/backbone/backbone": { exports: "Backbone" }
+ "libs/backbone/backbone": { exports: "Backbone" },
+ "libs/backbone/backbone-relational": ["libs/backbone/backbone"]
}
});
- require( ["base", "viz/trackster_ui","viz/trackster/util","viz/trackster/tracks"], function( base, trackster_ui, util, tracks ) {
+ require( ["base", "viz/visualization", "viz/trackster_ui", "viz/trackster/tracks"],
+ function( base, visualization, trackster_ui, tracks ) {
//
// Place URLs here so that url_for can be used to generate them.
@@ -54,7 +56,7 @@
* Set up router.
*/
var set_up_router = function(options) {
- browser_router = new TrackBrowserRouter(options);
+ browser_router = new visualization.TrackBrowserRouter(options);
Backbone.history.start();
};
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 templates/visualization/circster.mako
--- a/templates/visualization/circster.mako
+++ b/templates/visualization/circster.mako
@@ -16,7 +16,7 @@
<%def name="javascripts()">
${parent.javascripts()}
- ${h.js( "libs/require", "mvc/data" )}
+ ${h.js( "libs/require" )}
<script type="text/javascript">
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 templates/visualization/sweepster.mako
--- a/templates/visualization/sweepster.mako
+++ b/templates/visualization/sweepster.mako
@@ -108,19 +108,19 @@
${h.templates( "tool_link", "panel_section", "tool_search", "tool_form" )}
${h.js( "libs/require", "libs/jquery/jquery-ui-1.8.23.custom.min" )}
- ${h.js( "mvc/data", "mvc/tools" )}
-
+
<script type="text/javascript">
require.config({
baseUrl: "${h.url_for('/static/scripts')}",
shim: {
"libs/underscore": { exports: "_" },
"libs/d3": { exports: "d3" },
- "libs/backbone/backbone": { exports: "Backbone" }
+ "libs/backbone/backbone": { exports: "Backbone" },
+ "libs/backbone/backbone-relational": ["libs/backbone/backbone"]
}
});
- require(["libs/d3", "viz/visualization", "viz/sweepster"], function(d3, visualization, sweepster) {
+ require(["libs/d3", "viz/sweepster"], function(d3, sweepster) {
var viz;
$(function() {
diff -r d824b236fe80ffea89cae979112580935abfa7c4 -r 040555fcc6b5341e2878c0d4ec33f54c712273c2 templates/visualization/trackster_common.mako
--- a/templates/visualization/trackster_common.mako
+++ b/templates/visualization/trackster_common.mako
@@ -11,7 +11,7 @@
## Render needed JavaScript files.
<%def name="render_trackster_js_files()">
- ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui-1.8.23.custom.min", "mvc/data", "viz/visualization", "libs/require", "libs/farbtastic" )}
+ ${h.js( "galaxy.panels", "libs/jquery/jstorage", "libs/jquery/jquery.event.drag", "libs/jquery/jquery.event.hover","libs/jquery/jquery.mousewheel", "libs/jquery/jquery-ui-1.8.23.custom.min", "libs/require", "libs/farbtastic" )}
</%def>
## Render a block of JavaScript that contains all necessary variables for Trackster.
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Workflows: Viewing and Downloading of workflows with missing tools now handled gracefully.
by Bitbucket 20 Sep '12
by Bitbucket 20 Sep '12
20 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/d824b236fe80/
changeset: d824b236fe80
user: dannon
date: 2012-09-20 23:10:52
summary: Workflows: Viewing and Downloading of workflows with missing tools now handled gracefully.
affected #: 3 files
diff -r 501641b6f680b88f5e1ef78e1b8080853d59dea8 -r d824b236fe80ffea89cae979112580935abfa7c4 lib/galaxy/web/base/controller.py
--- a/lib/galaxy/web/base/controller.py
+++ b/lib/galaxy/web/base/controller.py
@@ -668,14 +668,19 @@
if step.type == 'tool' or step.type is None:
# Restore the tool state for the step
module = module_factory.from_workflow_step( trans, step )
- #Check if tool was upgraded
- step.upgrade_messages = module.check_and_update_state()
- # Any connected input needs to have value DummyDataset (these
- # are not persisted so we need to do it every time)
- module.add_dummy_datasets( connections=step.input_connections )
- # Store state with the step
- step.module = module
- step.state = module.state
+ if module:
+ #Check if tool was upgraded
+ step.upgrade_messages = module.check_and_update_state()
+ # Any connected input needs to have value DummyDataset (these
+ # are not persisted so we need to do it every time)
+ module.add_dummy_datasets( connections=step.input_connections )
+ # Store state with the step
+ step.module = module
+ step.state = module.state
+ else:
+ step.upgrade_messages = "Unknown Tool ID"
+ step.module = None
+ step.state = None
# Error dict
if step.tool_errors:
errors[step.id] = step.tool_errors
diff -r 501641b6f680b88f5e1ef78e1b8080853d59dea8 -r d824b236fe80ffea89cae979112580935abfa7c4 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py
+++ b/lib/galaxy/web/controllers/workflow.py
@@ -214,14 +214,12 @@
raise web.httpexceptions.HTTPNotFound()
# Security check raises error if user cannot access workflow.
self.security_check( trans, stored_workflow, False, True )
-
# Get data for workflow's steps.
self.get_stored_workflow_steps( trans, stored_workflow )
# Get annotations.
stored_workflow.annotation = self.get_item_annotation_str( trans.sa_session, stored_workflow.user, stored_workflow )
for step in stored_workflow.latest_workflow.steps:
step.annotation = self.get_item_annotation_str( trans.sa_session, stored_workflow.user, step )
-
# Get rating data.
user_item_rating = 0
if trans.get_user():
@@ -1010,6 +1008,10 @@
# Stream workflow to file.
stored_dict = self._workflow_to_dict( trans, stored )
+ if not stored_dict:
+ #This workflow has a tool that's missing from the distribution
+ trans.response.status = 400
+ return "Workflow cannot be exported due to missing tools."
valid_chars = '.,^_-()[]0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
sname = stored.name
sname = ''.join(c in valid_chars and c or '_' for c in sname)[0:150]
@@ -1661,6 +1663,8 @@
for step in workflow.steps:
# Load from database representation
module = module_factory.from_workflow_step( trans, step )
+ if not module:
+ return None
# Get user annotation.
step_annotation = self.get_item_annotation_obj(trans.sa_session, trans.user, step )
annotation_str = ""
diff -r 501641b6f680b88f5e1ef78e1b8080853d59dea8 -r d824b236fe80ffea89cae979112580935abfa7c4 templates/workflow/display.mako
--- a/templates/workflow/display.mako
+++ b/templates/workflow/display.mako
@@ -87,10 +87,14 @@
tool = trans.app.toolbox.get_tool( step.tool_id )
%><div class="toolForm">
+ %if tool:
<div class="toolFormTitle">Step ${int(step.order_index)+1}: ${tool.name}</div><div class="toolFormBody">
${do_inputs( tool.inputs, step.state.inputs, "", step )}
</div>
+ %else:
+ <div class="toolFormTitle">Step ${int(step.order_index)+1}: Unknown Tool with id '${step.tool_id}'</div>
+ %endif
</div>
%else:
## TODO: always input dataset?
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Add utility function to circster that determines whether an element is visible.
by Bitbucket 20 Sep '12
by Bitbucket 20 Sep '12
20 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/501641b6f680/
changeset: 501641b6f680
user: jgoecks
date: 2012-09-20 21:39:57
summary: Add utility function to circster that determines whether an element is visible.
affected #: 1 file
diff -r b7fdcf887f2da2e4ba19b5894f56b3807e98bdf4 -r 501641b6f680b88f5e1ef78e1b8080853d59dea8 static/scripts/viz/circster.js
--- a/static/scripts/viz/circster.js
+++ b/static/scripts/viz/circster.js
@@ -3,8 +3,32 @@
// General backbone style inheritence
var Base = function() { this.initialize && this.initialize.apply(this, arguments); }; Base.extend = Backbone.Model.extend;
+var SVGUtils = Backbone.Model.extend({
+
+ /**
+ * Returns true if element is visible.
+ */
+ is_visible: function(svg_elt, svg) {
+ var eltBRect = svg_elt.getBoundingClientRect(),
+ svgBRect = $('svg')[0].getBoundingClientRect();
+
+ if (// To the left of screen?
+ eltBRect.right < 0 ||
+ // To the right of screen?
+ eltBRect.left > svgBRect.right ||
+ // Above screen?
+ eltBRect.bottom < 0 ||
+ // Below screen?
+ eltBRect.top > svgBRect.bottom) {
+ return false;
+ }
+ return true;
+ }
+
+});
+
/**
- * Renders a full circster visualization
+ * Renders a full circster visualization.
*/
var CircsterView = Backbone.View.extend({
className: 'circster',
@@ -23,7 +47,7 @@
height = self.$el.height(),
// Compute radius start based on model, will be centered
// and fit entirely inside element by default
- init_radius_start = ( Math.min(width,height)/2 -
+ init_radius_start = ( Math.min(width, height)/2 -
this.model.get('tracks').length * (this.dataset_arc_height + this.track_gap) );
// Set up SVG element.
@@ -38,6 +62,13 @@
svg.attr("transform",
"translate(" + d3.event.translate + ")" +
" scale(" + d3.event.scale + ")");
+ var utils = new SVGUtils();
+ var visible_elts = d3.selectAll('path').filter(function(d, i) {
+ return utils.is_visible(this, svg);
+ });
+ visible_elts.each(function(d, i) {
+ console.log(this.attr('title'));
+ });
}))
.attr("transform", "translate(" + width / 2 + "," + height / 2 + ")")
.append('svg:g');
@@ -57,7 +88,7 @@
total_gap: self.total_gap
});
- track_renderer.render( svg );
+ track_renderer.render(svg);
});
}
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Display warning or error message if attempting to install tool dependencies defined in a tool shed repository when the tool_dependency_dir config setting is not set in the Galaxy config.
by Bitbucket 20 Sep '12
by Bitbucket 20 Sep '12
20 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/b7fdcf887f2d/
changeset: b7fdcf887f2d
user: greg
date: 2012-09-20 20:41:33
summary: Display warning or error message if attempting to install tool dependencies defined in a tool shed repository when the tool_dependency_dir config setting is not set in the Galaxy config.
affected #: 1 file
diff -r 92b2699573b9c2c8439e1e53a03c9e01ae1c4f15 -r b7fdcf887f2da2e4ba19b5894f56b3807e98bdf4 lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -963,17 +963,23 @@
kwd[ 'message' ] = 'All selected tool dependencies are already uninstalled.'
kwd[ 'status' ] = 'error'
elif operation == "install":
- tool_dependencies_for_installation = []
- for tool_dependency_id in tool_dependency_ids:
- tool_dependency = get_tool_dependency( trans, tool_dependency_id )
- if tool_dependency.status in [ trans.model.ToolDependency.installation_status.NEVER_INSTALLED,
- trans.model.ToolDependency.installation_status.UNINSTALLED ]:
- tool_dependencies_for_installation.append( tool_dependency )
- if tool_dependencies_for_installation:
- self.initiate_tool_dependency_installation( trans, tool_dependencies_for_installation )
+ if trans.app.config.tool_dependency_dir:
+ tool_dependencies_for_installation = []
+ for tool_dependency_id in tool_dependency_ids:
+ tool_dependency = get_tool_dependency( trans, tool_dependency_id )
+ if tool_dependency.status in [ trans.model.ToolDependency.installation_status.NEVER_INSTALLED,
+ trans.model.ToolDependency.installation_status.UNINSTALLED ]:
+ tool_dependencies_for_installation.append( tool_dependency )
+ if tool_dependencies_for_installation:
+ self.initiate_tool_dependency_installation( trans, tool_dependencies_for_installation )
+ else:
+ kwd[ 'message' ] = 'All selected tool dependencies are already installed.'
+ kwd[ 'status' ] = 'error'
else:
- kwd[ 'message' ] = 'All selected tool dependencies are already installed.'
- kwd[ 'status' ] = 'error'
+ message = 'Set the value of your <b>tool_dependency_dir</b> setting in your Galaxy config file (universe_wsgi.ini) '
+ message += ' and restart your Galaxy server to install tool dependencies.'
+ kwd[ 'message' ] = message
+ kwd[ 'status' ] = 'error'
return self.tool_dependency_grid( trans, **kwd )
@web.expose
@web.require_admin
@@ -1186,6 +1192,10 @@
else:
readme_text = ''
if trans.app.config.tool_dependency_dir is None:
+ if includes_tool_dependencies:
+ message = "Tool dependencies defined in this repository can be automatically installed if you set the value of your <b>tool_dependency_dir</b>"
+ message += " setting in your Galaxy config file (universe_wsgi.ini) and restart your Galaxy server before installing the repository."
+ status = "warning"
checked = False
else:
checked = True
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Workflows: Fix for 0ba260ea43c4 to correctly display error message when attempting to run a workflow missing tools.
by Bitbucket 20 Sep '12
by Bitbucket 20 Sep '12
20 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/92b2699573b9/
changeset: 92b2699573b9
user: dannon
date: 2012-09-20 20:11:19
summary: Workflows: Fix for 0ba260ea43c4 to correctly display error message when attempting to run a workflow missing tools.
affected #: 1 file
diff -r dd1711a3518a27f6426cdf4d9def2efae29149c0 -r 92b2699573b9c2c8439e1e53a03c9e01ae1c4f15 lib/galaxy/web/controllers/workflow.py
--- a/lib/galaxy/web/controllers/workflow.py
+++ b/lib/galaxy/web/controllers/workflow.py
@@ -1497,7 +1497,11 @@
step.input_connections_by_name = dict( ( conn.input_name, conn ) for conn in step.input_connections )
if missing_tools:
stored.annotation = self.get_item_annotation_str( trans.sa_session, trans.user, stored )
- return trans.fill_template("workflow/run.mako", steps=[], workflow=stored, missing_tools = missing_tools)
+ return trans.fill_template("workflow/run.mako",
+ steps=[],
+ workflow=stored,
+ hide_fixed_params=hide_fixed_params,
+ missing_tools = missing_tools)
# Render the form
stored.annotation = self.get_item_annotation_str( trans.sa_session, trans.user, stored )
return trans.fill_template(
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fixes for viewing tool metadata in a tool shed repository for tools the require data index (.loc) files.
by Bitbucket 20 Sep '12
by Bitbucket 20 Sep '12
20 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/dd1711a3518a/
changeset: dd1711a3518a
user: greg
date: 2012-09-20 19:43:42
summary: Fixes for viewing tool metadata in a tool shed repository for tools the require data index (.loc) files.
affected #: 3 files
diff -r 3184303c13918a8b4734e46e1ac956d0e44ecba2 -r dd1711a3518a27f6426cdf4d9def2efae29149c0 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -341,6 +341,17 @@
correction_msg += "Upload a file named <b>%s.sample</b> to the repository to correct this error." % str( index_file_name )
invalid_files_and_errors_tups.append( ( tool_config_name, correction_msg ) )
return invalid_files_and_errors_tups
+def concat_messages( msg1, msg2 ):
+ if msg1:
+ if msg2:
+ message = '%s %s' % ( msg1, msg2 )
+ else:
+ message = msg1
+ elif msg2:
+ message = msg2
+ else:
+ message = ''
+ return message
def config_elems_to_xml_file( app, config_elems, config_filename, tool_path ):
# Persist the current in-memory list of config_elems to a file named by the value of config_filename.
fd, filename = tempfile.mkstemp()
@@ -352,6 +363,16 @@
os.close( fd )
shutil.move( filename, os.path.abspath( config_filename ) )
os.chmod( config_filename, 0644 )
+def copy_disk_sample_files_to_dir( trans, repo_files_dir, dest_path ):
+ sample_files = []
+ for root, dirs, files in os.walk( repo_files_dir ):
+ if root.find( '.hg' ) < 0:
+ for name in files:
+ if name.endswith( '.sample' ):
+ relative_path = os.path.join( root, name )
+ copy_sample_file( trans.app, relative_path, dest_path=dest_path )
+ sample_files.append( name )
+ return sample_files
def clean_repository_clone_url( repository_clone_url ):
if repository_clone_url.find( '@' ) > 0:
# We have an url that includes an authenticated user, something like:
@@ -1399,12 +1420,13 @@
if missing_data_table_entry:
# The repository must contain a tool_data_table_conf.xml.sample file that includes all required entries for all tools in the repository.
sample_tool_data_table_conf = get_config_from_disk( 'tool_data_table_conf.xml.sample', relative_install_dir )
- # Add entries to the ToolDataTableManager's in-memory data_tables dictionary as well as the list of data_table_elems and the list of
- # data_table_elem_names.
- error, correction_msg = handle_sample_tool_data_table_conf_file( app, sample_tool_data_table_conf, persist=True )
- if error:
- # TODO: Do more here than logging an exception.
- log.debug( correction_msg )
+ if sample_tool_data_table_conf:
+ # Add entries to the ToolDataTableManager's in-memory data_tables dictionary as well as the list of data_table_elems and the list of
+ # data_table_elem_names.
+ error, message = handle_sample_tool_data_table_conf_file( app, sample_tool_data_table_conf, persist=True )
+ if error:
+ # TODO: Do more here than logging an exception.
+ log.debug( message )
# Reload the tool into the local list of repository_tools_tups.
repository_tool = app.toolbox.load_tool( os.path.join( tool_path, tup_path ), guid=guid )
repository_tools_tups[ index ] = ( tup_path, guid, repository_tool )
@@ -1436,9 +1458,21 @@
repository_tool = app.toolbox.load_tool( os.path.join( tool_path, tup_path ), guid=guid )
repository_tools_tups[ index ] = ( tup_path, guid, repository_tool )
return repository_tools_tups, sample_files_copied
+def handle_sample_files_and_load_tool_from_disk( trans, repo_files_dir, tool_config_filepath, work_dir ):
+ # Copy all sample files from disk to a temporary directory since the sample files may be in multiple directories.
+ message = ''
+ sample_files = copy_disk_sample_files_to_dir( trans, repo_files_dir, work_dir )
+ if sample_files:
+ if 'tool_data_table_conf.xml.sample' in sample_files:
+ # Load entries into the tool_data_tables if the tool requires them.
+ tool_data_table_config = os.path.join( work_dir, 'tool_data_table_conf.xml' )
+ error, message = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
+ tool, valid, message2 = load_tool_from_config( trans.app, tool_config_filepath )
+ message = concat_messages( message, message2 )
+ return tool, valid, message
def handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir ):
tool = None
- message = None
+ message = ''
ctx = get_changectx_for_changeset( repo, changeset_revision )
# We're not currently doing anything with the returned list of deleted_sample_files here. It is intended to help handle sample files that are in
# the manifest, but have been deleted from disk.
@@ -1448,13 +1482,14 @@
if 'tool_data_table_conf.xml.sample' in sample_files:
# Load entries into the tool_data_tables if the tool requires them.
tool_data_table_config = os.path.join( work_dir, 'tool_data_table_conf.xml' )
- error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
- if error:
- # TODO: Do more here than logging an exception.
- log.debug( correction_msg )
+ if tool_data_table_config:
+ error, message = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
+ if error:
+ log.debug( message )
manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( tool_config_filename, repo, changeset_revision )
if manifest_ctx and ctx_file:
- tool, message = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
+ tool, message2 = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
+ message = concat_messages( message, message2 )
return tool, message
def handle_sample_tool_data_table_conf_file( app, filename, persist=False ):
"""
diff -r 3184303c13918a8b4734e46e1ac956d0e44ecba2 -r dd1711a3518a27f6426cdf4d9def2efae29149c0 lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -7,8 +7,9 @@
from galaxy.util.hash_util import *
from galaxy.util.shed_util import check_tool_input_params, clone_repository, copy_sample_file, generate_metadata_for_changeset_revision
from galaxy.util.shed_util import get_changectx_for_changeset, get_config_from_disk, get_configured_ui, get_file_context_from_ctx, get_named_tmpfile_from_ctx
-from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_tmp_config, handle_sample_tool_data_table_conf_file, INITIAL_CHANGELOG_HASH
-from galaxy.util.shed_util import load_tool_from_config, reset_tool_data_tables, reversed_upper_bounded_changelog, strip_path
+from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_disk, handle_sample_files_and_load_tool_from_tmp_config
+from galaxy.util.shed_util import handle_sample_tool_data_table_conf_file, INITIAL_CHANGELOG_HASH, load_tool_from_config, reset_tool_data_tables
+from galaxy.util.shed_util import reversed_upper_bounded_changelog, strip_path
from galaxy.web.base.controller import *
from galaxy.webapps.community import model
from galaxy.model.orm import *
@@ -258,16 +259,6 @@
else:
return 'subset'
return 'not equal and not subset'
-def copy_disk_sample_files_to_dir( trans, repo_files_dir, dest_path ):
- sample_files = []
- for root, dirs, files in os.walk( repo_files_dir ):
- if root.find( '.hg' ) < 0:
- for name in files:
- if name.endswith( '.sample' ):
- relative_path = os.path.join( root, name )
- copy_sample_file( trans.app, relative_path, dest_path=dest_path )
- sample_files.append( name )
- return sample_files
def copy_file_from_disk( filename, repo_dir, dir ):
file_path = None
found = False
@@ -628,15 +619,8 @@
work_dir = tempfile.mkdtemp()
can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, tool_config_filepath, changeset_revision )
if can_use_disk_file:
- # Copy all sample files from disk to a temporary directory since the sample files may be in multiple directories.
- sample_files = copy_disk_sample_files_to_dir( trans, repo_files_dir, work_dir )
- if sample_files:
- trans.app.config.tool_data_path = work_dir
- if 'tool_data_table_conf.xml.sample' in sample_files:
- # Load entries into the tool_data_tables if the tool requires them.
- tool_data_table_config = os.path.join( work_dir, 'tool_data_table_conf.xml' )
- error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
- tool, valid, message = load_tool_from_config( trans.app, tool_config_filepath )
+ trans.app.config.tool_data_path = work_dir
+ tool, valid, message = handle_sample_files_and_load_tool_from_disk( trans, repo_files_dir, tool_config_filepath, work_dir )
if tool is not None:
invalid_files_and_errors_tups = check_tool_input_params( trans.app,
repo_files_dir,
@@ -645,11 +629,12 @@
sample_files,
webapp='community' )
if invalid_files_and_errors_tups:
- message = generate_message_for_invalid_tools( invalid_files_and_errors_tups,
- repository,
- metadata_dict=None,
- as_html=True,
- displaying_invalid_tool=True )
+ message2 = generate_message_for_invalid_tools( invalid_files_and_errors_tups,
+ repository,
+ metadata_dict=None,
+ as_html=True,
+ displaying_invalid_tool=True )
+ message = concat_messages( message, message2 )
status = 'error'
else:
tool, message = handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir )
diff -r 3184303c13918a8b4734e46e1ac956d0e44ecba2 -r dd1711a3518a27f6426cdf4d9def2efae29149c0 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -10,9 +10,9 @@
from galaxy.util.json import from_json_string, to_json_string
from galaxy.model.orm import *
from galaxy.util.shed_util import create_repo_info_dict, get_changectx_for_changeset, get_configured_ui, get_repository_file_contents
-from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_tmp_config, INITIAL_CHANGELOG_HASH, load_tool_from_config, NOT_TOOL_CONFIGS
-from galaxy.util.shed_util import open_repository_files_folder, reversed_lower_upper_bounded_changelog, reversed_upper_bounded_changelog, strip_path
-from galaxy.util.shed_util import to_html_escaped, update_repository, url_join
+from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_disk, handle_sample_files_and_load_tool_from_tmp_config, INITIAL_CHANGELOG_HASH
+from galaxy.util.shed_util import load_tool_from_config, NOT_TOOL_CONFIGS, open_repository_files_folder, reversed_lower_upper_bounded_changelog
+from galaxy.util.shed_util import reversed_upper_bounded_changelog, strip_path, to_html_escaped, update_repository, url_join
from galaxy.tool_shed.encoding_util import *
from common import *
@@ -2293,20 +2293,21 @@
if 'tools' in metadata:
for tool_metadata_dict in metadata[ 'tools' ]:
if tool_metadata_dict[ 'id' ] == tool_id:
+ work_dir = tempfile.mkdtemp()
relative_path_to_tool_config = tool_metadata_dict[ 'tool_config' ]
guid = tool_metadata_dict[ 'guid' ]
full_path_to_tool_config = os.path.abspath( relative_path_to_tool_config )
- full_path_to_dir, tool_tool_config_filename = os.path.split( full_path_to_tool_config )
+ full_path_to_dir, tool_config_filename = os.path.split( full_path_to_tool_config )
can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, full_path_to_tool_config, changeset_revision )
if can_use_disk_file:
- trans.app.config.tool_data_path = full_path_to_dir
- # Load entries into the tool_data_tables if the tool requires them.
- tool_data_table_config = get_config_from_disk( 'tool_data_table_conf.xml.sample', full_path_to_dir )
- error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
- tool, valid, message = load_tool_from_config( trans.app, full_path_to_tool_config )
+ trans.app.config.tool_data_path = work_dir
+ tool, valid, message = handle_sample_files_and_load_tool_from_disk( trans, repo_files_dir, full_path_to_tool_config, work_dir )
+ if message:
+ status = 'error'
else:
- work_dir = tempfile.mkdtemp()
tool, message = handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir )
+ if message:
+ status = 'error'
break
if guid:
tool_lineage = self.get_versions_of_tool( trans, repository, repository_metadata, guid )
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix for viewing tool metadata defined for tools in a repository that use the Galaxy ToolDataTableManager.
by Bitbucket 20 Sep '12
by Bitbucket 20 Sep '12
20 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/3184303c1391/
changeset: 3184303c1391
user: greg
date: 2012-09-20 16:58:05
summary: Fix for viewing tool metadata defined for tools in a repository that use the Galaxy ToolDataTableManager.
affected #: 3 files
diff -r be1f6ebb8d6bd3864e5ca08c59f8edaa4f471004 -r 3184303c13918a8b4734e46e1ac956d0e44ecba2 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -1053,12 +1053,75 @@
if converter_path and display_path:
break
return converter_path, display_path
+def get_ctx_file_path_from_manifest( filename, repo, changeset_revision ):
+ """Get the ctx file path for the latest revision of filename from the repository manifest up to the value of changeset_revision."""
+ stripped_filename = strip_path( filename )
+ for changeset in reversed_upper_bounded_changelog( repo, changeset_revision ):
+ manifest_changeset_revision = str( repo.changectx( changeset ) )
+ manifest_ctx = repo.changectx( changeset )
+ for ctx_file in manifest_ctx.files():
+ ctx_file_name = strip_path( ctx_file )
+ if ctx_file_name == stripped_filename:
+ return manifest_ctx, ctx_file
+ return None, None
def get_ctx_rev( tool_shed_url, name, owner, changeset_revision ):
url = url_join( tool_shed_url, 'repository/get_ctx_rev?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % ( name, owner, changeset_revision ) )
response = urllib2.urlopen( url )
ctx_rev = response.read()
response.close()
return ctx_rev
+def get_file_context_from_ctx( ctx, filename ):
+ # We have to be careful in determining if we found the correct file because multiple files with the same name may be in different directories
+ # within ctx if the files were moved within the change set. For example, in the following ctx.files() list, the former may have been moved to
+ # the latter: ['tmap_wrapper_0.0.19/tool_data_table_conf.xml.sample', 'tmap_wrapper_0.3.3/tool_data_table_conf.xml.sample']. Another scenario
+ # is that the file has been deleted.
+ deleted = False
+ filename = strip_path( filename )
+ for ctx_file in ctx.files():
+ ctx_file_name = strip_path( ctx_file )
+ if filename == ctx_file_name:
+ try:
+ # If the file was moved, its destination will be returned here.
+ fctx = ctx[ ctx_file ]
+ return fctx
+ except LookupError, e:
+ # Set deleted for now, and continue looking in case the file was moved instead of deleted.
+ deleted = True
+ if deleted:
+ return 'DELETED'
+ return None
+def get_list_of_copied_sample_files( repo, ctx, dir ):
+ """
+ Find all sample files (files in the repository with the special .sample extension) in the reversed repository manifest up to ctx. Copy
+ each discovered file to dir and return the list of filenames. If a .sample file was added in a changeset and then deleted in a later
+ changeset, it will be returned in the deleted_sample_files list. The caller will set the value of app.config.tool_data_path to dir in
+ order to load the tools and generate metadata for them.
+ """
+ deleted_sample_files = []
+ sample_files = []
+ for changeset in reversed_upper_bounded_changelog( repo, ctx ):
+ changeset_ctx = repo.changectx( changeset )
+ for ctx_file in changeset_ctx.files():
+ ctx_file_name = strip_path( ctx_file )
+ # If we decide in the future that files deleted later in the changelog should not be used, we can use the following if statement.
+ # if ctx_file_name.endswith( '.sample' ) and ctx_file_name not in sample_files and ctx_file_name not in deleted_sample_files:
+ if ctx_file_name.endswith( '.sample' ) and ctx_file_name not in sample_files:
+ fctx = get_file_context_from_ctx( changeset_ctx, ctx_file )
+ if fctx in [ 'DELETED' ]:
+ # Since the possibly future used if statement above is commented out, the same file that was initially added will be
+ # discovered in an earlier changeset in the change log and fall through to the else block below. In other words, if
+ # a file named blast2go.loc.sample was added in change set 0 and then deleted in changeset 3, the deleted file in changeset
+ # 3 will be handled here, but the later discovered file in changeset 0 will be handled in the else block below. In this
+ # way, the file contents will always be found for future tools even though the file was deleted.
+ if ctx_file_name not in deleted_sample_files:
+ deleted_sample_files.append( ctx_file_name )
+ else:
+ sample_files.append( ctx_file_name )
+ tmp_ctx_file_name = os.path.join( dir, ctx_file_name.replace( '.sample', '' ) )
+ fh = open( tmp_ctx_file_name, 'wb' )
+ fh.write( fctx.data() )
+ fh.close()
+ return sample_files, deleted_sample_files
def get_named_tmpfile_from_ctx( ctx, filename, dir ):
filename = strip_path( filename )
for ctx_file in ctx.files():
@@ -1373,6 +1436,26 @@
repository_tool = app.toolbox.load_tool( os.path.join( tool_path, tup_path ), guid=guid )
repository_tools_tups[ index ] = ( tup_path, guid, repository_tool )
return repository_tools_tups, sample_files_copied
+def handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir ):
+ tool = None
+ message = None
+ ctx = get_changectx_for_changeset( repo, changeset_revision )
+ # We're not currently doing anything with the returned list of deleted_sample_files here. It is intended to help handle sample files that are in
+ # the manifest, but have been deleted from disk.
+ sample_files, deleted_sample_files = get_list_of_copied_sample_files( repo, ctx, dir=work_dir )
+ if sample_files:
+ trans.app.config.tool_data_path = work_dir
+ if 'tool_data_table_conf.xml.sample' in sample_files:
+ # Load entries into the tool_data_tables if the tool requires them.
+ tool_data_table_config = os.path.join( work_dir, 'tool_data_table_conf.xml' )
+ error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
+ if error:
+ # TODO: Do more here than logging an exception.
+ log.debug( correction_msg )
+ manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( tool_config_filename, repo, changeset_revision )
+ if manifest_ctx and ctx_file:
+ tool, message = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
+ return tool, message
def handle_sample_tool_data_table_conf_file( app, filename, persist=False ):
"""
Parse the incoming filename and add new entries to the in-memory app.tool_data_tables dictionary. If persist is True (should only occur)
@@ -1492,6 +1575,31 @@
valid = False
error_message = str( e )
return tool, valid, error_message
+def load_tool_from_tmp_config( trans, repo, ctx, ctx_file, work_dir ):
+ tool = None
+ message = ''
+ tmp_tool_config = get_named_tmpfile_from_ctx( ctx, ctx_file, work_dir )
+ if tmp_tool_config:
+ element_tree = util.parse_xml( tmp_tool_config )
+ element_tree_root = element_tree.getroot()
+ # Look for code files required by the tool config.
+ tmp_code_files = []
+ for code_elem in element_tree_root.findall( 'code' ):
+ code_file_name = code_elem.get( 'file' )
+ tmp_code_file_name = copy_file_from_manifest( repo, ctx, code_file_name, work_dir )
+ if tmp_code_file_name:
+ tmp_code_files.append( tmp_code_file_name )
+ tool, valid, message = load_tool_from_config( trans.app, tmp_tool_config )
+ for tmp_code_file in tmp_code_files:
+ try:
+ os.unlink( tmp_code_file )
+ except:
+ pass
+ try:
+ os.unlink( tmp_tool_config )
+ except:
+ pass
+ return tool, message
def open_repository_files_folder( trans, folder_path ):
try:
files_list = get_repository_files( trans, folder_path )
diff -r be1f6ebb8d6bd3864e5ca08c59f8edaa4f471004 -r 3184303c13918a8b4734e46e1ac956d0e44ecba2 lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -6,9 +6,9 @@
from galaxy.util.json import from_json_string, to_json_string
from galaxy.util.hash_util import *
from galaxy.util.shed_util import check_tool_input_params, clone_repository, copy_sample_file, generate_metadata_for_changeset_revision
-from galaxy.util.shed_util import get_changectx_for_changeset, get_config_from_disk, get_configured_ui, get_named_tmpfile_from_ctx
-from galaxy.util.shed_util import handle_sample_tool_data_table_conf_file, INITIAL_CHANGELOG_HASH, load_tool_from_config, reset_tool_data_tables
-from galaxy.util.shed_util import reversed_upper_bounded_changelog, strip_path
+from galaxy.util.shed_util import get_changectx_for_changeset, get_config_from_disk, get_configured_ui, get_file_context_from_ctx, get_named_tmpfile_from_ctx
+from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_tmp_config, handle_sample_tool_data_table_conf_file, INITIAL_CHANGELOG_HASH
+from galaxy.util.shed_util import load_tool_from_config, reset_tool_data_tables, reversed_upper_bounded_changelog, strip_path
from galaxy.web.base.controller import *
from galaxy.webapps.community import model
from galaxy.model.orm import *
@@ -392,37 +392,6 @@
return trans.sa_session.query( trans.model.Category ) \
.filter( trans.model.Category.table.c.deleted==False ) \
.order_by( trans.model.Category.table.c.name ).all()
-def get_file_context_from_ctx( ctx, filename ):
- # We have to be careful in determining if we found the correct file because multiple files with the same name may be in different directories
- # within ctx if the files were moved within the change set. For example, in the following ctx.files() list, the former may have been moved to
- # the latter: ['tmap_wrapper_0.0.19/tool_data_table_conf.xml.sample', 'tmap_wrapper_0.3.3/tool_data_table_conf.xml.sample']. Another scenario
- # is that the file has been deleted.
- deleted = False
- filename = strip_path( filename )
- for ctx_file in ctx.files():
- ctx_file_name = strip_path( ctx_file )
- if filename == ctx_file_name:
- try:
- # If the file was moved, its destination will be returned here.
- fctx = ctx[ ctx_file ]
- return fctx
- except LookupError, e:
- # Set deleted for now, and continue looking in case the file was moved instead of deleted.
- deleted = True
- if deleted:
- return 'DELETED'
- return None
-def get_ctx_file_path_from_manifest( filename, repo, changeset_revision ):
- """Get the ctx file path for the latest revision of filename from the repository manifest up to the value of changeset_revision."""
- stripped_filename = strip_path( filename )
- for changeset in reversed_upper_bounded_changelog( repo, changeset_revision ):
- manifest_changeset_revision = str( repo.changectx( changeset ) )
- manifest_ctx = repo.changectx( changeset )
- for ctx_file in manifest_ctx.files():
- ctx_file_name = strip_path( ctx_file )
- if ctx_file_name == stripped_filename:
- return manifest_ctx, ctx_file
- return None, None
def get_latest_repository_metadata( trans, decoded_repository_id ):
"""Get last metadata defined for a specified repository from the database"""
return trans.sa_session.query( trans.model.RepositoryMetadata ) \
@@ -450,38 +419,6 @@
fh.close()
return tmp_filename
return None
-def get_list_of_copied_sample_files( repo, ctx, dir ):
- """
- Find all sample files (files in the repository with the special .sample extension) in the reversed repository manifest up to ctx. Copy
- each discovered file to dir and return the list of filenames. If a .sample file was added in a changeset and then deleted in a later
- changeset, it will be returned in the deleted_sample_files list. The caller will set the value of app.config.tool_data_path to dir in
- order to load the tools and generate metadata for them.
- """
- deleted_sample_files = []
- sample_files = []
- for changeset in reversed_upper_bounded_changelog( repo, ctx ):
- changeset_ctx = repo.changectx( changeset )
- for ctx_file in changeset_ctx.files():
- ctx_file_name = strip_path( ctx_file )
- # If we decide in the future that files deleted later in the changelog should not be used, we can use the following if statement.
- # if ctx_file_name.endswith( '.sample' ) and ctx_file_name not in sample_files and ctx_file_name not in deleted_sample_files:
- if ctx_file_name.endswith( '.sample' ) and ctx_file_name not in sample_files:
- fctx = get_file_context_from_ctx( changeset_ctx, ctx_file )
- if fctx in [ 'DELETED' ]:
- # Since the possibly future used if statement above is commented out, the same file that was initially added will be
- # discovered in an earlier changeset in the change log and fall through to the else block below. In other words, if
- # a file named blast2go.loc.sample was added in change set 0 and then deleted in changeset 3, the deleted file in changeset
- # 3 will be handled here, but the later discovered file in changeset 0 will be handled in the else block below. In this
- # way, the file contents will always be found for future tools even though the file was deleted.
- if ctx_file_name not in deleted_sample_files:
- deleted_sample_files.append( ctx_file_name )
- else:
- sample_files.append( ctx_file_name )
- tmp_ctx_file_name = os.path.join( dir, ctx_file_name.replace( '.sample', '' ) )
- fh = open( tmp_ctx_file_name, 'wb' )
- fh.write( fctx.data() )
- fh.close()
- return sample_files, deleted_sample_files
def get_parent_id( trans, id, old_id, version, guid, changeset_revisions ):
parent_id = None
# Compare from most recent to oldest.
@@ -715,54 +652,15 @@
displaying_invalid_tool=True )
status = 'error'
else:
- # The desired version of the tool config is no longer on disk, so create a temporary work environment and copy the tool config and dependent files.
- ctx = get_changectx_for_changeset( repo, changeset_revision )
- # We're not currently doing anything with the returned list of deleted_sample_files here. It is intended to help handle sample files that are in
- # the manifest, but have been deleted from disk.
- sample_files, deleted_sample_files = get_list_of_copied_sample_files( repo, ctx, dir=work_dir )
- if sample_files:
- trans.app.config.tool_data_path = work_dir
- if 'tool_data_table_conf.xml.sample' in sample_files:
- # Load entries into the tool_data_tables if the tool requires them.
- tool_data_table_config = os.path.join( work_dir, 'tool_data_table_conf.xml' )
- error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
- manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( tool_config_filename, repo, changeset_revision )
- if manifest_ctx and ctx_file:
- tool, message = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
+ tool, message = handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir )
try:
shutil.rmtree( work_dir )
except:
pass
- if sample_files:
- trans.app.config.tool_data_path = original_tool_data_path
+ trans.app.config.tool_data_path = original_tool_data_path
# Reset the tool_data_tables by loading the empty tool_data_table_conf.xml file.
reset_tool_data_tables( trans.app )
return repository, tool, message
-def load_tool_from_tmp_config( trans, repo, ctx, ctx_file, work_dir ):
- tool = None
- message = ''
- tmp_tool_config = get_named_tmpfile_from_ctx( ctx, ctx_file, work_dir )
- if tmp_tool_config:
- element_tree = util.parse_xml( tmp_tool_config )
- element_tree_root = element_tree.getroot()
- # Look for code files required by the tool config.
- tmp_code_files = []
- for code_elem in element_tree_root.findall( 'code' ):
- code_file_name = code_elem.get( 'file' )
- tmp_code_file_name = copy_file_from_manifest( repo, ctx, code_file_name, work_dir )
- if tmp_code_file_name:
- tmp_code_files.append( tmp_code_file_name )
- tool, valid, message = load_tool_from_config( trans.app, tmp_tool_config )
- for tmp_code_file in tmp_code_files:
- try:
- os.unlink( tmp_code_file )
- except:
- pass
- try:
- os.unlink( tmp_tool_config )
- except:
- pass
- return tool, message
def new_tool_metadata_required( trans, repository, metadata_dict ):
"""
Compare the last saved metadata for each tool in the repository with the new metadata in metadata_dict to determine if a new repository_metadata
diff -r be1f6ebb8d6bd3864e5ca08c59f8edaa4f471004 -r 3184303c13918a8b4734e46e1ac956d0e44ecba2 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -9,9 +9,10 @@
from galaxy.web.framework.helpers import time_ago, iff, grids
from galaxy.util.json import from_json_string, to_json_string
from galaxy.model.orm import *
-from galaxy.util.shed_util import create_repo_info_dict, get_changectx_for_changeset, get_configured_ui, get_repository_file_contents, INITIAL_CHANGELOG_HASH
-from galaxy.util.shed_util import load_tool_from_config, NOT_TOOL_CONFIGS, open_repository_files_folder, reversed_lower_upper_bounded_changelog
-from galaxy.util.shed_util import reversed_upper_bounded_changelog, strip_path, to_html_escaped, update_repository, url_join
+from galaxy.util.shed_util import create_repo_info_dict, get_changectx_for_changeset, get_configured_ui, get_repository_file_contents
+from galaxy.util.shed_util import handle_sample_files_and_load_tool_from_tmp_config, INITIAL_CHANGELOG_HASH, load_tool_from_config, NOT_TOOL_CONFIGS
+from galaxy.util.shed_util import open_repository_files_folder, reversed_lower_upper_bounded_changelog, reversed_upper_bounded_changelog, strip_path
+from galaxy.util.shed_util import to_html_escaped, update_repository, url_join
from galaxy.tool_shed.encoding_util import *
from common import *
@@ -2283,6 +2284,7 @@
tool_lineage = []
tool = None
guid = None
+ original_tool_data_path = trans.app.config.tool_data_path
revision_label = get_revision_label( trans, repository, changeset_revision )
repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
if repository_metadata:
@@ -2293,16 +2295,18 @@
if tool_metadata_dict[ 'id' ] == tool_id:
relative_path_to_tool_config = tool_metadata_dict[ 'tool_config' ]
guid = tool_metadata_dict[ 'guid' ]
- full_path = os.path.abspath( relative_path_to_tool_config )
- can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, full_path, changeset_revision )
+ full_path_to_tool_config = os.path.abspath( relative_path_to_tool_config )
+ full_path_to_dir, tool_tool_config_filename = os.path.split( full_path_to_tool_config )
+ can_use_disk_file = can_use_tool_config_disk_file( trans, repository, repo, full_path_to_tool_config, changeset_revision )
if can_use_disk_file:
- tool, valid, message = load_tool_from_config( trans.app, full_path )
+ trans.app.config.tool_data_path = full_path_to_dir
+ # Load entries into the tool_data_tables if the tool requires them.
+ tool_data_table_config = get_config_from_disk( 'tool_data_table_conf.xml.sample', full_path_to_dir )
+ error, correction_msg = handle_sample_tool_data_table_conf_file( trans.app, tool_data_table_config )
+ tool, valid, message = load_tool_from_config( trans.app, full_path_to_tool_config )
else:
- # We're attempting to load a tool using a config that no longer exists on disk.
work_dir = tempfile.mkdtemp()
- manifest_ctx, ctx_file = get_ctx_file_path_from_manifest( relative_path_to_tool_config, repo, changeset_revision )
- if manifest_ctx and ctx_file:
- tool, message = load_tool_from_tmp_config( trans, repo, manifest_ctx, ctx_file, work_dir )
+ tool, message = handle_sample_files_and_load_tool_from_tmp_config( trans, repo, changeset_revision, tool_config_filename, work_dir )
break
if guid:
tool_lineage = self.get_versions_of_tool( trans, repository, repository_metadata, guid )
@@ -2312,6 +2316,7 @@
selected_value=changeset_revision,
add_id_to_name=False,
downloadable_only=False )
+ trans.app.config.tool_data_path = original_tool_data_path
return trans.fill_template( "/webapps/community/repository/view_tool_metadata.mako",
repository=repository,
tool=tool,
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: jgoecks: Circster: render wiggle data as a single path rather than many small paths.
by Bitbucket 19 Sep '12
by Bitbucket 19 Sep '12
19 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/be1f6ebb8d6b/
changeset: be1f6ebb8d6b
user: jgoecks
date: 2012-09-20 00:31:30
summary: Circster: render wiggle data as a single path rather than many small paths.
affected #: 1 file
diff -r 6390e1f3a72300974c113f927b80eec98b32fe94 -r be1f6ebb8d6bd3864e5ca08c59f8edaa4f471004 static/scripts/viz/circster.js
--- a/static/scripts/viz/circster.js
+++ b/static/scripts/viz/circster.js
@@ -69,15 +69,10 @@
this.options = options;
},
- render: function( svg ) {
-
+ render: function( svg ) {
+ // Draw background arcs for each chromosome.
var genome_arcs = this.chroms_layout(),
- chroms_arcs = this.genome_data_layout();
-
- // -- Render. --
-
- // Draw background arcs for each chromosome.
- var radius_start = this.options.radius_start,
+ radius_start = this.options.radius_start,
radius_end = this.options.radius_end,
base_arc = svg.append("g").attr("id", "inner-arc"),
arc_gen = d3.svg.arc()
@@ -91,24 +86,13 @@
.style("fill", "#ccc")
.append("title").text(function(d) { return d.data.chrom; });
- // For each chromosome, draw dataset.
+ // Render data.
+ this.render_data(svg);
+
var prefs = this.options.track.get('prefs'),
block_color = prefs.block_color;
-
- _.each(chroms_arcs, function(chrom_layout) {
- if (!chrom_layout) { return; }
-
- var group = svg.append("g"),
- arc_gen = d3.svg.arc().innerRadius(radius_start),
- dataset_elts = group.selectAll("path")
- .data(chrom_layout).enter()
- ;
- //.style("stroke", block_color)
- //.style("fill", block_color)
-
- dataset_elts.append("path").attr("d", arc_gen).style("stroke", block_color);
-
- });
+ if (!block_color) { block_color = prefs.color; }
+ svg.selectAll('path.chrom-data').style('stroke', block_color).style('fill', block_color);
},
/**
@@ -131,12 +115,15 @@
},
/**
- * Returns layouts for drawing a chromosome's data.
+ * Render chromosome data and attach elements to svg.
*/
- chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, max) {
+ render_chrom_data: function(chrom_arc, chrom_data, inner_radius, outer_radius, max) {
},
- genome_data_layout: function() {
+ /**
+ * Render data as elements attached to svg.
+ */
+ render_data: function(svg) {
var self = this,
chrom_arcs = this.chroms_layout(),
dataset = this.options.track.get('genome_wide_data'),
@@ -150,7 +137,9 @@
chroms_data_layout = _.map(layout_and_data, function(chrom_info) {
var chrom_arc = chrom_info[0],
chrom_data = chrom_info[1];
- return self.chrom_data_layout(chrom_arc, chrom_data, r_start, r_end, dataset.get('min'), dataset.get('max'));
+ return self.render_chrom_data(svg, chrom_arc, chrom_data,
+ r_start, r_end,
+ dataset.get('min'), dataset.get('max'));
});
return chroms_data_layout;
@@ -165,7 +154,9 @@
/**
* Returns layouts for drawing a chromosome's data.
*/
- chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
+ render_chrom_data: function(svg, chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
+ // FIXME: draw as area:
+ /*
// If no chrom data, return null.
if (!chrom_data || typeof chrom_data === "string") {
return null;
@@ -189,6 +180,7 @@
});
return arcs;
+ */
}
});
@@ -198,32 +190,49 @@
var CircsterBigWigTrackRenderer = CircsterTrackRenderer.extend({
/**
- * Returns layouts for drawing a chromosome's data.
+ * Render chromosome data and attach elements to svg.
*/
- chrom_data_layout: function(chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
+ render_chrom_data: function(svg, chrom_arc, chrom_data, inner_radius, outer_radius, min, max) {
var data = chrom_data.data;
if (data.length === 0) { return; }
-
- var scale = d3.scale.linear()
- .domain( [min, max] )
- .range( [inner_radius, outer_radius] ),
- arc_layout = d3.layout.pie().value(function(d, i) {
- // If at end of data, draw nothing.
- if (i + 1 === data.length) { return 0; }
- // Layout is from current position to next position.
- return data[i+1][0] - data[i][0];
- })
- .startAngle(chrom_arc.startAngle)
- .endAngle(chrom_arc.endAngle),
- arcs = arc_layout(data);
-
- // Use scale to assign outer radius.
- _.each(data, function(datum, index) {
- arcs[index].outerRadius = scale(datum[1]);
- });
-
- return arcs;
+ // Radius scaler.
+ var radius = d3.scale.linear()
+ .domain([min, max])
+ .range([inner_radius, outer_radius]);
+
+ // Scaler for placing data points across arc.
+ var angle = d3.scale.linear()
+ .domain([0, data.length])
+ .range([chrom_arc.startAngle, chrom_arc.endAngle]);
+
+ // FIXME:
+ // *area is not necessary as long as 0 is used as the inner radius.
+ // *could provide fill as an option.
+
+ // Use both a line and area; area creates definition and line ensures that something is
+ // always drawn.
+ var line = d3.svg.line.radial()
+ .interpolate("linear-closed")
+ .radius(function(d) { return radius(d[1]); })
+ .angle(function(d, i) { return angle(i); });
+
+ var area = d3.svg.area.radial()
+ .interpolate(line.interpolate())
+ .innerRadius(radius(0))
+ .outerRadius(line.radius())
+ .angle(line.angle());
+
+ // Render data.
+ var parent = svg.datum(data);
+
+ parent.append("path")
+ .attr("class", "chrom-data")
+ .attr("d", area);
+
+ parent.append("path")
+ .attr("class", "chrom-data")
+ .attr("d", line);
}
});
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: greg: Fix and enhance the features for resetting a repository that encounted errors during the cloning process so the Galaxy admin can make another attempt to install it.
by Bitbucket 19 Sep '12
by Bitbucket 19 Sep '12
19 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/6390e1f3a723/
changeset: 6390e1f3a723
user: greg
date: 2012-09-19 22:35:49
summary: Fix and enhance the features for resetting a repository that encounted errors during the cloning process so the Galaxy admin can make another attempt to install it.
affected #: 11 files
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 lib/galaxy/tool_shed/install_manager.py
--- a/lib/galaxy/tool_shed/install_manager.py
+++ b/lib/galaxy/tool_shed/install_manager.py
@@ -244,57 +244,58 @@
owner=self.repository_owner,
dist_to_shed=True )
update_tool_shed_repository_status( self.app, tool_shed_repository, self.app.model.ToolShedRepository.installation_status.CLONING )
- clone_repository( repository_clone_url, os.path.abspath( relative_install_dir ), ctx_rev )
- self.handle_repository_contents( tool_shed_repository=tool_shed_repository,
- repository_clone_url=repository_clone_url,
- relative_install_dir=relative_install_dir,
- repository_elem=repository_elem,
- install_dependencies=install_dependencies )
- self.app.sa_session.refresh( tool_shed_repository )
- metadata_dict = tool_shed_repository.metadata
- if 'tools' in metadata_dict:
- update_tool_shed_repository_status( self.app,
- tool_shed_repository,
- self.app.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS )
- # Get the tool_versions from the tool shed for each tool in the installed change set.
- url = '%s/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
- ( tool_shed_url, tool_shed_repository.name, self.repository_owner, installed_changeset_revision )
- response = urllib2.urlopen( url )
- text = response.read()
- response.close()
- if text:
- tool_version_dicts = from_json_string( text )
- handle_tool_versions( self.app, tool_version_dicts, tool_shed_repository )
- else:
- # Set the tool versions since they seem to be missing for this repository in the tool shed.
- # CRITICAL NOTE: These default settings may not properly handle all parent/child associations.
- for tool_dict in metadata_dict[ 'tools' ]:
- flush_needed = False
- tool_id = tool_dict[ 'guid' ]
- old_tool_id = tool_dict[ 'id' ]
- tool_version = tool_dict[ 'version' ]
- tool_version_using_old_id = get_tool_version( self.app, old_tool_id )
- tool_version_using_guid = get_tool_version( self.app, tool_id )
- if not tool_version_using_old_id:
- tool_version_using_old_id = self.app.model.ToolVersion( tool_id=old_tool_id,
- tool_shed_repository=tool_shed_repository )
- self.app.sa_session.add( tool_version_using_old_id )
- self.app.sa_session.flush()
- if not tool_version_using_guid:
- tool_version_using_guid = self.app.model.ToolVersion( tool_id=tool_id,
- tool_shed_repository=tool_shed_repository )
- self.app.sa_session.add( tool_version_using_guid )
- self.app.sa_session.flush()
- # Associate the two versions as parent / child.
- tool_version_association = get_tool_version_association( self.app,
- tool_version_using_old_id,
- tool_version_using_guid )
- if not tool_version_association:
- tool_version_association = self.app.model.ToolVersionAssociation( tool_id=tool_version_using_guid.id,
- parent_id=tool_version_using_old_id.id )
- self.app.sa_session.add( tool_version_association )
- self.app.sa_session.flush()
- update_tool_shed_repository_status( self.app, tool_shed_repository, self.app.model.ToolShedRepository.installation_status.INSTALLED )
+ cloned_ok, error_message = clone_repository( repository_clone_url, os.path.abspath( relative_install_dir ), ctx_rev )
+ if cloned_ok:
+ self.handle_repository_contents( tool_shed_repository=tool_shed_repository,
+ repository_clone_url=repository_clone_url,
+ relative_install_dir=relative_install_dir,
+ repository_elem=repository_elem,
+ install_dependencies=install_dependencies )
+ self.app.sa_session.refresh( tool_shed_repository )
+ metadata_dict = tool_shed_repository.metadata
+ if 'tools' in metadata_dict:
+ update_tool_shed_repository_status( self.app,
+ tool_shed_repository,
+ self.app.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS )
+ # Get the tool_versions from the tool shed for each tool in the installed change set.
+ url = '%s/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
+ ( tool_shed_url, tool_shed_repository.name, self.repository_owner, installed_changeset_revision )
+ response = urllib2.urlopen( url )
+ text = response.read()
+ response.close()
+ if text:
+ tool_version_dicts = from_json_string( text )
+ handle_tool_versions( self.app, tool_version_dicts, tool_shed_repository )
+ else:
+ # Set the tool versions since they seem to be missing for this repository in the tool shed.
+ # CRITICAL NOTE: These default settings may not properly handle all parent/child associations.
+ for tool_dict in metadata_dict[ 'tools' ]:
+ flush_needed = False
+ tool_id = tool_dict[ 'guid' ]
+ old_tool_id = tool_dict[ 'id' ]
+ tool_version = tool_dict[ 'version' ]
+ tool_version_using_old_id = get_tool_version( self.app, old_tool_id )
+ tool_version_using_guid = get_tool_version( self.app, tool_id )
+ if not tool_version_using_old_id:
+ tool_version_using_old_id = self.app.model.ToolVersion( tool_id=old_tool_id,
+ tool_shed_repository=tool_shed_repository )
+ self.app.sa_session.add( tool_version_using_old_id )
+ self.app.sa_session.flush()
+ if not tool_version_using_guid:
+ tool_version_using_guid = self.app.model.ToolVersion( tool_id=tool_id,
+ tool_shed_repository=tool_shed_repository )
+ self.app.sa_session.add( tool_version_using_guid )
+ self.app.sa_session.flush()
+ # Associate the two versions as parent / child.
+ tool_version_association = get_tool_version_association( self.app,
+ tool_version_using_old_id,
+ tool_version_using_guid )
+ if not tool_version_association:
+ tool_version_association = self.app.model.ToolVersionAssociation( tool_id=tool_version_using_guid.id,
+ parent_id=tool_version_using_old_id.id )
+ self.app.sa_session.add( tool_version_association )
+ self.app.sa_session.flush()
+ update_tool_shed_repository_status( self.app, tool_shed_repository, self.app.model.ToolShedRepository.installation_status.INSTALLED )
@property
def non_shed_tool_panel_configs( self ):
# Get the non-shed related tool panel config file names from the Galaxy config - the default is tool_conf.xml.
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 lib/galaxy/util/shed_util.py
--- a/lib/galaxy/util/shed_util.py
+++ b/lib/galaxy/util/shed_util.py
@@ -380,10 +380,11 @@
pull=True,
noupdate=False,
rev=util.listify( str( ctx_rev ) ) )
- return True
+ return True, None
except Exception, e:
- log.debug( 'Encountered an exception while cloning the repository: %s' % e )
- return False
+ error_message = 'Error cloning repository: %s' % str( e )
+ log.debug( error_message )
+ return False, error_message
def copy_sample_file( app, filename, dest_path=None ):
"""Copy xxx.sample to dest_path/xxx.sample and dest_path/xxx. The default value for dest_path is ~/tool-data."""
if dest_path is None:
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 lib/galaxy/web/controllers/admin_toolshed.py
--- a/lib/galaxy/web/controllers/admin_toolshed.py
+++ b/lib/galaxy/web/controllers/admin_toolshed.py
@@ -63,8 +63,9 @@
columns = [
NameColumn( "Name",
key="name",
- link=( lambda item: iff( item.status == model.ToolShedRepository.installation_status.ERROR, \
- None, dict( operation="manage_repository", id=item.id, webapp="galaxy" ) ) ),
+ link=( lambda item: iff( item.status in [ model.ToolShedRepository.installation_status.CLONING ],
+ None,
+ dict( operation="manage_repository", id=item.id, webapp="galaxy" ) ) ),
attach_popup=True ),
DescriptionColumn( "Description" ),
OwnerColumn( "Owner" ),
@@ -90,25 +91,25 @@
[ model.ToolShedRepository.installation_status.ERROR, model.ToolShedRepository.installation_status.NEW ] ),
async_compatible=False,
url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='get updates' ) ),
+ grids.GridOperation( "Install",
+ allow_multiple=False,
+ condition=( lambda item: not item.deleted and item.status == model.ToolShedRepository.installation_status.NEW ),
+ async_compatible=False,
+ url_args=dict( controller='admin_toolshed', action='manage_repository', operation='install' ) ),
grids.GridOperation( "Deactivate or uninstall",
allow_multiple=False,
condition=( lambda item: not item.deleted and item.status not in \
[ model.ToolShedRepository.installation_status.ERROR, model.ToolShedRepository.installation_status.NEW ] ),
async_compatible=False,
url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='deactivate or uninstall' ) ),
- grids.GridOperation( "Uninstall",
- allow_multiple=False,
- condition=( lambda item: ( item.status == model.ToolShedRepository.installation_status.ERROR ) ),
- async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='uninstall' ) ),
grids.GridOperation( "Reset to install",
allow_multiple=False,
condition=( lambda item: ( item.status == model.ToolShedRepository.installation_status.ERROR ) ),
async_compatible=False,
- url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='reset status to new' ) ),
+ url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='reset to install' ) ),
grids.GridOperation( "Activate or reinstall",
allow_multiple=False,
- condition=( lambda item: ( item.deleted or item.uninstalled ) ),
+ condition=( lambda item: item.deleted ),
async_compatible=False,
url_args=dict( controller='admin_toolshed', action='browse_repositories', operation='activate or reinstall' ) ) ]
standard_filters = []
@@ -354,16 +355,9 @@
return self.manage_repository( trans, **kwd )
if operation == "get updates":
return self.check_for_updates( trans, **kwd )
- if operation == "uninstall":
- kwd[ 'deactivate_or_uninstall_repository_button' ] = 'Deactivate or Uninstall'
- kwd[ 'remove_from_disk' ] = [u'true', u'true']
- return self.deactivate_or_uninstall_repository( trans, **kwd )
- if operation == "reset status to new":
- repository = get_repository( trans, kwd[ 'id' ] )
- repository.status = model.ToolShedRepository.installation_status.NEW
- repository.deleted = False
- repository.uninstalled = True
- trans.app.model.context.current.flush()
+ if operation == "reset to install":
+ kwd[ 'reset_repository' ] = True
+ return self.reset_to_install( trans, **kwd )
if operation == "activate or reinstall":
repository = get_repository( trans, kwd[ 'id' ] )
if repository.uninstalled:
@@ -386,9 +380,19 @@
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
tool_dependency = get_tool_dependency( trans, kwd[ 'id' ] )
+ in_error_state = tool_dependency.status == trans.model.ToolDependency.installation_status.ERROR
+ can_uninstall = tool_dependency.status in [ trans.model.ToolDependency.installation_status.ERROR,
+ trans.model.ToolDependency.installation_status.INSTALLED ]
+ if in_error_state:
+ message = "This tool dependency is not installed correctly (see the <b>Tool dependency installation error</b> below). "
+ message += "Choose <b>Uninstall this tool dependency</b> from the <b>Repository Actions</b> menu, correct problems "
+ message += "if necessary, and try installing the dependency again."
+ status = "error"
return trans.fill_template( '/admin/tool_shed_repository/browse_tool_dependency.mako',
repository=tool_dependency.tool_shed_repository,
tool_dependency=tool_dependency,
+ in_error_state=in_error_state,
+ can_uninstall=can_uninstall,
message=message,
status=status )
@web.expose
@@ -428,7 +432,10 @@
remove_from_disk_checked = CheckboxField.is_checked( remove_from_disk )
tool_shed_repository = get_repository( trans, kwd[ 'id' ] )
shed_tool_conf, tool_path, relative_install_dir = get_tool_panel_config_tool_path_install_dir( trans.app, tool_shed_repository )
- repository_install_dir = os.path.abspath ( relative_install_dir ) if relative_install_dir is not None else None
+ if relative_install_dir:
+ repository_install_dir = os.path.abspath( relative_install_dir )
+ else:
+ repository_install_dir = None
errors = ''
if params.get( 'deactivate_or_uninstall_repository_button', False ):
if tool_shed_repository.includes_tools:
@@ -448,12 +455,8 @@
log.debug( "Removed repository installation directory: %s" % str( repository_install_dir ) )
removed = True
except Exception, e:
- if repository_install_dir is not None:
- removed = False
- log.debug( "Error removing repository installation directory %s: %s" % ( str( repository_install_dir ), str( e ) ) )
- else:
- log.debug( "Repository installation directory does not exist." )
- removed = True
+ log.debug( "Error removing repository installation directory %s: %s" % ( str( repository_install_dir ), str( e ) ) )
+ removed = False
if removed:
tool_shed_repository.uninstalled = True
# Remove all installed tool dependencies.
@@ -636,67 +639,72 @@
description, repository_clone_url, changeset_revision, ctx_rev, repository_owner, tool_dependencies = repo_info_tuple
clone_dir = os.path.join( tool_path, self.generate_tool_path( repository_clone_url, tool_shed_repository.installed_changeset_revision ) )
relative_install_dir = os.path.join( clone_dir, tool_shed_repository.name )
- result = clone_repository( repository_clone_url, os.path.abspath( relative_install_dir ), ctx_rev )
- if not result:
- update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.ERROR )
- return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
- action='monitor_repository_installation',
- tool_shed_repository_ids=[ trans.security.encode_id( tool_shed_repository.id ) ] ) )
- if reinstalling:
- # Since we're reinstalling the repository we need to find the latest changeset revision to which is can be updated.
- current_changeset_revision, current_ctx_rev = get_update_to_changeset_revision_and_ctx_rev( trans, tool_shed_repository )
- if current_ctx_rev != ctx_rev:
- repo = hg.repository( get_configured_ui(), path=os.path.abspath( relative_install_dir ) )
- pull_repository( repo, repository_clone_url, current_changeset_revision )
- update_repository( repo, ctx_rev=current_ctx_rev )
- self.handle_repository_contents( trans,
- tool_shed_repository=tool_shed_repository,
- tool_path=tool_path,
- repository_clone_url=repository_clone_url,
- relative_install_dir=relative_install_dir,
- tool_shed=tool_shed_repository.tool_shed,
- tool_section=tool_section,
- shed_tool_conf=kwd.get( 'shed_tool_conf', '' ),
- reinstalling=reinstalling )
- trans.sa_session.refresh( tool_shed_repository )
- metadata = tool_shed_repository.metadata
- if 'tools' in metadata:
- # Get the tool_versions from the tool shed for each tool in the installed change set.
- update_tool_shed_repository_status( trans.app,
- tool_shed_repository,
- trans.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS )
- tool_shed_url = get_url_from_repository_tool_shed( trans.app, tool_shed_repository )
- url = url_join( tool_shed_url,
- '/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
- ( tool_shed_repository.name, tool_shed_repository.owner, tool_shed_repository.changeset_revision ) )
- response = urllib2.urlopen( url )
- text = response.read()
- response.close()
- if text:
- tool_version_dicts = from_json_string( text )
- handle_tool_versions( trans.app, tool_version_dicts, tool_shed_repository )
- else:
- message += "Version information for the tools included in the <b>%s</b> repository is missing. " % name
- message += "Reset all of this repository's metadata in the tool shed, then set the installed tool versions "
- message += "from the installed repository's <b>Repository Actions</b> menu. "
- status = 'error'
- if install_tool_dependencies and tool_shed_repository.tool_dependencies and 'tool_dependencies' in metadata:
- work_dir = tempfile.mkdtemp()
- # Install tool dependencies.
- update_tool_shed_repository_status( trans.app,
- tool_shed_repository,
- trans.model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES )
- # Get the tool_dependencies.xml file from the repository.
- tool_dependencies_config = get_config_from_disk( 'tool_dependencies.xml', relative_install_dir )
- installed_tool_dependencies = handle_tool_dependencies( app=trans.app,
- tool_shed_repository=tool_shed_repository,
- tool_dependencies_config=tool_dependencies_config,
- tool_dependencies=tool_shed_repository.tool_dependencies )
- try:
- shutil.rmtree( work_dir )
- except:
- pass
- update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.INSTALLED )
+ cloned_ok, error_message = clone_repository( repository_clone_url, os.path.abspath( relative_install_dir ), ctx_rev )
+ if cloned_ok:
+ if reinstalling:
+ # Since we're reinstalling the repository we need to find the latest changeset revision to which is can be updated.
+ current_changeset_revision, current_ctx_rev = get_update_to_changeset_revision_and_ctx_rev( trans, tool_shed_repository )
+ if current_ctx_rev != ctx_rev:
+ repo = hg.repository( get_configured_ui(), path=os.path.abspath( relative_install_dir ) )
+ pull_repository( repo, repository_clone_url, current_changeset_revision )
+ update_repository( repo, ctx_rev=current_ctx_rev )
+ self.handle_repository_contents( trans,
+ tool_shed_repository=tool_shed_repository,
+ tool_path=tool_path,
+ repository_clone_url=repository_clone_url,
+ relative_install_dir=relative_install_dir,
+ tool_shed=tool_shed_repository.tool_shed,
+ tool_section=tool_section,
+ shed_tool_conf=kwd.get( 'shed_tool_conf', '' ),
+ reinstalling=reinstalling )
+ trans.sa_session.refresh( tool_shed_repository )
+ metadata = tool_shed_repository.metadata
+ if 'tools' in metadata:
+ # Get the tool_versions from the tool shed for each tool in the installed change set.
+ update_tool_shed_repository_status( trans.app,
+ tool_shed_repository,
+ trans.model.ToolShedRepository.installation_status.SETTING_TOOL_VERSIONS )
+ tool_shed_url = get_url_from_repository_tool_shed( trans.app, tool_shed_repository )
+ url = url_join( tool_shed_url,
+ '/repository/get_tool_versions?name=%s&owner=%s&changeset_revision=%s&webapp=galaxy' % \
+ ( tool_shed_repository.name, tool_shed_repository.owner, tool_shed_repository.changeset_revision ) )
+ response = urllib2.urlopen( url )
+ text = response.read()
+ response.close()
+ if text:
+ tool_version_dicts = from_json_string( text )
+ handle_tool_versions( trans.app, tool_version_dicts, tool_shed_repository )
+ else:
+ message += "Version information for the tools included in the <b>%s</b> repository is missing. " % name
+ message += "Reset all of this repository's metadata in the tool shed, then set the installed tool versions "
+ message += "from the installed repository's <b>Repository Actions</b> menu. "
+ status = 'error'
+ if install_tool_dependencies and tool_shed_repository.tool_dependencies and 'tool_dependencies' in metadata:
+ work_dir = tempfile.mkdtemp()
+ # Install tool dependencies.
+ update_tool_shed_repository_status( trans.app,
+ tool_shed_repository,
+ trans.model.ToolShedRepository.installation_status.INSTALLING_TOOL_DEPENDENCIES )
+ # Get the tool_dependencies.xml file from the repository.
+ tool_dependencies_config = get_config_from_disk( 'tool_dependencies.xml', relative_install_dir )
+ installed_tool_dependencies = handle_tool_dependencies( app=trans.app,
+ tool_shed_repository=tool_shed_repository,
+ tool_dependencies_config=tool_dependencies_config,
+ tool_dependencies=tool_shed_repository.tool_dependencies )
+ try:
+ shutil.rmtree( work_dir )
+ except:
+ pass
+ update_tool_shed_repository_status( trans.app, tool_shed_repository, trans.model.ToolShedRepository.installation_status.INSTALLED )
+ else:
+ # An error occurred while cloning the repository, so reset everything necessary to enable another attempt.
+ self.set_repository_attributes( trans,
+ tool_shed_repository,
+ status=trans.model.ToolShedRepository.installation_status.ERROR,
+ error_message=error_message,
+ deleted=False,
+ uninstalled=False,
+ remove_from_disk=True )
tsr_ids_for_monitoring = [ trans.security.encode_id( tsr.id ) for tsr in tool_shed_repositories ]
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='monitor_repository_installation',
@@ -776,17 +784,39 @@
message = util.restore_text( params.get( 'message', '' ) )
status = params.get( 'status', 'done' )
repository_id = kwd[ 'id' ]
+ operation = kwd.get( 'operation', None )
repository = get_repository( trans, repository_id )
- if repository.status in [ trans.model.ToolShedRepository.installation_status.NEW,
- trans.model.ToolShedRepository.installation_status.CLONING,
- trans.model.ToolShedRepository.installation_status.ERROR ]:
+ in_error_state = repository.status == trans.model.ToolShedRepository.installation_status.ERROR
+ can_install = repository.status == trans.model.ToolShedRepository.installation_status.NEW
+ if repository.status in [ trans.model.ToolShedRepository.installation_status.CLONING ]:
return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
action='monitor_repository_installation',
**kwd ) )
+ if can_install and operation == 'install':
+ # Send a request to the tool shed to install the repository.
+ tool_shed_url = get_url_from_repository_tool_shed( trans.app, repository )
+ url = url_join( tool_shed_url,
+ 'repository/install_repositories_by_revision?name=%s&owner=%s&changeset_revisions=%s&galaxy_url=%s&webapp=galaxy' % \
+ ( repository.name,
+ repository.owner,
+ repository.installed_changeset_revision,
+ ( url_for( '/', qualified=True ) ) ) )
+ return trans.response.send_redirect( url )
description = util.restore_text( params.get( 'description', repository.description ) )
shed_tool_conf, tool_path, relative_install_dir = get_tool_panel_config_tool_path_install_dir( trans.app, repository )
- repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) )
- if params.get( 'edit_repository_button', False ):
+ if relative_install_dir:
+ repo_files_dir = os.path.abspath( os.path.join( relative_install_dir, repository.name ) )
+ else:
+ repo_files_dir = None
+ if in_error_state:
+ message = "This repository is not installed correctly (see the <b>Repository installation error</b> below). Choose "
+ message += "<b>Reset to install</b> from the <b>Repository Actions</b> menu, correct problems if necessary, and try "
+ message += "installing the repository again."
+ status = "error"
+ elif can_install:
+ message = "This repository is not installed. You can install it by choosing <b>Install</b> from the <b>Repository Actions</b> menu."
+ status = "error"
+ elif params.get( 'edit_repository_button', False ):
if description != repository.description:
repository.description = description
trans.sa_session.add( repository )
@@ -809,6 +839,8 @@
message = "Repository metadata has been reset."
return trans.fill_template( '/admin/tool_shed_repository/manage_repository.mako',
repository=repository,
+ in_error_state=in_error_state,
+ can_install=can_install,
description=description,
repo_files_dir=repo_files_dir,
message=message,
@@ -890,7 +922,7 @@
url_args=dict( controller='admin_toolshed',
action='manage_repository',
id=trans.security.encode_id( tool_shed_repository.id ) ) ),
- grids.GridAction( label='Get updates',
+ grids.GridAction( label='Get repository updates',
url_args=dict( controller='admin_toolshed',
action='check_for_updates',
id=trans.security.encode_id( tool_shed_repository.id ) ) ),
@@ -1390,6 +1422,41 @@
status=status )
@web.expose
@web.require_admin
+ def reset_to_install( self, trans, **kwd ):
+ # An error occurred while cloning the repository, so reset everything necessary to enable another attempt.
+ repository = get_repository( trans, kwd[ 'id' ] )
+ if kwd.get( 'reset_repository', False ):
+ self.set_repository_attributes( trans,
+ repository,
+ status=trans.model.ToolShedRepository.installation_status.NEW,
+ error_message=None,
+ deleted=False,
+ uninstalled=False,
+ remove_from_disk=True )
+ new_kwd = {}
+ new_kwd[ 'message' ] = "You can now attempt to install the repository named <b>%s</b> again." % repository.name
+ new_kwd[ 'status' ] = "done"
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='browse_repositories',
+ **new_kwd ) )
+ return trans.response.send_redirect( web.url_for( controller='admin_toolshed',
+ action='manage_repository',
+ **kwd ) )
+ def set_repository_attributes( self, trans, repository, status, error_message, deleted, uninstalled, remove_from_disk=False ):
+ if remove_from_disk:
+ relative_install_dir = repository.repo_path( trans.app )
+ if relative_install_dir:
+ clone_dir = os.path.abspath( relative_install_dir )
+ shutil.rmtree( clone_dir )
+ log.debug( "Removed repository installation directory: %s" % str( clone_dir ) )
+ repository.error_message = error_message
+ repository.status = status
+ repository.deleted = deleted
+ repository.uninstalled = uninstalled
+ trans.sa_session.add( repository )
+ trans.sa_session.flush()
+ @web.expose
+ @web.require_admin
def set_tool_versions( self, trans, **kwd ):
# Get the tool_versions from the tool shed for each tool in the installed change set.
repository = get_repository( trans, kwd[ 'id' ] )
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 lib/galaxy/webapps/community/controllers/common.py
--- a/lib/galaxy/webapps/community/controllers/common.py
+++ b/lib/galaxy/webapps/community/controllers/common.py
@@ -875,59 +875,60 @@
current_changeset_revision = str( repo.changectx( changeset ) )
ctx = repo.changectx( changeset )
log.debug( "Cloning repository revision: %s", str( ctx.rev() ) )
- clone_repository( repository_clone_url, work_dir, str( ctx.rev() ) )
- log.debug( "Generating metadata for changset revision: %s", str( ctx.rev() ) )
- current_metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app,
- repository_clone_url=repository_clone_url,
- relative_install_dir=repo_dir,
- repository_files_dir=work_dir,
- resetting_all_metadata_on_repository=True,
- webapp='community' )
- if current_metadata_dict:
- if not metadata_changeset_revision and not metadata_dict:
- # We're at the first change set in the change log.
- metadata_changeset_revision = current_changeset_revision
- metadata_dict = current_metadata_dict
- if ancestor_changeset_revision:
- # Compare metadata from ancestor and current. The value of comparison will be one of:
- # 'no metadata' - no metadata for either ancestor or current, so continue from current
- # 'equal' - ancestor metadata is equivalent to current metadata, so continue from current
- # 'subset' - ancestor metadata is a subset of current metadata, so continue from current
- # 'not equal and not subset' - ancestor metadata is neither equal to nor a subset of current metadata, so persist ancestor metadata.
- comparison = compare_changeset_revisions( ancestor_changeset_revision,
- ancestor_metadata_dict,
- current_changeset_revision,
- current_metadata_dict )
- if comparison in [ 'no metadata', 'equal', 'subset' ]:
+ cloned_ok, error_message = clone_repository( repository_clone_url, work_dir, str( ctx.rev() ) )
+ if cloned_ok:
+ log.debug( "Generating metadata for changset revision: %s", str( ctx.rev() ) )
+ current_metadata_dict, invalid_file_tups = generate_metadata_for_changeset_revision( app=trans.app,
+ repository_clone_url=repository_clone_url,
+ relative_install_dir=repo_dir,
+ repository_files_dir=work_dir,
+ resetting_all_metadata_on_repository=True,
+ webapp='community' )
+ if current_metadata_dict:
+ if not metadata_changeset_revision and not metadata_dict:
+ # We're at the first change set in the change log.
+ metadata_changeset_revision = current_changeset_revision
+ metadata_dict = current_metadata_dict
+ if ancestor_changeset_revision:
+ # Compare metadata from ancestor and current. The value of comparison will be one of:
+ # 'no metadata' - no metadata for either ancestor or current, so continue from current
+ # 'equal' - ancestor metadata is equivalent to current metadata, so continue from current
+ # 'subset' - ancestor metadata is a subset of current metadata, so continue from current
+ # 'not equal and not subset' - ancestor metadata is neither equal to nor a subset of current metadata, so persist ancestor metadata.
+ comparison = compare_changeset_revisions( ancestor_changeset_revision,
+ ancestor_metadata_dict,
+ current_changeset_revision,
+ current_metadata_dict )
+ if comparison in [ 'no metadata', 'equal', 'subset' ]:
+ ancestor_changeset_revision = current_changeset_revision
+ ancestor_metadata_dict = current_metadata_dict
+ elif comparison == 'not equal and not subset':
+ metadata_changeset_revision = ancestor_changeset_revision
+ metadata_dict = ancestor_metadata_dict
+ repository_metadata = create_or_update_repository_metadata( trans, id, repository, metadata_changeset_revision, metadata_dict )
+ changeset_revisions.append( metadata_changeset_revision )
+ ancestor_changeset_revision = current_changeset_revision
+ ancestor_metadata_dict = current_metadata_dict
+ else:
+ # We're at the beginning of the change log.
ancestor_changeset_revision = current_changeset_revision
ancestor_metadata_dict = current_metadata_dict
- elif comparison == 'not equal and not subset':
- metadata_changeset_revision = ancestor_changeset_revision
- metadata_dict = ancestor_metadata_dict
+ if not ctx.children():
+ metadata_changeset_revision = current_changeset_revision
+ metadata_dict = current_metadata_dict
+ # We're at the end of the change log.
repository_metadata = create_or_update_repository_metadata( trans, id, repository, metadata_changeset_revision, metadata_dict )
changeset_revisions.append( metadata_changeset_revision )
- ancestor_changeset_revision = current_changeset_revision
- ancestor_metadata_dict = current_metadata_dict
- else:
- # We're at the beginning of the change log.
- ancestor_changeset_revision = current_changeset_revision
- ancestor_metadata_dict = current_metadata_dict
- if not ctx.children():
- metadata_changeset_revision = current_changeset_revision
- metadata_dict = current_metadata_dict
- # We're at the end of the change log.
- repository_metadata = create_or_update_repository_metadata( trans, id, repository, metadata_changeset_revision, metadata_dict )
- changeset_revisions.append( metadata_changeset_revision )
- ancestor_changeset_revision = None
- ancestor_metadata_dict = None
- elif ancestor_metadata_dict:
- # We reach here only if current_metadata_dict is empty and ancestor_metadata_dict is not.
- if not ctx.children():
- # We're at the end of the change log.
- repository_metadata = create_or_update_repository_metadata( trans, id, repository, metadata_changeset_revision, metadata_dict )
- changeset_revisions.append( metadata_changeset_revision )
- ancestor_changeset_revision = None
- ancestor_metadata_dict = None
+ ancestor_changeset_revision = None
+ ancestor_metadata_dict = None
+ elif ancestor_metadata_dict:
+ # We reach here only if current_metadata_dict is empty and ancestor_metadata_dict is not.
+ if not ctx.children():
+ # We're at the end of the change log.
+ repository_metadata = create_or_update_repository_metadata( trans, id, repository, metadata_changeset_revision, metadata_dict )
+ changeset_revisions.append( metadata_changeset_revision )
+ ancestor_changeset_revision = None
+ ancestor_metadata_dict = None
if os.path.exists( work_dir ):
try:
shutil.rmtree( work_dir )
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 lib/galaxy/webapps/community/controllers/repository.py
--- a/lib/galaxy/webapps/community/controllers/repository.py
+++ b/lib/galaxy/webapps/community/controllers/repository.py
@@ -1020,10 +1020,11 @@
repository_metadata = get_repository_metadata_by_id( trans, repository_metadata_id )
encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) )
changeset_revisions.append( repository_metadata.changeset_revision )
+ new_kwd[ 'repository_ids' ] = encoded_repository_ids
+ new_kwd[ 'changeset_revisions' ] = changeset_revisions
return trans.response.send_redirect( web.url_for( controller='repository',
action='install_repositories_by_revision',
- repository_ids=encoded_repository_ids,
- changeset_revisions=changeset_revisions ) )
+ **new_kwd ) )
else:
# This can only occur when there is a multi-select grid with check boxes and an operation,
# and the user clicked the operation button without checking any of the check boxes.
@@ -1106,10 +1107,12 @@
repository_metadata = get_repository_metadata_by_id( trans, item_id )
encoded_repository_ids.append( trans.security.encode_id( repository_metadata.repository.id ) )
changeset_revisions.append( repository_metadata.changeset_revision )
+ new_kwd = {}
+ new_kwd[ 'repository_ids' ] = encoded_repository_ids
+ new_kwd[ 'changeset_revisions' ] = changeset_revisions
return trans.response.send_redirect( web.url_for( controller='repository',
action='install_repositories_by_revision',
- repository_ids=encoded_repository_ids,
- changeset_revisions=changeset_revisions ) )
+ **new_kwd ) )
else:
# This can only occur when there is a multi-select grid with check boxes and an operation,
# and the user clicked the operation button without checking any of the check boxes.
@@ -1188,7 +1191,7 @@
repo_info_dicts = []
for tup in zip( util.listify( repository_ids ), util.listify( changeset_revisions ) ):
repository_id, changeset_revision = tup
- repository_clone_url = generate_clone_url( trans, repository_id )
+ repository_clone_url = generate_clone_url( trans, repository_id )
repository = get_repository( trans, repository_id )
repository_metadata = get_repository_metadata_by_changeset_revision( trans, repository_id, changeset_revision )
metadata = repository_metadata.metadata
@@ -1414,9 +1417,22 @@
message=message,
status=status )
@web.expose
- def install_repositories_by_revision( self, trans, repository_ids, changeset_revisions, **kwd ):
- """Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation process."""
- galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
+ def install_repositories_by_revision( self, trans, **kwd ):
+ """
+ Send the list of repository_ids and changeset_revisions to Galaxy so it can begin the installation process. If the value of
+ repository_ids is not received, then the name and owner of a single repository must be received to install a single repository.
+ """
+ repository_ids = kwd.get( 'repository_ids', None )
+ changeset_revisions = kwd.get( 'changeset_revisions', None )
+ name = kwd.get( 'name', None )
+ owner = kwd.get( 'owner', None )
+ galaxy_url = kwd.get( 'galaxy_url', None )
+ if not repository_ids:
+ repository = get_repository_by_name_and_owner( trans, name, owner )
+ repository_ids = trans.security.encode_id( repository.id )
+ if not galaxy_url:
+ # If galaxy_url is not in the request, it had to have been stored in a cookie by the tool shed.
+ galaxy_url = trans.get_cookie( name='toolshedgalaxyurl' )
# Redirect back to local Galaxy to perform install.
url = url_join( galaxy_url,
'admin_toolshed/prepare_for_install?tool_shed_url=%s&repository_ids=%s&changeset_revisions=%s' % \
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 templates/admin/tool_shed_repository/browse_repository.mako
--- a/templates/admin/tool_shed_repository/browse_repository.mako
+++ b/templates/admin/tool_shed_repository/browse_repository.mako
@@ -18,7 +18,7 @@
<li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get updates</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
%if repository.tool_dependencies:
<% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %>
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 templates/admin/tool_shed_repository/browse_tool_dependency.mako
--- a/templates/admin/tool_shed_repository/browse_tool_dependency.mako
+++ b/templates/admin/tool_shed_repository/browse_tool_dependency.mako
@@ -21,9 +21,12 @@
<div popupmenu="tool_dependency-${tool_dependency.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get updates</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
+ %if can_uninstall:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='uninstall_tool_dependencies', tool_dependency_ids=trans.security.encode_id( tool_dependency.id ) )}">Uninstall this tool dependency</a>
+ %endif
</div></ul>
@@ -45,6 +48,18 @@
<div style="clear: both"></div></div><div class="form-row" >
+ <label>Tool dependency status:</label>
+ ${tool_dependency.status}
+ <div style="clear: both"></div>
+ </div>
+ %if in_error_state:
+ <div class="form-row" >
+ <label>Tool dependency installation error:</label>
+ ${tool_dependency.error_message}
+ <div style="clear: both"></div>
+ </div>
+ %endif
+ <div class="form-row" ><label>Tool dependency installation directory:</label>
${tool_dependency.installation_directory( trans.app )}
<div style="clear: both"></div>
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
--- a/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
+++ b/templates/admin/tool_shed_repository/deactivate_or_uninstall_repository.mako
@@ -8,7 +8,7 @@
<div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get updates</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
%if repository.tool_dependencies:
<% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 templates/admin/tool_shed_repository/manage_repository.mako
--- a/templates/admin/tool_shed_repository/manage_repository.mako
+++ b/templates/admin/tool_shed_repository/manage_repository.mako
@@ -6,16 +6,22 @@
<ul class="manage-table-actions"><li><a class="action-button" id="repository-${repository.id}-popup" class="menubutton">Repository Actions</a></li><div popupmenu="repository-${repository.id}-popup">
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get updates</a>
- %if repository.includes_tools:
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a>
+ %if in_error_state:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='reset_to_install', id=trans.security.encode_id( repository.id ), reset_repository=True )}">Reset to install</a>
+ %elif can_install:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ), operation='install' )}">Install</a>
+ %else:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
+ %if repository.includes_tools:
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a>
+ %endif
+ %if repository.tool_dependencies:
+ <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
+ %endif
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a>
%endif
- %if repository.tool_dependencies:
- <% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
- %endif
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='deactivate_or_uninstall_repository', id=trans.security.encode_id( repository.id ) )}">Deactivate or uninstall repository</a></div></ul>
@@ -39,7 +45,11 @@
</div><div class="form-row"><label>Description:</label>
- <input name="description" type="textfield" value="${description}" size="80"/>
+ %if in_error_state:
+ ${description}
+ %else:
+ <input name="description" type="textfield" value="${description}" size="80"/>
+ %endif
<div style="clear: both"></div></div><div class="form-row">
@@ -50,17 +60,26 @@
<label>Owner:</label>
${repository.owner}
</div>
- <div class="form-row">
- <label>Location:</label>
- ${repo_files_dir}
- </div>
+ %if in_error_state:
+ <div class="form-row">
+ <label>Repository installation error:</label>
+ ${repository.error_message}
+ </div>
+ %else:
+ <div class="form-row">
+ <label>Location:</label>
+ ${repo_files_dir}
+ </div>
+ %endif
<div class="form-row"><label>Deleted:</label>
${repository.deleted}
</div>
- <div class="form-row">
- <input type="submit" name="edit_repository_button" value="Save"/>
- </div>
+ %if not in_error_state:
+ <div class="form-row">
+ <input type="submit" name="edit_repository_button" value="Save"/>
+ </div>
+ %endif
</form></div></div>
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 templates/admin/tool_shed_repository/manage_tool_dependencies.mako
--- a/templates/admin/tool_shed_repository/manage_tool_dependencies.mako
+++ b/templates/admin/tool_shed_repository/manage_tool_dependencies.mako
@@ -9,7 +9,7 @@
<div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get updates</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
%if repository.includes_tools:
<a class="action-button" href="${h.url_for( controller='admin_toolshed', action='set_tool_versions', id=trans.security.encode_id( repository.id ) )}">Set tool versions</a>
%endif
diff -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 -r 6390e1f3a72300974c113f927b80eec98b32fe94 templates/admin/tool_shed_repository/view_tool_metadata.mako
--- a/templates/admin/tool_shed_repository/view_tool_metadata.mako
+++ b/templates/admin/tool_shed_repository/view_tool_metadata.mako
@@ -7,7 +7,7 @@
<div popupmenu="repository-${repository.id}-popup"><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='browse_repository', id=trans.security.encode_id( repository.id ) )}">Browse repository files</a><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_repository', id=trans.security.encode_id( repository.id ) )}">Manage repository</a>
- <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get updates</a>
+ <a class="action-button" href="${h.url_for( controller='admin_toolshed', action='check_for_updates', id=trans.security.encode_id( repository.id ) )}">Get repository updates</a>
%if repository.tool_dependencies:
<% tool_dependency_ids = [ trans.security.encode_id( td.id ) for td in repository.tool_dependencies ] %><a class="action-button" href="${h.url_for( controller='admin_toolshed', action='manage_tool_dependencies', tool_dependency_ids=tool_dependency_ids )}">Manage tool dependencies</a>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0
commit/galaxy-central: dannon: Revert previous change to message.mako for now -- we do use html in the message box elsewhere (links, etc) and this breaks them.
by Bitbucket 19 Sep '12
by Bitbucket 19 Sep '12
19 Sep '12
1 new commit in galaxy-central:
https://bitbucket.org/galaxy/galaxy-central/changeset/da9d740fce31/
changeset: da9d740fce31
user: dannon
date: 2012-09-19 19:20:45
summary: Revert previous change to message.mako for now -- we do use html in the message box elsewhere (links, etc) and this breaks them.
affected #: 1 file
diff -r 96871214fe2f962004decde001de94d1ba827e94 -r da9d740fce314d67b51ff4f9d80b34bd37d3fd84 templates/message.mako
--- a/templates/message.mako
+++ b/templates/message.mako
@@ -82,12 +82,12 @@
## Render large message.
<%def name="render_large_message( message, status )">
- <div class="${status}messagelarge" style="margin: 1em">${_(message) | h}</div>
+ <div class="${status}messagelarge" style="margin: 1em">${_(message)}</div></%def>
## Render a message
<%def name="render_msg( msg, status='done' )">
- <div class="${status}message">${_(msg) | h}</div>
+ <div class="${status}message">${_(msg)}</div><br/></%def>
Repository URL: https://bitbucket.org/galaxy/galaxy-central/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
1
0