From a73da8c37d33e49fa88b74e859037cc1f2116247 Mon Sep 17 00:00:00 2001 From: Alan Nelson <alan.nelson@nebraska.edu> Date: Wed, 6 Feb 2019 17:19:10 -0600 Subject: [PATCH] Add parenthesis to print statements for python3 --- magento2-xml-lint/latest/xml-lint | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/magento2-xml-lint/latest/xml-lint b/magento2-xml-lint/latest/xml-lint index 4d00d97..e322c69 100644 --- a/magento2-xml-lint/latest/xml-lint +++ b/magento2-xml-lint/latest/xml-lint @@ -20,7 +20,7 @@ def get_xml_files(search_dir): try: return check_output(['find', search_dir, '-name', '*.xml']).splitlines() except CalledProcessError: - print "WARNING: No XML files found" + print("WARNING: No XML files found") return [] def lint_only(file): @@ -46,20 +46,20 @@ def search_file_for_xsd(file): return None def validate_file(file, mapping): - print "validating file {}".format(file) + print("validating file {}".format(file)) xsd = search_file_for_xsd(file) if xsd is not None: if xsd in mapping: lint_with_xsd(file, mapping[xsd]) else: - print 'WARNING: Unable to map XSD to path: {}'.format(xsd) + print('WARNING: Unable to map XSD to path: {}'.format(xsd)) else: - print 'WARNING: Unable to find XSD for file: {}'.format(file) + print('WARNING: Unable to find XSD for file: {}'.format(file)) lint_only(file) def main(): if len(sys.argv) < 4: - print "Usage: xml-lint <misc.xml> <app_base_dir> <search_dir>" + print("Usage: xml-lint <misc.xml> <app_base_dir> <search_dir>") exit(1) misc_file = sys.argv[1] @@ -67,19 +67,19 @@ def main(): search_dir = os.path.abspath(sys.argv[3]) if not os.path.isfile(misc_file): - print "{} is not a file".format(misc_file) + print("{} is not a file".format(misc_file)) exit(1) mapping = get_mappings(misc_file, base_dir) - print "loaded {} XSD mapping(s)".format(len(mapping)) + print("loaded {} XSD mapping(s)".format(len(mapping))) xml_files = get_xml_files(search_dir) - print "found {} XML file(s)".format(len(xml_files)) + print("found {} XML file(s)".format(len(xml_files))) - print "" + print("") for file in xml_files: validate_file(file, mapping) - print "" + print("") if __name__ == '__main__': main() -- GitLab