mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merge branch 'dev' into remove_toolshed_installation_grid
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
client/galaxy/style/source_material/circle.py
|
||||
config/
|
||||
contrib/
|
||||
cron/
|
||||
doc/parse_gx_xsd.py
|
||||
@@ -21,22 +22,13 @@ lib/galaxy/jobs/command_factory.py
|
||||
lib/galaxy/jobs/datasets.py
|
||||
lib/galaxy/jobs/deferred/
|
||||
lib/galaxy/jobs/error_level.py
|
||||
lib/galaxy/jobs/handler.py
|
||||
lib/galaxy/jobs/__init__.py
|
||||
lib/galaxy/jobs/manager.py
|
||||
lib/galaxy/jobs/metrics/
|
||||
lib/galaxy/jobs/output_checker.py
|
||||
lib/galaxy/jobs/rules/
|
||||
lib/galaxy/jobs/runners/cli.py
|
||||
lib/galaxy/jobs/runners/condor.py
|
||||
lib/galaxy/jobs/runners/drmaa.py
|
||||
lib/galaxy/jobs/runners/godocker.py
|
||||
lib/galaxy/jobs/runners/kubernetes.py
|
||||
lib/galaxy/jobs/runners/local.py
|
||||
lib/galaxy/jobs/runners/pbs.py
|
||||
lib/galaxy/jobs/runners/pulsar.py
|
||||
lib/galaxy/jobs/runners/slurm.py
|
||||
lib/galaxy/jobs/runners/state_handlers/
|
||||
lib/galaxy/jobs/runners/tasks.py
|
||||
lib/galaxy/jobs/runners/util/
|
||||
lib/galaxy/jobs/runners/
|
||||
lib/galaxy/jobs/splitters/basic.py
|
||||
lib/galaxy/jobs/splitters/__init__.py
|
||||
lib/galaxy/jobs/stock_rules.py
|
||||
@@ -61,9 +53,7 @@ lib/galaxy/objectstore/s3_multipart_upload.py
|
||||
lib/galaxy/objectstore/s3.py
|
||||
lib/galaxy/openid/__init__.py
|
||||
lib/galaxy/quota/
|
||||
lib/galaxy/sample_tracking/data_transfer.py
|
||||
lib/galaxy/sample_tracking/__init__.py
|
||||
lib/galaxy/sample_tracking/sample.py
|
||||
lib/galaxy/sample_tracking/
|
||||
lib/galaxy/security/
|
||||
lib/galaxy/tags/
|
||||
lib/galaxy/tools/
|
||||
@@ -71,6 +61,7 @@ lib/galaxy/util/
|
||||
lib/galaxy/version.py
|
||||
lib/galaxy/visualization/data_providers/basic.py
|
||||
lib/galaxy/visualization/data_providers/cigar.py
|
||||
lib/galaxy/visualization/data_providers/genome.py
|
||||
lib/galaxy/visualization/data_providers/__init__.py
|
||||
lib/galaxy/visualization/data_providers/phyloviz/baseparser.py
|
||||
lib/galaxy/visualization/genome/
|
||||
@@ -99,14 +90,23 @@ lib/galaxy/web/framework/middleware/xforwardedhost.py
|
||||
lib/galaxy/web/framework/webapp.py
|
||||
lib/galaxy/web/__init__.py
|
||||
lib/galaxy/web/params.py
|
||||
lib/galaxy/web/stack/
|
||||
lib/galaxy/webapps/galaxy/api/authenticate.py
|
||||
lib/galaxy/webapps/galaxy/api/forms.py
|
||||
lib/galaxy/webapps/galaxy/api/genomes.py
|
||||
lib/galaxy/webapps/galaxy/api/group_roles.py
|
||||
lib/galaxy/webapps/galaxy/api/group_users.py
|
||||
lib/galaxy/webapps/galaxy/api/groups.py
|
||||
lib/galaxy/webapps/galaxy/api/histories.py
|
||||
lib/galaxy/webapps/galaxy/api/__init__.py
|
||||
lib/galaxy/webapps/galaxy/api/jobs.py
|
||||
lib/galaxy/webapps/galaxy/api/library_contents.py
|
||||
lib/galaxy/webapps/galaxy/api/library_datasets.py
|
||||
lib/galaxy/webapps/galaxy/api/requests.py
|
||||
lib/galaxy/webapps/galaxy/api/request_types.py
|
||||
lib/galaxy/webapps/galaxy/api/roles.py
|
||||
lib/galaxy/webapps/galaxy/api/samples.py
|
||||
lib/galaxy/webapps/galaxy/api/tool_data.py
|
||||
lib/galaxy/webapps/galaxy/api/tools.py
|
||||
lib/galaxy/webapps/galaxy/api/tours.py
|
||||
lib/galaxy/webapps/galaxy/api/users.py
|
||||
@@ -116,6 +116,7 @@ lib/galaxy/webapps/galaxy/config_watchers.py
|
||||
lib/galaxy/webapps/galaxy/controllers/admin_toolshed.py
|
||||
lib/galaxy/webapps/galaxy/controllers/async.py
|
||||
lib/galaxy/webapps/galaxy/controllers/data_manager.py
|
||||
lib/galaxy/webapps/galaxy/controllers/dataset.py
|
||||
lib/galaxy/webapps/galaxy/controllers/error.py
|
||||
lib/galaxy/webapps/galaxy/controllers/external_services.py
|
||||
lib/galaxy/webapps/galaxy/controllers/forms.py
|
||||
@@ -124,21 +125,29 @@ lib/galaxy/webapps/galaxy/controllers/__init__.py
|
||||
lib/galaxy/webapps/galaxy/controllers/library_common.py
|
||||
lib/galaxy/webapps/galaxy/controllers/mobile.py
|
||||
lib/galaxy/webapps/galaxy/controllers/page.py
|
||||
lib/galaxy/webapps/galaxy/controllers/requests_admin.py
|
||||
lib/galaxy/webapps/galaxy/controllers/requests_common.py
|
||||
lib/galaxy/webapps/galaxy/controllers/requests.py
|
||||
lib/galaxy/webapps/galaxy/controllers/request_type.py
|
||||
lib/galaxy/webapps/galaxy/controllers/root.py
|
||||
lib/galaxy/webapps/galaxy/controllers/search.py
|
||||
lib/galaxy/webapps/galaxy/controllers/tool_runner.py
|
||||
lib/galaxy/webapps/galaxy/controllers/userskeys.py
|
||||
lib/galaxy/webapps/galaxy/__init__.py
|
||||
lib/galaxy/webapps/__init__.py
|
||||
lib/galaxy/webapps/reports/buildapp.py
|
||||
lib/galaxy/webapps/reports/config.py
|
||||
lib/galaxy/webapps/reports/controllers/__init__.py
|
||||
lib/galaxy/webapps/reports/controllers/query.py
|
||||
lib/galaxy/webapps/reports/controllers/system.py
|
||||
lib/galaxy/webapps/reports/controllers/tools.py
|
||||
lib/galaxy/webapps/reports/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/api/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/buildapp.py
|
||||
lib/galaxy/webapps/tool_shed/config.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/groups.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/repository.py
|
||||
lib/galaxy/webapps/tool_shed/controllers/user.py
|
||||
lib/galaxy/webapps/tool_shed/framework/__init__.py
|
||||
lib/galaxy/webapps/tool_shed/framework/middleware/__init__.py
|
||||
|
||||
@@ -17,14 +17,14 @@ window.app = function app(options, bootstrapped) {
|
||||
/** Routes */
|
||||
var AdminRouter = Router.extend({
|
||||
routes: {
|
||||
"(/)admin(/)users" : "show_users",
|
||||
"(/)admin(/)roles" : "show_roles",
|
||||
"(/)admin(/)groups" : "show_groups",
|
||||
"(/)admin(/)tool_versions" : "show_tool_versions",
|
||||
"(/)admin(/)quotas" : "show_quotas",
|
||||
"(/)admin(/)repositories" : "show_repositories",
|
||||
"(/)admin(/)forms" : "show_forms",
|
||||
"(/)admin(/)form(/)(:form_id)" : "show_form"
|
||||
"(/)admin(/)users": "show_users",
|
||||
"(/)admin(/)roles": "show_roles",
|
||||
"(/)admin(/)groups": "show_groups",
|
||||
"(/)admin(/)tool_versions": "show_tool_versions",
|
||||
"(/)admin(/)quotas": "show_quotas",
|
||||
"(/)admin(/)repositories": "show_repositories",
|
||||
"(/)admin(/)forms": "show_forms",
|
||||
"(/)admin(/)form(/)(:form_id)": "show_form"
|
||||
},
|
||||
|
||||
authenticate: function(args, name) {
|
||||
@@ -64,7 +64,8 @@ window.app = function app(options, bootstrapped) {
|
||||
show_repositories: function() {
|
||||
this.page.display(
|
||||
new GridView({
|
||||
url_base: Galaxy.root + "admin_toolshed/browse_repositories",
|
||||
url_base:
|
||||
Galaxy.root + "admin_toolshed/browse_repositories",
|
||||
url_data: Galaxy.params,
|
||||
dict_format: true
|
||||
})
|
||||
|
||||
@@ -12,177 +12,106 @@ var AdminPanel = Backbone.View.extend({
|
||||
this.model = new Backbone.Model({
|
||||
title: _l("Administration")
|
||||
});
|
||||
this.categories = new Backbone.Collection([
|
||||
{
|
||||
title: "Server",
|
||||
items: [
|
||||
{
|
||||
title: "Data types registry",
|
||||
url: "admin/view_datatypes_registry"
|
||||
},
|
||||
{
|
||||
title: "Data tables registry",
|
||||
url: "admin/view_tool_data_tables"
|
||||
},
|
||||
{
|
||||
title: "Display applications",
|
||||
url: "admin/display_applications"
|
||||
},
|
||||
{
|
||||
title: "Manage jobs",
|
||||
url: "admin/jobs"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Tools and Tool Shed",
|
||||
items: [
|
||||
{
|
||||
title: "Search Tool Shed",
|
||||
url: "admin_toolshed/browse_tool_sheds",
|
||||
enabled: self.settings.is_tool_shed_installed
|
||||
},
|
||||
{
|
||||
title: "Search Tool Shed (Beta)",
|
||||
url: "admin_toolshed/browse_toolsheds",
|
||||
enabled:
|
||||
self.settings.is_tool_shed_installed &&
|
||||
self.config.enable_beta_ts_api_install
|
||||
},
|
||||
{
|
||||
title: "Monitor installing repositories",
|
||||
url: "admin_toolshed/monitor_repository_installation"
|
||||
},
|
||||
{
|
||||
title: "Manage installed tools",
|
||||
url: "admin/repositories",
|
||||
enabled: self.settings.is_repo_installed,
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Reset metadata",
|
||||
url:
|
||||
"admin_toolshed/reset_metadata_on_selected_installed_repositories",
|
||||
enabled: self.settings.is_repo_installed
|
||||
},
|
||||
{
|
||||
title: "Download local tool",
|
||||
url: "admin/package_tool"
|
||||
},
|
||||
{
|
||||
title: "Tool lineage",
|
||||
url: "admin/tool_versions",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Reload a tool's configuration",
|
||||
url: "admin/reload_tool"
|
||||
},
|
||||
{
|
||||
title: "Review tool migration stages",
|
||||
url: "admin/review_tool_migration_stages"
|
||||
},
|
||||
{
|
||||
title: "View Tool Error Logs",
|
||||
url: "admin/tool_errors"
|
||||
},
|
||||
{
|
||||
title: "Manage Display Whitelist",
|
||||
url: "admin/sanitize_whitelist"
|
||||
},
|
||||
{
|
||||
title: "Manage Tool Dependencies",
|
||||
url: "admin/manage_tool_dependencies"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "User Management",
|
||||
items: [
|
||||
{
|
||||
title: "Users",
|
||||
url: "admin/users",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Groups",
|
||||
url: "admin/groups",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Roles",
|
||||
url: "admin/roles",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "API keys",
|
||||
url: "userskeys/all_users"
|
||||
},
|
||||
{
|
||||
title: "Impersonate a user",
|
||||
url: "admin/impersonate",
|
||||
enabled: self.config.allow_user_impersonation
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Data",
|
||||
items: [
|
||||
{
|
||||
title: "Quotas",
|
||||
url: "admin/quotas",
|
||||
target: "__use_router__",
|
||||
enabled: self.config.enable_quotas
|
||||
},
|
||||
{
|
||||
title: "Data libraries",
|
||||
url: "library_admin/browse_libraries"
|
||||
},
|
||||
{
|
||||
title: "Roles",
|
||||
url: "admin/roles",
|
||||
target: "__use_router__"
|
||||
},
|
||||
{
|
||||
title: "Local data",
|
||||
url: "data_manager"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Form Definitions",
|
||||
items: [
|
||||
{
|
||||
title: "Form definitions",
|
||||
url: "admin/forms",
|
||||
target: "__use_router__"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
title: "Sample Tracking",
|
||||
items: [
|
||||
{
|
||||
title: "Sequencers and external services",
|
||||
url: "external_service/browse_external_services"
|
||||
},
|
||||
{
|
||||
title: "Request types",
|
||||
url: "request_type/browse_request_types"
|
||||
},
|
||||
{
|
||||
title: "Sequencing requests",
|
||||
url: "requests_admin/browse_requests"
|
||||
},
|
||||
{
|
||||
title: "Find samples",
|
||||
url:
|
||||
"requests_common/find_samples?cntrller=requests_admin"
|
||||
}
|
||||
]
|
||||
}
|
||||
]);
|
||||
this.setElement(this._template());
|
||||
this.categories = new Backbone.Collection([{
|
||||
title : "Server",
|
||||
items : [ {
|
||||
title : "Data types registry",
|
||||
url : "admin/view_datatypes_registry"
|
||||
},{
|
||||
title : "Data tables registry",
|
||||
url : "admin/view_tool_data_tables"
|
||||
},{
|
||||
title : "Data libraries",
|
||||
url : "library_admin/browse_libraries"
|
||||
},{
|
||||
title : "Display applications",
|
||||
url : "admin/display_applications"
|
||||
},{
|
||||
title : "Manage jobs",
|
||||
url : "admin/jobs"
|
||||
},{
|
||||
title : "Local data",
|
||||
url : "data_manager"
|
||||
} ]
|
||||
},{
|
||||
title : "User Management",
|
||||
items : [ {
|
||||
title : "Users",
|
||||
url : "admin/users",
|
||||
target : "__use_router__"
|
||||
},{
|
||||
title : "Quotas",
|
||||
url : "admin/quotas",
|
||||
target : "__use_router__",
|
||||
enabled : self.config.enable_quotas
|
||||
},{
|
||||
title : "Groups",
|
||||
url : "admin/groups",
|
||||
target : "__use_router__"
|
||||
},{
|
||||
title : "Roles",
|
||||
url : "admin/roles",
|
||||
target : "__use_router__"
|
||||
},{
|
||||
title : "Forms",
|
||||
url : "admin/forms",
|
||||
target : "__use_router__"
|
||||
},{
|
||||
title : "API keys",
|
||||
url : "userskeys/all_users"
|
||||
},{
|
||||
title : "Impersonate a user",
|
||||
url : "admin/impersonate",
|
||||
enabled : self.config.allow_user_impersonation
|
||||
}]
|
||||
},{
|
||||
title : "Tools and Tool Shed",
|
||||
items : [ {
|
||||
title : "Search Tool Shed",
|
||||
url : "admin_toolshed/browse_tool_sheds",
|
||||
enabled : self.settings.is_tool_shed_installed
|
||||
},{
|
||||
title : "Search Tool Shed (Beta)",
|
||||
url : "admin_toolshed/browse_toolsheds",
|
||||
enabled : self.settings.is_tool_shed_installed && self.config.enable_beta_ts_api_install
|
||||
},{
|
||||
title : "Monitor installing repositories",
|
||||
url : "admin_toolshed/monitor_repository_installation",
|
||||
enabled : self.settings.installing_repository_ids
|
||||
},{
|
||||
title : "Manage installed tools",
|
||||
url : "admin/repositories",
|
||||
enabled : self.settings.is_repo_installed,
|
||||
target : "__use_router__"
|
||||
},{
|
||||
title : "Reset metadata",
|
||||
url : "admin_toolshed/reset_metadata_on_selected_installed_repositories",
|
||||
enabled : self.settings.is_repo_installed
|
||||
},{
|
||||
title : "Download local tool",
|
||||
url : "admin/package_tool"
|
||||
},{
|
||||
title : "Tool lineage",
|
||||
url : "admin/tool_versions",
|
||||
target : "__use_router__"
|
||||
},{
|
||||
title : "Reload a tool\"s configuration",
|
||||
url : "admin/reload_tool"
|
||||
},{
|
||||
title : "Review tool migration stages",
|
||||
url : "admin/review_tool_migration_stages"
|
||||
},{
|
||||
title : "View Tool Error Logs",
|
||||
url : "admin/tool_errors"
|
||||
},{
|
||||
title : "Manage Display Whitelist",
|
||||
url : "admin/sanitize_whitelist"
|
||||
},{
|
||||
title : "Manage Tool Dependencies",
|
||||
url : "admin/manage_tool_dependencies"
|
||||
} ]
|
||||
}]);
|
||||
this.setElement( this._template() );
|
||||
},
|
||||
|
||||
render: function() {
|
||||
|
||||
@@ -111,8 +111,10 @@ function spin(
|
||||
type: "GET",
|
||||
timeout: spin_state.ajax_timeout,
|
||||
success: function(data, status, jqxhr) {
|
||||
if (!success_callback(data, status, jqxhr))
|
||||
if (!success_callback(data, status, jqxhr)) {
|
||||
spin_state.count++;
|
||||
spin_again(spin_state);
|
||||
}
|
||||
},
|
||||
error: function(jqxhr, status, error) {
|
||||
if (status == "timeout") {
|
||||
|
||||
@@ -78,29 +78,6 @@ define(
|
||||
]
|
||||
});
|
||||
|
||||
//
|
||||
// Lab menu.
|
||||
//
|
||||
options.user_requests &&
|
||||
this.add({
|
||||
id: "lab",
|
||||
title: "Lab",
|
||||
menu: [
|
||||
{
|
||||
title: "Sequencing Requests",
|
||||
url: "requests/index"
|
||||
},
|
||||
{
|
||||
title: "Find Samples",
|
||||
url: "requests/find_samples_index"
|
||||
},
|
||||
{
|
||||
title: "Help",
|
||||
url: options.lims_doc_url
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
//
|
||||
// Visualization tab.
|
||||
//
|
||||
|
||||
@@ -541,7 +541,8 @@ define(
|
||||
}
|
||||
},
|
||||
|
||||
copyToClipboard: function() {
|
||||
copyToClipboard: function(e) {
|
||||
e.preventDefault();
|
||||
var href = Backbone.history.location.href;
|
||||
if (href.lastIndexOf("/permissions") !== -1) {
|
||||
href = href.substr(0, href.lastIndexOf("/permissions"));
|
||||
@@ -764,7 +765,7 @@ define(
|
||||
|
||||
'<% if (item.get("is_unrestricted")) { %>',
|
||||
"<div>",
|
||||
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a>this page</a></span>.',
|
||||
'This dataset is unrestricted so everybody with the link can access it. Just share <span class="copy-link-to-clipboard"><a href=""a>this page</a></span>.',
|
||||
"</div>",
|
||||
"<% } %>",
|
||||
|
||||
@@ -853,8 +854,34 @@ define(
|
||||
'<td scope="row"><%= _.escape(item.get("tags")) %></td>',
|
||||
"</tr>",
|
||||
"<% } %>",
|
||||
'<% if ( item.get("uuid") !== "ok" ) { %>',
|
||||
"<tr>",
|
||||
'<th scope="row">UUID</th>',
|
||||
'<td scope="row"><%= _.escape(item.get("uuid")) %></td>',
|
||||
"</tr>",
|
||||
"<% } %>",
|
||||
'<% if ( item.get("state") !== "ok" ) { %>',
|
||||
"<tr>",
|
||||
'<th scope="row">State</th>',
|
||||
'<td scope="row"><%= _.escape(item.get("state")) %></td>',
|
||||
"</tr>",
|
||||
"<% } %>",
|
||||
"</table>",
|
||||
|
||||
'<% if (item.get("job_stderr")) { %>',
|
||||
"<h4>Job Standard Error</h4>",
|
||||
'<pre class="code">',
|
||||
'<%= _.escape(item.get("job_stderr")) %>',
|
||||
"</pre>",
|
||||
"<% } %>",
|
||||
|
||||
'<% if (item.get("job_stdout")) { %>',
|
||||
"<h4>Job Standard Output</h4>",
|
||||
'<pre class="code">',
|
||||
'<%= _.escape(item.get("job_stdout")) %>',
|
||||
"</pre>",
|
||||
"<% } %>",
|
||||
|
||||
"<div>",
|
||||
'<pre class="peek">',
|
||||
"</pre>",
|
||||
@@ -1154,9 +1181,9 @@ define(
|
||||
"<h2>Dataset-related permissions</h2>",
|
||||
'<div class="alert alert-warning">Changes made below will affect <strong>every</strong> library item that was created from this dataset and also every history this dataset is part of.</div>',
|
||||
'<% if (!item.get("is_unrestricted")) { %>',
|
||||
'<p>You can <span class="remove-restrictions"><a>remove all access restrictions</a></span> on this dataset.</p>',
|
||||
'<p>You can <span class="remove-restrictions"><a href="">remove all access restrictions</a></span> on this dataset.</p>',
|
||||
"<% } else { %>",
|
||||
'<p>You can <span class="make-private"><a>make this dataset private</a></span> to you.</p>',
|
||||
'<p>You can <span class="make-private"><a href="">make this dataset private</a></span> to you.</p>',
|
||||
"<% } %>",
|
||||
"<h4>Roles that can access the dataset</h4>",
|
||||
'<div id="access_perm" class="access_perm roles-selection"></div>',
|
||||
|
||||
@@ -467,11 +467,12 @@ define(
|
||||
'<th class="button_heading"></th>',
|
||||
'<th style="text-align: center; width: 20px; " title="Check to select all datasets"><input id="select-all-checkboxes" style="margin: 0;" type="checkbox"></th>',
|
||||
'<th><a class="sort-folder-link" title="Click to reverse order" href="#">name</a> <span title="Sorted alphabetically" class="sort-icon fa fa-sort-alpha-<%- order %>"></span></th>',
|
||||
'<th style="width:25%;">description</th>',
|
||||
'<th style="width:20%;">description</th>',
|
||||
'<th style="width:5%;">data type</th>',
|
||||
'<th style="width:10%;">size</th>',
|
||||
'<th style="width:160px;">time updated (UTC)</th>',
|
||||
'<th style="width:10%;"></th> ',
|
||||
'<th style="width:5%;">state</th> ',
|
||||
'<th style="width:150px;"></th> ',
|
||||
"</thead>",
|
||||
'<tbody id="folder_list_body">',
|
||||
'<tr id="first_folder_item">',
|
||||
@@ -485,6 +486,7 @@ define(
|
||||
"<td></td>",
|
||||
"<td></td>",
|
||||
"<td></td>",
|
||||
"<td></td>",
|
||||
"</tr>",
|
||||
"</tbody>",
|
||||
"</table>",
|
||||
|
||||
@@ -17,10 +17,10 @@ define(
|
||||
defaults: {
|
||||
type: null,
|
||||
visibility_config: {
|
||||
edit_folder_btn: true,
|
||||
edit_folder_btn: false,
|
||||
save_folder_btn: false,
|
||||
cancel_folder_btn: false,
|
||||
permission_folder_btn: true
|
||||
permission_folder_btn: false
|
||||
},
|
||||
edit_mode: false
|
||||
},
|
||||
@@ -306,32 +306,31 @@ define(
|
||||
"<td>",
|
||||
'<%- content_item.get("description") %>',
|
||||
"</td>",
|
||||
"<td></td>",
|
||||
"<% } else if(edit_mode){ %>",
|
||||
'<td><textarea rows="4" class="form-control input_folder_name" placeholder="name" ><%- content_item.get("name") %></textarea></td>',
|
||||
'<td><textarea rows="4" class="form-control input_folder_description" placeholder="description" ><%- content_item.get("description") %></textarea></td>',
|
||||
"<% } %>",
|
||||
"<td>folder</td>",
|
||||
"<td></td>",
|
||||
"<td>",
|
||||
'<%= _.escape(content_item.get("update_time")) %>',
|
||||
"</td>",
|
||||
"<td></td>",
|
||||
"<td>",
|
||||
"<% if(edit_mode) { %>", // start edit mode
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_folder_btn" type="button" style="<% if(button_config.save_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-floppy-o"/>',
|
||||
" Save",
|
||||
'<span class="fa fa-floppy-o"/> Save',
|
||||
"</button>",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_folder_btn" type="button" style="<% if(button_config.cancel_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-times"/>',
|
||||
" Cancel",
|
||||
'<span class="fa fa-times"/> Cancel',
|
||||
"</button>",
|
||||
"<% } else if (!edit_mode){%>", // start no edit mode
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- content_item.get("name") %>\'" class="primary-button btn-xs edit_folder_btn" type="button" style="<% if(button_config.edit_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-pencil"/>',
|
||||
'<span class="fa fa-pencil"/> Edit',
|
||||
"</button>",
|
||||
'<a href="#/folders/<%- content_item.id %>/permissions">',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permission_folder_btn" title="Manage \'<%- content_item.get("name") %>\'" style="<% if(button_config.permission_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-group"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permission_folder_btn" title="Permissions of \'<%- content_item.get("name") %>\'" style="<% if(button_config.permission_folder_btn === false) { print("display:none;") } %>">',
|
||||
'<span class="fa fa-group"/> Manage',
|
||||
"</button>",
|
||||
"</a>",
|
||||
"<% } %>", //end no edit mode
|
||||
@@ -361,6 +360,11 @@ define(
|
||||
'<td><%= _.escape(content_item.get("file_size")) %></td>',
|
||||
'<td><%= _.escape(content_item.get("update_time")) %></td>',
|
||||
"<td>",
|
||||
'<% if ( content_item.get("state") !== "ok" ) { %>',
|
||||
'<%= _.escape(content_item.get("state")) %>',
|
||||
"<% } %>",
|
||||
"</td>",
|
||||
"<td>",
|
||||
'<% if (content_item.get("is_unrestricted")) { %>',
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted dataset" style="color:grey;" class="fa fa-globe fa-lg"/>',
|
||||
"<% } %>",
|
||||
@@ -372,8 +376,8 @@ define(
|
||||
"<% } %>",
|
||||
'<% if (content_item.get("can_manage")) { %>',
|
||||
'<a href="#folders/<%- content_item.get("folder_id") %>/datasets/<%- content_item.id %>/permissions">',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permissions-dataset-btn" title="Manage permissions">',
|
||||
'<span class="fa fa-group"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" class="primary-button btn-xs permissions-dataset-btn" title="Permissions of \'<%- content_item.get("name") %>\'">',
|
||||
'<span class="fa fa-group"/> Manage',
|
||||
"</button>",
|
||||
"</a>",
|
||||
"<% } %>",
|
||||
@@ -407,10 +411,14 @@ define(
|
||||
'<%= _.escape(content_item.get("update_time")) %>',
|
||||
"</td>",
|
||||
"<td>",
|
||||
'<% if ( content_item.get("state") !== "ok" ) { %>',
|
||||
'<%= _.escape(content_item.get("state")) %>',
|
||||
"<% } %>",
|
||||
"</td>",
|
||||
"<td>",
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_dataset_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/>',
|
||||
" Undelete",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- content_item.get("name") %>\'" class="primary-button btn-xs undelete_dataset_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/> Undelete',
|
||||
"</button>",
|
||||
"</td>",
|
||||
"</tr>"
|
||||
@@ -439,11 +447,11 @@ define(
|
||||
"<td>",
|
||||
'<%= _.escape(content_item.get("update_time")) %>',
|
||||
"</td>",
|
||||
"<td></td>",
|
||||
"<td>",
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg"/>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- content_item.get("name") %>" class="primary-button btn-xs undelete_folder_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/>',
|
||||
" Undelete",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- content_item.get("name") %>\'" class="primary-button btn-xs undelete_folder_btn" type="button" style="margin-left:1em;">',
|
||||
'<span class="fa fa-unlock"/> Undelete',
|
||||
"</button>",
|
||||
"</td>",
|
||||
"</tr>"
|
||||
|
||||
@@ -112,7 +112,10 @@ define(
|
||||
show_page: parseInt(this.options.show_page),
|
||||
page_count: parseInt(this.options.page_count),
|
||||
total_items_count: this.options.total_items_count,
|
||||
items_shown: this.options.items_shown
|
||||
items_shown: this.options.items_shown,
|
||||
folder_page_size: Galaxy.libraries.preferences.get(
|
||||
"folder_page_size"
|
||||
)
|
||||
})
|
||||
);
|
||||
},
|
||||
@@ -1432,7 +1435,8 @@ define(
|
||||
/**
|
||||
* Show user the prompt to change the number of items shown on page.
|
||||
*/
|
||||
showPageSizePrompt: function() {
|
||||
showPageSizePrompt: function(e) {
|
||||
e.preventDefault();
|
||||
var folder_page_size = prompt(
|
||||
"How many items per page do you want to see?",
|
||||
Galaxy.libraries.preferences.get("folder_page_size")
|
||||
@@ -1886,11 +1890,10 @@ define(
|
||||
"<% } %>",
|
||||
"</ul>",
|
||||
"<span>",
|
||||
" showing ",
|
||||
'<a data-toggle="tooltip" data-placement="top" title="Click to change the number of items on page" class="page_size_prompt">',
|
||||
"<%- items_shown %>",
|
||||
"</a>",
|
||||
" of <%- total_items_count %> items",
|
||||
' <%- items_shown %> items shown <a href="" data-toggle="tooltip" data-placement="top" title="currently <%- folder_page_size %> per page" class="page_size_prompt">(change)</a>',
|
||||
"</span>",
|
||||
"<span>",
|
||||
" <%- total_items_count %> total",
|
||||
"</span>"
|
||||
].join("")
|
||||
);
|
||||
|
||||
@@ -264,7 +264,7 @@ define(["layout/masthead", "utils/utils", "libs/toastr"], function(
|
||||
'<tr class="<% if(library.get("deleted") === true) { print("active") } %>" style="display:none;" data-id="<%- library.get("id") %>">',
|
||||
"<% if(!edit_mode) { %>",
|
||||
'<% if(library.get("deleted")) { %>',
|
||||
'<td style="color:grey;"><span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey;" class="fa fa-ban fa-lg deleted_lib_ico"> </span> <%- library.get("name") %></td>',
|
||||
'<td style="color:grey;"><%- library.get("name") %></td>',
|
||||
"<% } else { %>",
|
||||
'<td><a href="#folders/<%- library.get("root_folder_id") %>"><%- library.get("name") %></a></td>',
|
||||
"<% } %>",
|
||||
@@ -293,14 +293,16 @@ define(["layout/masthead", "utils/utils", "libs/toastr"], function(
|
||||
"<% } %>",
|
||||
'<td class="right-center">',
|
||||
'<% if( (library.get("public")) && (library.get("deleted") === false) ) { %>',
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted library" style="color:grey;" class="fa fa-globe fa-lg public_lib_ico"> </span>',
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Unrestricted library" style="color:grey;" class="fa fa-globe fa-lg"> </span>',
|
||||
"<% }%>",
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- library.get("name") %>\'" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span></button>',
|
||||
'<a href="#library/<%- library.get("id") %>/permissions"><button data-toggle="tooltip" data-placement="top" title="Manage \'<%- library.get("name") %>\'" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span></button></a>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"> Save</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"> Cancel</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Delete <%- library.get("name") %>" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"> Delete</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete <%- library.get("name") %> " class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"> Undelete</span></button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Modify \'<%- library.get("name") %>\'" class="primary-button btn-xs edit_library_btn" type="button" style="<% if(button_config.edit_library_btn === false) { print("display:none;") } %>"><span class="fa fa-pencil"></span> Edit</button>',
|
||||
'<a href="#library/<%- library.get("id") %>/permissions"><button data-toggle="tooltip" data-placement="top" title="Permissions of \'<%- library.get("name") %>\'" class="primary-button btn-xs permission_library_btn" type="button" style="<% if(button_config.permission_library_btn === false) { print("display:none;") } %>"><span class="fa fa-group"></span> Manage</button></a>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Save changes" class="primary-button btn-xs save_library_btn" type="button" style="<% if(button_config.save_library_btn === false) { print("display:none;") } %>"><span class="fa fa-floppy-o"></span> Save</button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Discard changes" class="primary-button btn-xs cancel_library_btn" type="button" style="<% if(button_config.cancel_library_btn === false) { print("display:none;") } %>"><span class="fa fa-times"></span> Cancel</button>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Delete \'<%- library.get("name") %>\'" class="primary-button btn-xs delete_library_btn" type="button" style="<% if(button_config.delete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-trash-o"></span> Delete</button>',
|
||||
// For deleted libraries
|
||||
'<span data-toggle="tooltip" data-placement="top" title="Marked deleted" style="color:grey; <% if(button_config.undelete_library_btn === false) { print("display:none;") } %>" class="fa fa-ban fa-lg"></span>',
|
||||
'<button data-toggle="tooltip" data-placement="top" title="Undelete \'<%- library.get("name") %>\' " class="primary-button btn-xs undelete_library_btn" type="button" style="<% if(button_config.undelete_library_btn === false) { print("display:none;") } %>"><span class="fa fa-unlock"></span> Undelete</button>',
|
||||
"</td>",
|
||||
"</tr>"
|
||||
].join("")
|
||||
|
||||
@@ -17,7 +17,7 @@ define(["libs/toastr", "mvc/library/library-model"], function(
|
||||
"click #create_new_library_btn": "createLibraryFromModal",
|
||||
"click #include_deleted_chk": "includeDeletedChecked",
|
||||
"click #exclude_restricted_chk": "excludeRestrictedChecked",
|
||||
"click #lib_page_size_prompt": "showPageSizePrompt",
|
||||
"click .page_size_prompt": "showPageSizePrompt",
|
||||
"keyup .library-search-input": "searchLibraries"
|
||||
},
|
||||
|
||||
@@ -64,7 +64,10 @@ define(["libs/toastr", "mvc/library/library-model"], function(
|
||||
show_page: parseInt(this.options.show_page),
|
||||
page_count: parseInt(this.options.page_count),
|
||||
total_libraries_count: this.options.total_libraries_count,
|
||||
libraries_shown: this.options.libraries_shown
|
||||
libraries_shown: this.options.libraries_shown,
|
||||
library_page_size: Galaxy.libraries.preferences.get(
|
||||
"library_page_size"
|
||||
)
|
||||
})
|
||||
);
|
||||
},
|
||||
@@ -128,7 +131,8 @@ define(["libs/toastr", "mvc/library/library-model"], function(
|
||||
/**
|
||||
* Show user the propmpt to change the number of libs shown on page.
|
||||
*/
|
||||
showPageSizePrompt: function() {
|
||||
showPageSizePrompt: function(e) {
|
||||
e.preventDefault();
|
||||
var library_page_size = prompt(
|
||||
"How many libraries per page do you want to see?",
|
||||
Galaxy.libraries.preferences.get("library_page_size")
|
||||
@@ -281,8 +285,11 @@ define(["libs/toastr", "mvc/library/library-model"], function(
|
||||
'<li class="disabled"><a href="#page/<% print( page_count ) %>"><span class="fa fa-angle-double-right"></span></a></li>',
|
||||
"<% } %>",
|
||||
"</ul>",
|
||||
'<span id="lib_page_size_prompt">',
|
||||
' showing <a data-toggle="tooltip" data-placement="top" title="Click to change the number of libraries on page"><%- libraries_shown %></a> of <%- total_libraries_count %> libraries',
|
||||
"<span>",
|
||||
' <%- libraries_shown %> libraries shown <a href="" data-toggle="tooltip" data-placement="top" title="currently <%- library_page_size %> per page" class="page_size_prompt">(change)</a>',
|
||||
"</span>",
|
||||
"<span>",
|
||||
" <%- total_libraries_count %> total",
|
||||
"</span>"
|
||||
].join("")
|
||||
);
|
||||
|
||||
@@ -312,7 +312,7 @@ define(["utils/localization"], function(_l) {
|
||||
var d = new Date();
|
||||
var hours = (d.getHours() < 10 ? "0" : "") + d.getHours();
|
||||
var minutes = (d.getMinutes() < 10 ? "0" : "") + d.getMinutes();
|
||||
return (datetime =
|
||||
return (
|
||||
d.getDate() +
|
||||
"/" +
|
||||
(d.getMonth() + 1) +
|
||||
@@ -321,7 +321,8 @@ define(["utils/localization"], function(_l) {
|
||||
", " +
|
||||
hours +
|
||||
":" +
|
||||
minutes);
|
||||
minutes
|
||||
);
|
||||
}
|
||||
|
||||
/** Append script and style tags to Galaxy main application */
|
||||
|
||||
@@ -11,7 +11,7 @@ overflow: auto !important;
|
||||
.fa{
|
||||
font-size: 12px;
|
||||
}
|
||||
.fa-globe{
|
||||
.fa-globe, .fa-shield, .fa-key, .fa-ban{
|
||||
font-size: initial;
|
||||
margin-left: 0.6em;
|
||||
}
|
||||
|
||||
@@ -245,6 +245,7 @@
|
||||
<datatype extension="hardklor" type="galaxy.datatypes.tabular:Tabular" subclass="true" />
|
||||
<datatype extension="kronik" type="galaxy.datatypes.tabular:Tabular" subclass="true" />
|
||||
<datatype extension="imzml" type="galaxy.datatypes.proteomics:ImzML" mimetype="application/xml" display_in_upload="true"/>
|
||||
<datatype extension="analyze75" type="galaxy.datatypes.proteomics:Analyze75" mimetype="application/xml" display_in_upload="true"/>
|
||||
<!-- End Proteomics Datatypes -->
|
||||
<datatype extension="deeptools_compute_matrix_archive" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/>
|
||||
<datatype extension="deeptools_coverage_matrix" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/>
|
||||
|
||||
+22
-12
@@ -447,10 +447,9 @@ paste.app_factory = galaxy.web.buildapp:app_factory
|
||||
# -- Mail and notification
|
||||
|
||||
# Galaxy sends mail for various things: subscribing users to the mailing list
|
||||
# if they request it, password resets, notifications from the Galaxy Sample
|
||||
# Tracking system, reporting dataset errors, and sending activation emails.
|
||||
# To do this, it needs to send mail through an SMTP server, which you may
|
||||
# define here (host:port).
|
||||
# if they request it, password resets, reporting dataset errors, and sending
|
||||
# activation emails. To do this, it needs to send mail through an SMTP server,
|
||||
# which you may define here (host:port).
|
||||
# Galaxy will automatically try STARTTLS but will continue upon failure.
|
||||
#smtp_server = None
|
||||
|
||||
@@ -912,6 +911,14 @@ use_interactive = True
|
||||
# sub-directories of files contained in their directory.
|
||||
#user_library_import_dir = None
|
||||
|
||||
# For security reasons, users may not import any files that actually lie
|
||||
# outside of their `user_library_import_dir` (e.g. using symbolic links). A
|
||||
# list of directories can be allowed by setting the following option (the list
|
||||
# is comma-separated). Be aware that *any* user with library import permissions
|
||||
# can import from anywhere in these directories (assuming they are able to
|
||||
# create symlinks to them).
|
||||
#user_library_import_symlink_whitelist = None
|
||||
|
||||
# Allow admins to paste filesystem paths during upload. For libraries this
|
||||
# adds an option to the admin library upload tool allowing admins to paste
|
||||
# filesystem paths to files and directories in a box, and these paths will be
|
||||
@@ -1224,6 +1231,9 @@ use_interactive = True
|
||||
# Directory to store Data Manager based tool-data; defaults to tool_data_path.
|
||||
#galaxy_data_manager_data_path = tool-data
|
||||
|
||||
# Enable the API for sample tracking
|
||||
#enable_legacy_sample_tracking_api = False
|
||||
|
||||
# -- Job Execution
|
||||
|
||||
# To increase performance of job execution and the web interface, you can
|
||||
@@ -1325,16 +1335,16 @@ use_interactive = True
|
||||
#drmaa_external_killjob_script = sudo -E scripts/drmaa_external_killer.py
|
||||
#external_chown_script = sudo -E scripts/external_chown_script.py
|
||||
|
||||
# For the job submission as the actual system user, Galaxy can extract
|
||||
# the user name from the email address (actually the local-part before the @)
|
||||
# or the username which are both stored in the Galaxy data base.
|
||||
# The latter option is particularly useful for installations that get the
|
||||
# For the job submission as the actual system user, Galaxy can extract
|
||||
# the user name from the email address (actually the local-part before the @)
|
||||
# or the username which are both stored in the Galaxy data base.
|
||||
# The latter option is particularly useful for installations that get the
|
||||
# authentication from LDAP.
|
||||
# Also, Galaxy can accept the name of a common system user (eg. galaxy_worker)
|
||||
# who can run every job being submitted. This user should not be the same user
|
||||
# running the galaxy system.
|
||||
# Also, Galaxy can accept the name of a common system user (eg. galaxy_worker)
|
||||
# who can run every job being submitted. This user should not be the same user
|
||||
# running the galaxy system.
|
||||
# Possible values are user_email (default), username or <common_system_user>
|
||||
#real_system_username = user_email
|
||||
#real_system_username = user_email
|
||||
|
||||
# File to source to set up the environment when running jobs. By default, the
|
||||
# environment in which the Galaxy server starts is used when running jobs
|
||||
|
||||
@@ -53,7 +53,7 @@ function keep_alive(){
|
||||
var count_max = 60;
|
||||
// we sleep 15 seconds between requests and the default timeout for the Jupyter container is 120 seconds, so start
|
||||
// with a pretty high ajax timeout. sleep starts low because we want to get the warning up pretty quickly
|
||||
var spin_state = make_spin_state("IE keep alive", 8000, 16000, 2000, 5000, 15000, 5000, false);
|
||||
var spin_state = make_spin_state("IE keepalive", 8000, 16000, 2000, 5000, 15000, 5000, false);
|
||||
var success = function(){
|
||||
console.log("IE keepalive request succeeded");
|
||||
toastr.clear()
|
||||
@@ -85,7 +85,7 @@ function keep_alive(){
|
||||
return true; // stop spinning
|
||||
}
|
||||
}
|
||||
console.log("IE keep alive worker starting");
|
||||
console.log("IE keepalive worker starting");
|
||||
spin(notebook_access_url, false, success, timeout_error, timeout_error, spin_state);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import os
|
||||
import logging
|
||||
import os
|
||||
from cgi import FieldStorage
|
||||
|
||||
from galaxy.util import Params
|
||||
|
||||
@@ -19,7 +19,7 @@ def add_manual_builds(input_file, build_file, chr_dir):
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
existing_builds.append(line.replace("\n", "").replace("\r", "").split("\t")[0])
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
build_file_out = open(build_file, 'a')
|
||||
for line in open(input_file):
|
||||
@@ -31,7 +31,7 @@ def add_manual_builds(input_file, build_file, chr_dir):
|
||||
name = fields.pop(0)
|
||||
try: # get chrom lens if included in file, otherwise still add build
|
||||
chrs = fields.pop(0).split(",")
|
||||
except:
|
||||
except Exception:
|
||||
chrs = []
|
||||
print>>build_file_out, build + "\t" + name + " (" + build + ")"
|
||||
if chrs: # create len file if provided chrom lens
|
||||
@@ -39,7 +39,7 @@ def add_manual_builds(input_file, build_file, chr_dir):
|
||||
for chr in chrs:
|
||||
print>>chr_len_out, chr.replace("=", "\t")
|
||||
chr_len_out.close()
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
build_file_out.close()
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ if __name__ == "__main__":
|
||||
if line.startswith("#"):
|
||||
continue
|
||||
builds.append(line.split("\t")[0])
|
||||
except:
|
||||
except Exception:
|
||||
sys.exit("Bad input file.")
|
||||
else:
|
||||
try:
|
||||
for build in parse_builds.getbuilds("http://genome.cse.ucsc.edu/cgi-bin/das/dsn"):
|
||||
builds.append(build[0])
|
||||
except:
|
||||
except Exception:
|
||||
sys.exit("Unable to retrieve builds.")
|
||||
for build in builds:
|
||||
if build == "?":
|
||||
|
||||
@@ -15,14 +15,14 @@ import requests
|
||||
def getbuilds(url):
|
||||
try:
|
||||
text = requests.get(url).text
|
||||
except:
|
||||
except Exception:
|
||||
print("#Unable to open " + url)
|
||||
print("?\tunspecified (?)")
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
tree = ElementTree.fromstring(text)
|
||||
except:
|
||||
except Exception:
|
||||
print("#Invalid xml passed back from " + url)
|
||||
print("?\tunspecified (?)")
|
||||
sys.exit(1)
|
||||
|
||||
@@ -21,13 +21,13 @@ def main():
|
||||
builds = []
|
||||
try:
|
||||
text = requests.get(site).text
|
||||
except:
|
||||
except Exception:
|
||||
print("#Unable to connect to " + site)
|
||||
continue
|
||||
|
||||
try:
|
||||
tree = ElementTree.fromstring(text)
|
||||
except:
|
||||
except Exception:
|
||||
print("#Invalid xml passed back from " + site)
|
||||
continue
|
||||
print("#Harvested from", site)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -3,8 +3,149 @@
|
||||
September 2017 Galaxy Release (v 17.09)
|
||||
===========================================================
|
||||
|
||||
.. include:: _header.rst
|
||||
|
||||
Schedule
|
||||
Highlights
|
||||
===========================================================
|
||||
* Planned Freeze Date: 2017-09-04
|
||||
* Planned Release Date: 2017-09-25
|
||||
|
||||
**Singularity**
|
||||
Tool execution using the HPC-friendly container technology `Singularity <http://singularity.lbl.gov/>`__
|
||||
is now supported. Custom containers can be specified by the Galaxy admin on a per job destination basis
|
||||
or standardized containers corresponding to Conda requirements can be built or downloaded automatically
|
||||
using the mulled toolkit built into Galaxy (just like is possible for Docker). For more information
|
||||
checkout `this presentation <http://bit.ly/gcc-biocontainers>`__ from the 2017 Galaxy Community Conference.
|
||||
`Pull Request 4175`_
|
||||
|
||||
**Download entire collection**
|
||||
Downloading whole colections is now possible from the history interface. `Pull Request 4098`_
|
||||
Thanks to `@mvdbeek <https://github.com/mvdbeek>`__.
|
||||
|
||||
**Switch tool versions in workflows**
|
||||
You can now select exactly what version of tool you want to use when building workflows. `Pull Request 4373`_
|
||||
Thanks to `@mvdbeek <https://github.com/mvdbeek>`__.
|
||||
|
||||
Get Galaxy
|
||||
==========
|
||||
|
||||
The code lives at `Github <https://github.com/galaxyproject/galaxy>`__ and you should have `Git <https://git-scm.com/>`__ to obtain it.
|
||||
|
||||
To get a new Galaxy repository run:
|
||||
.. code-block:: shell
|
||||
|
||||
$ git clone -b release_17.09 https://github.com/galaxyproject/galaxy.git
|
||||
|
||||
To update an existing Galaxy repository run:
|
||||
.. code-block:: shell
|
||||
|
||||
$ git checkout release_17.09 && git pull --ff-only origin release_17.09
|
||||
|
||||
See `the community hub <https://galaxyproject.org/develop/source-code/>`__ for additional details regarding the source code locations.
|
||||
|
||||
|
||||
Security
|
||||
========
|
||||
|
||||
The 17.09 Galaxy version includes many security patches. Per our new `Security Policy
|
||||
<https://github.com/galaxyproject/galaxy/blob/dev/SECURITY_POLICY.md>`__ some of these have been
|
||||
applied to Galaxy releases going back 12 months.
|
||||
|
||||
Details of the vulnerabilities that have been backported can be found in the `Security patch details`_
|
||||
section of these release notes. Some issues have only been addressed in 17.09, for this reason
|
||||
if security is important to your Galaxy instance we strongly recommend upgrading to this latest release
|
||||
as soon as possible.
|
||||
|
||||
If you maintain a publicly accessible Galaxy please consider signing up for this `mailing list <https://lists.galaxyproject.org/listinfo/galaxy-public-servers>`__ to receive the future security patches in advance of the public disclosure.
|
||||
|
||||
Deprecation Notices
|
||||
===================
|
||||
|
||||
* The Galaxy Sample Tracking and External Services functionality is now considered deprecated. In future releases we will strip down the related
|
||||
user interface and introduce configuration option to keep relevant API controllers active if desired. `Related PR <https://github.com/galaxyproject/galaxy/pull/4526>`__.
|
||||
* The deprecated admin-only interface for Galaxy Data Libraries is staged to be removed in the next release.
|
||||
* Workflows API: When exposing WorkflowInvocationSteps ``state`` will no longer be available.
|
||||
* The ``refresh_on_change`` attribute of a ``<param>`` tag in the tool syntax can no longer be set to a value of another parameter. Use boolean instead (e.g.``refresh_on_change="True"``). `Details <https://github.com/galaxyproject/galaxy/issues/4810>`__
|
||||
|
||||
|
||||
Release Notes
|
||||
===========================================================
|
||||
|
||||
.. include:: 17.09.rst
|
||||
:start-after: announce_start
|
||||
|
||||
Security patch details
|
||||
======================
|
||||
|
||||
Limited Galaxy Data Library unauthorized filesystem access
|
||||
----------------------------------------------------------
|
||||
|
||||
Tracked as `GX-2017-0001 <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-October/026058.html>`__
|
||||
|
||||
A medium severity security vulnerability in Galaxy Data Libraries was
|
||||
recently discovered by `Jelle Scholtalbers <https://github.com/scholtalbers>`__.
|
||||
This vulnerability allows the following unauthorized actions:
|
||||
|
||||
1. Any user that has been granted the permission to add datasets to a
|
||||
library, library folder, or to modify an existing library dataset (an
|
||||
"authorized user"), is able to import any file on the system that is
|
||||
readable by the user running the Galaxy server.
|
||||
|
||||
2. Anyone can create libraries and library folders (but not add datasets to them)
|
||||
|
||||
The fix for this issue has been applied to Galaxy releases back to 16.07 and can be found in this `commit <https://github.com/galaxyproject/galaxy/commit/93a8bfc7cb5e9c3395c5057910ec39d68ad787b4>`__
|
||||
|
||||
Arbitrary code execution for Galaxy servers with Galaxy Interactive Environments enabled
|
||||
----------------------------------------------------------------------------------------
|
||||
|
||||
Tracked as `GX-2017-0002 <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-October/026059.html>`__
|
||||
|
||||
A high severity security vulnerability was recently discovered in Galaxy
|
||||
Interactive Environments (GIEs) by the Galaxy Committers Team. Anyone with
|
||||
a Galaxy account can exploit this vulnerability to execute arbitrary code
|
||||
on the Galaxy server as the user running the Galaxy server process.
|
||||
|
||||
The vulnerability only affects Galaxy servers on which Galaxy Interactive
|
||||
Environments are enabled (by setting the
|
||||
`interactive_environment_plugins_directory`
|
||||
option in `galaxy.ini`). Because the vulnerability can be exploited to
|
||||
execute arbitrary code, the impact for affected servers is severe.
|
||||
|
||||
Administrators of Galaxy servers where GIEs *are* enabled should update
|
||||
immediately.
|
||||
|
||||
The fix for this issue has been applied to Galaxy releases back to 17.05 and can be found in this `commit <https://github.com/galaxyproject/galaxy/commit/9f8d3ee444ad10038add204ed1c1dc11e636dd9d>`__
|
||||
|
||||
Unauthorized filesystem access via data source tools
|
||||
----------------------------------------------------
|
||||
|
||||
Tracked as `GX-2017-0003 <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-October/026060.html>`__
|
||||
|
||||
A medium severity security vulnerability in tools utilizing the Galaxy data
|
||||
source protocol was recently discovered by the Galaxy Committers Team.
|
||||
Anyone who is able to run an external data source tool can access
|
||||
any file that is readable by the user running Galaxy jobs
|
||||
on the host where the job runs.
|
||||
|
||||
Many such "external data source" tools are provided with the Galaxy
|
||||
distribution and are enabled by default (most tools under the "Get Data"
|
||||
section of the tool panel), meaning that its exploitability is fairly high,
|
||||
as only one such tool needs to be enabled to be vulnerable, including any
|
||||
custom data source tools (any tool that uses
|
||||
`tools/data_source/data_source.py`).
|
||||
What files are readable depends entirely upon what the job's user has
|
||||
access to read on the host(s) where jobs run.
|
||||
|
||||
The fix for this issue has been applied to Galaxy releases back to 16.07 and can be found in this `commit <https://github.com/galaxyproject/galaxy/commit/0e698813a96f1ad61d797255686f69cf5e6b1280>`__
|
||||
|
||||
Cross site scripting and session fixation
|
||||
-----------------------------------------
|
||||
|
||||
Disclosed on the `mailing list <https://lists.galaxyproject.org/pipermail/galaxy-dev/2017-August/025938.html>`__ in August 2017.
|
||||
|
||||
Vulnerabilities were found by Eric Rasche and Manabu Ishii respectively. Detailed descriptions of these categories of vulnerabilities can be found at:
|
||||
|
||||
- https://www.owasp.org/index.php/Cross-site_Scripting_(XSS)
|
||||
- https://www.owasp.org/index.php/Session_fixation
|
||||
|
||||
The fix for these issues has been applied to Galaxy releases back to 16.10 and can be found in this `diff <https://gist.githubusercontent.com/jmchilton/760bf8ba6055b9a47a48529fcc49a493/raw/01bc98e5a8067a435f38d7cf4fda4e304c4425a2/2017augsecurity_1610.patch>`__
|
||||
|
||||
.. include:: _thanks.rst
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
|
||||
===========================================================
|
||||
January 2018 Galaxy Release (v 18.01)
|
||||
===========================================================
|
||||
|
||||
|
||||
Schedule
|
||||
===========================================================
|
||||
* Planned Freeze Date: 2018-01-08
|
||||
* Planned Release Date: 2018-01-29
|
||||
@@ -4,6 +4,7 @@ Releases
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
17.09_announce
|
||||
17.05_announce
|
||||
17.01_announce
|
||||
16.10_announce
|
||||
|
||||
@@ -95,7 +95,7 @@ class LDAP(AuthProvider):
|
||||
|
||||
try:
|
||||
import ldap
|
||||
except:
|
||||
except ImportError:
|
||||
log.debug('LDAP authenticate: could not load ldap module')
|
||||
return (failure_mode, '', '')
|
||||
|
||||
|
||||
@@ -212,7 +212,7 @@ class Configuration(object):
|
||||
self.hours_between_check = 12.0
|
||||
else:
|
||||
self.hours_between_check = 12
|
||||
except:
|
||||
except Exception:
|
||||
self.hours_between_check = 12
|
||||
self.update_integrated_tool_panel = kwargs.get("update_integrated_tool_panel", True)
|
||||
self.enable_data_manager_user_view = string_as_bool(kwargs.get("enable_data_manager_user_view", "False"))
|
||||
@@ -338,6 +338,9 @@ class Configuration(object):
|
||||
# Beta containers interface used by GIEs
|
||||
self.enable_beta_containers_interface = string_as_bool(kwargs.get('enable_beta_containers_interface', 'False'))
|
||||
|
||||
# Deprecated API for sample tracking
|
||||
self.enable_legacy_sample_tracking_api = string_as_bool(kwargs.get('enable_legacy_sample_tracking_api', 'False'))
|
||||
|
||||
# Certain modules such as the pause module will automatically cause
|
||||
# workflows to be scheduled in job handlers the way all workflows will
|
||||
# be someday - the following two properties can also be used to force this
|
||||
@@ -395,6 +398,7 @@ class Configuration(object):
|
||||
self.genomespace_ui_url = kwargs.get('genomespace_ui_url', 'https://gsui.genomespace.org/jsui/')
|
||||
self.library_import_dir = kwargs.get('library_import_dir', None)
|
||||
self.user_library_import_dir = kwargs.get('user_library_import_dir', None)
|
||||
self.user_library_import_symlink_whitelist = listify(kwargs.get('user_library_import_symlink_whitelist', []), do_strip=True)
|
||||
# Searching data libraries
|
||||
self.enable_lucene_library_search = string_as_bool(kwargs.get('enable_lucene_library_search', False))
|
||||
self.enable_whoosh_library_search = string_as_bool(kwargs.get('enable_whoosh_library_search', False))
|
||||
@@ -793,7 +797,7 @@ class Configuration(object):
|
||||
|
||||
try:
|
||||
port = config.getint('server:%s' % self.server_name, 'port')
|
||||
except:
|
||||
except Exception:
|
||||
# uWSGI galaxy installations don't use paster and only speak uWSGI not http
|
||||
port = None
|
||||
return port
|
||||
|
||||
@@ -374,7 +374,7 @@ class DockerNode(object):
|
||||
|
||||
@property
|
||||
def labels(self):
|
||||
labels = self.inspect[0]['Spec'].get('Labels', {})
|
||||
labels = self.inspect[0]['Spec'].get('Labels', {}) or {}
|
||||
return DockerNodeLabels.from_label_dictionary(labels)
|
||||
|
||||
def label_add(self, label, value):
|
||||
|
||||
@@ -23,7 +23,7 @@ class SnapHmm(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "SNAP HMM model (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def sniff(self, filename):
|
||||
@@ -54,7 +54,7 @@ class Augustus(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Augustus model (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def sniff(self, filename):
|
||||
|
||||
@@ -63,7 +63,7 @@ class Amos(data.Text):
|
||||
if re.match(r'{(RED|CTG|TLE)$', line):
|
||||
isAmos = True
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return isAmos
|
||||
|
||||
@@ -102,7 +102,7 @@ class Sequences(sequence.Fasta):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a fasta header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -138,7 +138,7 @@ class Roadmaps(data.Text):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a fasta header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -202,7 +202,7 @@ class Velvet(Html):
|
||||
gen_msg = gen_msg + ' Long Reads'
|
||||
if len(gen_msg) > 0:
|
||||
gen_msg = 'Uses: ' + gen_msg
|
||||
except:
|
||||
except Exception:
|
||||
log.debug("Velveth could not read Log file in %s" % efp)
|
||||
log.debug("Velveth log info %s" % gen_msg)
|
||||
rval = ['<html><head><title>Velvet Galaxy Composite Dataset </title></head><p/>']
|
||||
|
||||
@@ -106,7 +106,7 @@ class Ab1(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary ab1 sequence file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ class Idat(Binary):
|
||||
if header == b'IDAT':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -157,7 +157,7 @@ class Cel(Binary):
|
||||
if header == b';\x01\x00\x00':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -183,7 +183,7 @@ class CompressedArchive(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Compressed binary file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ class CompressedZipArchive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Compressed zip file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -425,7 +425,7 @@ class Bam(Binary):
|
||||
dataset.metadata.read_groups = [read_group['ID'] for read_group in dataset.metadata.bam_header.get('RG', []) if 'ID' in read_group]
|
||||
dataset.metadata.sort_order = dataset.metadata.bam_header.get('HD', {}).get('SO', None)
|
||||
dataset.metadata.bam_version = dataset.metadata.bam_header.get('HD', {}).get('VN', None)
|
||||
except:
|
||||
except Exception:
|
||||
# Per Dan, don't log here because doing so will cause datasets that
|
||||
# fail metadata to end in the error state
|
||||
pass
|
||||
@@ -438,7 +438,7 @@ class Bam(Binary):
|
||||
if header == b'BAM\1':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -452,7 +452,7 @@ class Bam(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary bam alignments file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def to_archive(self, trans, dataset, name=""):
|
||||
@@ -664,7 +664,7 @@ class CRAM(Binary):
|
||||
if header == b"CRAM":
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -700,7 +700,7 @@ class Bcf(BaseBcf):
|
||||
if header == b'BCF':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_meta(self, dataset, overwrite=True, **kwd):
|
||||
@@ -756,7 +756,7 @@ class BcfUncompressed(Bcf):
|
||||
if header == b'BCF':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -789,7 +789,7 @@ class H5(Binary):
|
||||
if header == self._magic:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -803,7 +803,7 @@ class H5(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary HDF5 file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -886,7 +886,7 @@ class Biom2(H5):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Biom2 (HDF5) file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -911,7 +911,7 @@ class Scf(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary scf sequence file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -932,7 +932,7 @@ class Sff(Binary):
|
||||
if header == b'.sff':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -946,7 +946,7 @@ class Sff(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary sff file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -976,7 +976,7 @@ class BigWig(Binary):
|
||||
try:
|
||||
magic = self._unpack("I", open(filename, 'rb'))
|
||||
return magic[0] == self._magic
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -990,7 +990,7 @@ class BigWig(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary UCSC %s file (%s)" % (self._name, nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1040,7 +1040,7 @@ class TwoBit(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary TwoBit format nucleotide file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1097,7 +1097,7 @@ class SQlite(Binary):
|
||||
if header == b'SQLite format 3\0':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -1108,7 +1108,7 @@ class SQlite(Binary):
|
||||
for table in dataset.metadata.tables:
|
||||
try:
|
||||
lines.append('%s [%s]' % (table, dataset.metadata.table_row_count[table]))
|
||||
except:
|
||||
except Exception:
|
||||
continue
|
||||
dataset.peek = '\n'.join(lines)
|
||||
dataset.blurb = nice_size(dataset.get_size())
|
||||
@@ -1119,7 +1119,7 @@ class SQlite(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "SQLite Database (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
@dataproviders.decorators.dataprovider_factory('sqlite', dataproviders.dataset.SQliteDataProvider.settings)
|
||||
@@ -1191,7 +1191,7 @@ class GeminiSQLite(SQlite):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Gemini SQLite Database, version %s" % (dataset.metadata.gemini_version or 'unknown')
|
||||
|
||||
|
||||
@@ -1265,7 +1265,7 @@ class IdpDB(SQlite):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "IDPickerDB SQLite file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1289,7 +1289,7 @@ class Xlsx(Binary):
|
||||
if "[Content_Types].xml" in tempzip.namelist() and tempzip.read("[Content_Types].xml").find(b'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml') != -1:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1320,7 +1320,7 @@ class ExcelXls(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Microsoft Excel XLS file (%s)" % (data.nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1341,7 +1341,7 @@ class Sra(Binary):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -1355,7 +1355,7 @@ class Sra(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return 'Binary sra file (%s)' % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1376,7 +1376,7 @@ class RData(Binary):
|
||||
header = gzip.open(filename).read(7)
|
||||
if header == rdata_header:
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1612,7 +1612,7 @@ class PostgresqlArchive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "PostgreSQL Archive (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1669,7 +1669,7 @@ class Fast5Archive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "FAST5 Archive (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -1771,7 +1771,7 @@ class SearchGuiArchive(CompressedArchive):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "SearchGUI Archive, version %s" % (dataset.metadata.searchgui_version or 'unknown')
|
||||
|
||||
|
||||
@@ -1795,7 +1795,7 @@ class NetCDF(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Binary netCDF file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def sniff(self, filename):
|
||||
@@ -1805,7 +1805,7 @@ class NetCDF(Binary):
|
||||
if header == b'CDF':
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1838,7 +1838,7 @@ class DMND(Binary):
|
||||
if header == self._magic:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class Ply(object):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Ply file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -301,7 +301,7 @@ class Vtk(object):
|
||||
dataset.metadata.field_names.append(field_name)
|
||||
try:
|
||||
num_components = int(items[-1])
|
||||
except:
|
||||
except Exception:
|
||||
num_components = 1
|
||||
field_component_indexes = [str(i) for i in range(num_components)]
|
||||
field_components[field_name] = field_component_indexes
|
||||
@@ -319,7 +319,7 @@ class Vtk(object):
|
||||
float(items[0])
|
||||
# Don't process the cell data.
|
||||
# 0.0123457 0.197531
|
||||
except:
|
||||
except Exception:
|
||||
# Line consists of arrayName numComponents numTuples dataType.
|
||||
# Example: surface_field1 1 12 double
|
||||
field_name = items[0]
|
||||
@@ -438,7 +438,7 @@ class Vtk(object):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Vtk file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
|
||||
@@ -30,21 +30,21 @@ def __main__():
|
||||
else:
|
||||
try:
|
||||
feature = elems[3]
|
||||
except:
|
||||
except Exception:
|
||||
feature = 'feature%d' % (i + 1)
|
||||
start = int(elems[1]) + 1
|
||||
end = int(elems[2])
|
||||
try:
|
||||
score = elems[4]
|
||||
except:
|
||||
except Exception:
|
||||
score = '0'
|
||||
try:
|
||||
strand = elems[5]
|
||||
except:
|
||||
except Exception:
|
||||
strand = '+'
|
||||
try:
|
||||
group = elems[3]
|
||||
except:
|
||||
except Exception:
|
||||
group = 'group%d' % (i + 1)
|
||||
if complete_bed:
|
||||
out.write('%s\tbed2gff\t%s\t%d\t%d\t%s\t%s\t.\t%s %s;\n' % (chrom, feature, start, end, score, strand, feature, group))
|
||||
@@ -59,7 +59,7 @@ def __main__():
|
||||
exon_start = int(start) + int(block_starts[j])
|
||||
exon_end = exon_start + int(block_sizes[j]) - 1
|
||||
out.write('%s\tbed2gff\texon\t%d\t%d\t%s\t%s\t.\texon %s;\n' % (chrom, exon_start, exon_end, score, strand, group))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if not first_skipped_line:
|
||||
first_skipped_line = i + 1
|
||||
|
||||
@@ -68,10 +68,10 @@ def __main__():
|
||||
# peek: ascii or digits?
|
||||
val = line.split()[0]
|
||||
|
||||
fastq_integer = True
|
||||
try:
|
||||
int(val)
|
||||
fastq_integer = True
|
||||
except:
|
||||
except ValueError:
|
||||
fastq_integer = False
|
||||
|
||||
if fastq_integer: # digits
|
||||
|
||||
@@ -28,7 +28,7 @@ def __main__():
|
||||
# Replace any spaces in the name with underscores so UCSC will not complain
|
||||
name = elems[2].replace(" ", "_")
|
||||
out.write("%s\t%s\t%s\t%s\t0\t%s\n" % (elems[0], start, elems[4], name, strand))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if not first_skipped_line:
|
||||
first_skipped_line = i + 1
|
||||
|
||||
@@ -19,23 +19,23 @@ def __main__():
|
||||
input_name = sys.argv[2]
|
||||
try:
|
||||
chromCol = int(sys.argv[3]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid chrom column, correct the column settings before attempting to convert the data format." % str(sys.argv[3]))
|
||||
try:
|
||||
startCol = int(sys.argv[4]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid start column, correct the column settings before attempting to convert the data format." % str(sys.argv[4]))
|
||||
try:
|
||||
endCol = int(sys.argv[5]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid end column, correct the column settings before attempting to convert the data format." % str(sys.argv[5]))
|
||||
try:
|
||||
strandCol = int(sys.argv[6]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
strandCol = -1
|
||||
try:
|
||||
nameCol = int(sys.argv[7]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
nameCol = -1
|
||||
skipped_lines = 0
|
||||
first_skipped_line = 0
|
||||
@@ -47,12 +47,12 @@ def __main__():
|
||||
name = region.fields[nameCol]
|
||||
else:
|
||||
raise IndexError
|
||||
except:
|
||||
except Exception:
|
||||
name = "region_%i" % count
|
||||
try:
|
||||
|
||||
out.write("%s\t%i\t%i\t%s\t%i\t%s\n" % (region.chrom, region.start, region.end, name, 0, region.strand))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if not first_skipped_line:
|
||||
first_skipped_line = count + 1
|
||||
|
||||
@@ -41,31 +41,31 @@ def __main__():
|
||||
input_name = sys.argv[2]
|
||||
try:
|
||||
chromCol = int(sys.argv[3]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid chrom column, correct the column settings before attempting to convert the data format." % str(sys.argv[3]))
|
||||
try:
|
||||
startCol = int(sys.argv[4]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid start column, correct the column settings before attempting to convert the data format." % str(sys.argv[4]))
|
||||
try:
|
||||
endCol = int(sys.argv[5]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
stop_err("'%s' is an invalid end column, correct the column settings before attempting to convert the data format." % str(sys.argv[5]))
|
||||
try:
|
||||
strandCol = int(sys.argv[6]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
strandCol = -1
|
||||
try:
|
||||
nameCol = int(sys.argv[7]) - 1
|
||||
except:
|
||||
except Exception:
|
||||
nameCol = -1
|
||||
try:
|
||||
extension = sys.argv[8]
|
||||
except:
|
||||
except IndexError:
|
||||
extension = 'interval' # default extension
|
||||
try:
|
||||
force_num_columns = int(sys.argv[9])
|
||||
except:
|
||||
except Exception:
|
||||
force_num_columns = None
|
||||
|
||||
skipped_lines = 0
|
||||
@@ -116,7 +116,7 @@ def __main__():
|
||||
fields2 = fields[11].rstrip(",").split(",") # remove trailing comma and split on comma
|
||||
for field in fields2:
|
||||
int(field)
|
||||
except:
|
||||
except Exception:
|
||||
strict_bed = False
|
||||
break
|
||||
if force_num_columns is not None and len(fields) != force_num_columns:
|
||||
@@ -137,14 +137,14 @@ def __main__():
|
||||
name = region.fields[nameCol]
|
||||
else:
|
||||
raise IndexError
|
||||
except:
|
||||
except Exception:
|
||||
name = "region_%i" % count
|
||||
try:
|
||||
fields = [str(item) for item in (region.chrom, region.start, region.end, name, 0, region.strand)]
|
||||
if force_num_columns is not None and len(fields) != force_num_columns:
|
||||
fields = force_bed_field_count(fields, count, force_num_columns)
|
||||
out.write("%s\n" % '\t'.join(fields))
|
||||
except:
|
||||
except Exception:
|
||||
skipped_lines += 1
|
||||
if first_skipped_line is None:
|
||||
first_skipped_line = count + 1
|
||||
|
||||
@@ -127,7 +127,7 @@ if __name__ == "__main__":
|
||||
chr_col_1, start_col_1, end_col_1, strand_col_1 = [int(x) - 1 for x in options.cols1.split(',')]
|
||||
chr_col_2, position_col_2, forward_col_2, reverse_col_2 = [int(x) - 1 for x in options.cols2.split(',')]
|
||||
in_fname, out_fname = args
|
||||
except:
|
||||
except Exception:
|
||||
doc_optparse.exception()
|
||||
|
||||
# Sort through a tempfile first
|
||||
|
||||
@@ -48,7 +48,7 @@ def main():
|
||||
try:
|
||||
float(val)
|
||||
continue
|
||||
except:
|
||||
except ValueError:
|
||||
convert_gff_coords_to_bed(feature)
|
||||
# Value is not a number, so it can be indexed.
|
||||
if val not in name_loc_dict:
|
||||
|
||||
@@ -41,17 +41,17 @@ def rgConv(inpedfilepath, outhtmlname, outfilepath):
|
||||
outfpath = os.path.join(outfilepath, outf) # where to write the fbat format file to
|
||||
try:
|
||||
mf = open(inmap, 'r')
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write('%s cannot open inmap file %s - do you have permission?\n' % (prog, inmap))
|
||||
sys.exit(1)
|
||||
try:
|
||||
rsl = [x.split()[1] for x in mf]
|
||||
except:
|
||||
except Exception:
|
||||
sys.stderr.write('## cannot parse %s' % inmap)
|
||||
sys.exit(1)
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass # already exists
|
||||
head = ' '.join(rsl) # list of rs numbers
|
||||
# TODO add anno to rs but fbat will prolly barf?
|
||||
@@ -64,7 +64,7 @@ def rgConv(inpedfilepath, outhtmlname, outfilepath):
|
||||
lrow = row.split()
|
||||
try:
|
||||
[int(x) for x in lrow[10:50]] # look for non numeric codes
|
||||
except:
|
||||
except Exception:
|
||||
dorecode = 1
|
||||
if dorecode:
|
||||
lrow = row.strip().split()
|
||||
@@ -94,7 +94,7 @@ def main():
|
||||
outfilepath = sys.argv[3]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
rgConv(inpedfilepath, outhtmlname, outfilepath)
|
||||
flist = os.listdir(outfilepath)
|
||||
|
||||
@@ -42,13 +42,13 @@ def getMissval(inped=''):
|
||||
commonmissvals = {'N': 'N', '0': '0', 'n': 'n', '9': '9', '-': '-', '.': '.'}
|
||||
try:
|
||||
f = open(inped, 'r')
|
||||
except:
|
||||
except Exception:
|
||||
return None # signal no in file
|
||||
missval = None
|
||||
while missval is None: # doggedly continue until we solve the mystery
|
||||
try:
|
||||
l = f.readline()
|
||||
except:
|
||||
except Exception:
|
||||
break
|
||||
ll = l.split()[6:] # ignore pedigree stuff
|
||||
for c in ll:
|
||||
@@ -94,7 +94,7 @@ def main():
|
||||
outfilepath = sys.argv[3]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
plink = sys.argv[4]
|
||||
rgConv(inpedfilepath, outhtmlname, outfilepath, plink)
|
||||
|
||||
@@ -48,7 +48,7 @@ def pruneLD(plinktasks=[], cd='./', vclbase=[]):
|
||||
alog += lplog
|
||||
alog.append('\n')
|
||||
os.unlink(plog) # no longer needed
|
||||
except:
|
||||
except Exception:
|
||||
alog.append('### %s Strange - no std out from plink when running command line\n%s\n' % (timenow(), ' '.join(vcl)))
|
||||
return alog
|
||||
|
||||
@@ -92,7 +92,7 @@ def main():
|
||||
outfilepath = sys.argv[6]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
plink = sys.argv[7]
|
||||
makeLDreduced(base_name, infpath=inpedfilepath, outfpath=outfilepath, plinke=plink, forcerebuild=False, returnFname=False,
|
||||
|
||||
@@ -60,7 +60,7 @@ def main():
|
||||
outfilepath = sys.argv[3]
|
||||
try:
|
||||
os.makedirs(outfilepath)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
plink = sys.argv[4]
|
||||
rgConv(inpedfilepath, outhtmlname, outfilepath, plink)
|
||||
|
||||
@@ -179,7 +179,7 @@ class Data(object):
|
||||
def set_max_optional_metadata_filesize(self, max_value):
|
||||
try:
|
||||
max_value = int(max_value)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
return
|
||||
self.__class__._max_optional_metadata_filesize = max_value
|
||||
|
||||
@@ -394,7 +394,7 @@ class Data(object):
|
||||
if not mime:
|
||||
try:
|
||||
mime = trans.app.datatypes_registry.get_mimetype_by_extension(".".split(file_path)[-1])
|
||||
except:
|
||||
except Exception:
|
||||
mime = "text/plain"
|
||||
self._clean_and_set_mime_type(trans, mime)
|
||||
return self._yield_user_file_content(trans, data, file_path)
|
||||
@@ -490,7 +490,7 @@ class Data(object):
|
||||
info = unicodify(info, 'utf-8')
|
||||
|
||||
return info
|
||||
except:
|
||||
except Exception:
|
||||
return "info unavailable"
|
||||
|
||||
def validate(self, dataset):
|
||||
@@ -521,7 +521,7 @@ class Data(object):
|
||||
self.supported_display_apps = self.supported_display_apps.copy()
|
||||
try:
|
||||
del self.supported_display_apps[app_id]
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Tried to remove display app %s from datatype %s, but this display app is not declared.', type, self.__class__.__name__)
|
||||
|
||||
def clear_display_apps(self):
|
||||
@@ -551,7 +551,7 @@ class Data(object):
|
||||
"""Returns primary label for display app"""
|
||||
try:
|
||||
return self.supported_display_apps[type]['label']
|
||||
except:
|
||||
except Exception:
|
||||
return 'unknown'
|
||||
|
||||
def as_display_type(self, dataset, type, **kwd):
|
||||
@@ -559,7 +559,7 @@ class Data(object):
|
||||
try:
|
||||
if type in self.get_display_types():
|
||||
return getattr(self, self.supported_display_apps[type]['file_function'])(dataset, **kwd)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Function %s is referred to in datatype %s for displaying as type %s, but is not accessible', self.supported_display_apps[type]['file_function'], self.__class__.__name__, type)
|
||||
return "This display type (%s) is not implemented for this datatype (%s)." % (type, dataset.ext)
|
||||
|
||||
@@ -573,7 +573,7 @@ class Data(object):
|
||||
try:
|
||||
if app.config.enable_old_display_applications and type in self.get_display_types():
|
||||
return target_frame, getattr(self, self.supported_display_apps[type]['links_function'])(dataset, type, app, base_url, **kwd)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Function %s is referred to in datatype %s for generating links for type %s, but is not accessible',
|
||||
self.supported_display_apps[type]['links_function'], self.__class__.__name__, type)
|
||||
return target_frame, []
|
||||
|
||||
@@ -7,7 +7,7 @@ import logging
|
||||
import subprocess
|
||||
import tempfile
|
||||
|
||||
from six.moves.urllib.parse import urlencode
|
||||
from six.moves.urllib.parse import urlencode, urlparse
|
||||
from six.moves.urllib.request import urlopen
|
||||
|
||||
from . import (
|
||||
@@ -112,6 +112,9 @@ class URLDataProvider(base.DataProvider):
|
||||
self.data = data or {}
|
||||
encoded_data = urlencode(self.data)
|
||||
|
||||
scheme = urlparse(url).scheme
|
||||
assert scheme in ('http', 'https', 'ftp'), 'Invalid URL scheme: %s' % scheme
|
||||
|
||||
if method == 'GET':
|
||||
self.url += '?%s' % (encoded_data)
|
||||
opened = urlopen(url)
|
||||
|
||||
@@ -122,7 +122,7 @@ class DynamicDisplayApplicationBuilder(object):
|
||||
id_col = elem.get('id', None)
|
||||
try:
|
||||
id_col = int(id_col)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
if data_table:
|
||||
if id_col is None:
|
||||
id_col = data_table.columns.get('id', None)
|
||||
@@ -130,14 +130,14 @@ class DynamicDisplayApplicationBuilder(object):
|
||||
id_col = data_table.columns.get('value', None)
|
||||
try:
|
||||
id_col = int(id_col)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
# id is set to a string or None, use column by that name if available
|
||||
id_col = data_table.columns.get(id_col, None)
|
||||
id_col = int(id_col)
|
||||
name_col = elem.get('name', None)
|
||||
try:
|
||||
name_col = int(name_col)
|
||||
except:
|
||||
except (TypeError, ValueError):
|
||||
if data_table:
|
||||
if name_col is None:
|
||||
name_col = data_table.columns.get('name', None)
|
||||
|
||||
@@ -126,7 +126,7 @@ class GenomeGraphs(Tabular):
|
||||
hasheader = 0
|
||||
try:
|
||||
['%f' % x for x in d[0][1:]] # first is name - see if starts all numerics
|
||||
except:
|
||||
except Exception:
|
||||
hasheader = 1
|
||||
# Generate column header
|
||||
out.append('<tr>')
|
||||
@@ -158,7 +158,7 @@ class GenomeGraphs(Tabular):
|
||||
for j, x in enumerate(ll):
|
||||
try:
|
||||
x = float(x)
|
||||
except:
|
||||
except Exception:
|
||||
badvals.append('col%d:%s' % (j + 1, x))
|
||||
if len(badvals) > 0:
|
||||
errors.append('row %d, %s' % (' '.join(badvals)))
|
||||
@@ -331,13 +331,13 @@ class Rgenetics(Html):
|
||||
return True
|
||||
try:
|
||||
efp = dataset.extra_files_path
|
||||
except:
|
||||
except Exception:
|
||||
if verbose:
|
||||
gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
|
||||
return False
|
||||
try:
|
||||
flist = os.listdir(efp)
|
||||
except:
|
||||
except Exception:
|
||||
if verbose:
|
||||
gal_Log.debug('@@@rgenetics set_meta failed %s - dataset %s has no efp ?' % (sys.exc_info()[0], dataset.name))
|
||||
return False
|
||||
@@ -655,7 +655,7 @@ class RexpBase(Html):
|
||||
pp = os.path.join(dataset.extra_files_path, '%s.pheno' % dataset.metadata.base_name)
|
||||
try:
|
||||
p = open(pp, 'r').readlines()
|
||||
except:
|
||||
except Exception:
|
||||
p = ['##failed to find %s' % pp, ]
|
||||
dataset.peek = ''.join(p[:5])
|
||||
dataset.blurb = 'Galaxy Rexpression composite file'
|
||||
@@ -670,7 +670,7 @@ class RexpBase(Html):
|
||||
pp = os.path.join(dataset.extra_files_path, '%s.pheno' % dataset.metadata.base_name)
|
||||
try:
|
||||
p = open(pp, 'r').readlines()
|
||||
except:
|
||||
except Exception:
|
||||
p = ['##failed to find %s' % pp]
|
||||
return ''.join(p[:5])
|
||||
|
||||
@@ -681,7 +681,7 @@ class RexpBase(Html):
|
||||
h = '## rexpression get_file_peek: no file found'
|
||||
try:
|
||||
h = open(filename, 'r').readlines()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return ''.join(h[:5])
|
||||
|
||||
@@ -713,7 +713,7 @@ class RexpBase(Html):
|
||||
Html.set_meta(self, dataset, **kwd)
|
||||
try:
|
||||
flist = os.listdir(dataset.extra_files_path)
|
||||
except:
|
||||
except Exception:
|
||||
if verbose:
|
||||
gal_Log.debug('@@@rexpression set_meta failed - no dataset?')
|
||||
return False
|
||||
@@ -731,7 +731,7 @@ class RexpBase(Html):
|
||||
dataset.metadata.pheno_path = pp
|
||||
try:
|
||||
pf = open(pp, 'r').readlines() # read the basename.phenodata in the extra_files_path
|
||||
except:
|
||||
except Exception:
|
||||
pf = None
|
||||
if pf:
|
||||
h = pf[0].strip()
|
||||
|
||||
@@ -225,7 +225,7 @@ class Gmaj(data.Data):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "peek unavailable"
|
||||
|
||||
def get_mime(self):
|
||||
@@ -285,5 +285,5 @@ class Laj(data.Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "peek unavailable"
|
||||
|
||||
@@ -111,20 +111,20 @@ class Interval(Tabular):
|
||||
int(elems[1])
|
||||
if overwrite or not dataset.metadata.element_is_set('startCol'):
|
||||
dataset.metadata.startCol = 2
|
||||
except:
|
||||
except Exception:
|
||||
pass # Metadata default will be used
|
||||
try:
|
||||
int(elems[2])
|
||||
if overwrite or not dataset.metadata.element_is_set('endCol'):
|
||||
dataset.metadata.endCol = 3
|
||||
except:
|
||||
except Exception:
|
||||
pass # Metadata default will be used
|
||||
# we no longer want to guess that this column is the 'name', name must now be set manually for interval files
|
||||
# we will still guess at the strand, as we can make a more educated guess
|
||||
# if len( elems ) > 3:
|
||||
# try:
|
||||
# int( elems[3] )
|
||||
# except:
|
||||
# except Exception:
|
||||
# if overwrite or not dataset.metadata.element_is_set( 'nameCol' ):
|
||||
# dataset.metadata.nameCol = 4
|
||||
if len(elems) < 6 or elems[5] not in data.valid_strand:
|
||||
@@ -149,7 +149,7 @@ class Interval(Tabular):
|
||||
and dataset.metadata.chromCol \
|
||||
and dataset.metadata.startCol \
|
||||
and dataset.metadata.endCol
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_estimated_display_viewport(self, dataset, chrom_col=None, start_col=None, end_col=None):
|
||||
@@ -331,10 +331,10 @@ class Interval(Tabular):
|
||||
# respectively ( for 0 based columns )
|
||||
int(hdr[1])
|
||||
int(hdr[2])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_track_resolution(self, dataset, start, end):
|
||||
@@ -458,14 +458,14 @@ class Bed(Interval):
|
||||
fields2 = fields[11].rstrip(",").split(",") # remove trailing comma and split on comma
|
||||
for field in fields2:
|
||||
int(field)
|
||||
except:
|
||||
except Exception:
|
||||
return Interval.as_ucsc_display_file(self, dataset)
|
||||
# only check first line for proper form
|
||||
break
|
||||
|
||||
try:
|
||||
return open(dataset.file_name)
|
||||
except:
|
||||
except Exception:
|
||||
return "This item contains no content"
|
||||
|
||||
def sniff(self, filename):
|
||||
@@ -510,7 +510,7 @@ class Bed(Interval):
|
||||
try:
|
||||
int(hdr[1])
|
||||
int(hdr[2])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 4:
|
||||
# hdr[3] is a string, 'name', which defines the name of the BED line - difficult to test for this.
|
||||
@@ -518,7 +518,7 @@ class Bed(Interval):
|
||||
try:
|
||||
if int(hdr[4]) < 0 or int(hdr[4]) > 1000:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 5:
|
||||
# hdr[5] is strand
|
||||
@@ -528,48 +528,48 @@ class Bed(Interval):
|
||||
# hdr[6] is thickStart, the starting position at which the feature is drawn thickly.
|
||||
try:
|
||||
int(hdr[6])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 7:
|
||||
# hdr[7] is thickEnd, the ending position at which the feature is drawn thickly
|
||||
try:
|
||||
int(hdr[7])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 8:
|
||||
# hdr[8] is itemRgb, an RGB value of the form R,G,B (e.g. 255,0,0). However, this could also be an int (e.g., 0)
|
||||
try:
|
||||
int(hdr[8])
|
||||
except:
|
||||
except Exception:
|
||||
try:
|
||||
hdr[8].split(',')
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 9:
|
||||
# hdr[9] is blockCount, the number of blocks (exons) in the BED line.
|
||||
try:
|
||||
block_count = int(hdr[9])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 10:
|
||||
# hdr[10] is blockSizes - A comma-separated list of the block sizes.
|
||||
# Sometimes the blosck_sizes and block_starts lists end in extra commas
|
||||
try:
|
||||
block_sizes = hdr[10].rstrip(',').split(',')
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(hdr) > 11:
|
||||
# hdr[11] is blockStarts - A comma-separated list of block starts.
|
||||
try:
|
||||
block_starts = hdr[11].rstrip(',').split(',')
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if len(block_sizes) != block_count or len(block_starts) != block_count:
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -678,15 +678,15 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
# Try int.
|
||||
int(value)
|
||||
value_type = "int"
|
||||
except:
|
||||
except ValueError:
|
||||
try:
|
||||
# Try float.
|
||||
float(value)
|
||||
value_type = "float"
|
||||
except:
|
||||
except ValueError:
|
||||
pass
|
||||
attribute_types[name] = value_type
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if i + 1 == num_lines:
|
||||
break
|
||||
@@ -708,7 +708,7 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
int(elems[3])
|
||||
int(elems[4])
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
Tabular.set_meta(self, dataset, overwrite=overwrite, skip=i)
|
||||
|
||||
@@ -771,7 +771,7 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
# Make sure we have not spanned chromosomes
|
||||
start = min(start, int(elems[3]))
|
||||
stop = max(stop, int(elems[4]))
|
||||
except:
|
||||
except Exception:
|
||||
# most likely start/stop is not an int or not enough fields
|
||||
pass
|
||||
# make sure we are at the next new line
|
||||
@@ -848,19 +848,19 @@ class Gff(Tabular, _RemoteCallMixin):
|
||||
try:
|
||||
int(hdr[3])
|
||||
int(hdr[4])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[5] != '.':
|
||||
try:
|
||||
float(hdr[5])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[6] not in data.valid_strand:
|
||||
return False
|
||||
if hdr[7] not in self.valid_gff_frame:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
# ------------- Dataproviders
|
||||
@@ -919,13 +919,13 @@ class Gff3(Gff):
|
||||
try:
|
||||
start = int(elems[3])
|
||||
valid_start = True
|
||||
except:
|
||||
except Exception:
|
||||
if elems[3] == '.':
|
||||
valid_start = True
|
||||
try:
|
||||
end = int(elems[4])
|
||||
valid_end = True
|
||||
except:
|
||||
except Exception:
|
||||
if elems[4] == '.':
|
||||
valid_end = True
|
||||
strand = elems[6]
|
||||
@@ -982,18 +982,18 @@ class Gff3(Gff):
|
||||
return False
|
||||
try:
|
||||
int(hdr[3])
|
||||
except:
|
||||
except Exception:
|
||||
if hdr[3] != '.':
|
||||
return False
|
||||
try:
|
||||
int(hdr[4])
|
||||
except:
|
||||
except Exception:
|
||||
if hdr[4] != '.':
|
||||
return False
|
||||
if hdr[5] != '.':
|
||||
try:
|
||||
float(hdr[5])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[6] not in self.valid_gff3_strand:
|
||||
return False
|
||||
@@ -1001,7 +1001,7 @@ class Gff3(Gff):
|
||||
return False
|
||||
parse_gff3_attributes(hdr[8])
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1055,12 +1055,12 @@ class Gtf(Gff):
|
||||
try:
|
||||
int(hdr[3])
|
||||
int(hdr[4])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[5] != '.':
|
||||
try:
|
||||
float(hdr[5])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[6] not in data.valid_strand:
|
||||
return False
|
||||
@@ -1077,7 +1077,7 @@ class Gtf(Gff):
|
||||
else:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1140,7 +1140,7 @@ class Wiggle(Tabular, _RemoteCallMixin):
|
||||
start = min(int(fields[0]), start)
|
||||
end = max(end, int(fields[0]) + span)
|
||||
viewport_feature_count -= 1
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
# make sure we are at the next new line
|
||||
readline_count = VIEWPORT_MAX_READS_PER_LINE
|
||||
@@ -1199,7 +1199,7 @@ class Wiggle(Tabular, _RemoteCallMixin):
|
||||
try:
|
||||
float(elems[0]) # "Wiggle track data values can be integer or real, positive or negative values"
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
do_break = False
|
||||
for col_startswith in data.col1_startswith:
|
||||
if elems[0].lower().startswith(col_startswith):
|
||||
@@ -1244,7 +1244,7 @@ class Wiggle(Tabular, _RemoteCallMixin):
|
||||
if len(hdr) > 1 and hdr[0] == 'track' and hdr[1].startswith('type=wiggle'):
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_track_resolution(self, dataset, start, end):
|
||||
@@ -1394,7 +1394,7 @@ class CustomTrack (Tabular):
|
||||
return False
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
else:
|
||||
try:
|
||||
@@ -1404,9 +1404,9 @@ class CustomTrack (Tabular):
|
||||
try:
|
||||
int(hdr[1])
|
||||
int(hdr[2])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -1539,7 +1539,7 @@ class ScIdx(Tabular):
|
||||
count += 1
|
||||
if count < 100 and count > 0:
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
finally:
|
||||
fh.close()
|
||||
|
||||
@@ -33,7 +33,7 @@ def count_special_lines(word, filename, invert=False):
|
||||
cmd.extend([word, filename])
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
return int(out.communicate()[0].split()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return 0
|
||||
|
||||
@@ -48,7 +48,7 @@ def count_lines(filename, non_empty=False):
|
||||
else:
|
||||
out = subprocess.Popen(['wc', '-l', filename], stdout=subprocess.PIPE)
|
||||
return int(out.communicate()[0].split()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return 0
|
||||
|
||||
@@ -427,7 +427,7 @@ class OBFS(Binary):
|
||||
"""Create HTML content, used for displaying peek."""
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "OpenBabel Fastsearch Index"
|
||||
|
||||
def display_data(self, trans, data, preview=False, filename=None,
|
||||
@@ -702,7 +702,7 @@ class SMILES(Tabular):
|
||||
# if we have atoms, we have a molecule
|
||||
if not len(pybel.readstring('smi', smiles).atoms) > 0:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
# if convert fails its not a smiles string
|
||||
return False
|
||||
return True
|
||||
|
||||
@@ -26,7 +26,7 @@ class Hmmer(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "HMMER database (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
@abc.abstractmethod
|
||||
@@ -77,7 +77,7 @@ class HmmerPress(Binary):
|
||||
"""Create HTML content, used for displaying peek."""
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "HMMER3 database (multiple files)"
|
||||
|
||||
def __init__(self, **kwd):
|
||||
|
||||
@@ -55,7 +55,7 @@ class BowtieIndex(Html):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Bowtie index file"
|
||||
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ class Smat(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "ESTScan scores matrices (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -98,7 +98,7 @@ class PlantTribesKsComponents(Tabular):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Significant components in the Ks distribution (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
def set_meta(self, dataset, **kwd):
|
||||
|
||||
@@ -285,7 +285,7 @@ class ThermoRAW(Binary):
|
||||
if header.find(finnigan) != -1:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
@@ -299,7 +299,7 @@ class ThermoRAW(Binary):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Thermo Finnigan RAW file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -464,3 +464,49 @@ class ImzML(Binary):
|
||||
rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
|
||||
rval.append('</ul></div></html>')
|
||||
return "\n".join(rval)
|
||||
|
||||
|
||||
class Analyze75(Binary):
|
||||
"""
|
||||
Mayo Analyze 7.5 files
|
||||
http://www.imzml.org
|
||||
"""
|
||||
file_ext = 'analyze75'
|
||||
allow_datatype_change = False
|
||||
composite_type = 'auto_primary_file'
|
||||
|
||||
def __init__(self, **kwd):
|
||||
Binary.__init__(self, **kwd)
|
||||
|
||||
"""The header file. Provides information about dimensions, identification, and processing history."""
|
||||
self.add_composite_file(
|
||||
'hdr',
|
||||
description='The Analyze75 header file.',
|
||||
is_binary=False)
|
||||
|
||||
"""The image file. Image data, whose data type and ordering are described by the header file."""
|
||||
self.add_composite_file(
|
||||
'img',
|
||||
description='The Analyze75 image file.',
|
||||
is_binary=True)
|
||||
|
||||
"""The optional t2m file."""
|
||||
self.add_composite_file(
|
||||
't2m',
|
||||
description='The Analyze75 t2m file.',
|
||||
optional='True', is_binary=True)
|
||||
|
||||
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():
|
||||
fn = composite_name
|
||||
opt_text = ''
|
||||
if composite_file.optional:
|
||||
opt_text = ' (optional)'
|
||||
if composite_file.get('description'):
|
||||
rval.append('<li><a href="%s" type="text/plain">%s (%s)</a>%s</li>' % (fn, fn, composite_file.get('description'), opt_text))
|
||||
else:
|
||||
rval.append('<li><a href="%s" type="text/plain">%s</a>%s</li>' % (fn, fn, opt_text))
|
||||
rval.append('</ul></div></html>')
|
||||
return "\n".join(rval)
|
||||
|
||||
@@ -56,7 +56,7 @@ class QualityScoreSOLiD (QualityScore):
|
||||
if not(readlen):
|
||||
readlen = len(line.split())
|
||||
assert len(line.split()) == readlen # SOLiD reads should be of the same length
|
||||
except:
|
||||
except Exception:
|
||||
break
|
||||
goodblock += 1
|
||||
if goodblock > 10:
|
||||
@@ -64,7 +64,7 @@ class QualityScoreSOLiD (QualityScore):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -106,13 +106,13 @@ class QualityScore454 (QualityScore):
|
||||
break
|
||||
try:
|
||||
[int(x) for x in line.split()]
|
||||
except:
|
||||
except Exception:
|
||||
break
|
||||
return True
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ class SequenceSplitLocations(data.Text):
|
||||
if 'start' not in section or 'end' not in section or 'sequences' not in section:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -376,7 +376,7 @@ class Fasta(Sequence):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a fasta header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -543,7 +543,7 @@ class csFasta(Sequence):
|
||||
else:
|
||||
break # we found a non-empty line, but it's not a header
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -634,7 +634,7 @@ class BaseFastq (Sequence):
|
||||
return False
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, **kwd):
|
||||
@@ -930,7 +930,7 @@ class Maf(Alignment):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -968,7 +968,7 @@ class MafCustomTrack(data.Text):
|
||||
dataset.metadata.vp_chromosome = chrom
|
||||
dataset.metadata.vp_start = forward_strand_start
|
||||
dataset.metadata.vp_end = forward_strand_end
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
@@ -1019,7 +1019,7 @@ class Axt(data.Text):
|
||||
return False
|
||||
try:
|
||||
map(int, [hdr[0], hdr[2], hdr[3], hdr[5], hdr[6], hdr[8]])
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
if hdr[7] not in data.valid_strand:
|
||||
return False
|
||||
@@ -1060,7 +1060,7 @@ class Lav(data.Text):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
|
||||
@@ -1205,7 +1205,7 @@ class Genbank(data.Text):
|
||||
try:
|
||||
with open(filename, 'r') as handle:
|
||||
return 'LOCUS ' == handle.read(6)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return False
|
||||
@@ -1236,7 +1236,7 @@ class MemePsp(Sequence):
|
||||
for item in l.split():
|
||||
try:
|
||||
float(item)
|
||||
except:
|
||||
except ValueError:
|
||||
return False
|
||||
return True
|
||||
try:
|
||||
@@ -1269,7 +1269,7 @@ class MemePsp(Sequence):
|
||||
# We found a non-empty line,
|
||||
# but it's not a psp id width.
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
# We've reached EOF in less than 100 lines.
|
||||
return True
|
||||
|
||||
@@ -54,7 +54,7 @@ def stream_to_open_named_file(stream, fd, filename, source_encoding=None, source
|
||||
is_multi_byte = False
|
||||
try:
|
||||
codecs.lookup(target_encoding)
|
||||
except:
|
||||
except Exception:
|
||||
target_encoding = util.DEFAULT_ENCODING # utf-8
|
||||
if not source_encoding:
|
||||
source_encoding = util.DEFAULT_ENCODING # sys.getdefaultencoding() would mimic old behavior (defaults to ascii)
|
||||
@@ -70,7 +70,7 @@ def stream_to_open_named_file(stream, fd, filename, source_encoding=None, source
|
||||
try:
|
||||
if text_type(chunk[:2]) == text_type(util.gzip_magic):
|
||||
is_compressed = True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if not is_compressed:
|
||||
# See if we have a multi-byte character file
|
||||
@@ -408,7 +408,7 @@ def guess_ext(fname, sniff_order, is_multi_byte=False):
|
||||
if datatype.sniff(fname):
|
||||
file_ext = datatype.file_ext
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
# Ugly hack for tsv vs tabular sniffing, we want to prefer tabular
|
||||
# to tsv but it doesn't have a sniffer - is TSV was sniffed just check
|
||||
|
||||
@@ -62,7 +62,7 @@ class TabularData(data.Text):
|
||||
and dataset.state == dataset.states.OK \
|
||||
and dataset.metadata.columns > 0 \
|
||||
and dataset.metadata.data_lines != 0
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_chunk(self, trans, dataset, offset=0, ck_size=None):
|
||||
@@ -156,7 +156,7 @@ class TabularData(data.Text):
|
||||
if isinstance(spec.param, metadata.ColumnParameter):
|
||||
try:
|
||||
i = int(getattr(dataset.metadata, name)) - 1
|
||||
except:
|
||||
except Exception:
|
||||
i = -1
|
||||
if 0 <= i < columns and column_headers[i] is None:
|
||||
column_headers[i] = column_parameter_alias.get(name, name)
|
||||
@@ -294,14 +294,14 @@ class Tabular(TabularData):
|
||||
try:
|
||||
int(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def is_float(column_text):
|
||||
try:
|
||||
float(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
if column_text.strip().lower() == 'na':
|
||||
return True # na is special cased to be a float
|
||||
return False
|
||||
@@ -488,7 +488,7 @@ class Sam(Tabular):
|
||||
fh.close()
|
||||
if count < 5 and count > 0:
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return False
|
||||
|
||||
@@ -650,10 +650,10 @@ class Pileup(Tabular):
|
||||
chrom = int(hdr[1])
|
||||
assert chrom >= 0
|
||||
assert hdr[2] in ['A', 'C', 'G', 'T', 'N', 'a', 'c', 'g', 't', 'n']
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
# Dataproviders
|
||||
@@ -919,14 +919,14 @@ class BaseCSV(TabularData):
|
||||
try:
|
||||
int(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
return False
|
||||
|
||||
def is_float(self, column_text):
|
||||
try:
|
||||
float(column_text)
|
||||
return True
|
||||
except:
|
||||
except ValueError:
|
||||
if column_text.strip().lower() == 'na':
|
||||
return True # na is special cased to be a float
|
||||
return False
|
||||
@@ -990,7 +990,7 @@ class BaseCSV(TabularData):
|
||||
if not csv.Sniffer().has_header(open(filename, 'r').read(self.big_peek_size)):
|
||||
return False
|
||||
return True
|
||||
except:
|
||||
except Exception:
|
||||
# Not readable by Python's csv using this dialect
|
||||
return False
|
||||
|
||||
@@ -1137,7 +1137,7 @@ class ConnectivityTable(Tabular):
|
||||
j += 1
|
||||
i += 1
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def get_chunk(self, trans, dataset, chunk):
|
||||
|
||||
@@ -55,7 +55,7 @@ class Html(Text):
|
||||
if hdr and hdr[0].lower().find('<html>') >= 0:
|
||||
return True
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return True
|
||||
|
||||
|
||||
@@ -104,7 +104,7 @@ class Json(Text):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "JSON file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
@@ -130,7 +130,7 @@ class Ipynb(Json):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def display_data(self, trans, dataset, preview=False, filename=None, to_ext=None, **kwd):
|
||||
@@ -420,7 +420,7 @@ class SnpEffDb(Text):
|
||||
if m:
|
||||
snpeff_version = m.groups()[0] + m.groups()[1]
|
||||
fh.close()
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return snpeff_version
|
||||
|
||||
@@ -465,7 +465,7 @@ class SnpEffDb(Text):
|
||||
fh.write("annotations: %s\n" % ','.join(annotations))
|
||||
if regulations:
|
||||
fh.write("regulations: %s\n" % ','.join(regulations))
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ class UCSCTrackHub(Html):
|
||||
def display_peek(self, dataset):
|
||||
try:
|
||||
return dataset.peek
|
||||
except:
|
||||
except Exception:
|
||||
return "Track Hub structure: Visualization in UCSC Track Hub"
|
||||
|
||||
def sniff(self, filename):
|
||||
|
||||
@@ -14,6 +14,6 @@ def count_special_lines(word, filename, invert=False):
|
||||
cmd.extend([word, filename])
|
||||
out = subprocess.Popen(cmd, stdout=subprocess.PIPE)
|
||||
return int(out.communicate()[0].split()[0])
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
return 0
|
||||
|
||||
@@ -63,7 +63,7 @@ class ConditionalDependencies(object):
|
||||
try:
|
||||
name = name.replace('-', '_').replace('.', '_')
|
||||
return getattr(self, 'check_' + name)()
|
||||
except:
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def check_psycopg2(self):
|
||||
|
||||
@@ -1166,7 +1166,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
# TODO: After failing here, consider returning from the function.
|
||||
try:
|
||||
self.reclaim_ownership()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('(%s) Failed to change ownership of %s, failing' % (job.id, self.working_directory))
|
||||
return self.fail(job.info, stdout=stdout, stderr=stderr, exit_code=tool_exit_code)
|
||||
|
||||
@@ -1316,7 +1316,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
dataset.set_peek(line_count=context['line_count'], is_multi_byte=True)
|
||||
else:
|
||||
dataset.set_peek(line_count=context['line_count'])
|
||||
except:
|
||||
except Exception:
|
||||
if (not dataset.datatype.composite_type and dataset.dataset.is_multi_byte()) or self.tool.is_multi_byte:
|
||||
dataset.set_peek(is_multi_byte=True)
|
||||
else:
|
||||
@@ -1467,7 +1467,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
galaxy.tools.imp_exp.JobImportHistoryArchiveWrapper(self.app, self.job_id).cleanup_after_job()
|
||||
if delete_files:
|
||||
self.app.object_store.delete(self.get_job(), base_dir='job_work', entire_dir=True, dir_only=True, obj_dir=True)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Unable to cleanup job %d", self.job_id)
|
||||
|
||||
def _collect_extra_files(self, dataset, job_working_directory):
|
||||
@@ -1765,7 +1765,7 @@ class JobWrapper(object, HasResourceParameters):
|
||||
if external_chown_script and job.user is not None:
|
||||
try:
|
||||
self._change_ownership(self.user_system_pwent[0], str(self.user_system_pwent[3]))
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('(%s) Failed to change ownership of %s, making world-writable instead' % (job.id, self.working_directory))
|
||||
os.chmod(self.working_directory, 0o777)
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ class DeferredJobQueue(object):
|
||||
module_name = 'galaxy.jobs.deferred.' + name
|
||||
try:
|
||||
module = __import__(module_name)
|
||||
except:
|
||||
except ImportError:
|
||||
log.exception('Deferred job plugin appears to exist but is not loadable: %s', module_name)
|
||||
continue
|
||||
for comp in module_name.split(".")[1:]:
|
||||
@@ -76,7 +76,7 @@ class DeferredJobQueue(object):
|
||||
while self.running:
|
||||
try:
|
||||
self.__monitor_step()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Exception in monitor_step')
|
||||
self.sleeper.sleep(1)
|
||||
log.info('job queue stopped')
|
||||
@@ -100,7 +100,7 @@ class DeferredJobQueue(object):
|
||||
# Recovered jobs are passed in by ID
|
||||
assert type(job) is int
|
||||
job = self.sa_session.query(model.DeferredJob).get(job)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if job.is_check_time:
|
||||
try:
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
"""
|
||||
Galaxy job handler, prepares, runs, tracks, and finishes Galaxy jobs
|
||||
"""
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import time
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
from Queue import Queue, Empty
|
||||
import time
|
||||
from Queue import (
|
||||
Empty,
|
||||
Queue
|
||||
)
|
||||
|
||||
from sqlalchemy.sql.expression import and_, or_, select, func, true, null
|
||||
from sqlalchemy.sql.expression import (
|
||||
and_,
|
||||
func,
|
||||
null,
|
||||
or_,
|
||||
select,
|
||||
true
|
||||
)
|
||||
|
||||
from galaxy import model
|
||||
from galaxy.util.sleeper import Sleeper
|
||||
from galaxy.jobs import JobWrapper, TaskWrapper, JobDestination
|
||||
from galaxy.jobs import (
|
||||
JobDestination,
|
||||
JobWrapper,
|
||||
TaskWrapper
|
||||
)
|
||||
from galaxy.jobs.mapper import JobNotReadyException
|
||||
from galaxy.util.sleeper import Sleeper
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
@@ -196,7 +209,7 @@ class JobHandlerQueue(object):
|
||||
# to the sleep.
|
||||
if not self.app.job_manager.job_lock:
|
||||
self.__monitor_step()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Exception in monitor_step")
|
||||
# Sleep
|
||||
self.sleeper.sleep(1)
|
||||
@@ -703,7 +716,7 @@ class JobHandlerStopQueue(object):
|
||||
while self.running:
|
||||
try:
|
||||
self.monitor_step()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Exception in monitor_step")
|
||||
# Sleep
|
||||
self.sleeper.sleep(1)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import re
|
||||
from .error_level import StdioErrorLevel
|
||||
import traceback
|
||||
|
||||
from logging import getLogger
|
||||
|
||||
from .error_level import StdioErrorLevel
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ def check_output(tool, stdout, stderr, tool_exit_code, job):
|
||||
success = True
|
||||
|
||||
# On any exception, return True.
|
||||
except:
|
||||
except Exception:
|
||||
tb = traceback.format_exc()
|
||||
log.warning("Tool check encountered unexpected exception; " +
|
||||
"assuming tool was successful: " + tb)
|
||||
|
||||
@@ -1,28 +1,34 @@
|
||||
"""
|
||||
Base classes for job runner plugins.
|
||||
"""
|
||||
|
||||
import os
|
||||
import time
|
||||
import string
|
||||
import logging
|
||||
import datetime
|
||||
import threading
|
||||
import logging
|
||||
import os
|
||||
import string
|
||||
import subprocess
|
||||
|
||||
from Queue import Queue, Empty
|
||||
import threading
|
||||
import time
|
||||
from Queue import (
|
||||
Empty,
|
||||
Queue
|
||||
)
|
||||
|
||||
import galaxy.jobs
|
||||
from galaxy.jobs.command_factory import build_command
|
||||
from galaxy import model
|
||||
from galaxy.util import DATABASE_MAX_STRING_SIZE, shrink_stream_by_size
|
||||
from galaxy.util import in_directory
|
||||
from galaxy.util import ParamsWithSpecs
|
||||
from galaxy.util import ExecutionTimer
|
||||
from galaxy.util.bunch import Bunch
|
||||
from galaxy.jobs.runners.util.job_script import write_script
|
||||
from galaxy.jobs.runners.util.job_script import job_script
|
||||
from galaxy.jobs.command_factory import build_command
|
||||
from galaxy.jobs.runners.util.env import env_to_statement
|
||||
from galaxy.jobs.runners.util.job_script import (
|
||||
job_script,
|
||||
write_script
|
||||
)
|
||||
from galaxy.util import (
|
||||
DATABASE_MAX_STRING_SIZE,
|
||||
ExecutionTimer,
|
||||
in_directory,
|
||||
ParamsWithSpecs,
|
||||
shrink_stream_by_size
|
||||
)
|
||||
from galaxy.util.bunch import Bunch
|
||||
|
||||
from .state_handler_factory import build_state_handlers
|
||||
|
||||
@@ -94,15 +100,15 @@ class BaseJobRunner(object):
|
||||
else:
|
||||
# arg should be a JobWrapper/TaskWrapper
|
||||
job_id = arg.get_id_tag()
|
||||
except:
|
||||
except Exception:
|
||||
job_id = 'unknown'
|
||||
try:
|
||||
name = method.__name__
|
||||
except:
|
||||
except Exception:
|
||||
name = 'unknown'
|
||||
try:
|
||||
method(arg)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("(%s) Unhandled exception calling %s" % (job_id, name))
|
||||
|
||||
# Causes a runner's `queue_job` method to be called from a worker thread
|
||||
@@ -366,7 +372,7 @@ class BaseJobRunner(object):
|
||||
handler(self.app, self, job_state)
|
||||
if job_state.runner_state_handled:
|
||||
break
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Caught exception in runner state handler')
|
||||
|
||||
def fail_job(self, job_state, exception=False):
|
||||
@@ -610,14 +616,14 @@ class AsynchronousJobRunner(BaseJobRunner):
|
||||
try:
|
||||
# This should be an 8-bit exit code, but read ahead anyway:
|
||||
exit_code_str = open(job_state.exit_code_file, "r").read(32)
|
||||
except:
|
||||
except Exception:
|
||||
# By default, the exit code is 0, which typically indicates success.
|
||||
exit_code_str = "0"
|
||||
|
||||
try:
|
||||
# Decode the exit code. If it's bogus, then just use 0.
|
||||
exit_code = int(exit_code_str)
|
||||
except:
|
||||
except ValueError:
|
||||
log.warning("(%s/%s) Exit code '%s' invalid. Using 0." % (galaxy_id_tag, external_job_id, exit_code_str))
|
||||
exit_code = 0
|
||||
|
||||
@@ -628,7 +634,7 @@ class AsynchronousJobRunner(BaseJobRunner):
|
||||
|
||||
try:
|
||||
job_state.job_wrapper.finish(stdout, stderr, exit_code)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("(%s/%s) Job wrapper finish method failed" % (galaxy_id_tag, external_job_id))
|
||||
job_state.job_wrapper.fail("Unable to finish job", exception=True)
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class ShellJobRunner(AsynchronousJobRunner):
|
||||
|
||||
try:
|
||||
self.write_executable_script(ajs.job_file, script)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("(%s) failure writing job script" % galaxy_id_tag)
|
||||
job_wrapper.fail("failure preparing job script", exception=True)
|
||||
return
|
||||
|
||||
@@ -105,7 +105,7 @@ class CondorJobRunner(AsynchronousJobRunner):
|
||||
)
|
||||
try:
|
||||
self.write_executable_script(executable, script)
|
||||
except:
|
||||
except Exception:
|
||||
job_wrapper.fail("failure preparing job script", exception=True)
|
||||
log.exception("(%s) failure preparing job script" % galaxy_id_tag)
|
||||
return
|
||||
|
||||
@@ -110,7 +110,7 @@ class DRMAAJobRunner(AsynchronousJobRunner):
|
||||
"""Get any native DRM arguments specified by the site configuration"""
|
||||
try:
|
||||
return url.split('/')[2] or None
|
||||
except:
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def queue_job(self, job_wrapper):
|
||||
@@ -151,7 +151,7 @@ class DRMAAJobRunner(AsynchronousJobRunner):
|
||||
script = self.get_job_file(job_wrapper, exit_code_path=ajs.exit_code_file)
|
||||
try:
|
||||
self.write_executable_script(ajs.job_file, script)
|
||||
except:
|
||||
except Exception:
|
||||
job_wrapper.fail("failure preparing job script", exception=True)
|
||||
log.exception("(%s) failure writing job script" % galaxy_id_tag)
|
||||
return
|
||||
@@ -183,7 +183,7 @@ class DRMAAJobRunner(AsynchronousJobRunner):
|
||||
log.warning('(%s) drmaa.Session.runJob() failed, will retry: %s', galaxy_id_tag, e)
|
||||
fail_msg = "Unable to run this job due to a cluster error, please retry it later"
|
||||
time.sleep(5)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('(%s) drmaa.Session.runJob() failed unconditionally', galaxy_id_tag)
|
||||
trynum = 5
|
||||
else:
|
||||
|
||||
@@ -336,16 +336,16 @@ class GodockerJobRunner(AsynchronousJobRunner):
|
||||
job_destination = job_wrapper.job_destination
|
||||
try:
|
||||
docker_cpu = int(job_destination.params["docker_cpu"])
|
||||
except:
|
||||
except Exception:
|
||||
docker_cpu = 1
|
||||
try:
|
||||
docker_ram = int(job_destination.params["docker_memory"])
|
||||
except:
|
||||
except Exception:
|
||||
docker_ram = 1
|
||||
try:
|
||||
docker_image = self._find_container(job_wrapper).container_id
|
||||
log.debug("GoDocker runner using container %s.", docker_image)
|
||||
except:
|
||||
except Exception:
|
||||
log.error("Unable to find docker_image for job %s, failing." % job_wrapper.job_id)
|
||||
return False
|
||||
|
||||
@@ -367,7 +367,7 @@ class GodockerJobRunner(AsynchronousJobRunner):
|
||||
for i in volume:
|
||||
temp = dict({"name": i})
|
||||
volumes.append(temp)
|
||||
except:
|
||||
except Exception:
|
||||
log.debug("godocker_volume not set, using default.")
|
||||
|
||||
dt = datetime.now()
|
||||
@@ -379,7 +379,7 @@ class GodockerJobRunner(AsynchronousJobRunner):
|
||||
command = "#!/bin/bash\n" + "cd " + job_wrapper.working_directory + "\n" + venv + "\n" + job_wrapper.runner_command_line
|
||||
else:
|
||||
command = "#!/bin/bash\n" + "cd " + job_wrapper.working_directory + "\n" + job_wrapper.runner_command_line
|
||||
except:
|
||||
except Exception:
|
||||
command = "#!/bin/bash\n" + "cd " + job_wrapper.working_directory + "\n" + job_wrapper.runner_command_line
|
||||
|
||||
# GoDocker Job model schema
|
||||
|
||||
@@ -131,7 +131,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
|
||||
if "k8s_supplemental_group_id" in self.runner_params:
|
||||
try:
|
||||
return int(self.runner_params["k8s_supplemental_group_id"])
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("Supplemental group passed for Kubernetes runner needs to be an integer, value "
|
||||
+ self.runner_params["k8s_supplemental_group_id"] + " passed is invalid")
|
||||
return None
|
||||
@@ -141,7 +141,7 @@ class KubernetesJobRunner(AsynchronousJobRunner):
|
||||
if "k8s_fs_group_id" in self.runner_params:
|
||||
try:
|
||||
return int(self.runner_params["k8s_fs_group_id"])
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("FS group passed for Kubernetes runner needs to be an integer, value "
|
||||
+ self.runner_params["k8s_fs_group_id"] + " passed is invalid")
|
||||
return None
|
||||
|
||||
@@ -128,7 +128,7 @@ class LocalJobRunner(BaseJobRunner):
|
||||
# Finish the job!
|
||||
try:
|
||||
job_wrapper.finish(stdout, stderr, exit_code)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Job wrapper finish method failed")
|
||||
self._fail_job_local(job_wrapper, "Unable to finish job")
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
# stripping the - comes later (in parse_destination_params)
|
||||
for i, opt in enumerate(opts):
|
||||
opts[i] = '-' + opt
|
||||
except:
|
||||
except Exception:
|
||||
opts = []
|
||||
for opt in opts:
|
||||
param, value = opt.split(None, 1)
|
||||
@@ -168,7 +168,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
arg = PBS_ARGMAP[arg]
|
||||
arg = arg.lstrip('-')
|
||||
args[arg] = value
|
||||
except:
|
||||
except Exception:
|
||||
log.warning('Unrecognized long argument in destination params: %s' % arg)
|
||||
return self.__args_to_attrs(args)
|
||||
|
||||
@@ -371,7 +371,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
self.check_single_job(pbs_server_name, job_id)
|
||||
log.warning("(%s/%s) PBS job was not in state check list, but was found with individual state check" % (galaxy_job_id, job_id))
|
||||
new_watched.append(pbs_job_state)
|
||||
except:
|
||||
except Exception:
|
||||
errno, text = pbs.error()
|
||||
if errno == 15001:
|
||||
# 15001 == job not in queue
|
||||
@@ -525,7 +525,7 @@ class PBSJobRunner(AsynchronousJobRunner):
|
||||
pbs.pbs_deljob(c, job_id, '')
|
||||
log.debug("%s Removed from PBS queue before job completion"
|
||||
% job_tag)
|
||||
except:
|
||||
except Exception:
|
||||
e = traceback.format_exc()
|
||||
log.debug("%s Unable to stop job: %s" % (job_tag, e))
|
||||
finally:
|
||||
|
||||
@@ -104,7 +104,7 @@ class SlurmJobRunner(DRMAAJobRunner):
|
||||
try:
|
||||
self.queue_job(ajs.job_wrapper)
|
||||
return
|
||||
except:
|
||||
except Exception:
|
||||
ajs.fail_message = "This job failed due to a cluster node failure, and an attempt to resubmit the job failed."
|
||||
elif slurm_state == 'CANCELLED':
|
||||
# Check to see if the job was killed for exceeding memory consumption
|
||||
@@ -164,7 +164,7 @@ class SlurmJobRunner(DRMAAJobRunner):
|
||||
return 'This job was terminated because it used more memory than it was allocated.'
|
||||
elif any(_ in stripped_line for _ in SLURM_MEMORY_LIMIT_EXCEEDED_PARTIAL_WARNINGS):
|
||||
return 'This job was cancelled probably because it used more memory than it was allocated.'
|
||||
except:
|
||||
except Exception:
|
||||
log.exception('Error reading end of %s:', efile_path)
|
||||
|
||||
return False
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import logging
|
||||
|
||||
from galaxy.util.submodules import submodules
|
||||
|
||||
import galaxy.jobs.runners.state_handlers
|
||||
|
||||
from galaxy.util.submodules import submodules
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
parallelism = job_wrapper.get_parallelism()
|
||||
try:
|
||||
splitter = getattr(__import__('galaxy.jobs.splitters', globals(), locals(), [parallelism.method]), parallelism.method)
|
||||
except:
|
||||
except Exception:
|
||||
job_wrapper.change_state(model.Job.states.ERROR)
|
||||
job_wrapper.fail("Job Splitting Failed, no match for '%s'" % parallelism)
|
||||
return
|
||||
@@ -125,7 +125,7 @@ class TaskedJobRunner(BaseJobRunner):
|
||||
# Finish the job
|
||||
try:
|
||||
job_wrapper.finish(stdout, stderr, job_exit_code)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Job wrapper finish method failed")
|
||||
job_wrapper.fail("Unable to finish job", exception=True)
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ class Slurm(BaseJobExec):
|
||||
if not k.startswith('-'):
|
||||
k = argmap[k]
|
||||
scriptargs[k] = v
|
||||
except:
|
||||
except Exception:
|
||||
log.warning('Unrecognized long argument passed to Slurm CLI plugin: %s' % k)
|
||||
|
||||
# Generated template.
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from logging import getLogger
|
||||
try:
|
||||
import xml.etree.cElementTree as et
|
||||
except:
|
||||
except ImportError:
|
||||
import xml.etree.ElementTree as et
|
||||
|
||||
try:
|
||||
|
||||
@@ -147,7 +147,7 @@ class TransferManager(object):
|
||||
# restart the transfer if socket communication fails repeatedly.
|
||||
try:
|
||||
os.kill(tj.pid, 0)
|
||||
except:
|
||||
except Exception:
|
||||
self.sa_session.refresh(tj)
|
||||
if tj.state == tj.states.RUNNING:
|
||||
log.error('Transfer job %s is marked as running but pid %s appears to be dead.' % (tj.id, tj.pid))
|
||||
|
||||
@@ -27,11 +27,11 @@ class ProvidesAppContext(object):
|
||||
action.user = user
|
||||
else:
|
||||
action.user = self.user
|
||||
except:
|
||||
except Exception:
|
||||
action.user = None
|
||||
try:
|
||||
action.session_id = self.galaxy_session.id
|
||||
except:
|
||||
except Exception:
|
||||
action.session_id = None
|
||||
self.sa_session.add(action)
|
||||
self.sa_session.flush()
|
||||
@@ -46,23 +46,23 @@ class ProvidesAppContext(object):
|
||||
event.tool_id = tool_id
|
||||
try:
|
||||
event.message = message % kwargs
|
||||
except:
|
||||
except Exception:
|
||||
event.message = message
|
||||
try:
|
||||
event.history = self.get_history()
|
||||
except:
|
||||
except Exception:
|
||||
event.history = None
|
||||
try:
|
||||
event.history_id = self.history.id
|
||||
except:
|
||||
except Exception:
|
||||
event.history_id = None
|
||||
try:
|
||||
event.user = self.user
|
||||
except:
|
||||
except Exception:
|
||||
event.user = None
|
||||
try:
|
||||
event.session_id = self.galaxy_session.id
|
||||
except:
|
||||
except Exception:
|
||||
event.session_id = None
|
||||
self.sa_session.add(event)
|
||||
self.sa_session.flush()
|
||||
|
||||
@@ -132,7 +132,7 @@ class FolderManager(object):
|
||||
"""
|
||||
parent_folder = self.get(trans, parent_folder_id)
|
||||
current_user_roles = trans.get_current_user_roles()
|
||||
if not (trans.user_is_admin or trans.app.security_agent.can_add_library_item(current_user_roles, parent_folder)):
|
||||
if not (trans.user_is_admin() or trans.app.security_agent.can_add_library_item(current_user_roles, parent_folder)):
|
||||
raise InsufficientPermissionsException('You do not have proper permission to create folders under given folder.')
|
||||
new_folder = trans.app.model.LibraryFolder(name=new_folder_name, description=new_folder_description)
|
||||
# We are associating the last used genome build with folders, so we will always
|
||||
@@ -230,7 +230,7 @@ class FolderManager(object):
|
||||
"""
|
||||
Return true if the user has permissions to add item to the given folder.
|
||||
"""
|
||||
if trans.user_is_admin:
|
||||
if trans.user_is_admin():
|
||||
return True
|
||||
current_user_roles = trans.get_current_user_roles()
|
||||
add_roles = set(trans.app.security_agent.get_roles_for_action(folder, trans.app.security_agent.permitted_actions.LIBRARY_ADD))
|
||||
|
||||
@@ -50,7 +50,7 @@ class LibraryManager(object):
|
||||
"""
|
||||
Create a new library.
|
||||
"""
|
||||
if not trans.user_is_admin:
|
||||
if not trans.user_is_admin():
|
||||
raise exceptions.ItemAccessibilityException('Only administrators can create libraries.')
|
||||
else:
|
||||
library = trans.app.model.Library(name=name, description=description, synopsis=synopsis)
|
||||
|
||||
@@ -195,17 +195,26 @@ class LibraryDatasetsManager(object):
|
||||
if len(expired_ldda_versions) > 0:
|
||||
rval['has_versions'] = True
|
||||
rval['expired_versions'] = expired_ldda_versions
|
||||
|
||||
ldda = ld.library_dataset_dataset_association
|
||||
if ldda.creating_job_associations:
|
||||
if ldda.creating_job_associations[0].job.stdout:
|
||||
rval['job_stdout'] = ldda.creating_job_associations[0].job.stdout.strip()
|
||||
if ldda.creating_job_associations[0].job.stderr:
|
||||
rval['job_stderr'] = ldda.creating_job_associations[0].job.stderr.strip()
|
||||
if ldda.dataset.uuid:
|
||||
rval['uuid'] = str(ldda.dataset.uuid)
|
||||
rval['deleted'] = ld.deleted
|
||||
rval['folder_id'] = 'F' + rval['folder_id']
|
||||
rval['full_path'] = full_path
|
||||
rval['file_size'] = util.nice_size(int(ld.library_dataset_dataset_association.get_size()))
|
||||
rval['date_uploaded'] = ld.library_dataset_dataset_association.create_time.strftime("%Y-%m-%d %I:%M %p")
|
||||
rval['can_user_modify'] = trans.app.security_agent.can_modify_library_item(current_user_roles, ld) or trans.user_is_admin()
|
||||
rval['is_unrestricted'] = trans.app.security_agent.dataset_is_public(ld.library_dataset_dataset_association.dataset)
|
||||
rval['tags'] = self.tag_manager.get_tags_str(ld.library_dataset_dataset_association.tags)
|
||||
rval['file_size'] = util.nice_size(int(ldda.get_size()))
|
||||
rval['date_uploaded'] = ldda.create_time.strftime("%Y-%m-%d %I:%M %p")
|
||||
rval['can_user_modify'] = trans.user_is_admin() or trans.app.security_agent.can_modify_library_item(current_user_roles, ld)
|
||||
rval['is_unrestricted'] = trans.app.security_agent.dataset_is_public(ldda.dataset)
|
||||
rval['tags'] = self.tag_manager.get_tags_str(ldda.tags)
|
||||
|
||||
# Manage dataset permission is always attached to the dataset itself, not the the ld or ldda to maintain consistency
|
||||
rval['can_user_manage'] = trans.app.security_agent.can_manage_dataset(current_user_roles, ld.library_dataset_dataset_association.dataset) or trans.user_is_admin()
|
||||
rval['can_user_manage'] = trans.user_is_admin() or trans.app.security_agent.can_manage_dataset(current_user_roles, ldda.dataset)
|
||||
return rval
|
||||
|
||||
def _build_path(self, trans, folder):
|
||||
|
||||
@@ -233,14 +233,6 @@ class UserManager(base.ModelManager, deletable.PurgableManagerMixin):
|
||||
tags = [((name + ':' + val) if val else name) for name, val in tags]
|
||||
return sorted(tags)
|
||||
|
||||
def has_requests(self, user, trans):
|
||||
"""
|
||||
"""
|
||||
if self.is_anonymous(user):
|
||||
return False
|
||||
request_types = self.app.security_agent.get_accessible_request_types(trans, user)
|
||||
return bool(user.requests or request_types)
|
||||
|
||||
|
||||
class UserSerializer(base.ModelSerializer, deletable.PurgableSerializerMixin):
|
||||
model_manager_class = UserManager
|
||||
@@ -292,7 +284,6 @@ class UserSerializer(base.ModelSerializer, deletable.PurgableSerializerMixin):
|
||||
'quota' : lambda i, k, **c: self.user_manager.quota(i, total=True),
|
||||
|
||||
'tags_used' : lambda i, k, **c: self.user_manager.tags_used(i),
|
||||
'has_requests' : lambda i, k, trans=None, **c: self.user_manager.has_requests(i, trans)
|
||||
})
|
||||
|
||||
|
||||
|
||||
@@ -1172,7 +1172,7 @@ class DeferredJob(object):
|
||||
def set_last_check(self, seconds):
|
||||
try:
|
||||
self._last_check = int(seconds)
|
||||
except:
|
||||
except ValueError:
|
||||
self._last_check = time.time()
|
||||
last_check = property(get_last_check, set_last_check)
|
||||
|
||||
@@ -4324,7 +4324,7 @@ class FormDefinition(object, Dictifiable):
|
||||
try:
|
||||
# This field has a saved value.
|
||||
value = str(contents[field['name']])
|
||||
except:
|
||||
except Exception:
|
||||
# If there was an error getting the saved value, we'll still
|
||||
# display the widget, but it will be empty.
|
||||
if field_type == 'AddressField':
|
||||
|
||||
@@ -291,10 +291,10 @@ class MetadataType(JSONType):
|
||||
ret = metadata_pickler.loads(str(value))
|
||||
if ret:
|
||||
ret = dict(ret.__dict__)
|
||||
except:
|
||||
except Exception:
|
||||
try:
|
||||
ret = json_decoder.decode(str(_sniffnfix_pg9_hex(value)))
|
||||
except:
|
||||
except Exception:
|
||||
ret = None
|
||||
return ret
|
||||
|
||||
|
||||
@@ -2534,7 +2534,7 @@ def db_next_hid(self, n=1):
|
||||
table.update(table.c.id == self.id).execute(hid_counter=(next_hid + n))
|
||||
trans.commit()
|
||||
return next_hid
|
||||
except:
|
||||
except Exception:
|
||||
trans.rollback()
|
||||
raise
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ class MetadataCollection(object):
|
||||
def get(self, key, default=None):
|
||||
try:
|
||||
return self.__getattr__(key) or default
|
||||
except:
|
||||
except Exception:
|
||||
return default
|
||||
|
||||
def items(self):
|
||||
|
||||
@@ -36,7 +36,7 @@ def create_or_verify_database(url, galaxy_config_file, engine_options={}, app=No
|
||||
try:
|
||||
# Declare the database to be under a repository's version control
|
||||
db_schema = schema.ControlledSchema.create(engine, migrate_repository)
|
||||
except:
|
||||
except Exception:
|
||||
# The database is already under version control
|
||||
db_schema = schema.ControlledSchema(engine, migrate_repository)
|
||||
# Apply all scripts to get to current version
|
||||
|
||||
@@ -692,7 +692,7 @@ def __guess_dataset_by_filename(filename):
|
||||
if fields:
|
||||
if fields[-1].startswith('dataset_') and fields[-1].endswith('.dat'): # dataset_%d.dat
|
||||
return Dataset.get(int(fields[-1][len('dataset_'): -len('.dat')]))
|
||||
except:
|
||||
except Exception:
|
||||
pass # some parsing error, we can't guess Dataset
|
||||
return None
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ def upgrade(migrate_engine):
|
||||
i = Index("ix_page_slug", Page_table.c.slug, unique=False)
|
||||
i.create()
|
||||
|
||||
except:
|
||||
except Exception:
|
||||
|
||||
# Mysql doesn't have a named index, but alter should work
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
i = Index("ix_stored_workflow_slug", StoredWorkflow_table.c.slug, mysql_length=200)
|
||||
i.create()
|
||||
except:
|
||||
except Exception:
|
||||
# Mysql doesn't have a named index, but alter should work
|
||||
StoredWorkflow_table.c.slug.alter(unique=False)
|
||||
|
||||
|
||||
+3
-3
@@ -31,7 +31,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
i = Index("ix_history_published", History_table.c.published)
|
||||
i.create()
|
||||
except:
|
||||
except Exception:
|
||||
# Mysql doesn't have a named index, but alter should work
|
||||
History_table.c.published.alter(unique=False)
|
||||
|
||||
@@ -49,7 +49,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
i = Index("ix_stored_workflow_published", StoredWorkflow_table.c.published)
|
||||
i.create()
|
||||
except:
|
||||
except Exception:
|
||||
# Mysql doesn't have a named index, but alter should work
|
||||
StoredWorkflow_table.c.published.alter(unique=False)
|
||||
|
||||
@@ -67,7 +67,7 @@ def upgrade(migrate_engine):
|
||||
try:
|
||||
i = Index("ix_page_importable", Page_table.c.importable)
|
||||
i.create()
|
||||
except:
|
||||
except Exception:
|
||||
# Mysql doesn't have a named index, but alter should work
|
||||
Page_table.c.importable.alter(unique=False)
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ def upgrade(migrate_engine):
|
||||
for table in tables:
|
||||
try:
|
||||
table.create()
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("Failed to create table '%s', ignoring (might result in wrong schema)" % table.name)
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ def upgrade(migrate_engine):
|
||||
t = Table(table_name, metadata, autoload=True)
|
||||
t.drop()
|
||||
metadata.remove(t)
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Failed to drop table '%s', ignoring (might result in wrong schema)" % table_name)
|
||||
|
||||
# 2) Readd
|
||||
@@ -46,7 +46,7 @@ def upgrade(migrate_engine):
|
||||
for table in [WorkflowInvocation_table, WorkflowInvocationStep_table]:
|
||||
try:
|
||||
table.create()
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Failed to create table '%s', ignoring (might result in wrong schema)" % table.name)
|
||||
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ def upgrade(migrate_engine):
|
||||
for table in tables:
|
||||
try:
|
||||
table.create()
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("Failed to create table '%s', ignoring (might result in wrong schema)" % table.name)
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
for table in tables:
|
||||
try:
|
||||
table.create()
|
||||
except:
|
||||
except Exception:
|
||||
log.warning("Failed to create table '%s', ignoring (might result in wrong schema)" % table.name)
|
||||
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ def upgrade(migrate_engine):
|
||||
# Encoding errors? Just to be safe.
|
||||
print("Attempting to fix row %s" % row['id'])
|
||||
print("Prior to replacement: %s" % field_values_str)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
field_values_dict = {}
|
||||
# look for each field name in the values and extract its value (string)
|
||||
@@ -77,7 +77,7 @@ def upgrade(migrate_engine):
|
||||
migrate_engine.execute(cmd)
|
||||
try:
|
||||
print("Post replacement: %s" % json_values)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if corrupted_rows:
|
||||
print('Fixed %i corrupted rows.' % corrupted_rows)
|
||||
|
||||
@@ -13,7 +13,7 @@ def upgrade(migrate_engine):
|
||||
user = Table('galaxy_user', meta, autoload=True)
|
||||
try:
|
||||
user.c.password.alter(type=String(255))
|
||||
except:
|
||||
except Exception:
|
||||
log.exception("Altering password column failed")
|
||||
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user