mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Merge remote-tracking branch 'upstream/dev' into remove_gridhelper_001
This commit is contained in:
@@ -1,84 +0,0 @@
|
||||
client/galaxy/style/source_material/circle.py
|
||||
contrib/
|
||||
cron/
|
||||
doc/parse_gx_xsd.py
|
||||
doc/patch.py
|
||||
lib/galaxy/actions/
|
||||
lib/galaxy/auth/
|
||||
lib/galaxy/config.py
|
||||
lib/galaxy/containers/
|
||||
lib/galaxy/dataset_collections/
|
||||
lib/galaxy/datatypes/
|
||||
lib/galaxy/dependencies/
|
||||
lib/galaxy/eggs/
|
||||
lib/galaxy/exceptions/
|
||||
lib/galaxy/external_services/
|
||||
lib/galaxy/forms/
|
||||
lib/galaxy/jobs/
|
||||
lib/galaxy/managers/
|
||||
lib/galaxy/model/
|
||||
lib/galaxy/objectstore/
|
||||
lib/galaxy/openid/
|
||||
lib/galaxy/quota/
|
||||
lib/galaxy/sample_tracking/
|
||||
lib/galaxy/security/
|
||||
lib/galaxy/tags/
|
||||
lib/galaxy/tools/
|
||||
lib/galaxy/tours/
|
||||
lib/galaxy/util/
|
||||
lib/galaxy/visualization/
|
||||
lib/galaxy/web/
|
||||
lib/galaxy/webapps/galaxy/api/histories.py
|
||||
lib/galaxy/webapps/galaxy/api/library_datasets.py
|
||||
lib/galaxy/webapps/galaxy/api/tours.py
|
||||
lib/galaxy/webapps/galaxy/api/users.py
|
||||
lib/galaxy/webapps/galaxy/api/workflows.py
|
||||
lib/galaxy/webapps/galaxy/buildapp.py
|
||||
lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
|
||||
lib/galaxy/webapps/galaxy/controllers/external_services.py
|
||||
lib/galaxy/webapps/galaxy/controllers/forms.py
|
||||
lib/galaxy/webapps/galaxy/controllers/history.py
|
||||
lib/galaxy/webapps/galaxy/controllers/library_common.py
|
||||
lib/galaxy/webapps/galaxy/controllers/search.py
|
||||
lib/galaxy/webapps/galaxy/controllers/userskeys.py
|
||||
lib/galaxy/webapps/reports/config.py
|
||||
lib/galaxy/webapps/reports/controllers/tools.py
|
||||
lib/galaxy/webapps/reports/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/config.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/groups.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/user.py
|
||||
lib/galaxy/webapps/tool_shed/framework/middleware/remoteuser.py
|
||||
lib/galaxy/webapps/tool_shed/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/model/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/search/repo_search.py
|
||||
lib/galaxy/webapps/tool_shed/util/ratings_util.py
|
||||
lib/galaxy/webhooks/
|
||||
lib/galaxy/work/
|
||||
lib/galaxy/workflow/
|
||||
lib/galaxy_ext/
|
||||
lib/log_tempfile.py
|
||||
lib/mimeparse.py
|
||||
lib/psyco_full.py
|
||||
lib/tool_shed/
|
||||
scripts/api/
|
||||
scripts/auth/
|
||||
scripts/bootstrap_history.py
|
||||
scripts/build_toolbox.py
|
||||
scripts/check_eggs.py
|
||||
scripts/check_galaxy.py
|
||||
scripts/check_python.py
|
||||
scripts/cleanup_datasets/
|
||||
scripts/communication/
|
||||
scripts/data_libraries/build_whoosh_index.py
|
||||
scripts/db_shell.py
|
||||
scripts/drmaa_external_runner.py
|
||||
scripts/metagenomics/
|
||||
scripts/microbes/BeautifulSoup.py
|
||||
scripts/microbes/harvest_bacteria.py
|
||||
scripts/secret_decoder_ring.py
|
||||
scripts/tool_shed/api/common.py
|
||||
scripts/tool_shed/build_ts_whoosh_index.py
|
||||
scripts/tool_shed/deprecate_repositories_without_metadata.py
|
||||
test/
|
||||
tool_list.py
|
||||
tools/
|
||||
@@ -10,7 +10,7 @@ import QueryStringParsing from "utils/query-string-parsing";
|
||||
import Router from "layout/router";
|
||||
import Utils from "utils/utils";
|
||||
import Page from "layout/page";
|
||||
import Vue from "libs/vue";
|
||||
import Vue from "vue";
|
||||
import UserAPIKeys from "components/UserAPIKeys.vue";
|
||||
|
||||
window.app = function app(options, bootstrapped) {
|
||||
|
||||
@@ -22,7 +22,7 @@ import Ui from "mvc/ui/ui-misc";
|
||||
import DatasetError from "mvc/dataset/dataset-error";
|
||||
import DatasetEditAttributes from "mvc/dataset/dataset-edit-attributes";
|
||||
import Citations from "components/Citations.vue";
|
||||
import Vue from "libs/vue";
|
||||
import Vue from "vue";
|
||||
|
||||
/** define the 'Analyze Data'/analysis/main/home page for Galaxy
|
||||
* * has a masthead
|
||||
|
||||
@@ -6,9 +6,7 @@
|
||||
export function append_notebook(url) {
|
||||
clear_main_area();
|
||||
$("#main").append(
|
||||
`<iframe frameBorder="0" seamless="seamless" style="width: 100%; height: 100%; overflow:hidden;" scrolling="no" src="${
|
||||
url
|
||||
}"></iframe>`
|
||||
`<iframe frameBorder="0" seamless="seamless" style="width: 100%; height: 100%; overflow:hidden;" scrolling="no" src="${url}"></iframe>`
|
||||
);
|
||||
}
|
||||
|
||||
@@ -21,9 +19,7 @@ export function clear_main_area() {
|
||||
|
||||
export function display_spinner() {
|
||||
$("#main").append(
|
||||
`<img id="spinner" src="${
|
||||
galaxy_root
|
||||
}static/style/largespinner.gif" style="position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;">`
|
||||
`<img id="spinner" src="${galaxy_root}static/style/largespinner.gif" style="position:absolute;margin:auto;top:0;left:0;right:0;bottom:0;">`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -154,11 +154,7 @@ WYMeditor.editor.prototype.dialog = function(dialogType, dialogFeatures, bodyHtm
|
||||
}
|
||||
show_modal(
|
||||
"Create Link",
|
||||
`<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='${
|
||||
curURL
|
||||
}' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='${
|
||||
curTitle
|
||||
}' size='40' /></div><div>`,
|
||||
`<div><div><label id='link_attribute_label'>URL <span style='float: right; font-size: 90%'><a href='#' id='set_link_id'>Create in-page anchor</a></span></label><br><input type='text' class='wym_href' value='${curURL}' size='40' /></div><div><label>Title</label><br><input type='text' class='wym_title' value='${curTitle}' size='40' /></div><div>`,
|
||||
{
|
||||
"Make link": function() {
|
||||
// Get URL, name/title.
|
||||
|
||||
@@ -154,9 +154,9 @@ function show_in_overlay(options) {
|
||||
closeButton: true,
|
||||
title: " ",
|
||||
body: $(
|
||||
`<div style='margin: -5px;'><iframe style='margin: 0; padding: 0;' src='${options.url}' width='${
|
||||
width
|
||||
}' height='${height}' scrolling='${scroll}' frameborder='0'></iframe></div>`
|
||||
`<div style='margin: -5px;'><iframe style='margin: 0; padding: 0;' src='${
|
||||
options.url
|
||||
}' width='${width}' height='${height}' scrolling='${scroll}' frameborder='0'></iframe></div>`
|
||||
)
|
||||
});
|
||||
modal.show({ backdrop: true });
|
||||
|
||||
@@ -180,9 +180,7 @@ export default {
|
||||
if (options.operations.length !== 0) {
|
||||
tmpl += `<div id="${id}" class="${cls}" style="float: left;">`;
|
||||
}
|
||||
tmpl += `<a class="menubutton-label use-target" target="${target}" href="${
|
||||
link
|
||||
}" onclick="return false;">${value}</a>`;
|
||||
tmpl += `<a class="menubutton-label use-target" target="${target}" href="${link}" onclick="return false;">${value}</a>`;
|
||||
if (options.operations.length !== 0) {
|
||||
tmpl += "</div>";
|
||||
}
|
||||
@@ -262,21 +260,13 @@ export default {
|
||||
if (page_index == options.cur_page_num) {
|
||||
tmpl += `<span class="page-link inactive-link" id="page-link-${page_index}">${page_index}</span>`;
|
||||
} else {
|
||||
tmpl += `<span class="page-link" id="page-link-${
|
||||
page_index
|
||||
}"><a href="javascript:void(0);" onclick="return false;" page_num="${page_index}">${
|
||||
page_index
|
||||
}</a></span>`;
|
||||
tmpl += `<span class="page-link" id="page-link-${page_index}"><a href="javascript:void(0);" onclick="return false;" page_num="${page_index}">${page_index}</a></span>`;
|
||||
}
|
||||
}
|
||||
|
||||
// show last page
|
||||
if (max_page < num_pages) {
|
||||
tmpl += `...<span class="page-link" id="page-link-${
|
||||
num_pages
|
||||
}"><a href="javascript:void(0);" onclick="return false;" page_num="${num_pages}">${
|
||||
num_pages
|
||||
}</a></span>`;
|
||||
tmpl += `...<span class="page-link" id="page-link-${num_pages}"><a href="javascript:void(0);" onclick="return false;" page_num="${num_pages}">${num_pages}</a></span>`;
|
||||
}
|
||||
tmpl += "</span>";
|
||||
|
||||
@@ -386,9 +376,7 @@ export default {
|
||||
//
|
||||
// standard search
|
||||
//
|
||||
var tmpl = `<div id="standard-search" style="display: ${
|
||||
standard_search_display
|
||||
};"><table><tr><td style="padding: 0;"><table>`;
|
||||
var tmpl = `<div id="standard-search" style="display: ${standard_search_display};"><table><tr><td style="padding: 0;"><table>`;
|
||||
|
||||
// add standard filters
|
||||
for (let column of options.columns) {
|
||||
@@ -411,9 +399,7 @@ export default {
|
||||
//
|
||||
// advanced search
|
||||
//
|
||||
tmpl += `<div id="advanced-search" style="display: ${
|
||||
advanced_search_display
|
||||
}; margin-top: 5px; border: 1px solid #ccc;"><table><tr><td style="text-align: left" colspan="100"><a href="" class="advanced-search-toggle">Close Advanced Search</a></td></tr>`;
|
||||
tmpl += `<div id="advanced-search" style="display: ${advanced_search_display}; margin-top: 5px; border: 1px solid #ccc;"><table><tr><td style="text-align: left" colspan="100"><a href="" class="advanced-search-toggle">Close Advanced Search</a></td></tr>`;
|
||||
|
||||
// add advanced filters
|
||||
for (let column of options.columns) {
|
||||
@@ -456,9 +442,9 @@ export default {
|
||||
if (column.is_text) {
|
||||
filter_value = JSON.stringify(filter_value);
|
||||
}
|
||||
tmpl += `<input type="hidden" id="${column.key}" name="f-${column.key}" value="${
|
||||
filter_value
|
||||
}"/>`;
|
||||
tmpl += `<input type="hidden" id="${column.key}" name="f-${
|
||||
column.key
|
||||
}" value="${filter_value}"/>`;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -510,9 +496,7 @@ export default {
|
||||
// print input field for column
|
||||
tmpl += `
|
||||
<span class="search-box">
|
||||
<input class="search-box-input" id="input-${column_key}-filter" name="f-${
|
||||
column_key
|
||||
}" type="text" placeholder="${value}" size="${size}"/>
|
||||
<input class="search-box-input" id="input-${column_key}-filter" name="f-${column_key}" type="text" placeholder="${value}" size="${size}"/>
|
||||
<button type="submit" style="background: transparent; border: none; padding: 4px; margin: 0px;">
|
||||
<i class="fa fa-search"></i>
|
||||
</button>
|
||||
@@ -547,11 +531,7 @@ export default {
|
||||
if (filter && cf[column_key] && filter == cf_arg) {
|
||||
tmpl += `<span class="categorical-filter ${column_key}-filter current-filter">${cf_label}</span>`;
|
||||
} else {
|
||||
tmpl += `<span class="categorical-filter ${
|
||||
column_key
|
||||
}-filter"><a href="javascript:void(0);" filter_key="${cf_key}" filter_val="${cf_arg}">${
|
||||
cf_label
|
||||
}</a></span>`;
|
||||
tmpl += `<span class="categorical-filter ${column_key}-filter"><a href="javascript:void(0);" filter_key="${cf_key}" filter_val="${cf_arg}">${cf_label}</a></span>`;
|
||||
}
|
||||
}
|
||||
tmpl += "</span>";
|
||||
@@ -565,10 +545,6 @@ export default {
|
||||
// template for filter items
|
||||
filter_element: function(filter_key, filter_value) {
|
||||
filter_value = Utils.sanitize(filter_value);
|
||||
return `<span class="text-filter-val">${filter_value}<a href="javascript:void(0);" filter_key="${
|
||||
filter_key
|
||||
}" filter_val="${
|
||||
filter_value
|
||||
}"><i class="fa fa-times" style="padding-left: 5px; padding-bottom: 6px;"/></a></span>`;
|
||||
return `<span class="text-filter-val">${filter_value}<a href="javascript:void(0);" filter_key="${filter_key}" filter_val="${filter_value}"><i class="fa fa-times" style="padding-left: 5px; padding-bottom: 6px;"/></a></span>`;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -75,9 +75,7 @@ var HDCAListItemView = _super.extend(
|
||||
} else if (!jobStatesSummary || !jobStatesSummary.hasDetails()) {
|
||||
return `
|
||||
<div class="progress state-progress">
|
||||
<span class="note">Loading job data for ${
|
||||
collectionTypeDescription
|
||||
}.<span class="blinking">..</span></span>
|
||||
<span class="note">Loading job data for ${collectionTypeDescription}.<span class="blinking">..</span></span>
|
||||
<div class="progress-bar info" style="width:100%">
|
||||
</div>`;
|
||||
} else {
|
||||
|
||||
@@ -910,9 +910,9 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
}
|
||||
var promise = $.when(
|
||||
$.post(
|
||||
`${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${options.source}&path=${
|
||||
popped_item
|
||||
}&file_type=${options.file_type}&link_data=${options.link_data}&space_to_tab=${
|
||||
`${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${
|
||||
options.source
|
||||
}&path=${popped_item}&file_type=${options.file_type}&link_data=${options.link_data}&space_to_tab=${
|
||||
options.space_to_tab
|
||||
}&to_posix_lines=${options.to_posix_lines}&dbkey=${options.dbkey}&tag_using_filenames=${
|
||||
options.tag_using_filenames
|
||||
@@ -959,13 +959,13 @@ var FolderToolbarView = Backbone.View.extend({
|
||||
}
|
||||
var promise = $.when(
|
||||
$.post(
|
||||
`${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${options.source}&path=${
|
||||
popped_item
|
||||
}&preserve_dirs=${options.preserve_dirs}&link_data=${options.link_data}&to_posix_lines=${
|
||||
options.to_posix_lines
|
||||
}&space_to_tab=${options.space_to_tab}&file_type=${options.file_type}&dbkey=${
|
||||
options.dbkey
|
||||
}&tag_using_filenames=${options.tag_using_filenames}`
|
||||
`${Galaxy.root}api/libraries/datasets?encoded_folder_id=${that.id}&source=${
|
||||
options.source
|
||||
}&path=${popped_item}&preserve_dirs=${options.preserve_dirs}&link_data=${
|
||||
options.link_data
|
||||
}&to_posix_lines=${options.to_posix_lines}&space_to_tab=${options.space_to_tab}&file_type=${
|
||||
options.file_type
|
||||
}&dbkey=${options.dbkey}&tag_using_filenames=${options.tag_using_filenames}`
|
||||
)
|
||||
);
|
||||
promise
|
||||
|
||||
@@ -124,9 +124,9 @@ var LibraryView = Backbone.View.extend({
|
||||
placeholder: "Click to select a role",
|
||||
container: self.$el.find(`#${id}`),
|
||||
ajax: {
|
||||
url: `${Galaxy.root}api/libraries/${self.id}/permissions?scope=available&is_library_access=${
|
||||
is_library_access
|
||||
}`,
|
||||
url: `${Galaxy.root}api/libraries/${
|
||||
self.id
|
||||
}/permissions?scope=available&is_library_access=${is_library_access}`,
|
||||
dataType: "json",
|
||||
quietMillis: 100,
|
||||
data: function(term, page) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import Deferred from "utils/deferred";
|
||||
import Ui from "mvc/ui/ui-misc";
|
||||
import FormBase from "mvc/form/form-view";
|
||||
import Citations from "components/Citations.vue";
|
||||
import Vue from "libs/vue";
|
||||
import Vue from "vue";
|
||||
export default FormBase.extend({
|
||||
initialize: function(options) {
|
||||
var self = this;
|
||||
|
||||
@@ -269,9 +269,7 @@ var View = Backbone.View.extend({
|
||||
} else if (batch_n !== n) {
|
||||
this.form.highlight(
|
||||
input_id,
|
||||
`Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>${
|
||||
n
|
||||
}</b> selection(s) while a previous field contains <b>${batch_n}</b>.`
|
||||
`Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>${n}</b> selection(s) while a previous field contains <b>${batch_n}</b>.`
|
||||
);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,7 @@ $.extend(Workflow.prototype, {
|
||||
}
|
||||
if (!this.canLabelOutputWith(toLabel)) {
|
||||
Toastr.warning(
|
||||
`Workflow contains duplicate workflow output labels ${
|
||||
toLabel
|
||||
}. This must be fixed before it can be saved.`
|
||||
`Workflow contains duplicate workflow output labels ${toLabel}. This must be fixed before it can be saved.`
|
||||
);
|
||||
}
|
||||
if (toLabel) {
|
||||
|
||||
@@ -277,9 +277,7 @@ export default Backbone.View.extend({
|
||||
if (upgrade_message) {
|
||||
window.show_modal(
|
||||
"Issues loading this workflow",
|
||||
`Please review the following issues, possibly resulting from tool upgrades or changes.<p><ul>${
|
||||
upgrade_message
|
||||
}</ul></p>`,
|
||||
`Please review the following issues, possibly resulting from tool upgrades or changes.<p><ul>${upgrade_message}</ul></p>`,
|
||||
{ Continue: hide_modal }
|
||||
);
|
||||
} else {
|
||||
@@ -560,9 +558,7 @@ export default Backbone.View.extend({
|
||||
if (upgrade_message) {
|
||||
window.show_modal(
|
||||
"Subworkflow embedded with changes",
|
||||
`Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.<ul>${
|
||||
upgrade_message
|
||||
}</ul>`,
|
||||
`Problems were encountered loading this workflow (possibly a result of tool upgrades). Please review the following parameters and then save.<ul>${upgrade_message}</ul>`,
|
||||
{ Continue: hide_modal }
|
||||
);
|
||||
} else {
|
||||
|
||||
@@ -103,9 +103,7 @@ var WorkflowItemView = Backbone.View.extend({
|
||||
} value="${wfId}">`;
|
||||
var trHtml = `<td><div class="dropdown"><button class="menubutton" type="button" data-toggle="dropdown">${_.escape(
|
||||
this.model.get("name")
|
||||
)}<span class="caret"></span></button>${this._templateActions()}</div></td><td><span><div class="${
|
||||
wfId
|
||||
} tags-display"></div></td><td>${
|
||||
)}<span class="caret"></span></button>${this._templateActions()}</div></td><td><span><div class="${wfId} tags-display"></div></td><td>${
|
||||
this.model.get("owner") === Galaxy.user.attributes.username ? "You" : this.model.get("owner")
|
||||
}</span></td><td>${this.model.get("number_of_steps")}</td><td>${
|
||||
this.model.get("published") ? "Yes" : "No"
|
||||
@@ -323,9 +321,7 @@ var WorkflowListView = Backbone.View.extend({
|
||||
"<th>Published</th>" +
|
||||
"<th>Show in tools panel</th>" +
|
||||
"</tr></thead>";
|
||||
return `${
|
||||
tableHtml
|
||||
}<tbody class="workflow-search "><div class="hidden_description_layer"><p>Drop workflow files here to import</p></tbody></table></div>`;
|
||||
return `${tableHtml}<tbody class="workflow-search "><div class="hidden_description_layer"><p>Drop workflow files here to import</p></tbody></table></div>`;
|
||||
},
|
||||
|
||||
/** Main template */
|
||||
|
||||
+1
-2
@@ -34,8 +34,7 @@ var paths = {
|
||||
'jquery-mousewheel': [ 'jquery.mousewheel.js', 'jquery/jquery.mousewheel.js' ],
|
||||
'raven-js': ['dist/raven.js', 'raven.js'],
|
||||
'requirejs': [ 'require.js', 'require.js' ],
|
||||
'underscore': [ 'underscore.js', 'underscore.js' ],
|
||||
'vue': [ 'dist/vue.js', 'vue.js' ]
|
||||
'underscore': [ 'underscore.js', 'underscore.js' ]
|
||||
},
|
||||
libs: ['galaxy/scripts/libs/**/*.js']
|
||||
};
|
||||
|
||||
+7
-7
@@ -28,7 +28,7 @@
|
||||
"raven-js": "^3.17.0",
|
||||
"requirejs": "2",
|
||||
"underscore": "^1.8.3",
|
||||
"vue": "^2.5.3"
|
||||
"vue": "^2.5.9"
|
||||
},
|
||||
"scripts": {
|
||||
"watch": "gulp stage-libs && concurrently \"yarn run webpack-watch\" \"yarn run gulp watch\" \"yarn run style-watch\"",
|
||||
@@ -55,11 +55,11 @@
|
||||
"devDependencies": {
|
||||
"babel-core": "^6.24.0",
|
||||
"babel-loader": "^7.1.1",
|
||||
"babel-preset-env": "^1.3.2",
|
||||
"concurrently": "^3.4.0",
|
||||
"babel-preset-env": "^1.6.1",
|
||||
"concurrently": "^3.5.1",
|
||||
"css-loader": "^0.28.7",
|
||||
"del": "^3.0.0",
|
||||
"expose-loader": "^0.7.3",
|
||||
"expose-loader": "^0.7.4",
|
||||
"grunt": "^0.4.5",
|
||||
"grunt-bower-install-simple": "^1.1.0",
|
||||
"grunt-cli": "^0.1.13",
|
||||
@@ -87,11 +87,11 @@
|
||||
"karma-webpack": "^2.0.6",
|
||||
"phantomjs-polyfill": "0.0.2",
|
||||
"phantomjs-prebuilt": "^2.1.7",
|
||||
"prettier": "^1.7.4",
|
||||
"prettier": "^1.9.1",
|
||||
"qunitjs": "^2.4.1",
|
||||
"sinon": "^4.1.2",
|
||||
"vue-loader": "^13.5.0",
|
||||
"vue-template-compiler": "^2.5.3",
|
||||
"webpack": "^3.6.0"
|
||||
"vue-template-compiler": "^2.5.9",
|
||||
"webpack": "^3.10.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ var commonLibs = [
|
||||
"libs/farbtastic",
|
||||
"libs/bootstrap",
|
||||
"libs/bootstrap-tour",
|
||||
"libs/vue",
|
||||
"vue",
|
||||
// mvc
|
||||
"libs/underscore",
|
||||
"libs/backbone",
|
||||
|
||||
+23
-19
@@ -887,9 +887,9 @@ babel-plugin-transform-strict-mode@^6.24.1:
|
||||
babel-runtime "^6.22.0"
|
||||
babel-types "^6.24.1"
|
||||
|
||||
babel-preset-env@^1.3.2:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.0.tgz#2de1c782a780a0a5d605d199c957596da43c44e4"
|
||||
babel-preset-env@^1.6.1:
|
||||
version "1.6.1"
|
||||
resolved "https://registry.yarnpkg.com/babel-preset-env/-/babel-preset-env-1.6.1.tgz#a18b564cc9b9afdf4aae57ae3c1b0d99188e6f48"
|
||||
dependencies:
|
||||
babel-plugin-check-es2015-constants "^6.22.0"
|
||||
babel-plugin-syntax-trailing-function-commas "^6.22.0"
|
||||
@@ -1659,9 +1659,9 @@ concat-stream@~1.4.6:
|
||||
readable-stream "~1.1.9"
|
||||
typedarray "~0.0.5"
|
||||
|
||||
concurrently@^3.4.0:
|
||||
version "3.5.0"
|
||||
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.5.0.tgz#8cf1b7707a6916a78a4ff5b77bb04dec54b379b2"
|
||||
concurrently@^3.5.1:
|
||||
version "3.5.1"
|
||||
resolved "https://registry.yarnpkg.com/concurrently/-/concurrently-3.5.1.tgz#ee8b60018bbe86b02df13e5249453c6ececd2521"
|
||||
dependencies:
|
||||
chalk "0.5.1"
|
||||
commander "2.6.0"
|
||||
@@ -2616,9 +2616,9 @@ expand-tilde@^2.0.2:
|
||||
dependencies:
|
||||
homedir-polyfill "^1.0.1"
|
||||
|
||||
expose-loader@^0.7.3:
|
||||
version "0.7.3"
|
||||
resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-0.7.3.tgz#35fbd3659789e4faa81f59de8b7e9fc39e466d51"
|
||||
expose-loader@^0.7.4:
|
||||
version "0.7.4"
|
||||
resolved "https://registry.yarnpkg.com/expose-loader/-/expose-loader-0.7.4.tgz#9bcdd3878b5da9107930b55a03f65afe90b3314a"
|
||||
|
||||
extend@^3.0.0, extend@~3.0.0, extend@~3.0.1:
|
||||
version "3.0.1"
|
||||
@@ -5894,10 +5894,14 @@ preserve@^0.2.0:
|
||||
version "0.2.0"
|
||||
resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
|
||||
|
||||
prettier@^1.7.0, prettier@^1.7.4:
|
||||
prettier@^1.7.0:
|
||||
version "1.8.2"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.8.2.tgz#bff83e7fd573933c607875e5ba3abbdffb96aeb8"
|
||||
|
||||
prettier@^1.9.1:
|
||||
version "1.9.1"
|
||||
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.9.1.tgz#41638a0d47c1efbd1b7d5a742aaa5548eab86d70"
|
||||
|
||||
pretty-bytes@^1.0.0:
|
||||
version "1.0.4"
|
||||
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-1.0.4.tgz#0a22e8210609ad35542f8c8d5d2159aff0751c84"
|
||||
@@ -7495,9 +7499,9 @@ vue-style-loader@^3.0.0:
|
||||
hash-sum "^1.0.2"
|
||||
loader-utils "^1.0.2"
|
||||
|
||||
vue-template-compiler@^2.5.3:
|
||||
version "2.5.3"
|
||||
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.3.tgz#ab631b0694e211a6aaf0d800102b37836aae36a4"
|
||||
vue-template-compiler@^2.5.9:
|
||||
version "2.5.9"
|
||||
resolved "https://registry.yarnpkg.com/vue-template-compiler/-/vue-template-compiler-2.5.9.tgz#7fabc73c8d3d12d32340cd86c5fc33e00e86d686"
|
||||
dependencies:
|
||||
de-indent "^1.0.2"
|
||||
he "^1.1.0"
|
||||
@@ -7506,9 +7510,9 @@ vue-template-es2015-compiler@^1.6.0:
|
||||
version "1.6.0"
|
||||
resolved "https://registry.yarnpkg.com/vue-template-es2015-compiler/-/vue-template-es2015-compiler-1.6.0.tgz#dc42697133302ce3017524356a6c61b7b69b4a18"
|
||||
|
||||
vue@^2.5.3:
|
||||
version "2.5.3"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.3.tgz#e1a3b1f49b6e93e574ce040b95cbc873912fecc1"
|
||||
vue@^2.5.9:
|
||||
version "2.5.9"
|
||||
resolved "https://registry.yarnpkg.com/vue/-/vue-2.5.9.tgz#b2380cd040915dca69881dafd121d760952e65f7"
|
||||
|
||||
walk-sync@0.3.1:
|
||||
version "0.3.1"
|
||||
@@ -7577,9 +7581,9 @@ webpack@^1.14.0:
|
||||
watchpack "^0.2.1"
|
||||
webpack-core "~0.6.9"
|
||||
|
||||
webpack@^3.6.0:
|
||||
version "3.7.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.7.0.tgz#9081d0b1ba4950e34ddc54195721eba4bf205e83"
|
||||
webpack@^3.10.0:
|
||||
version "3.10.0"
|
||||
resolved "https://registry.yarnpkg.com/webpack/-/webpack-3.10.0.tgz#5291b875078cf2abf42bdd23afe3f8f96c17d725"
|
||||
dependencies:
|
||||
acorn "^5.0.0"
|
||||
acorn-dynamic-import "^2.0.0"
|
||||
|
||||
@@ -174,7 +174,7 @@ class TourGenerator(object):
|
||||
elif input.type == 'select':
|
||||
params = []
|
||||
if name in test_inputs:
|
||||
for option in self._tool.inputs[name].static_options:
|
||||
for option in input.static_options:
|
||||
for test_option in self._test.inputs[name]:
|
||||
if test_option == option[1]:
|
||||
params.append(option[0])
|
||||
|
||||
@@ -46,7 +46,7 @@ SWARM_MANAGER_CONF_DEFAULTS = {
|
||||
'service_wait_count_limit': 0,
|
||||
'service_wait_time_limit': 5,
|
||||
'slots_min_limit': 0,
|
||||
'slots_max_limit': sys.maxint,
|
||||
'slots_max_limit': sys.maxsize,
|
||||
'slots_min_spare': 0,
|
||||
'node_idle_limit': 120,
|
||||
'limits': [],
|
||||
@@ -137,7 +137,7 @@ class SwarmManager(object):
|
||||
state = node_state['state']
|
||||
if not nodes:
|
||||
nodes = self._docker_interface.nodes()
|
||||
node = (filter(lambda x: x.name == name, nodes) + [None])[0]
|
||||
node = ([x for x in nodes if x.name == name] + [None])[0]
|
||||
if not node:
|
||||
if elapsed > self._conf.spawn_wait_time:
|
||||
log.warning("spawning node '%s' not found in `docker node ls` and spawn_wait_time exceeded! %d seconds have elapsed", name, elapsed)
|
||||
|
||||
@@ -449,7 +449,7 @@ class ImzML(Binary):
|
||||
def generate_primary_file(self, dataset=None):
|
||||
rval = ['<html><head><title>imzML Composite Dataset </title></head><p/>']
|
||||
rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).items():
|
||||
fn = composite_name
|
||||
opt_text = ''
|
||||
if composite_file.get('description'):
|
||||
@@ -493,7 +493,7 @@ class Analyze75(Binary):
|
||||
def generate_primary_file(self, dataset=None):
|
||||
rval = ['<html><head><title>Analyze75 Composite Dataset.</title></head><p/>']
|
||||
rval.append('<div>This composite dataset is composed of the following files:<p/><ul>')
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).iteritems():
|
||||
for composite_name, composite_file in self.get_composite_files(dataset=dataset).items():
|
||||
fn = composite_name
|
||||
opt_text = ''
|
||||
if composite_file.optional:
|
||||
|
||||
@@ -35,7 +35,7 @@ SQLAlchemy==1.0.15 --hash:sha256=7cbac295f87d2af82aac08346b52f72d0b0c00712290495
|
||||
--hash:sha256=f819742f33ae543ca2c48bc43e35bd75372f7c3e379e4881f9040549d3df94b6 \
|
||||
--hash:sha256=fce29753f720f8a6920185bd5a4d1670fa6b6936819475197b2bce7644243766 \
|
||||
--hash:sha256=aa8843df6869f6c999400ae32de5480fba1b7711fe535c168a14225ffd1d3de4
|
||||
mercurial==3.7.3 --hash:sha256=49f596820f005ac6f94266b89a0dbd815c0ee0aacd3aa86545dc39fb349ea4bf \
|
||||
mercurial==3.7.3; python_version < '3.0' --hash:sha256=49f596820f005ac6f94266b89a0dbd815c0ee0aacd3aa86545dc39fb349ea4bf \
|
||||
--hash:sha256=75f5b6b708bec2d6e0e68ec8912725a5dcac42df00b122fa73a8c4bd21495039 \
|
||||
--hash:sha256=8c07cb3404d26641d8829099bd1047582b76def49eca067ba6bea9a73d261775 \
|
||||
--hash:sha256=6a05bf22101b79b5f56421f7a1c6d301000f759f0114827f37cc9f847c1ab352 \
|
||||
|
||||
@@ -7,7 +7,7 @@ MarkupSafe==1.0
|
||||
PyYAML==3.12
|
||||
SQLAlchemy==1.0.15
|
||||
sqlalchemy-utils==0.32.19
|
||||
mercurial==3.7.3
|
||||
mercurial==3.7.3; python_version < '3.0'
|
||||
pycrypto==2.6.1
|
||||
uWSGI==2.0.15
|
||||
# Flexible BAM index naming is new to core pysam
|
||||
|
||||
@@ -5,7 +5,7 @@ bx-python
|
||||
MarkupSafe
|
||||
PyYAML
|
||||
SQLAlchemy
|
||||
mercurial
|
||||
mercurial; python_version < '3.0'
|
||||
pycrypto
|
||||
# Flexible BAM index naming is new to main pysam
|
||||
pysam>=0.13
|
||||
|
||||
@@ -5,11 +5,11 @@ import datetime
|
||||
import logging
|
||||
import os
|
||||
import time
|
||||
from Queue import (
|
||||
|
||||
from six.moves.queue import (
|
||||
Empty,
|
||||
Queue
|
||||
)
|
||||
|
||||
from sqlalchemy.sql.expression import (
|
||||
and_,
|
||||
func,
|
||||
@@ -343,7 +343,7 @@ class JobHandlerQueue(Monitors, object):
|
||||
if not self.track_jobs_in_database:
|
||||
self.waiting_jobs = new_waiting_jobs
|
||||
# Remove cached wrappers for any jobs that are no longer being tracked
|
||||
for id in self.job_wrappers.keys():
|
||||
for id in list(self.job_wrappers.keys()):
|
||||
if id not in new_waiting_jobs:
|
||||
del self.job_wrappers[id]
|
||||
# Flush, if we updated the state
|
||||
@@ -896,7 +896,7 @@ class DefaultJobDispatcher(object):
|
||||
job_wrapper.fail(DEFAULT_JOB_PUT_FAILURE_MESSAGE)
|
||||
|
||||
def shutdown(self):
|
||||
for runner in self.job_runners.itervalues():
|
||||
for runner in self.job_runners.values():
|
||||
try:
|
||||
runner.shutdown()
|
||||
except Exception:
|
||||
|
||||
@@ -232,7 +232,7 @@ class ChronosJobRunner(AsynchronousJobRunner):
|
||||
|
||||
def parse_destination_params(self, params):
|
||||
parsed_params = {}
|
||||
for k, spec in self.DESTINATION_PARAMS_SPEC.iteritems():
|
||||
for k, spec in self.DESTINATION_PARAMS_SPEC.items():
|
||||
value = params.get(k, spec.get('default'))
|
||||
map_to = spec.get('map_name')
|
||||
mapper = spec.get('map')
|
||||
@@ -264,7 +264,7 @@ class ChronosJobRunner(AsynchronousJobRunner):
|
||||
|
||||
def _retrieve_job(self, job_id):
|
||||
jobs = self._chronos_client.list()
|
||||
job = filter((lambda x: x['name'] == job_id), jobs)
|
||||
job = [x for x in jobs if x['name'] == job_id]
|
||||
if len(job) > 1:
|
||||
msg = 'Multiple jobs found with name {name!r}'.format(name=job_id)
|
||||
LOGGER.error(msg)
|
||||
|
||||
@@ -373,10 +373,10 @@ class HDASerializer( # datasets._UnflattenedMetadataDatasetAssociationSerialize
|
||||
Return dictionary containing new-style display app urls.
|
||||
"""
|
||||
display_apps = []
|
||||
for display_app in hda.get_display_applications(trans).itervalues():
|
||||
for display_app in hda.get_display_applications(trans).values():
|
||||
|
||||
app_links = []
|
||||
for link_app in display_app.links.itervalues():
|
||||
for link_app in display_app.links.values():
|
||||
app_links.append({
|
||||
'target': link_app.url.get('target_frame', '_blank'),
|
||||
'href': link_app.get_display_url(hda, trans),
|
||||
|
||||
@@ -413,7 +413,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
else:
|
||||
inputs = step.module.get_runtime_inputs(connections=step.output_connections)
|
||||
step_model = {
|
||||
'inputs' : [input.to_dict(trans) for input in inputs.itervalues()]
|
||||
'inputs' : [input.to_dict(trans) for input in inputs.values()]
|
||||
}
|
||||
step_model['step_type'] = step.type
|
||||
step_model['step_label'] = step.label
|
||||
@@ -713,7 +713,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
# tools. This should be removed at some point. Mirrored
|
||||
# hack in _workflow_from_dict should never be removed so
|
||||
# existing workflow exports continue to function.
|
||||
for input_name, input_conn in dict(input_conn_dict).iteritems():
|
||||
for input_name, input_conn in dict(input_conn_dict).items():
|
||||
if len(input_conn) == 1:
|
||||
input_conn_dict[input_name] = input_conn[0]
|
||||
step_dict['input_connections'] = input_conn_dict
|
||||
@@ -790,7 +790,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
supplied_steps = data['steps']
|
||||
# Try to iterate through imported workflow in such a way as to
|
||||
# preserve step order.
|
||||
step_indices = supplied_steps.keys()
|
||||
step_indices = list(supplied_steps.keys())
|
||||
try:
|
||||
step_indices = sorted(step_indices, key=int)
|
||||
except ValueError:
|
||||
@@ -927,7 +927,7 @@ class WorkflowContentsManager(UsesAnnotations):
|
||||
"""
|
||||
for step in steps:
|
||||
# Input connections
|
||||
for input_name, conn_list in step.temp_input_connections.iteritems():
|
||||
for input_name, conn_list in step.temp_input_connections.items():
|
||||
if not conn_list:
|
||||
continue
|
||||
if not isinstance(conn_list, list): # Older style singleton connection
|
||||
|
||||
@@ -4,6 +4,8 @@ Contains OpenID provider functionality
|
||||
import logging
|
||||
import os
|
||||
|
||||
import six
|
||||
|
||||
from galaxy.util import parse_xml, string_as_bool
|
||||
from galaxy.util.odict import odict
|
||||
|
||||
@@ -87,7 +89,7 @@ class OpenIDProvider(object):
|
||||
|
||||
def post_authentication(self, trans, openid_manager, info):
|
||||
sreg_attributes = openid_manager.get_sreg(info)
|
||||
for store_pref_name, store_pref_value_name in self.store_user_preference.iteritems():
|
||||
for store_pref_name, store_pref_value_name in self.store_user_preference.items():
|
||||
if store_pref_value_name in (self.sreg_optional + self.sreg_required):
|
||||
trans.user.preferences[store_pref_name] = sreg_attributes.get(store_pref_value_name)
|
||||
else:
|
||||
@@ -129,10 +131,10 @@ class OpenIDProviders(object):
|
||||
self.providers = providers
|
||||
else:
|
||||
self.providers = odict()
|
||||
self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.itervalues() if provider.never_associate_with_user]
|
||||
self._banned_identifiers = [provider.op_endpoint_url for provider in self.providers.values() if provider.never_associate_with_user]
|
||||
|
||||
def __iter__(self):
|
||||
for provider in self.providers.itervalues():
|
||||
for provider in six.itervalues(self.providers):
|
||||
yield provider
|
||||
|
||||
def get(self, name, default=None):
|
||||
|
||||
@@ -339,7 +339,7 @@ class DefaultToolState(object):
|
||||
"""
|
||||
self.inputs = {}
|
||||
context = ExpressionContext(self.inputs)
|
||||
for input in tool.inputs.itervalues():
|
||||
for input in tool.inputs.values():
|
||||
self.inputs[input.name] = input.get_initial_value(trans, context)
|
||||
|
||||
def encode(self, tool, app, nested=False):
|
||||
|
||||
@@ -448,7 +448,7 @@ def create_paramfile(trans, uploaded_datasets):
|
||||
auto_decompress=getattr(uploaded_dataset, "auto_decompress", True),
|
||||
purge_source=purge_source,
|
||||
space_to_tab=uploaded_dataset.space_to_tab,
|
||||
in_place=trans.app.config.external_chown_script is None,
|
||||
run_as_real_user=trans.app.config.external_chown_script is None,
|
||||
check_content=trans.app.config.check_upload_content,
|
||||
path=uploaded_dataset.path)
|
||||
# TODO: This will have to change when we start bundling inputs.
|
||||
|
||||
@@ -78,9 +78,9 @@ def to_cwl_job(tool, param_dict, local_working_directory):
|
||||
else:
|
||||
return str(param_dict_value)
|
||||
|
||||
for input_name, input in inputs.iteritems():
|
||||
for input_name, input in inputs.items():
|
||||
if input.type == "repeat":
|
||||
only_input = input.inputs.values()[0]
|
||||
only_input = next(iter(input.inputs.values()))
|
||||
array_value = []
|
||||
for instance in param_dict[input_name]:
|
||||
array_value.append(simple_value(only_input, instance[input_name[:-len("_repeat")]]))
|
||||
@@ -112,7 +112,7 @@ def to_galaxy_parameters(tool, as_dict):
|
||||
else:
|
||||
return param_dict_value
|
||||
|
||||
for input_name, input in inputs.iteritems():
|
||||
for input_name, input in inputs.items():
|
||||
as_dict_value = as_dict.get(input_name, NOT_PRESENT)
|
||||
galaxy_input_type = input.type
|
||||
|
||||
@@ -120,7 +120,7 @@ def to_galaxy_parameters(tool, as_dict):
|
||||
if input_name not in as_dict:
|
||||
continue
|
||||
|
||||
only_input = input.inputs.values()[0]
|
||||
only_input = next(iter(input.inputs.values()))
|
||||
for index, value in enumerate(as_dict_value):
|
||||
key = "%s_repeat_0|%s" % (input_name, only_input.name)
|
||||
galaxy_value = from_simple_value(only_input, value)
|
||||
|
||||
@@ -240,7 +240,7 @@ class JobImportHistoryArchiveWrapper(object, UsesAnnotations):
|
||||
|
||||
# Set parameters. May be useful to look at metadata.py for creating parameters.
|
||||
# TODO: there may be a better way to set parameters, e.g.:
|
||||
# for name, value in tool.params_to_strings( incoming, trans.app ).iteritems():
|
||||
# for name, value in tool.params_to_strings( incoming, trans.app ).items():
|
||||
# job.add_parameter( name, value )
|
||||
# to make this work, we'd need to flesh out the HDA objects. The code below is
|
||||
# relatively similar.
|
||||
|
||||
@@ -39,13 +39,12 @@ def expand_multi_inputs(inputs, classifier, key_filter=None):
|
||||
|
||||
def __split_inputs(inputs, classifier, key_filter):
|
||||
key_filter = key_filter or (lambda x: True)
|
||||
input_keys = filter(key_filter, inputs)
|
||||
|
||||
single_inputs = {}
|
||||
matched_multi_inputs = {}
|
||||
multiplied_multi_inputs = {}
|
||||
|
||||
for input_key in input_keys:
|
||||
for input_key in filter(key_filter, inputs):
|
||||
input_type, expanded_val = classifier(input_key)
|
||||
if input_type == input_classification.SINGLE:
|
||||
single_inputs[input_key] = expanded_val
|
||||
@@ -73,14 +72,14 @@ def __extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
|
||||
matched_multi_inputs = []
|
||||
|
||||
first_multi_input_key = multi_inputs.keys()[0]
|
||||
first_multi_input_key = next(iter(multi_inputs.keys()))
|
||||
first_multi_value = multi_inputs.get(first_multi_input_key)
|
||||
|
||||
for value in first_multi_value:
|
||||
new_inputs = __copy_and_extend_inputs(single_inputs, first_multi_input_key, value)
|
||||
matched_multi_inputs.append(new_inputs)
|
||||
|
||||
for multi_input_key, multi_input_values in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_values in multi_inputs.items():
|
||||
if multi_input_key == first_multi_input_key:
|
||||
continue
|
||||
if len(multi_input_values) != len(first_multi_value):
|
||||
@@ -95,7 +94,7 @@ def __extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
def __extend_with_multiplied_combos(input_combos, multi_inputs):
|
||||
combos = input_combos
|
||||
|
||||
for multi_input_key, multi_input_value in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_value in multi_inputs.items():
|
||||
iter_combos = []
|
||||
|
||||
for combo in combos:
|
||||
|
||||
@@ -42,7 +42,7 @@ def _app_properties(args):
|
||||
def _arg_parser():
|
||||
parser = argparse.ArgumentParser(description=DESCRIPTION)
|
||||
parser.add_argument('action', metavar='ACTION', type=str,
|
||||
choices=ACTIONS.keys(),
|
||||
choices=list(ACTIONS.keys()),
|
||||
default=DEFAULT_ACTION,
|
||||
nargs='?' if DEFAULT_ACTION is not None else None,
|
||||
help='action to perform')
|
||||
|
||||
@@ -37,7 +37,7 @@ class BaseDataProvider(object):
|
||||
"""
|
||||
raise Exception("Unimplemented Function")
|
||||
|
||||
def get_data(self, chrom, start, end, start_val=0, max_vals=sys.maxint, **kwargs):
|
||||
def get_data(self, chrom, start, end, start_val=0, max_vals=sys.maxsize, **kwargs):
|
||||
"""
|
||||
Returns data as specified by kwargs. start_val is the first element to
|
||||
return and max_vals indicates the number of values to return.
|
||||
|
||||
@@ -44,8 +44,8 @@ def get_bounds(reads, start_pos_index, end_pos_index):
|
||||
'''
|
||||
Returns the minimum and maximum position for a set of reads.
|
||||
'''
|
||||
max_low = sys.maxint
|
||||
max_high = -sys.maxint
|
||||
max_low = sys.maxsize
|
||||
max_high = -sys.maxsize
|
||||
for read in reads:
|
||||
if read[start_pos_index] < max_low:
|
||||
max_low = read[start_pos_index]
|
||||
@@ -182,7 +182,7 @@ class GenomeDataProvider(BaseDataProvider):
|
||||
"""
|
||||
raise Exception("Unimplemented Function")
|
||||
|
||||
def get_data(self, chrom=None, low=None, high=None, start_val=0, max_vals=sys.maxint, **kwargs):
|
||||
def get_data(self, chrom=None, low=None, high=None, start_val=0, max_vals=sys.maxsize, **kwargs):
|
||||
"""
|
||||
Returns data in region defined by chrom, start, and end. start_val and
|
||||
max_vals are used to denote the data to return: start_val is the first element to
|
||||
@@ -233,7 +233,7 @@ class GenomeDataProvider(BaseDataProvider):
|
||||
column_names = self.original_dataset.datatype.column_names
|
||||
except AttributeError:
|
||||
try:
|
||||
column_names = range(self.original_dataset.metadata.columns)
|
||||
column_names = list(range(self.original_dataset.metadata.columns))
|
||||
except Exception: # Give up
|
||||
return []
|
||||
|
||||
@@ -511,7 +511,7 @@ class BedDataProvider(GenomeDataProvider):
|
||||
if length >= 12:
|
||||
block_sizes = [int(n) for n in feature[10].split(',') if n != '']
|
||||
block_starts = [int(n) for n in feature[11].split(',') if n != '']
|
||||
blocks = zip(block_sizes, block_starts)
|
||||
blocks = list(zip(block_sizes, block_starts))
|
||||
payload.append([(int(feature[1]) + block[1], int(feature[1]) + block[1] + block[0]) for block in blocks])
|
||||
|
||||
# Score (filter data)
|
||||
@@ -1022,7 +1022,7 @@ class BamDataProvider(GenomeDataProvider, FilterableMixin):
|
||||
count += 1
|
||||
|
||||
# Take care of reads whose mates are out of range.
|
||||
for qname, read in paired_pending.iteritems():
|
||||
for qname, read in paired_pending.items():
|
||||
if read['mate_start'] < read['start']:
|
||||
# Mate is before read.
|
||||
read_start = read['mate_start']
|
||||
@@ -1286,7 +1286,7 @@ class IntervalIndexDataProvider(FilterableMixin, GenomeDataProvider):
|
||||
out.write(line)
|
||||
else:
|
||||
reader = GFFReaderWrapper(source, fix_strand=True)
|
||||
feature = reader.next()
|
||||
feature = next(reader)
|
||||
for interval in feature.intervals:
|
||||
out.write('\t'.join(interval.fields) + '\n')
|
||||
|
||||
@@ -1328,7 +1328,7 @@ class IntervalIndexDataProvider(FilterableMixin, GenomeDataProvider):
|
||||
|
||||
# GFF dataset.
|
||||
reader = GFFReaderWrapper(source, fix_strand=True)
|
||||
feature = reader.next()
|
||||
feature = next(reader)
|
||||
payload = package_gff_feature(feature, no_detail, filter_cols)
|
||||
payload.insert(0, offset)
|
||||
|
||||
@@ -1604,7 +1604,7 @@ class ChromatinInteractionsDataProvider(GenomeDataProvider):
|
||||
|
||||
|
||||
class ChromatinInteractionsTabixDataProvider(TabixDataProvider, ChromatinInteractionsDataProvider):
|
||||
def get_iterator(self, data_file, chrom, start=0, end=sys.maxint, interchromosomal=False, **kwargs):
|
||||
def get_iterator(self, data_file, chrom, start=0, end=sys.maxsize, interchromosomal=False, **kwargs):
|
||||
"""
|
||||
"""
|
||||
# Modify start as needed to get earlier interactions with start region.
|
||||
@@ -1661,7 +1661,7 @@ def package_gff_feature(feature, no_detail=False, filter_cols=[]):
|
||||
# Add blocks.
|
||||
block_sizes = [(interval.end - interval.start) for interval in feature_intervals]
|
||||
block_starts = [(interval.start - feature.start) for interval in feature_intervals]
|
||||
blocks = zip(block_sizes, block_starts)
|
||||
blocks = list(zip(block_sizes, block_starts))
|
||||
payload.append([(feature.start + block[1], feature.start + block[1] + block[0]) for block in blocks])
|
||||
|
||||
# Add filter data to payload.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
from __future__ import absolute_import
|
||||
from __future__ import print_function
|
||||
from __future__ import absolute_import, print_function
|
||||
|
||||
import argparse
|
||||
import copy
|
||||
@@ -268,7 +267,7 @@ def main(argv=None):
|
||||
def _arg_parser():
|
||||
parser = argparse.ArgumentParser(description=DESCRIPTION)
|
||||
parser.add_argument('action', metavar='ACTION', type=str,
|
||||
choices=ACTIONS.keys(),
|
||||
choices=list(ACTIONS.keys()),
|
||||
help='action to perform')
|
||||
parser.add_argument('app', metavar='APP', type=str, nargs="?",
|
||||
help=APP_DESCRIPTION)
|
||||
@@ -691,7 +690,7 @@ def _ordered_dump(data, stream=None, Dumper=yaml.Dumper, **kwds):
|
||||
def _dict_representer(dumper, data):
|
||||
return dumper.represent_mapping(
|
||||
yaml.resolver.BaseResolver.DEFAULT_MAPPING_TAG,
|
||||
data.items())
|
||||
list(data.items()))
|
||||
OrderedDumper.add_representer(OrderedDict, _dict_representer)
|
||||
return yaml.dump(data, stream, OrderedDumper, **kwds)
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@ Returns:
|
||||
"""
|
||||
import logging
|
||||
from base64 import b64decode
|
||||
from urllib import unquote
|
||||
|
||||
from six.moves.urllib.parse import unquote
|
||||
|
||||
from galaxy import exceptions
|
||||
from galaxy.managers import api_keys
|
||||
|
||||
@@ -88,7 +88,7 @@ class ConfigurationController(BaseAPIController):
|
||||
@require_admin
|
||||
def dynamic_tool_confs(self, trans):
|
||||
confs = self.app.toolbox.dynamic_confs(include_migrated_tool_conf=True)
|
||||
return map(_tool_conf_to_dict, confs)
|
||||
return list(map(_tool_conf_to_dict, confs))
|
||||
|
||||
@expose_api
|
||||
@require_admin
|
||||
|
||||
@@ -383,5 +383,5 @@ class DatasetsController(BaseAPIController, UsesVisualizationMixin):
|
||||
return converted
|
||||
|
||||
except model.NoConverterException:
|
||||
exc_data = dict(source=original.ext, target=target_ext, available=original.get_converter_types().keys())
|
||||
exc_data = dict(source=original.ext, target=target_ext, available=list(original.get_converter_types().keys()))
|
||||
raise galaxy_exceptions.RequestParameterInvalidException('Conversion not possible', **exc_data)
|
||||
|
||||
@@ -42,7 +42,7 @@ class DatatypesController(BaseAPIController):
|
||||
if extension in datatypes_registry.datatypes_by_extension:
|
||||
composite_files = datatypes_registry.datatypes_by_extension[extension].composite_files
|
||||
if composite_files:
|
||||
dictionary['composite_files'] = [_.dict() for _ in composite_files.itervalues()]
|
||||
dictionary['composite_files'] = [_.dict() for _ in composite_files.values()]
|
||||
rval.append(dictionary)
|
||||
return rval
|
||||
except Exception as exception:
|
||||
@@ -61,7 +61,7 @@ class DatatypesController(BaseAPIController):
|
||||
try:
|
||||
ext_to_class_name = dict()
|
||||
classes = []
|
||||
for k, v in self._datatypes_registry.datatypes_by_extension.iteritems():
|
||||
for k, v in self._datatypes_registry.datatypes_by_extension.items():
|
||||
c = v.__class__
|
||||
ext_to_class_name[k] = c.__module__ + "." + c.__name__
|
||||
classes.append(c)
|
||||
@@ -109,7 +109,7 @@ class DatatypesController(BaseAPIController):
|
||||
@expose_api_anonymous_and_sessionless
|
||||
def converters(self, trans, **kwd):
|
||||
converters = []
|
||||
for (source_type, targets) in self._datatypes_registry.datatype_converters.iteritems():
|
||||
for (source_type, targets) in self._datatypes_registry.datatype_converters.items():
|
||||
for target_type in targets:
|
||||
converters.append({
|
||||
'source': source_type,
|
||||
|
||||
@@ -92,7 +92,7 @@ class FolderContentsController(BaseAPIController, UsesLibraryMixin, UsesLibraryM
|
||||
if content_item.description:
|
||||
return_item.update(dict(description=content_item.description))
|
||||
|
||||
if content_item.api_type == 'file':
|
||||
elif content_item.api_type == 'file':
|
||||
# Is the dataset public or private?
|
||||
# When both are False the dataset is 'restricted'
|
||||
# Access rights are checked on the dataset level, not on the ld or ldda level to maintain consistency
|
||||
|
||||
@@ -96,7 +96,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
|
||||
|
||||
contents_kwds = {'types': types}
|
||||
if ids:
|
||||
ids = map(lambda id: self.decode_id(id), ids.split(','))
|
||||
ids = [self.decode_id(id) for id in ids.split(',')]
|
||||
contents_kwds['ids'] = ids
|
||||
# If explicit ids given, always used detailed result.
|
||||
details = 'all'
|
||||
@@ -209,7 +209,7 @@ class HistoryContentsController(BaseAPIController, UsesLibraryMixin, UsesLibrary
|
||||
else:
|
||||
ids = util.listify(ids)
|
||||
types = util.listify(types)
|
||||
return map(lambda s: self.encode_all_ids(trans, s), fetch_job_states(self.app, trans.sa_session, ids, types))
|
||||
return [self.encode_all_ids(trans, s) for s in fetch_job_states(self.app, trans.sa_session, ids, types)]
|
||||
|
||||
@expose_api_anonymous
|
||||
def show_jobs_summary(self, trans, id, history_id, **kwd):
|
||||
|
||||
@@ -231,7 +231,7 @@ class JobController(BaseAPIController, UsesLibraryMixinItems):
|
||||
def __dictify_associations(self, trans, *association_lists):
|
||||
rval = []
|
||||
for association_list in association_lists:
|
||||
rval.extend(map(lambda a: self.__dictify_association(trans, a), association_list))
|
||||
rval.extend(self.__dictify_association(trans, a) for a in association_list)
|
||||
return rval
|
||||
|
||||
def __dictify_association(self, trans, job_dataset_association):
|
||||
@@ -293,7 +293,7 @@ class JobController(BaseAPIController, UsesLibraryMixinItems):
|
||||
raise exceptions.ObjectAttributeMissingException("No inputs defined")
|
||||
inputs = payload.get('inputs', {})
|
||||
# Find files coming in as multipart file data and add to inputs.
|
||||
for k, v in payload.iteritems():
|
||||
for k, v in payload.items():
|
||||
if k.startswith('files_') or k.startswith('__files_'):
|
||||
inputs[k] = v
|
||||
request_context = WorkRequestContext(app=trans.app, user=trans.user, history=trans.history)
|
||||
|
||||
@@ -253,8 +253,8 @@ class ToolShedRepositoriesController(BaseAPIController):
|
||||
# this is ever not the case, this code will need to be updated.
|
||||
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(self.app, tool_ids[0].split('/')[0])
|
||||
found_repository = json.loads(util.url_get(tool_shed_url, params=dict(tool_ids=','.join(tool_ids)), pathspec=['api', 'repositories']))
|
||||
fr_keys = found_repository.keys()
|
||||
tsr_id = found_repository[fr_keys[0]]['repository_id']
|
||||
fr_first_key = next(iter(found_repository.keys()))
|
||||
tsr_id = found_repository[fr_first_key]['repository_id']
|
||||
repository_data['current_changeset'] = found_repository['current_changeset']
|
||||
repository_data['repository'] = json.loads(util.url_get(tool_shed_url, pathspec=['api', 'repositories', tsr_id]))
|
||||
del found_repository['current_changeset']
|
||||
@@ -537,7 +537,7 @@ class ToolShedRepositoriesController(BaseAPIController):
|
||||
id=trans.security.encode_id(tool_shed_repository.id))
|
||||
return tool_shed_repository_dict
|
||||
if installed_tool_shed_repositories:
|
||||
return map(to_dict, installed_tool_shed_repositories)
|
||||
return list(map(to_dict, installed_tool_shed_repositories))
|
||||
message = "No repositories were installed, possibly because the selected repository has already been installed."
|
||||
return dict(status="ok", message=message)
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import logging
|
||||
import urllib
|
||||
from json import dumps
|
||||
|
||||
from six.moves.urllib.parse import unquote_plus
|
||||
|
||||
import galaxy.queue_worker
|
||||
from galaxy import exceptions, managers, util, web
|
||||
from galaxy.managers.collections_util import dictify_dataset_collection_instance
|
||||
@@ -201,7 +202,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
lineage_dict = None
|
||||
tool_shed_dependencies = tool.installed_tool_dependencies
|
||||
if tool_shed_dependencies:
|
||||
tool_shed_dependencies_dict = map(to_dict, tool_shed_dependencies)
|
||||
tool_shed_dependencies_dict = list(map(to_dict, tool_shed_dependencies))
|
||||
else:
|
||||
tool_shed_dependencies_dict = None
|
||||
return {
|
||||
@@ -209,7 +210,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
"tool_version": tool.version,
|
||||
"dependency_shell_commands": tool.build_dependency_shell_commands(),
|
||||
"lineage": lineage_dict,
|
||||
"requirements": map(to_dict, tool.requirements),
|
||||
"requirements": list(map(to_dict, tool.requirements)),
|
||||
"installed_tool_shed_dependencies": tool_shed_dependencies_dict,
|
||||
"tool_dir": tool.tool_dir,
|
||||
"tool_shed": tool.tool_shed,
|
||||
@@ -326,19 +327,19 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
# Set up inputs.
|
||||
inputs = payload.get('inputs', {})
|
||||
# Find files coming in as multipart file data and add to inputs.
|
||||
for k, v in payload.iteritems():
|
||||
for k, v in payload.items():
|
||||
if k.startswith('files_') or k.startswith('__files_'):
|
||||
inputs[k] = v
|
||||
|
||||
# for inputs that are coming from the Library, copy them into the history
|
||||
input_patch = {}
|
||||
for k, v in inputs.iteritems():
|
||||
for k, v in inputs.items():
|
||||
if isinstance(v, dict) and v.get('src', '') == 'ldda' and 'id' in v:
|
||||
ldda = trans.sa_session.query(trans.app.model.LibraryDatasetDatasetAssociation).get(self.decode_id(v['id']))
|
||||
if trans.user_is_admin() or trans.app.security_agent.can_access_dataset(trans.get_current_user_roles(), ldda.dataset):
|
||||
input_patch[k] = ldda.to_history_dataset_association(target_history, add_to_history=True)
|
||||
|
||||
for k, v in input_patch.iteritems():
|
||||
for k, v in input_patch.items():
|
||||
inputs[k] = v
|
||||
|
||||
# TODO: encode data ids and decode ids.
|
||||
@@ -375,7 +376,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
output_dict['output_name'] = output_name
|
||||
rval['output_collections'].append(output_dict)
|
||||
|
||||
for output_name, collection_instance in vars.get('implicit_collections', {}).iteritems():
|
||||
for output_name, collection_instance in vars.get('implicit_collections', {}).items():
|
||||
history = target_history or trans.history
|
||||
output_dict = dictify_dataset_collection_instance(collection_instance, security=trans.security, parent=history)
|
||||
output_dict['output_name'] = output_name
|
||||
@@ -387,7 +388,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
# -- Helper methods --
|
||||
#
|
||||
def _get_tool(self, id, tool_version=None, user=None):
|
||||
id = urllib.unquote_plus(id)
|
||||
id = unquote_plus(id)
|
||||
tool = self.app.toolbox.get_tool(id, tool_version)
|
||||
if not tool:
|
||||
raise exceptions.ObjectNotFound("Could not find tool with id '%s'." % id)
|
||||
@@ -466,7 +467,7 @@ class ToolsController(BaseAPIController, UsesVisualizationMixin):
|
||||
# TODO: need to handle updates to conditional parameters; conditional
|
||||
# params are stored in dicts (and dicts within dicts).
|
||||
new_inputs = payload['inputs']
|
||||
tool_params.update(dict([(key, dumps(value)) for key, value in new_inputs.items() if key in tool.inputs and new_inputs[key] is not None]))
|
||||
tool_params.update(dict([(key, dumps(value)) for key, value in new_inputs.items() if key in tool.inputs and value is not None]))
|
||||
tool_params = tool.params_from_strings(tool_params, self.app)
|
||||
|
||||
#
|
||||
|
||||
@@ -243,8 +243,8 @@ class ToolShedController(BaseAPIController):
|
||||
# this is ever not the case, this code will need to be updated.
|
||||
tool_shed_url = common_util.get_tool_shed_url_from_tool_shed_registry(self.app, tool_ids[0].split('/')[0])
|
||||
found_repository = json.loads(util.url_get(tool_shed_url, params=dict(tool_ids=','.join(tool_ids)), pathspec=['api', 'repositories']))
|
||||
fr_keys = found_repository.keys()
|
||||
repository_id = found_repository[fr_keys[0]]['repository_id']
|
||||
fr_first_key = next(iter(found_repository.keys()))
|
||||
repository_id = found_repository[fr_first_key]['repository_id']
|
||||
repository_data['current_changeset'] = found_repository['current_changeset']
|
||||
repository_data['repository'] = json.loads(util.url_get(tool_shed_url, pathspec=['api', 'repositories', repository_id]))
|
||||
del found_repository['current_changeset']
|
||||
|
||||
@@ -1358,7 +1358,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
|
||||
if users:
|
||||
if trans.request.method == 'GET':
|
||||
return {
|
||||
'message': 'Changes password(s) for: %s.' % ', '.join([user.email for user in users.itervalues()]),
|
||||
'message': 'Changes password(s) for: %s.' % ', '.join(user.email for user in users.values()),
|
||||
'status' : 'info',
|
||||
'inputs' : [{'name' : 'password', 'label' : 'New password', 'type' : 'password'},
|
||||
{'name' : 'confirm', 'label' : 'Confirm password', 'type' : 'password'}]
|
||||
@@ -1370,7 +1370,7 @@ class AdminGalaxy(controller.JSAppLauncher, AdminActions, UsesQuotaMixin, QuotaP
|
||||
return self.message_exception(trans, 'Use a password of at least 6 characters.')
|
||||
elif password != confirm:
|
||||
return self.message_exception(trans, 'Passwords do not match.')
|
||||
for user in users.itervalues():
|
||||
for user in users.values():
|
||||
user.set_password_cleartext(password)
|
||||
trans.sa_session.add(user)
|
||||
trans.sa_session.flush()
|
||||
|
||||
@@ -5,9 +5,9 @@ Upload class
|
||||
from __future__ import absolute_import
|
||||
|
||||
import logging
|
||||
import urllib
|
||||
|
||||
import requests
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
from galaxy import jobs, web
|
||||
from galaxy.util import Params
|
||||
@@ -75,10 +75,10 @@ class ASync(BaseUIController):
|
||||
|
||||
# Assume there is exactly one output file possible
|
||||
TOOL_OUTPUT_TYPE = None
|
||||
for idx, obj in enumerate(tool.outputs.values()):
|
||||
for key, obj in tool.outputs.items():
|
||||
try:
|
||||
TOOL_OUTPUT_TYPE = obj.format
|
||||
params[tool.outputs.keys()[idx]] = data.id
|
||||
params[key] = data.id
|
||||
break
|
||||
except Exception:
|
||||
# exclude outputs different from ToolOutput (e.g. collections) from the previous assumption
|
||||
@@ -163,7 +163,7 @@ class ASync(BaseUIController):
|
||||
url_join_char = '&'
|
||||
else:
|
||||
url_join_char = '?'
|
||||
url = "%s%s%s" % (url, url_join_char, urllib.urlencode(params.flatten()))
|
||||
url = "%s%s%s" % (url, url_join_char, urlencode(params.flatten()))
|
||||
log.debug("connecting to -> %s" % url)
|
||||
trans.log_event("Async connecting to -> %s" % url)
|
||||
text = requests.get(url).text.strip()
|
||||
|
||||
@@ -65,7 +65,7 @@ class DataManager(BaseUIController):
|
||||
data_manager_json = {}
|
||||
error_messages.append(escape("Unable to obtain data_table info for hda (%s): %s" % (hda.id, e)))
|
||||
values = []
|
||||
for key, value in data_manager_json.get('data_tables', {}).iteritems():
|
||||
for key, value in data_manager_json.get('data_tables', {}).items():
|
||||
values.append((key, value))
|
||||
data_manager_output.append(values)
|
||||
return trans.fill_template("data_manager/view_job.mako", data_manager=data_manager, job=job, view_only=not_is_admin, hdas=hdas, data_manager_output=data_manager_output, message=message, status=status, error_messages=error_messages)
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
import logging
|
||||
import os
|
||||
import urllib
|
||||
|
||||
import paste.httpexceptions
|
||||
from markupsafe import escape
|
||||
from six import string_types, text_type
|
||||
from six.moves.urllib.parse import (
|
||||
quote_plus,
|
||||
unquote_plus
|
||||
)
|
||||
from sqlalchemy import false, true
|
||||
|
||||
from galaxy import (
|
||||
@@ -274,7 +277,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
return self.message_exception(trans, 'Please wait until this dataset finishes uploading before attempting to edit its metadata.')
|
||||
# let's not overwrite the imported datatypes module with the variable datatypes?
|
||||
# the built-in 'id' is overwritten in lots of places as well
|
||||
ldatatypes = [(dtype_name, dtype_name) for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.iteritems() if dtype_value.allow_datatype_change]
|
||||
ldatatypes = [(dtype_name, dtype_name) for dtype_name, dtype_value in trans.app.datatypes_registry.datatypes_by_extension.items() if dtype_value.allow_datatype_change]
|
||||
ldatatypes.sort()
|
||||
all_roles = [(r.name, trans.security.encode_id(r.id)) for r in trans.app.security_agent.get_legitimate_roles(trans, data.dataset, 'root')]
|
||||
data_metadata = [(name, spec) for name, spec in data.metadata.spec.items()]
|
||||
@@ -350,11 +353,10 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
permission_inputs = list()
|
||||
if trans.user:
|
||||
if data.dataset.actions:
|
||||
permitted_actions = trans.app.model.Dataset.permitted_actions.items()
|
||||
in_roles = {}
|
||||
for action, roles in trans.app.security_agent.get_permissions(data.dataset).items():
|
||||
in_roles[action.action] = [trans.security.encode_id(role.id) for role in roles]
|
||||
for index, action in permitted_actions:
|
||||
for index, action in trans.app.model.Dataset.permitted_actions.items():
|
||||
if action == trans.app.security_agent.permitted_actions.DATASET_ACCESS:
|
||||
help_text = action.description + '<br/>NOTE: Users must have every role associated with this dataset in order to access it.'
|
||||
else:
|
||||
@@ -413,6 +415,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
if job_to_dataset_association.job.state not in [job_to_dataset_association.job.states.OK, job_to_dataset_association.job.states.ERROR, job_to_dataset_association.job.states.DELETED]:
|
||||
return False
|
||||
return True
|
||||
|
||||
message = None
|
||||
status = 'success'
|
||||
dataset_id = payload.get('dataset_id')
|
||||
@@ -481,9 +484,8 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
if not trans.user:
|
||||
return self.message_exception(trans, 'You must be logged in if you want to change permissions.')
|
||||
if trans.app.security_agent.can_manage_dataset(trans.get_current_user_roles(), data.dataset):
|
||||
permitted_actions = trans.app.model.Dataset.permitted_actions.items()
|
||||
payload_permissions = {}
|
||||
for action, key in permitted_actions:
|
||||
for action in trans.app.model.Dataset.permitted_actions.keys():
|
||||
payload_permissions[action] = [trans.security.decode_id(role_id) for role_id in util.listify(payload.get(action))]
|
||||
# The user associated the DATASET_ACCESS permission on the dataset with 1 or more roles. We
|
||||
# need to ensure that they did not associate roles that would cause accessibility problems.
|
||||
@@ -727,7 +729,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
if 'display_url' not in kwd or 'redirect_url' not in kwd:
|
||||
return trans.show_error_message('Invalid parameters specified for "display at" link, please contact a Galaxy administrator')
|
||||
try:
|
||||
redirect_url = kwd['redirect_url'] % urllib.quote_plus(kwd['display_url'])
|
||||
redirect_url = kwd['redirect_url'] % quote_plus(kwd['display_url'])
|
||||
except Exception:
|
||||
redirect_url = kwd['redirect_url'] # not all will need custom text
|
||||
if trans.app.security_agent.dataset_is_public(data.dataset):
|
||||
@@ -743,7 +745,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
"""Access to external display applications"""
|
||||
# Build list of parameters to pass in to display application logic (app_kwds)
|
||||
app_kwds = {}
|
||||
for name, value in dict(kwds).iteritems(): # clone kwds because we remove stuff as we go.
|
||||
for name, value in dict(kwds).items(): # clone kwds because we remove stuff as we go.
|
||||
if name.startswith("app_"):
|
||||
app_kwds[name[len("app_"):]] = value
|
||||
del kwds[name]
|
||||
@@ -760,8 +762,8 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
else:
|
||||
user_roles = []
|
||||
# Decode application name and link name
|
||||
app_name = urllib.unquote_plus(app_name)
|
||||
link_name = urllib.unquote_plus(link_name)
|
||||
app_name = unquote_plus(app_name)
|
||||
link_name = unquote_plus(link_name)
|
||||
if None in [app_name, link_name]:
|
||||
return trans.show_error_message("A display application name and link name must be provided.")
|
||||
if self._can_access_dataset(trans, data, additional_roles=user_roles):
|
||||
@@ -1140,7 +1142,7 @@ class DatasetInterface(BaseUIController, UsesAnnotations, UsesItemRatings, UsesE
|
||||
target_histories = [history]
|
||||
if len(target_histories) != len(target_history_ids):
|
||||
error_msg = error_msg + "You do not have permission to add datasets to %i requested histories. " % (len(target_history_ids) - len(target_histories))
|
||||
source_contents = map(trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get, decoded_dataset_ids)
|
||||
source_contents = list(map(trans.sa_session.query(trans.app.model.HistoryDatasetAssociation).get, decoded_dataset_ids))
|
||||
source_contents.extend(map(trans.sa_session.query(trans.app.model.HistoryDatasetCollectionAssociation).get, decoded_dataset_collection_ids))
|
||||
source_contents.sort(key=lambda content: content.hid)
|
||||
for content in source_contents:
|
||||
|
||||
@@ -152,7 +152,7 @@ class RootController(controller.JSAppLauncher, UsesAnnotations):
|
||||
if len(query) > 2:
|
||||
search_results = trans.app.toolbox_search.search(query)
|
||||
if 'tags[]' in kwd:
|
||||
results = filter(lambda x: x in results, search_results)
|
||||
results = [x for x in search_results if x in results]
|
||||
else:
|
||||
results = search_results
|
||||
return results
|
||||
|
||||
@@ -5,10 +5,10 @@ Contains the user interface in the Universe class
|
||||
import logging
|
||||
import random
|
||||
import socket
|
||||
import urllib
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
from markupsafe import escape
|
||||
from six.moves.urllib.parse import unquote
|
||||
from sqlalchemy import (
|
||||
and_,
|
||||
func,
|
||||
@@ -853,7 +853,7 @@ class User(BaseUIController, UsesFormDefinitionsMixin, CreatesUsersMixin, Create
|
||||
Check whether token fits the user and then activate the user's account.
|
||||
"""
|
||||
params = util.Params(kwd, sanitize=False)
|
||||
email = urllib.unquote(params.get('email', None))
|
||||
email = unquote(params.get('email', None))
|
||||
activation_token = params.get('activation_token', None)
|
||||
|
||||
if email is None or activation_token is None:
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import base64
|
||||
import httplib
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
@@ -9,6 +8,7 @@ import sgmllib
|
||||
|
||||
import requests
|
||||
from markupsafe import escape
|
||||
from six.moves.http_client import HTTPConnection
|
||||
from sqlalchemy import and_
|
||||
from sqlalchemy.orm import joinedload
|
||||
from sqlalchemy.sql import expression
|
||||
@@ -678,7 +678,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
|
||||
auth_header = base64.b64encode('%s:%s' % (myexp_username, myexp_password))
|
||||
headers = {"Content-type": "text/xml", "Accept": "text/xml", "Authorization": "Basic %s" % auth_header}
|
||||
myexp_url = trans.app.config.get("myexperiment_url", self.__myexp_url)
|
||||
conn = httplib.HTTPConnection(myexp_url)
|
||||
conn = HTTPConnection(myexp_url)
|
||||
# NOTE: blocks web thread.
|
||||
conn.request("POST", "/workflow.xml", request, headers)
|
||||
response = conn.getresponse()
|
||||
@@ -987,7 +987,7 @@ class WorkflowController(BaseUIController, SharableMixin, UsesStoredWorkflowMixi
|
||||
# Extract just the output flags for this step.
|
||||
p = "%s|otag|" % step.id
|
||||
l = len(p)
|
||||
outputs = [k[l:] for (k, v) in kwargs.iteritems() if k.startswith(p)]
|
||||
outputs = [k[l:] for (k, v) in kwargs.items() if k.startswith(p)]
|
||||
if step.workflow_outputs:
|
||||
for existing_output in step.workflow_outputs:
|
||||
if existing_output.output_name not in outputs:
|
||||
@@ -1058,10 +1058,10 @@ def _expand_multiple_inputs(kwargs):
|
||||
input_combos = _extend_with_multiplied_combos(input_combos, multiplied_multi_inputs)
|
||||
|
||||
# Input name that are multiply specified
|
||||
multi_input_keys = matched_multi_inputs.keys() + multiplied_multi_inputs.keys()
|
||||
multi_input_keys = list(matched_multi_inputs.keys()) + list(multiplied_multi_inputs.keys())
|
||||
|
||||
for input_combo in input_combos:
|
||||
for key, value in input_combo.iteritems():
|
||||
for key, value in input_combo.items():
|
||||
kwargs[key] = value
|
||||
yield (kwargs, multi_input_keys)
|
||||
|
||||
@@ -1072,14 +1072,14 @@ def _extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
|
||||
matched_multi_inputs = []
|
||||
|
||||
first_multi_input_key = multi_inputs.keys()[0]
|
||||
first_multi_input_key = next(iter(multi_inputs.keys()))
|
||||
first_multi_value = multi_inputs.get(first_multi_input_key)
|
||||
|
||||
for value in first_multi_value:
|
||||
new_inputs = _copy_and_extend_inputs(single_inputs, first_multi_input_key, value)
|
||||
matched_multi_inputs.append(new_inputs)
|
||||
|
||||
for multi_input_key, multi_input_values in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_values in multi_inputs.items():
|
||||
if multi_input_key == first_multi_input_key:
|
||||
continue
|
||||
if len(multi_input_values) != len(first_multi_value):
|
||||
@@ -1092,7 +1092,7 @@ def _extend_with_matched_combos(single_inputs, multi_inputs):
|
||||
def _extend_with_multiplied_combos(input_combos, multi_inputs):
|
||||
combos = input_combos
|
||||
|
||||
for multi_input_key, multi_input_value in multi_inputs.iteritems():
|
||||
for multi_input_key, multi_input_value in multi_inputs.items():
|
||||
iter_combos = []
|
||||
|
||||
for combo in combos:
|
||||
@@ -1112,7 +1112,7 @@ def _copy_and_extend_inputs(inputs, key, value):
|
||||
def _split_inputs(kwargs):
|
||||
"""
|
||||
"""
|
||||
input_keys = filter(lambda a: a.endswith('|input'), kwargs)
|
||||
input_keys = [a for a in kwargs if a.endswith('|input')]
|
||||
single_inputs = {}
|
||||
matched_multi_inputs = {}
|
||||
multiplied_multi_inputs = {}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import StringIO
|
||||
import tarfile
|
||||
from cgi import FieldStorage
|
||||
from collections import namedtuple
|
||||
from time import strftime
|
||||
|
||||
from six import StringIO
|
||||
from sqlalchemy import and_, false
|
||||
|
||||
from galaxy import (
|
||||
@@ -1075,7 +1075,7 @@ class RepositoriesController(BaseAPIController):
|
||||
file_data = payload.get('file')
|
||||
# Code stolen from gx's upload_common.py
|
||||
if isinstance(file_data, FieldStorage):
|
||||
assert not isinstance(file_data.file, StringIO.StringIO)
|
||||
assert not isinstance(file_data.file, StringIO)
|
||||
assert file_data.file.name != '<fdopen>'
|
||||
local_filename = util.mkstemp_ln(file_data.file.name, 'upload_file_data_')
|
||||
file_data.file.close()
|
||||
|
||||
@@ -46,7 +46,7 @@ class AdminController(BaseUIController, Admin):
|
||||
**kwd))
|
||||
elif operation == "repositories_by_user":
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
if 'user_id' in kwd:
|
||||
@@ -61,7 +61,7 @@ class AdminController(BaseUIController, Admin):
|
||||
kwd['f-email'] = repository.user.email
|
||||
elif operation == "repositories_by_category":
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
category_id = kwd.get('id', None)
|
||||
|
||||
@@ -120,7 +120,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
operation = kwd['operation'].lower()
|
||||
if operation in ["repositories_by_category", "repositories_by_user"]:
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
return trans.response.send_redirect(web.url_for(controller='repository',
|
||||
@@ -274,7 +274,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
def browse_repositories_by_user(self, trans, **kwd):
|
||||
"""Display the list of repositories owned by a specified user."""
|
||||
# Eliminate the current search filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
if 'operation' in kwd:
|
||||
@@ -522,7 +522,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
operation = kwd['operation'].lower()
|
||||
if operation in ["valid_repositories_by_category", "valid_repositories_by_user"]:
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
return trans.response.send_redirect(web.url_for(controller='repository',
|
||||
@@ -560,7 +560,7 @@ class RepositoryController(BaseUIController, ratings_util.ItemRatings):
|
||||
changeset_revision=latest_installable_changeset_revision))
|
||||
elif operation == "valid_repositories_by_category":
|
||||
# Eliminate the current filters if any exist.
|
||||
for k, v in kwd.items():
|
||||
for k, v in list(kwd.items()):
|
||||
if k.startswith('f-'):
|
||||
del kwd[k]
|
||||
category_id = kwd.get('id', None)
|
||||
|
||||
@@ -32,7 +32,7 @@ class RBACAgent:
|
||||
When getting permitted actions from an untrusted source like a
|
||||
form, ensure that they match our actual permitted actions.
|
||||
"""
|
||||
return filter(lambda x: x is not None, [self.permitted_actions.get(action_string) for action_string in permitted_action_strings])
|
||||
return [x for x in [self.permitted_actions.get(action_string) for action_string in permitted_action_strings] if x is not None]
|
||||
|
||||
def create_private_user_role(self, user):
|
||||
raise Exception("Unimplemented Method")
|
||||
@@ -46,7 +46,7 @@ class RBACAgent:
|
||||
|
||||
def get_actions(self):
|
||||
"""Get all permitted actions as a list of Action objects"""
|
||||
return self.permitted_actions.__dict__.values()
|
||||
return list(self.permitted_actions.__dict__.values())
|
||||
|
||||
def get_item_actions(self, action, item):
|
||||
raise Exception('No valid method of retrieving action (%s) for item %s.' % (action, item))
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import ConfigParser
|
||||
import logging
|
||||
import os
|
||||
import shutil
|
||||
import threading
|
||||
from datetime import date
|
||||
|
||||
from six.moves import configparser
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
new_hgweb_config_template = """
|
||||
@@ -60,12 +61,12 @@ class HgWebConfigManager(object):
|
||||
self.read_config()
|
||||
try:
|
||||
entry = self.in_memory_config.get('paths', lhs)
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
try:
|
||||
# We have a multi-threaded front-end, so one of the threads may not have the latest version of the hgweb.config file.
|
||||
self.read_config(force_read=True)
|
||||
entry = self.in_memory_config.get('paths', lhs)
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
raise Exception("Entry for repository %s missing in file %s." % (lhs, self.hgweb_config))
|
||||
return entry
|
||||
|
||||
@@ -92,7 +93,7 @@ class HgWebConfigManager(object):
|
||||
|
||||
def read_config(self, force_read=False):
|
||||
if force_read or self.in_memory_config is None:
|
||||
config = ConfigParser.ConfigParser()
|
||||
config = configparser.ConfigParser()
|
||||
config.read(self.hgweb_config)
|
||||
self.in_memory_config = config
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ from tool_shed.util import basic_util, tool_dependency_util
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
VIRTUALENV_URL = 'https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz'
|
||||
VIRTUALENV_URL = 'https://pypi.python.org/packages/d4/0c/9840c08189e030873387a73b90ada981885010dd9aea134d6de30cd24cb8/virtualenv-15.1.0.tar.gz'
|
||||
|
||||
|
||||
class CompressedFile(object):
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
from ConfigParser import ConfigParser
|
||||
from os import listdir
|
||||
from os.path import join
|
||||
from re import match
|
||||
from sys import argv
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
|
||||
def merge():
|
||||
"""
|
||||
|
||||
@@ -9,13 +9,13 @@ details.
|
||||
Run from the ~/scripts/data_libraries directory:
|
||||
%sh build_lucene_index.sh
|
||||
"""
|
||||
import ConfigParser
|
||||
import csv
|
||||
import os
|
||||
import sys
|
||||
import urllib
|
||||
|
||||
import requests
|
||||
from six.moves.configparser import ConfigParser
|
||||
from six.moves.urllib.parse import urlencode
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'lib')))
|
||||
|
||||
@@ -39,7 +39,7 @@ def main(ini_file):
|
||||
|
||||
|
||||
def build_index(search_url, dataset_file):
|
||||
url = "%s/index?%s" % (search_url, urllib.urlencode({"docfile": dataset_file}))
|
||||
url = "%s/index?%s" % (search_url, urlencode({"docfile": dataset_file}))
|
||||
requests.put(url)
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ def _get_folder_info(folder):
|
||||
|
||||
|
||||
def get_sa_session(ini_file):
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
kwds = dict()
|
||||
for key, value in conf_parser.items("app:main"):
|
||||
|
||||
+2
-5
@@ -31,10 +31,7 @@ import threading
|
||||
from argparse import ArgumentParser
|
||||
from logging.config import fileConfig
|
||||
|
||||
try:
|
||||
import ConfigParser as configparser
|
||||
except ImportError:
|
||||
import configparser
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
try:
|
||||
from daemonize import Daemonize
|
||||
@@ -219,7 +216,7 @@ class GalaxyConfigBuilder(object):
|
||||
if not self.config_file:
|
||||
return
|
||||
if self.config_is_ini:
|
||||
raw_config = configparser.ConfigParser()
|
||||
raw_config = ConfigParser()
|
||||
raw_config.read([self.config_file])
|
||||
if raw_config.has_section('loggers'):
|
||||
config_file = os.path.abspath(self.config_file)
|
||||
|
||||
+2
-1
@@ -8,9 +8,10 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, 'lib'))
|
||||
|
||||
from galaxy.model import mapping
|
||||
|
||||
@@ -149,18 +149,6 @@ VARIANT_MAP = {'canon': 'Canonical',
|
||||
'male': 'Male'}
|
||||
|
||||
|
||||
# alphabetize ignoring case
|
||||
def caseless_compare(a, b):
|
||||
au = a.upper()
|
||||
bu = b.upper()
|
||||
if au > bu:
|
||||
return 1
|
||||
elif au == bu:
|
||||
return 0
|
||||
elif au < bu:
|
||||
return -1
|
||||
|
||||
|
||||
def __main__():
|
||||
# command line variables
|
||||
parser = optparse.OptionParser()
|
||||
@@ -257,14 +245,13 @@ def __main__():
|
||||
else:
|
||||
unmatching_fasta_paths.append(os.path.join(dirpath, fn))
|
||||
# remove redundant fasta files
|
||||
if variant_exclusions.keys():
|
||||
for k in variant_exclusions.keys():
|
||||
leave_in = '%s%s' % (genome_subdir, k)
|
||||
if leave_in in fasta_locs:
|
||||
to_remove = ['%s%s' % (genome_subdir, k) for k in variant_exclusions[k]]
|
||||
for tr in to_remove:
|
||||
if tr in fasta_locs:
|
||||
del fasta_locs[tr]
|
||||
for k, v in variant_exclusions.items():
|
||||
leave_in = '%s%s' % (genome_subdir, k)
|
||||
if leave_in in fasta_locs:
|
||||
to_remove = ['%s%s' % (genome_subdir, _) for _ in v]
|
||||
for tr in to_remove:
|
||||
if tr in fasta_locs:
|
||||
del fasta_locs[tr]
|
||||
|
||||
# output results
|
||||
print('\nThere were %s fasta files found that were not included because they did not have the expected file names.' % len(unmatching_fasta_paths))
|
||||
@@ -286,8 +273,8 @@ def __main__():
|
||||
else:
|
||||
all_fasta_loc.write('%s\n' % open('%s.sample' % loc_path, 'rb').read().strip())
|
||||
# output list of fasta files in alphabetical order
|
||||
fasta_bases = fasta_locs.keys()
|
||||
fasta_bases.sort(caseless_compare)
|
||||
fasta_bases = list(fasta_locs.keys())
|
||||
fasta_bases.sort(key=str.upper)
|
||||
for fb in fasta_bases:
|
||||
out_line = []
|
||||
for col in col_values:
|
||||
|
||||
@@ -20,25 +20,25 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
for org in organisms:
|
||||
org = organisms[org]
|
||||
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
|
||||
|
||||
@@ -20,32 +20,31 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
|
||||
orgs = organisms.keys()
|
||||
for org in orgs:
|
||||
if 'name' not in organisms[org]:
|
||||
del organisms[org]
|
||||
for org_name, org in list(organisms.items()):
|
||||
if 'name' not in org:
|
||||
del organisms[org_name]
|
||||
|
||||
orgs = organisms.keys()
|
||||
orgs = list(organisms.keys())
|
||||
# need to sort by name
|
||||
swap_test = False
|
||||
for i in range(0, len(orgs) - 1):
|
||||
@@ -58,8 +57,7 @@ def __main__():
|
||||
|
||||
print("||'''Organism'''||'''Kingdom'''||'''Group'''||'''Links to UCSC Archaea Browser'''||")
|
||||
|
||||
for org in orgs:
|
||||
org = organisms[org]
|
||||
for org in organisms.values():
|
||||
at_ucsc = False
|
||||
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
|
||||
try:
|
||||
|
||||
@@ -29,25 +29,25 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
|
||||
for org in organisms:
|
||||
org = organisms[org]
|
||||
|
||||
@@ -20,25 +20,25 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
name = dict['genome project id']
|
||||
if 'build' in dict.keys():
|
||||
name = dict['build']
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
name = tmp_dict['genome project id']
|
||||
if 'build' in tmp_dict.keys():
|
||||
name = tmp_dict['build']
|
||||
if name not in organisms.keys():
|
||||
organisms[name] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[name][key] = dict[key]
|
||||
for key in tmp_dict.keys():
|
||||
organisms[name][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
for org in organisms:
|
||||
org = organisms[org]
|
||||
# if no gpi, then must be a ncbi chr which corresponds to a UCSC org, w/o matching UCSC designation
|
||||
|
||||
@@ -12,10 +12,10 @@ import time
|
||||
from ftplib import FTP
|
||||
|
||||
import requests
|
||||
from BeautifulSoup import BeautifulSoup
|
||||
from six.moves.urllib.request import urlretrieve
|
||||
|
||||
from util import ( # noqa: I202
|
||||
from BeautifulSoup import BeautifulSoup # noqa: I100, I202
|
||||
from util import (
|
||||
get_bed_from_genbank,
|
||||
get_bed_from_GeneMark,
|
||||
get_bed_from_GeneMarkHMM,
|
||||
|
||||
@@ -7,10 +7,11 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
import urllib
|
||||
from shutil import move
|
||||
from xml.etree import ElementTree
|
||||
|
||||
from six.moves.urllib.request import urlopen
|
||||
|
||||
|
||||
def __main__():
|
||||
base_dir = os.path.join(os.getcwd(), "bacteria")
|
||||
@@ -24,29 +25,29 @@ def __main__():
|
||||
this_base_dir, sub_dirs, files = result
|
||||
for file in files:
|
||||
if file[-5:] == ".info":
|
||||
dict = {}
|
||||
tmp_dict = {}
|
||||
info_file = open(os.path.join(this_base_dir, file), 'r')
|
||||
info = info_file.readlines()
|
||||
info_file.close()
|
||||
for line in info:
|
||||
fields = line.replace("\n", "").split("=")
|
||||
dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in dict.keys():
|
||||
if dict['genome project id'] not in organisms.keys():
|
||||
organisms[dict['genome project id']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in dict.keys():
|
||||
organisms[dict['genome project id']][key] = dict[key]
|
||||
tmp_dict[fields[0]] = "=".join(fields[1:])
|
||||
if 'genome project id' in tmp_dict.keys():
|
||||
if tmp_dict['genome project id'] not in organisms.keys():
|
||||
organisms[tmp_dict['genome project id']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
for key in tmp_dict.keys():
|
||||
organisms[tmp_dict['genome project id']][key] = tmp_dict[key]
|
||||
else:
|
||||
if dict['organism'] not in organisms.keys():
|
||||
organisms[dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[dict['organism']]['chrs'][dict['chromosome']] = dict
|
||||
if tmp_dict['organism'] not in organisms.keys():
|
||||
organisms[tmp_dict['organism']] = {'chrs': {}, 'base_dir': this_base_dir}
|
||||
organisms[tmp_dict['organism']]['chrs'][tmp_dict['chromosome']] = tmp_dict
|
||||
|
||||
# get UCSC data
|
||||
|
||||
URL = "http://archaea.ucsc.edu/cgi-bin/das/dsn"
|
||||
|
||||
try:
|
||||
page = urllib.urlopen(URL)
|
||||
page = urlopen(URL)
|
||||
except Exception:
|
||||
print("#Unable to open " + URL)
|
||||
print("?\tunspecified (?)")
|
||||
@@ -65,7 +66,7 @@ def __main__():
|
||||
for dsn in tree:
|
||||
build = dsn.find("SOURCE").attrib['id']
|
||||
try:
|
||||
org_page = urllib.urlopen("http://archaea.ucsc.edu/cgi-bin/hgGateway?db=" + build).read().replace("\n", "").split("<table border=2 cellspacing=2 cellpadding=2>")[1].split("</table>")[0].split("</tr>")
|
||||
org_page = urlopen("http://archaea.ucsc.edu/cgi-bin/hgGateway?db=" + build).read().replace("\n", "").split("<table border=2 cellspacing=2 cellpadding=2>")[1].split("</table>")[0].split("</tr>")
|
||||
except Exception:
|
||||
print("NO CHROMS FOR", build)
|
||||
continue
|
||||
|
||||
@@ -137,7 +137,7 @@ def get_bed_from_GeneMark(geneMark_filename, chr):
|
||||
for block in orfs.split("\n\n"):
|
||||
if block.startswith("List of Regions of interest"):
|
||||
break
|
||||
best_block = {'start': 0, 'end': 0, 'strand': '+', 'avg_prob': -sys.maxint, 'start_prob': -sys.maxint, 'name': 'DNE'}
|
||||
best_block = {'start': 0, 'end': 0, 'strand': '+', 'avg_prob': -sys.maxsize, 'start_prob': -sys.maxsize, 'name': 'DNE'}
|
||||
ctr += 1
|
||||
ctr2 = 0
|
||||
for line in block.split("\n"):
|
||||
@@ -158,9 +158,8 @@ def get_bed_from_GeneMark(geneMark_filename, chr):
|
||||
except Exception:
|
||||
start_prob = 0
|
||||
name = "orf_" + str(ctr) + "_" + str(ctr2)
|
||||
if avg_prob >= best_block['avg_prob']:
|
||||
if start_prob > best_block['start_prob']:
|
||||
best_block = {'start': start, 'end': end, 'strand': strand, 'avg_prob': avg_prob, 'start_prob': start_prob, 'name': name}
|
||||
if avg_prob >= best_block['avg_prob'] and start_prob > best_block['start_prob']:
|
||||
best_block = {'start': start, 'end': end, 'strand': strand, 'avg_prob': avg_prob, 'start_prob': start_prob, 'name': name}
|
||||
regions.append(chr + "\t" + str(best_block['start']) + "\t" + str(best_block['end']) + "\t" + best_block['name'] + "\t" + str(int(best_block['avg_prob'] * 1000)) + "\t" + best_block['strand'])
|
||||
return regions
|
||||
|
||||
@@ -198,8 +197,8 @@ def get_bed_from_GeneMarkHMM(geneMarkHMM_filename, chr):
|
||||
# converts glimmer3 to bed, doing some linear scaling (probably not correct?) on scores
|
||||
# returns an array of bed regions
|
||||
def get_bed_from_glimmer3(glimmer3_filename, chr):
|
||||
max_score = -sys.maxint
|
||||
min_score = sys.maxint
|
||||
max_score = -sys.maxsize
|
||||
min_score = sys.maxsize
|
||||
orfs = []
|
||||
for line in open(glimmer3_filename).readlines():
|
||||
if line.startswith(">"):
|
||||
|
||||
@@ -5,12 +5,12 @@ wherein the second dataset doesn't have chr, start and end in standard columns 1
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import sqlalchemy as sa
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
import galaxy.app
|
||||
import galaxy.model.mapping
|
||||
@@ -34,7 +34,7 @@ class TestApplication(object):
|
||||
|
||||
def main():
|
||||
ini_file = sys.argv[1]
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
configuration = {}
|
||||
for key, value in conf_parser.items("app:main"):
|
||||
|
||||
@@ -4,12 +4,12 @@ Fetch gops_join wherein the use specified minimum coverage is not 1.
|
||||
"""
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
import tempfile
|
||||
|
||||
import sqlalchemy as sa
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
import galaxy.app
|
||||
import galaxy.model.mapping
|
||||
@@ -33,7 +33,7 @@ class TestApplication(object):
|
||||
|
||||
def main():
|
||||
ini_file = sys.argv[1]
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
configuration = {}
|
||||
for key, value in conf_parser.items("app:main"):
|
||||
|
||||
+3
-2
@@ -4,14 +4,15 @@ Bootstrap the Galaxy framework.
|
||||
This should not be called directly! Use the run.sh script in Galaxy's
|
||||
top level directly.
|
||||
"""
|
||||
from __future__ import absolute_import
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
from galaxy.util.pastescript import serve
|
||||
|
||||
from check_python import check_python # noqa: I100
|
||||
from check_python import check_python # noqa: I100, I201
|
||||
|
||||
# ensure supported version
|
||||
try:
|
||||
|
||||
@@ -3,9 +3,9 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
|
||||
@@ -3,9 +3,10 @@ from __future__ import print_function
|
||||
|
||||
import os
|
||||
import sys
|
||||
from ConfigParser import ConfigParser
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, 'lib')))
|
||||
|
||||
import galaxy.config
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
from ConfigParser import ConfigParser
|
||||
from sys import argv
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
REPLACE_PROPERTIES = ["file_path", "database_connection", "new_file_path"]
|
||||
MAIN_SECTION = "app:main"
|
||||
|
||||
|
||||
@@ -74,9 +74,9 @@ def main(options):
|
||||
if latest_revision_only:
|
||||
latest_revision = repository_dict.get('latest_revision', hg_util.INITIAL_CHANGELOG_HASH)
|
||||
if changeset_revision == latest_revision:
|
||||
repository_dicts.append(dict(repository_dict.items() + baseline_repository_dict.items()))
|
||||
repository_dicts.append(dict(list(repository_dict.items()) + list(baseline_repository_dict.items())))
|
||||
else:
|
||||
repository_dicts.append(dict(repository_dict.items() + baseline_repository_dict.items()))
|
||||
repository_dicts.append(dict(list(repository_dict.items()) + list(baseline_repository_dict.items())))
|
||||
print('\n\n', repository_dicts)
|
||||
print('\nThe url:\n\n', api_url, '\n\nreturned ', len(repository_dicts), ' repository dictionaries...')
|
||||
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
#!/usr/bin/python
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import optparse
|
||||
import os
|
||||
import sys
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'lib'))
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
from sqlalchemy.exc import OperationalError, ProgrammingError
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'lib'))
|
||||
|
||||
import galaxy.webapps.tool_shed.model.mapping as tool_shed_model
|
||||
from tool_shed.util import xml_util
|
||||
|
||||
@@ -50,7 +50,7 @@ def check_db(config_parser):
|
||||
pass
|
||||
|
||||
if config_parser.has_option('app:main', 'hgweb_config_dir'):
|
||||
hgweb_config_parser = ConfigParser.ConfigParser()
|
||||
hgweb_config_parser = ConfigParser()
|
||||
hgweb_dir = config_parser.get('app:main', 'hgweb_config_dir')
|
||||
hgweb_config_file = os.path.join(hgweb_dir, 'hgweb.config')
|
||||
if not os.path.exists(hgweb_config_file):
|
||||
@@ -104,7 +104,7 @@ def get_local_tool_shed_url(config_parser):
|
||||
|
||||
|
||||
def main(args):
|
||||
config_parser = ConfigParser.ConfigParser()
|
||||
config_parser = ConfigParser()
|
||||
|
||||
if os.path.exists(args.config):
|
||||
config_parser.read(args.config)
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
#!/usr/bin/env python
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
from six.moves.configparser import ConfigParser
|
||||
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, os.pardir, 'lib'))
|
||||
sys.path.insert(1, os.path.join(os.path.dirname(__file__)))
|
||||
|
||||
import galaxy.webapps.tool_shed.config as tool_shed_config
|
||||
from galaxy.web import security
|
||||
from galaxy.webapps.tool_shed.model import mapping
|
||||
|
||||
from bootstrap_util import admin_user_info # noqa: I100
|
||||
from bootstrap_util import admin_user_info # noqa: I100,I201
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -124,7 +124,7 @@ if __name__ == "__main__":
|
||||
parser.add_option('-c', dest='config', action='store', help='.ini file to retried toolshed configuration from')
|
||||
(args, options) = parser.parse_args()
|
||||
ini_file = args.config
|
||||
config_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
config_parser = ConfigParser({'here': os.getcwd()})
|
||||
print("Reading ini file: ", ini_file)
|
||||
config_parser.read(ini_file)
|
||||
config_dict = {}
|
||||
|
||||
@@ -5,10 +5,14 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import os
|
||||
import urllib2
|
||||
import xml.etree.ElementTree as ET
|
||||
from optparse import OptionParser
|
||||
|
||||
from six.moves.urllib.request import (
|
||||
Request,
|
||||
urlopen
|
||||
)
|
||||
|
||||
FILENAMES = ['tool_dependencies.xml']
|
||||
ACTION_TYPES = ['download_by_url', 'download_file']
|
||||
|
||||
@@ -30,7 +34,7 @@ def main():
|
||||
for element in root.findall(".//action[@type='%s']" % action_type):
|
||||
url = element.text.strip()
|
||||
try:
|
||||
urllib2.urlopen(urllib2.Request(url))
|
||||
urlopen(Request(url))
|
||||
except Exception as e:
|
||||
print("Bad URL '%s' in file '%s': %s" % (url, path, e))
|
||||
except Exception as e:
|
||||
|
||||
@@ -20,7 +20,6 @@ To run this script, use "sh migrate_tools_to_repositories.sh" from this director
|
||||
'''
|
||||
from __future__ import print_function
|
||||
|
||||
import ConfigParser
|
||||
import os
|
||||
import shutil
|
||||
import sys
|
||||
@@ -29,6 +28,7 @@ import tempfile
|
||||
from time import strftime
|
||||
|
||||
from mercurial import hg, ui
|
||||
from six.moves import configparser
|
||||
|
||||
sys.path.insert(1, os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir, 'lib')))
|
||||
|
||||
@@ -276,11 +276,11 @@ def main():
|
||||
print("%s - Migrating current tool archives to new tool repositories" % now)
|
||||
# tool_shed_wsgi.ini file
|
||||
ini_file = sys.argv[1]
|
||||
conf_parser = ConfigParser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser = configparser.ConfigParser({'here': os.getcwd()})
|
||||
conf_parser.read(ini_file)
|
||||
try:
|
||||
db_conn_str = conf_parser.get("app:main", "database_connection")
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
db_conn_str = conf_parser.get("app:main", "database_file")
|
||||
print('DB Connection: ', db_conn_str)
|
||||
# Instantiate app
|
||||
|
||||
+13
-10
@@ -4,18 +4,15 @@ Downloads files to temp locations. This script is invoked by the Transfer
|
||||
Manager (galaxy.jobs.transfer_manager) and should not normally be invoked by
|
||||
hand.
|
||||
"""
|
||||
import ConfigParser
|
||||
import json
|
||||
import logging
|
||||
import optparse
|
||||
import os
|
||||
import random
|
||||
import SocketServer
|
||||
import sys
|
||||
import tempfile
|
||||
import threading
|
||||
import time
|
||||
import urllib2
|
||||
|
||||
try:
|
||||
import pexpect
|
||||
@@ -23,6 +20,12 @@ except ImportError:
|
||||
pexpect = None
|
||||
|
||||
from daemon import DaemonContext
|
||||
from six.moves import (
|
||||
configparser,
|
||||
socketserver
|
||||
)
|
||||
from six.moves.urllib.error import URLError
|
||||
from six.moves.urllib.request import urlopen
|
||||
from sqlalchemy import create_engine, MetaData, Table
|
||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||
|
||||
@@ -82,7 +85,7 @@ class GalaxyApp(object):
|
||||
model/database.
|
||||
"""
|
||||
def __init__(self, config_file):
|
||||
self.config = ConfigParser.ConfigParser(dict(database_file='database/universe.sqlite',
|
||||
self.config = configparser.ConfigParser(dict(database_file='database/universe.sqlite',
|
||||
file_path='database/files',
|
||||
transfer_worker_port_range='12275-12675',
|
||||
transfer_worker_log=None))
|
||||
@@ -95,7 +98,7 @@ class GalaxyApp(object):
|
||||
default_dburl = 'sqlite:///%s?isolation_level=IMMEDIATE' % self.config.get('app:main', 'database_file')
|
||||
try:
|
||||
dburl = self.config.get('app:main', 'database_connection')
|
||||
except ConfigParser.NoOptionError:
|
||||
except configparser.NoOptionError:
|
||||
dburl = default_dburl
|
||||
engine = create_engine(dburl)
|
||||
metadata = MetaData(engine)
|
||||
@@ -107,7 +110,7 @@ class GalaxyApp(object):
|
||||
return self.sa_session.query(self.model.TransferJob).get(int(id))
|
||||
|
||||
|
||||
class ListenerServer(SocketServer.ThreadingTCPServer):
|
||||
class ListenerServer(socketserver.ThreadingTCPServer):
|
||||
"""
|
||||
The listener will accept state requests and new transfers for as long as
|
||||
the manager is running.
|
||||
@@ -118,7 +121,7 @@ class ListenerServer(SocketServer.ThreadingTCPServer):
|
||||
while True:
|
||||
random_port = random.choice(port_range)
|
||||
try:
|
||||
SocketServer.ThreadingTCPServer.__init__(self, ('localhost', random_port), RequestHandlerClass)
|
||||
super(ListenerServer, self).__init__(('localhost', random_port), RequestHandlerClass)
|
||||
log.info('Listening on port %s' % random_port)
|
||||
break
|
||||
except Exception as e:
|
||||
@@ -128,7 +131,7 @@ class ListenerServer(SocketServer.ThreadingTCPServer):
|
||||
app.sa_session.flush()
|
||||
|
||||
|
||||
class ListenerRequestHandler(SocketServer.BaseRequestHandler):
|
||||
class ListenerRequestHandler(socketserver.BaseRequestHandler):
|
||||
"""
|
||||
Handle state or transfer requests received on the socket.
|
||||
"""
|
||||
@@ -217,8 +220,8 @@ def http_transfer(transfer_job):
|
||||
url = transfer_job.params['url']
|
||||
assert url.startswith('http://') or url.startswith('https://')
|
||||
try:
|
||||
f = urllib2.urlopen(url)
|
||||
except urllib2.URLError as e:
|
||||
f = urlopen(url)
|
||||
except URLError as e:
|
||||
yield dict(state=transfer_job.states.ERROR, info='Unable to open URL: %s' % str(e))
|
||||
return
|
||||
size = f.info().getheader('Content-Length')
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import ConfigParser
|
||||
import os
|
||||
import sys
|
||||
|
||||
from six.moves.configparser import SafeConfigParser
|
||||
from sqlalchemy import create_engine, MetaData
|
||||
from sqlalchemy.orm import scoped_session, sessionmaker
|
||||
|
||||
@@ -27,7 +27,7 @@ def main(opts, session, model):
|
||||
|
||||
|
||||
def create_database(config_file):
|
||||
parser = ConfigParser.SafeConfigParser()
|
||||
parser = SafeConfigParser()
|
||||
parser.read(config_file)
|
||||
# Determine which database connection to use.
|
||||
database_connection = parser.get('app:main', 'install_database_connection')
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
||||
define("mvc/tool/tool-form-base",["exports","utils/localization","utils/utils","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","components/Citations.vue","libs/vue"],function(e,t,i,n,o,r,a,s){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var u=l(t),d=(l(i),l(n)),c=l(o),f=l(r),p=l(a),h=l(s);e.default=f.default.extend({initialize:function(e){var t=this;this.deferred=new d.default,f.default.prototype.initialize.call(this,e),this._update(this.model.get("initialmodel")),this.model.get("listen_to_history")&&parent.Galaxy&&parent.Galaxy.currHistoryPanel&&this.listenTo(parent.Galaxy.currHistoryPanel.collection,"change",function(){t.model.get("onchange")()}),this.$el.on("remove",function(){t._destroy()})},_update:function(e){var t=this;(e=e||this.model.get("buildmodel"))?(this.deferred.reset(),this.deferred.execute(function(i){e(i,t),i.then(function(){t._render()})})):this._render()},_destroy:function(){var e=this;this.$el.off().hide(),this.deferred.execute(function(){f.default.prototype.remove.call(e),Galaxy.emit.debug("tool-form-base::_destroy()","Destroy view.")})},_render:function(){var e=this,t=this.model.attributes;this.model.set({title:t.fixed_title||"<b>"+t.name+"</b> "+t.description+" (Galaxy Version "+t.version+")",operations:!t.hide_operations&&this._operations(),onchange:function(){e.deferred.reset(),e.deferred.execute(function(t){e.model.get("postchange")(t,e)})}}),this.render(),this.model.get("collapsible")||this.$el.append($("<div/>").addClass("ui-margin-top-large").append(this._footer())),this.show_message&&this.message.update({status:"success",message:"Now you are using '"+t.name+"' version "+t.version+", id '"+t.id+"'.",persistent:!1}),this.show_message=!0},_operations:function(){var e=this,t=this.model.attributes,i=new c.default.ButtonMenu({icon:"fa-cubes",title:!t.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!t.sustain_version&&t.versions&&t.versions.length>1)for(var n in t.versions){var o=t.versions[n];o!=t.version&&i.addMenu({title:"Switch to "+o,version:o,icon:"fa-cube",onclick:function(){e.model.set("id",t.id.replace(t.version,this.version)),e.model.set("version",this.version),e._update()}})}else i.$el.hide();var r=new c.default.ButtonMenu({id:"options",icon:"fa-caret-down",title:!t.narrow&&"Options"||null,tooltip:"View available options"});return t.biostar_url&&(r.addMenu({icon:"fa-question-circle",title:"Question?",onclick:function(){window.open(t.biostar_url+"/p/new/post/")}}),r.addMenu({icon:"fa-search",title:(0,u.default)("Search"),onclick:function(){window.open(t.biostar_url+"/local/search/page/?q="+t.name)}})),r.addMenu({icon:"fa-share",title:(0,u.default)("Share"),onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+t.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&r.addMenu({icon:"fa-download",title:(0,u.default)("Download"),onclick:function(){window.location.href=Galaxy.root+"api/tools/"+t.id+"/download"}}),t.requirements&&t.requirements.length>0&&r.addMenu({icon:"fa-info-circle",title:(0,u.default)("Requirements"),onclick:function(){!this.requirements_visible||e.portlet.collapsed?(this.requirements_visible=!0,e.portlet.expand(),e.message.update({persistent:!0,message:e._templateRequirements(t),status:"info"})):(this.requirements_visible=!1,e.message.update({message:""}))}}),t.sharable_url&&r.addMenu({icon:"fa-external-link",title:(0,u.default)("See in Tool Shed"),onclick:function(){window.open(t.sharable_url)}}),$.getJSON("/api/webhooks/tool-menu/all",function(e){_.each(e,function(e){e.activate&&e.config.function&&r.addMenu({icon:e.config.icon,title:e.config.title,onclick:function(){new Function("options",e.config.function)(t)}})})}),{menu:r,versions:i}},_footer:function(){var e=this.model.attributes,t=$("<div/>").append(this._templateHelp(e));if(e.citations){var i=h.default.extend(p.default),n=document.createElement("div");t.append(n),new i({propsData:{id:e.id,source:"tools"}}).$mount(n)}return t},_templateHelp:function(e){var t=$("<div/>").addClass("ui-form-help").append(e.help);return t.find("a").attr("target","_blank"),t},_templateRequirements:function(e){var t=e.requirements.length;if(t>0){var i="This tool requires ";_.each(e.requirements,function(e,n){i+=e.name+(e.version?" (Version "+e.version+")":"")+(n<t-2?", ":n==t-2?" and ":"")});var n=$("<a/>").attr("target","_blank").attr("href","https://galaxyproject.org/tools/requirements/").text("here");return $("<span/>").append(i+". Click ").append(n).append(" for more information.")}return"No requirements found."}})});
|
||||
define("mvc/tool/tool-form-base",["exports","utils/localization","utils/utils","utils/deferred","mvc/ui/ui-misc","mvc/form/form-view","components/Citations.vue","vue"],function(e,t,i,n,o,r,a,s){"use strict";function l(e){return e&&e.__esModule?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var u=l(t),d=(l(i),l(n)),c=l(o),f=l(r),p=l(a),h=l(s);e.default=f.default.extend({initialize:function(e){var t=this;this.deferred=new d.default,f.default.prototype.initialize.call(this,e),this._update(this.model.get("initialmodel")),this.model.get("listen_to_history")&&parent.Galaxy&&parent.Galaxy.currHistoryPanel&&this.listenTo(parent.Galaxy.currHistoryPanel.collection,"change",function(){t.model.get("onchange")()}),this.$el.on("remove",function(){t._destroy()})},_update:function(e){var t=this;(e=e||this.model.get("buildmodel"))?(this.deferred.reset(),this.deferred.execute(function(i){e(i,t),i.then(function(){t._render()})})):this._render()},_destroy:function(){var e=this;this.$el.off().hide(),this.deferred.execute(function(){f.default.prototype.remove.call(e),Galaxy.emit.debug("tool-form-base::_destroy()","Destroy view.")})},_render:function(){var e=this,t=this.model.attributes;this.model.set({title:t.fixed_title||"<b>"+t.name+"</b> "+t.description+" (Galaxy Version "+t.version+")",operations:!t.hide_operations&&this._operations(),onchange:function(){e.deferred.reset(),e.deferred.execute(function(t){e.model.get("postchange")(t,e)})}}),this.render(),this.model.get("collapsible")||this.$el.append($("<div/>").addClass("ui-margin-top-large").append(this._footer())),this.show_message&&this.message.update({status:"success",message:"Now you are using '"+t.name+"' version "+t.version+", id '"+t.id+"'.",persistent:!1}),this.show_message=!0},_operations:function(){var e=this,t=this.model.attributes,i=new c.default.ButtonMenu({icon:"fa-cubes",title:!t.narrow&&"Versions"||null,tooltip:"Select another tool version"});if(!t.sustain_version&&t.versions&&t.versions.length>1)for(var n in t.versions){var o=t.versions[n];o!=t.version&&i.addMenu({title:"Switch to "+o,version:o,icon:"fa-cube",onclick:function(){e.model.set("id",t.id.replace(t.version,this.version)),e.model.set("version",this.version),e._update()}})}else i.$el.hide();var r=new c.default.ButtonMenu({id:"options",icon:"fa-caret-down",title:!t.narrow&&"Options"||null,tooltip:"View available options"});return t.biostar_url&&(r.addMenu({icon:"fa-question-circle",title:"Question?",onclick:function(){window.open(t.biostar_url+"/p/new/post/")}}),r.addMenu({icon:"fa-search",title:(0,u.default)("Search"),onclick:function(){window.open(t.biostar_url+"/local/search/page/?q="+t.name)}})),r.addMenu({icon:"fa-share",title:(0,u.default)("Share"),onclick:function(){prompt("Copy to clipboard: Ctrl+C, Enter",window.location.origin+Galaxy.root+"root?tool_id="+t.id)}}),Galaxy.user&&Galaxy.user.get("is_admin")&&r.addMenu({icon:"fa-download",title:(0,u.default)("Download"),onclick:function(){window.location.href=Galaxy.root+"api/tools/"+t.id+"/download"}}),t.requirements&&t.requirements.length>0&&r.addMenu({icon:"fa-info-circle",title:(0,u.default)("Requirements"),onclick:function(){!this.requirements_visible||e.portlet.collapsed?(this.requirements_visible=!0,e.portlet.expand(),e.message.update({persistent:!0,message:e._templateRequirements(t),status:"info"})):(this.requirements_visible=!1,e.message.update({message:""}))}}),t.sharable_url&&r.addMenu({icon:"fa-external-link",title:(0,u.default)("See in Tool Shed"),onclick:function(){window.open(t.sharable_url)}}),$.getJSON("/api/webhooks/tool-menu/all",function(e){_.each(e,function(e){e.activate&&e.config.function&&r.addMenu({icon:e.config.icon,title:e.config.title,onclick:function(){new Function("options",e.config.function)(t)}})})}),{menu:r,versions:i}},_footer:function(){var e=this.model.attributes,t=$("<div/>").append(this._templateHelp(e));if(e.citations){var i=h.default.extend(p.default),n=document.createElement("div");t.append(n),new i({propsData:{id:e.id,source:"tools"}}).$mount(n)}return t},_templateHelp:function(e){var t=$("<div/>").addClass("ui-form-help").append(e.help);return t.find("a").attr("target","_blank"),t},_templateRequirements:function(e){var t=e.requirements.length;if(t>0){var i="This tool requires ";_.each(e.requirements,function(e,n){i+=e.name+(e.version?" (Version "+e.version+")":"")+(n<t-2?", ":n==t-2?" and ":"")});var n=$("<a/>").attr("target","_blank").attr("href","https://galaxyproject.org/tools/requirements/").text("here");return $("<span/>").append(i+". Click ").append(n).append(" for more information.")}return"No requirements found."}})});
|
||||
@@ -1,3 +1,4 @@
|
||||
from base.populators import flakey
|
||||
from galaxy_selenium.navigates_galaxy import retry_call_during_transitions
|
||||
|
||||
from .framework import (
|
||||
@@ -84,13 +85,16 @@ class ToolFormTestCase(SeleniumTestCase, UsesHistoryItemAssertions):
|
||||
self.history_panel_wait_for_hid_ok(2)
|
||||
self._check_dataset_details_for_inttest_value(2)
|
||||
|
||||
@flakey
|
||||
@selenium_test
|
||||
def test_run_data(self):
|
||||
test_path = self.get_filename("1.fasta")
|
||||
test_path_decoy = self.get_filename("1.txt")
|
||||
# Upload form posts bad data if executed two times in a row like this, so
|
||||
# wait between uploads. xref https://github.com/galaxyproject/galaxy/issues/5169
|
||||
self.perform_upload(test_path)
|
||||
self.perform_upload(test_path_decoy)
|
||||
self.history_panel_wait_for_hid_ok(1)
|
||||
self.perform_upload(test_path_decoy)
|
||||
self.history_panel_wait_for_hid_ok(2)
|
||||
|
||||
self.home()
|
||||
|
||||
+23
-10
@@ -77,14 +77,29 @@ def add_file(dataset, registry, json_file, output_path):
|
||||
converted_path = None
|
||||
stdout = None
|
||||
link_data_only = dataset.get('link_data_only', 'copy_files')
|
||||
run_as_real_user = in_place = dataset.get('in_place', True)
|
||||
purge_source = dataset.get('purge_source', True)
|
||||
# in_place is True if there is no external chmod in place,
|
||||
# however there are other instances where modifications should not occur in_place:
|
||||
# when a file is added from a directory on the local file system (ftp import folder or any other path).
|
||||
if dataset.type in ('server_dir', 'path_paste', 'ftp_import'):
|
||||
in_place = False
|
||||
|
||||
# run_as_real_user is estimated from galaxy config (external chmod indicated of inputs executed)
|
||||
# If this is True we always purge supplied upload inputs so they are cleaned up and we reuse their
|
||||
# paths during data conversions since this user already owns that path.
|
||||
# Older in_place check for upload jobs created before 18.01, TODO remove in 19.XX. xref #5206
|
||||
run_as_real_user = dataset.get('run_as_real_user', False) or dataset.get("in_place", False)
|
||||
|
||||
# purge_source is False if this is an FTP import and ftp_upload_purge has been overridden to False in Galaxy's config.
|
||||
# This prevents us from deleting the user supplied paths in this case. We disable this behavior
|
||||
# if running as the real user so the file can be cleaned up by Galaxy.
|
||||
purge_source = dataset.get('purge_source', True) and not run_as_real_user
|
||||
|
||||
# in_place is True only if we are running as a real user and not importing external paths (i.e.
|
||||
# this is a real upload and not a path paste or ftp import).
|
||||
# In this case we try to reuse the uploaded file that has been chowned to this user already.
|
||||
in_place = run_as_real_user and dataset.type not in ('server_dir', 'path_paste', 'ftp_import')
|
||||
|
||||
# Base on the check_upload_content Galaxy config option and on by default, this enables some
|
||||
# security related checks on the uploaded content, but can prevent uploads from working in some cases.
|
||||
check_content = dataset.get('check_content' , True)
|
||||
|
||||
# auto_decompress is a request flag that can be swapped off to prevent Galaxy from automatically
|
||||
# decompressing archive files before sniffing.
|
||||
auto_decompress = dataset.get('auto_decompress', True)
|
||||
try:
|
||||
ext = dataset.file_type
|
||||
@@ -303,9 +318,7 @@ def add_file(dataset, registry, json_file, output_path):
|
||||
if e.errno != errno.EACCES:
|
||||
raise
|
||||
elif link_data_only == 'copy_files':
|
||||
if purge_source and not run_as_real_user:
|
||||
# if the upload tool runs as a real user the real user
|
||||
# can't move dataset.path as this path is owned by galaxy.
|
||||
if purge_source:
|
||||
shutil.move(dataset.path, output_path)
|
||||
else:
|
||||
shutil.copy(dataset.path, output_path)
|
||||
|
||||
@@ -54,7 +54,7 @@ def _prepare_json_param_dict(param_dict):
|
||||
JSON serialization Support functions for exec_before_job hook
|
||||
"""
|
||||
rval = {}
|
||||
for key, value in param_dict.iteritems():
|
||||
for key, value in param_dict.items():
|
||||
if isinstance(value, dict):
|
||||
rval[key] = _prepare_json_param_dict(value)
|
||||
elif isinstance(value, list):
|
||||
@@ -83,7 +83,7 @@ def exec_before_job(app, inp_data, out_data, param_dict=None, tool=None):
|
||||
GALAXY_ROOT_DIR=param_dict.get('GALAXY_ROOT_DIR'),
|
||||
TOOL_PROVIDED_JOB_METADATA_FILE=galaxy.jobs.TOOL_PROVIDED_JOB_METADATA_FILE)
|
||||
json_filename = None
|
||||
for i, (out_name, data) in enumerate(out_data.iteritems()):
|
||||
for i, (out_name, data) in enumerate(out_data.items()):
|
||||
file_name = data.get_file_name()
|
||||
data_dict = dict(out_data_name=out_name,
|
||||
ext=data.ext,
|
||||
|
||||
Reference in New Issue
Block a user