Package list ctdconverter / debian/2.0-4_bpo9+1 debian / patches / 2to3_result.patch
debian/2.0-4_bpo9+1

Tree @debian/2.0-4_bpo9+1 (Download .tar.gz)

2to3_result.patch @debian/2.0-4_bpo9+1raw · history · blame

--- a/common/utils.py
+++ b/common/utils.py
@@ -4,7 +4,7 @@ import ntpath
 import os
 
 from lxml import etree
-from logger import info, error, warning
+from .logger import info, error, warning
 
 from common.exceptions import ApplicationException
 from CTDopts.CTDopts import CTDModel, ParameterGroup
@@ -100,7 +100,7 @@ def parse_input_ctds(xsd_location, input
         try:
             info("Loading validation schema from %s" % xsd_location, 0)
             schema = etree.XMLSchema(etree.parse(xsd_location))
-        except Exception, e:
+        except Exception as e:
             error("Could not load validation schema %s. Reason: %s" % (xsd_location, str(e)), 0)
     else:
         warning("Validation against a schema has not been enabled.", 0)
@@ -127,7 +127,7 @@ def validate_against_schema(ctd_file, sc
     try:
         parser = etree.XMLParser(schema=schema)
         etree.parse(ctd_file, parser=parser)
-    except etree.XMLSyntaxError, e:
+    except etree.XMLSyntaxError as e:
         raise ApplicationException("Invalid CTD file %s. Reason: %s" % (ctd_file, str(e)))
 
 
@@ -195,9 +195,9 @@ def parse_hardcoded_parameters(hardcoded
 def extract_tool_help_text(ctd_model):
     manual = ""
     doc_url = None
-    if "manual" in ctd_model.opt_attribs.keys():
+    if "manual" in list(ctd_model.opt_attribs.keys()):
         manual += "%s\n\n" % ctd_model.opt_attribs["manual"]
-    if "docurl" in ctd_model.opt_attribs.keys():
+    if "docurl" in list(ctd_model.opt_attribs.keys()):
         doc_url = ctd_model.opt_attribs["docurl"]
 
     help_text = "No help available"
@@ -258,7 +258,7 @@ def extract_and_flatten_parameters(ctd_m
                 parameters.append(parameter)
             else:
                 # append the first-level children of this ParameterGroup
-                pending.extend(parameter.parameters.values())
+                pending.extend(list(parameter.parameters.values()))
     # returned the reversed list of parameters (as it is now,
     # we have the last parameter in the CTD as first in the list)
     return reversed(parameters)
--- a/convert.py
+++ b/convert.py
@@ -224,19 +224,19 @@ def main(argv=None):
         print("Interrupted...")
         return 0
 
-    except ApplicationException, e:
+    except ApplicationException as e:
         traceback.print_exc()
         utils.error("CTDConverter could not complete the requested operation.", 0)
         utils.error("Reason: " + e.msg, 0)
         return 1
 
-    except ModelError, e:
+    except ModelError as e:
         traceback.print_exc()
         utils.error("There seems to be a problem with one of your input CTDs.", 0)
         utils.error("Reason: " + e.msg, 0)
         return 1
 
-    except Exception, e:
+    except Exception as e:
         traceback.print_exc()
         utils.error("CTDConverter could not complete the requested operation.", 0)
         utils.error("Reason: " + e.msg, 0)
--- a/galaxy/converter.py
+++ b/galaxy/converter.py
@@ -134,10 +134,10 @@ def parse_macros_files(macros_file_names
                 else:
                     logger.info("Macro %s found" % name, 1)
                     macros_to_expand.add(name)
-        except ParseError, e:
+        except ParseError as e:
             raise ApplicationException("The macros file " + macros_file_name + " could not be parsed. Cause: " +
                                        str(e))
-        except IOError, e:
+        except IOError as e:
             raise ApplicationException("The macros file " + macros_file_name + " could not be opened. Cause: " +
                                        str(e))
 
@@ -281,7 +281,7 @@ def generate_tool_conf(parsed_ctds, tool
     if galaxy_tool_path is None:
         galaxy_tool_path = ""
     
-    for category, file_names in categories_to_tools.iteritems():
+    for category, file_names in categories_to_tools.items():
         section_node = add_child_node(toolbox_node, "section")
         section_node.attrib["id"] = "section-id-" + "".join(category.split())
         section_node.attrib["name"] = category
@@ -322,7 +322,7 @@ def create_tool(model):
 
 
 def create_description(tool, model):
-    if "description" in model.opt_attribs.keys() and model.opt_attribs["description"] is not None:
+    if "description" in list(model.opt_attribs.keys()) and model.opt_attribs["description"] is not None:
         description = SubElement(tool,"description")
         description.text = model.opt_attribs["description"]
 
@@ -667,7 +667,7 @@ def create_param_attribute_list(param_no
 def generate_label_and_help(desc):
     help_text = ""
     # This tag is found in some descriptions 
-    if not isinstance(desc, basestring):
+    if not isinstance(desc, str):
         desc = str(desc)
     desc = desc.encode("utf8").replace("#br#", " <br>")
     # Get rid of dots in the end
@@ -734,9 +734,9 @@ def is_selection_parameter(param):
 
 
 def get_lowercase_list(some_list):
-    lowercase_list = map(str, some_list)
-    lowercase_list = map(string.lower, lowercase_list)
-    lowercase_list = map(strip, lowercase_list)
+    lowercase_list = list(map(str, some_list))
+    lowercase_list = list(map(string.lower, lowercase_list))
+    lowercase_list = list(map(strip, lowercase_list))
     return lowercase_list
 
 
@@ -800,7 +800,7 @@ def create_output_node(parent, param, mo
             # check if there are formats that have not been registered yet...
             output = list()
             for format_name in param.restrictions.formats:
-                if not format_name in supported_file_formats.keys():
+                if not format_name in list(supported_file_formats.keys()):
                     output.append(str(format_name))
 
             # warn only if there's about to complain
@@ -833,7 +833,7 @@ def create_output_node(parent, param, mo
 
 # Get the supported file format for one given format
 def get_supported_file_type(format_name, supported_file_formats):
-    if format_name in supported_file_formats.keys():
+    if format_name in list(supported_file_formats.keys()):
         return supported_file_formats.get(format_name, DataType(format_name, format_name)).galaxy_extension
     else:
         return None
@@ -841,7 +841,7 @@ def get_supported_file_type(format_name,
 
 def get_supported_file_types(formats, supported_file_formats):
     return set([supported_file_formats.get(format_name, DataType(format_name, format_name)).galaxy_extension
-               for format_name in formats if format_name in supported_file_formats.keys()])
+               for format_name in formats if format_name in list(supported_file_formats.keys())])
 
 
 def create_change_format_node(parent, data_formats, input_ref):