diff --git a/tools/filters/gff/gff_filter_by_attribute.py b/tools/filters/gff/gff_filter_by_attribute.py index cd6600cf916..3d4319bc152 100644 --- a/tools/filters/gff/gff_filter_by_attribute.py +++ b/tools/filters/gff/gff_filter_by_attribute.py @@ -6,8 +6,9 @@ from __future__ import division import sys -from json import loads + from ast import Module, parse, walk +from json import loads AST_NODE_TYPE_WHITELIST = [ 'Expr', 'Load', 'Str', 'Num', 'BoolOp', 'Compare', 'And', 'Eq', 'NotEq', @@ -152,6 +153,7 @@ def check_expression( text ): return True + # # Helper functions. # diff --git a/tools/filters/gff/gff_filter_by_feature_count.py b/tools/filters/gff/gff_filter_by_feature_count.py index 778527972bc..d0e65caa9f5 100644 --- a/tools/filters/gff/gff_filter_by_feature_count.py +++ b/tools/filters/gff/gff_filter_by_feature_count.py @@ -5,12 +5,15 @@ Filter a gff file using a criterion based on feature counts for a transcript. Usage: %prog input_name output_name feature_name condition """ +from __future__ import print_function + import sys +from ast import Module, parse, walk + from bx.intervals.io import GenomicInterval from galaxy.datatypes.util.gff_util import GFFReaderWrapper -from ast import Module, parse, walk AST_NODE_TYPE_WHITELIST = [ 'Expr', 'Load', 'Str', 'Num', 'BoolOp', 'Compare', 'And', 'Eq', 'NotEq', @@ -137,7 +140,7 @@ def __main__(): except: number = None if empty != "" or not number: - print >> sys.stderr, "Invalid condition: %s, cannot filter." % condition + print("Invalid condition: %s, cannot filter." % condition, file=sys.stderr) return break @@ -173,7 +176,7 @@ def __main__(): ( kept_features, i, float(kept_features) / i * 100.0, feature_name + condition ) if skipped_lines > 0: info_msg += "Skipped %d blank/comment/invalid lines starting with line #%d." % ( skipped_lines, first_skipped_line ) - print info_msg + print(info_msg) if __name__ == "__main__": __main__() diff --git a/tox.ini b/tox.ini index 561d0637f5d..c4822638555 100644 --- a/tox.ini +++ b/tox.ini @@ -41,7 +41,7 @@ whitelist_externals = bash skip_install = True deps = flake8 - flake8-import-order>=0.9 + flake8-import-order==0.9 [testenv:py27-lint-imports-include-list] commands = bash .ci/flake8_wrapper_imports.sh @@ -49,7 +49,7 @@ whitelist_externals = bash skip_install = True deps = flake8==3.0.4 - flake8-import-order>=0.9 + flake8-import-order==0.9 [testenv:qunit] commands = bash run_tests.sh -q