11#!/usr/bin/env python
22import json
3+ import logging
34import ntpath
45import operator
56import os
1617)
1718from lxml import etree
1819
19- from ..common import logger
2020from ..common .exceptions import ApplicationException
2121
2222
@@ -109,7 +109,7 @@ def validate_path_exists(path):
109109
110110def validate_argument_is_directory (args , argument_name ):
111111 file_name = getattr (args , argument_name )
112- logger .info ("REALPATH %s" % os .path .realpath (file_name ))
112+ logging .info ("REALPATH %s" % os .path .realpath (file_name ))
113113 if file_name is not None and os .path .isdir (os .path .realpath (file_name )):
114114 raise ApplicationException ("The provided output file name (%s) points to a directory." % file_name )
115115
@@ -150,12 +150,12 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e
150150 schema = None
151151 if xsd_location is not None :
152152 try :
153- logger .info ("Loading validation schema from %s" % xsd_location , 0 )
153+ logging .info ("Loading validation schema from %s" % xsd_location )
154154 schema = etree .XMLSchema (etree .parse (xsd_location ))
155155 except Exception as e :
156- logger .error ("Could not load validation schema {}. Reason: {}" .format (xsd_location , str (e )), 0 )
156+ logging .error ("Could not load validation schema {}. Reason: {}" .format (xsd_location , str (e )))
157157 else :
158- logger .warning ("Validation against a schema has not been enabled." , 0 )
158+ logging .warning ("Validation against a schema has not been enabled." )
159159
160160 for input_ctd in input_ctds :
161161 if schema is not None :
@@ -165,7 +165,7 @@ def parse_input_ctds(xsd_location, input_ctds, output_destination, output_file_e
165165 # if multiple inputs are being converted, we need to generate a different output_file for each input
166166 if is_converting_multiple_ctds :
167167 output_file = os .path .join (output_file , get_filename_without_suffix (input_ctd ) + "." + output_file_extension )
168- logger .info ("Parsing %s" % input_ctd )
168+ logging .info ("Parsing %s" % input_ctd )
169169
170170 model = None
171171 try :
@@ -386,8 +386,8 @@ def resolve_param_mapping(param, ctd_model, fix_underscore=False):
386386 for mapping_element in cli_element .mappings :
387387 if mapping_element .reference_name == param .name :
388388 if param_mapping is not None :
389- logger .warning ("The parameter %s has more than one mapping in the <cli> section. "
390- "The first found mapping, %s, will be used." % (param .name , param_mapping ), 1 )
389+ logging .warning ("The parameter %s has more than one mapping in the <cli> section. "
390+ "The first found mapping, %s, will be used." % (param .name , param_mapping ))
391391 else :
392392 param_mapping = cli_element .option_identifier
393393 if param_mapping is not None :
@@ -404,7 +404,7 @@ def _extract_param_cli_name(param, ctd_model, fix_underscore=False):
404404 # we generate parameters with colons for subgroups, but not for the two topmost parents (OpenMS legacy)
405405 if type (param .parent ) == ParameterGroup :
406406 if hasattr (ctd_model , "cli" ) and ctd_model .cli :
407- logger .warning ("Using nested parameter sections (NODE elements) is not compatible with <cli>" , 1 )
407+ logging .warning ("Using nested parameter sections (NODE elements) is not compatible with <cli>" )
408408 return ":" .join (extract_param_path (param , fix_underscore )[:- 1 ]) + ":" + resolve_param_mapping (param , ctd_model , fix_underscore )
409409 else :
410410 return resolve_param_mapping (param , ctd_model , fix_underscore )
0 commit comments