Package list ctdconverter / debian/2.0-4_bpo9+1
Avoid explicit dependency from 2to3 Andreas Tille 2 years ago
6 changed file(s) with 165 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
00 ctdconverter (2.0-4~bpo9+1) stretch-backports; urgency=medium
11
22 * Rebuild for stretch-backports.
3 * Avoid explicit dependency from 2to3
34
45 -- Andreas Tille <tille@debian.org> Fri, 25 Jan 2019 14:30:28 +0100
56
1010 python3-lxml,
1111 python3-ruamel.yaml,
1212 python3-ctdopts,
13 help2man,
14 2to3
13 help2man
1514 Standards-Version: 4.1.3
1615 Vcs-Browser: https://salsa.debian.org/med-team/ctdconverter
1716 Vcs-Git: https://salsa.debian.org/med-team/ctdconverter.git
0 --- a/common/utils.py
1 +++ b/common/utils.py
2 @@ -4,7 +4,7 @@ import ntpath
3 import os
4
5 from lxml import etree
6 -from logger import info, error, warning
7 +from .logger import info, error, warning
8
9 from common.exceptions import ApplicationException
10 from CTDopts.CTDopts import CTDModel, ParameterGroup
11 @@ -100,7 +100,7 @@ def parse_input_ctds(xsd_location, input
12 try:
13 info("Loading validation schema from %s" % xsd_location, 0)
14 schema = etree.XMLSchema(etree.parse(xsd_location))
15 - except Exception, e:
16 + except Exception as e:
17 error("Could not load validation schema %s. Reason: %s" % (xsd_location, str(e)), 0)
18 else:
19 warning("Validation against a schema has not been enabled.", 0)
20 @@ -127,7 +127,7 @@ def validate_against_schema(ctd_file, sc
21 try:
22 parser = etree.XMLParser(schema=schema)
23 etree.parse(ctd_file, parser=parser)
24 - except etree.XMLSyntaxError, e:
25 + except etree.XMLSyntaxError as e:
26 raise ApplicationException("Invalid CTD file %s. Reason: %s" % (ctd_file, str(e)))
27
28
29 @@ -195,9 +195,9 @@ def parse_hardcoded_parameters(hardcoded
30 def extract_tool_help_text(ctd_model):
31 manual = ""
32 doc_url = None
33 - if "manual" in ctd_model.opt_attribs.keys():
34 + if "manual" in list(ctd_model.opt_attribs.keys()):
35 manual += "%s\n\n" % ctd_model.opt_attribs["manual"]
36 - if "docurl" in ctd_model.opt_attribs.keys():
37 + if "docurl" in list(ctd_model.opt_attribs.keys()):
38 doc_url = ctd_model.opt_attribs["docurl"]
39
40 help_text = "No help available"
41 @@ -258,7 +258,7 @@ def extract_and_flatten_parameters(ctd_m
42 parameters.append(parameter)
43 else:
44 # append the first-level children of this ParameterGroup
45 - pending.extend(parameter.parameters.values())
46 + pending.extend(list(parameter.parameters.values()))
47 # returned the reversed list of parameters (as it is now,
48 # we have the last parameter in the CTD as first in the list)
49 return reversed(parameters)
50 --- a/convert.py
51 +++ b/convert.py
52 @@ -224,19 +224,19 @@ def main(argv=None):
53 print("Interrupted...")
54 return 0
55
56 - except ApplicationException, e:
57 + except ApplicationException as e:
58 traceback.print_exc()
59 utils.error("CTDConverter could not complete the requested operation.", 0)
60 utils.error("Reason: " + e.msg, 0)
61 return 1
62
63 - except ModelError, e:
64 + except ModelError as e:
65 traceback.print_exc()
66 utils.error("There seems to be a problem with one of your input CTDs.", 0)
67 utils.error("Reason: " + e.msg, 0)
68 return 1
69
70 - except Exception, e:
71 + except Exception as e:
72 traceback.print_exc()
73 utils.error("CTDConverter could not complete the requested operation.", 0)
74 utils.error("Reason: " + e.msg, 0)
75 --- a/galaxy/converter.py
76 +++ b/galaxy/converter.py
77 @@ -134,10 +134,10 @@ def parse_macros_files(macros_file_names
78 else:
79 logger.info("Macro %s found" % name, 1)
80 macros_to_expand.add(name)
81 - except ParseError, e:
82 + except ParseError as e:
83 raise ApplicationException("The macros file " + macros_file_name + " could not be parsed. Cause: " +
84 str(e))
85 - except IOError, e:
86 + except IOError as e:
87 raise ApplicationException("The macros file " + macros_file_name + " could not be opened. Cause: " +
88 str(e))
89
90 @@ -281,7 +281,7 @@ def generate_tool_conf(parsed_ctds, tool
91 if galaxy_tool_path is None:
92 galaxy_tool_path = ""
93
94 - for category, file_names in categories_to_tools.iteritems():
95 + for category, file_names in categories_to_tools.items():
96 section_node = add_child_node(toolbox_node, "section")
97 section_node.attrib["id"] = "section-id-" + "".join(category.split())
98 section_node.attrib["name"] = category
99 @@ -322,7 +322,7 @@ def create_tool(model):
100
101
102 def create_description(tool, model):
103 - if "description" in model.opt_attribs.keys() and model.opt_attribs["description"] is not None:
104 + if "description" in list(model.opt_attribs.keys()) and model.opt_attribs["description"] is not None:
105 description = SubElement(tool,"description")
106 description.text = model.opt_attribs["description"]
107
108 @@ -667,7 +667,7 @@ def create_param_attribute_list(param_no
109 def generate_label_and_help(desc):
110 help_text = ""
111 # This tag is found in some descriptions
112 - if not isinstance(desc, basestring):
113 + if not isinstance(desc, str):
114 desc = str(desc)
115 desc = desc.encode("utf8").replace("#br#", " <br>")
116 # Get rid of dots in the end
117 @@ -734,9 +734,9 @@ def is_selection_parameter(param):
118
119
120 def get_lowercase_list(some_list):
121 - lowercase_list = map(str, some_list)
122 - lowercase_list = map(string.lower, lowercase_list)
123 - lowercase_list = map(strip, lowercase_list)
124 + lowercase_list = list(map(str, some_list))
125 + lowercase_list = list(map(string.lower, lowercase_list))
126 + lowercase_list = list(map(strip, lowercase_list))
127 return lowercase_list
128
129
130 @@ -800,7 +800,7 @@ def create_output_node(parent, param, mo
131 # check if there are formats that have not been registered yet...
132 output = list()
133 for format_name in param.restrictions.formats:
134 - if not format_name in supported_file_formats.keys():
135 + if not format_name in list(supported_file_formats.keys()):
136 output.append(str(format_name))
137
138 # warn only if there's about to complain
139 @@ -833,7 +833,7 @@ def create_output_node(parent, param, mo
140
141 # Get the supported file format for one given format
142 def get_supported_file_type(format_name, supported_file_formats):
143 - if format_name in supported_file_formats.keys():
144 + if format_name in list(supported_file_formats.keys()):
145 return supported_file_formats.get(format_name, DataType(format_name, format_name)).galaxy_extension
146 else:
147 return None
148 @@ -841,7 +841,7 @@ def get_supported_file_type(format_name,
149
150 def get_supported_file_types(formats, supported_file_formats):
151 return set([supported_file_formats.get(format_name, DataType(format_name, format_name)).galaxy_extension
152 - for format_name in formats if format_name in supported_file_formats.keys()])
153 + for format_name in formats if format_name in list(supported_file_formats.keys())])
154
155
156 def create_change_format_node(parent, data_formats, input_ref):
00 From: Michael R. Crusoe <michael.crusoe@gmail.com>
11 Subject: use `open` instead of `file`
2 --- ctdconverter.orig/cwl/converter.py
3 +++ ctdconverter/cwl/converter.py
4 @@ -72,7 +72,7 @@
2 --- a/cwl/converter.py
3 +++ b/cwl/converter.py
4 @@ -72,7 +72,7 @@ def convert_models(args, parsed_ctds):
55
66 logger.info("Writing to %s" % utils.get_filename(output_file), 1)
77
1010 stream.write(CWL_SHEBANG + '\n\n')
1111 stream.write("# This CWL file was automatically generated using CTDConverter.\n")
1212 stream.write("# Visit https://github.com/WorkflowConversion/CTDConverter for more information.\n\n")
13 @@ -103,6 +103,8 @@
13 @@ -103,6 +103,8 @@ def convert_to_cwl(ctd_model, args):
1414 param_name = utils.extract_param_name(param)
1515 cwl_fixed_param_name = fix_param_name(param_name)
1616 hardcoded_value = args.parameter_hardcoder.get_hardcoded_value(param_name, ctd_model.name)
11 upgrade_deprecated_strip
22 correct_name
33 py3_compat
4 2to3_result.patch
1919 dh $@ --with python3 --buildsystem=pybuild
2020
2121 override_dh_auto_build:
22 2to3 --write --nobackups --no-diffs convert.py galaxy/ cwl/ common/
22 # for backport done in quilt patch# 2to3 --write --nobackups --no-diffs convert.py galaxy/ cwl/ common/
2323 dh_auto_build
2424
2525 debian/CTDConverter.1: debian/rules debian/CTDConverter.help2man