diff --git a/lib/galaxy/model/mapping.py b/lib/galaxy/model/mapping.py index 31b97bbde7c..293d8d32c54 100644 --- a/lib/galaxy/model/mapping.py +++ b/lib/galaxy/model/mapping.py @@ -5,8 +5,28 @@ are encapsulated here. import logging -from sqlalchemy import ( and_, asc, Boolean, Column, DateTime, desc, false, ForeignKey, Integer, - MetaData, not_, Numeric, select, String, Table, Text, TEXT, true, Unicode, UniqueConstraint ) +from sqlalchemy import ( + and_, + asc, + Boolean, + Column, + DateTime, + desc, + false, + ForeignKey, + Integer, + MetaData, + not_, + Numeric, + select, + String, + Table, + TEXT, + Text, + true, + Unicode, + UniqueConstraint +) from sqlalchemy.ext.associationproxy import association_proxy from sqlalchemy.ext.orderinglist import ordering_list from sqlalchemy.orm import backref, class_mapper, deferred, mapper, object_session, relation diff --git a/lib/galaxy/tools/toolbox/integrated_panel.py b/lib/galaxy/tools/toolbox/integrated_panel.py index e744064e6bf..e9985706b5e 100644 --- a/lib/galaxy/tools/toolbox/integrated_panel.py +++ b/lib/galaxy/tools/toolbox/integrated_panel.py @@ -5,9 +5,10 @@ import time import traceback from xml.sax.saxutils import escape -from .panel import ToolPanelElements -from .panel import panel_item_types - +from .panel import ( + panel_item_types, + ToolPanelElements +) INTEGRATED_TOOL_PANEL_DESCRIPTION = """ This is Galaxy's integrated tool panel and should be modified directly only for diff --git a/lib/tool_shed/tools/tool_validator.py b/lib/tool_shed/tools/tool_validator.py index d7873ac7dfa..d6576c78ee7 100644 --- a/lib/tool_shed/tools/tool_validator.py +++ b/lib/tool_shed/tools/tool_validator.py @@ -3,8 +3,10 @@ import logging import os import tempfile -from galaxy.tools import Tool -from galaxy.tools import parameters +from galaxy.tools import ( + parameters, + Tool +) from galaxy.tools.parameters import dynamic_options from tool_shed.tools import data_table_manager diff --git a/scripts/api/filter_failed_datasets_from_collection.py b/scripts/api/filter_failed_datasets_from_collection.py index a67d4493a67..af1c722821a 100644 --- a/scripts/api/filter_failed_datasets_from_collection.py +++ b/scripts/api/filter_failed_datasets_from_collection.py @@ -6,11 +6,16 @@ datasets "(not ok)" and the successfully finished datasets "(ok)". Sample call: python filter_failed_datasets_from_collection.py MySpecialHistory 1234 """ -import sys -from bioblend.galaxy import GalaxyInstance -from bioblend.galaxy import dataset_collections as collections +from __future__ import print_function -if (len(sys.argv) < 5): +import sys + +from bioblend.galaxy import ( + dataset_collections as collections, + GalaxyInstance +) + +if len(sys.argv) < 5: print("Usage: %s " % sys.argv[0]) exit(0) @@ -28,20 +33,20 @@ if (len(historyMatches) > 1): historyId = historyMatches[0]['id'] historyContents = gi.histories.show_history(historyId, contents=True, deleted=False, visible=True, details=False) -matchingCollections = filter(lambda x: x['hid'] == collectionHistoryId, historyContents) +matchingCollections = [x for x in historyContents if x['hid'] == collectionHistoryId] -if (len(matchingCollections) == 0): +if len(matchingCollections) == 0: print("Error: no collections matching that id found.") exit(1) -if (len(matchingCollections) > 1): +if len(matchingCollections) > 1: print("Error: more than one collection matching that id found (WTF?)") exit(1) collectionId = matchingCollections[0]['id'] failedCollection = gi.histories.show_dataset_collection(historyId, collectionId) -okDatasets = filter(lambda d: d['object']['state'] == 'ok' and d['object']['file_size'] > 0, failedCollection['elements']) -notOkDatasets = filter(lambda d: d['object']['state'] != 'ok' or d['object']['file_size'] == 0, failedCollection['elements']) +okDatasets = [d for d in failedCollection['elements'] if d['object']['state'] == 'ok' and d['object']['file_size'] > 0] +notOkDatasets = [d for d in failedCollection['elements'] if d['object']['state'] != 'ok' or d['object']['file_size'] == 0] okCollectionName = failedCollection['name'] + " (ok)" notOkCollectionName = failedCollection['name'] + " (not ok)"