From 1d68057a7a509fceb84fbcde86daf9ba03d360ff Mon Sep 17 00:00:00 2001 From: Jimmy Brisson Date: Tue, 11 Apr 2017 15:49:29 -0500 Subject: [PATCH] Fix Traceback in CMSIS export. The traceback was caused when a file without a parent directory (which is implicitly ".") is added to the resources object. The code assumed that all files within the resources object would have a parent directory. This commit changes the check to account for files that are in the root directory of a project and have no preceding `./` --- tools/export/cmsis/__init__.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/tools/export/cmsis/__init__.py b/tools/export/cmsis/__init__.py index bd72466756..b2df6e572e 100644 --- a/tools/export/cmsis/__init__.py +++ b/tools/export/cmsis/__init__.py @@ -121,7 +121,7 @@ class CMSIS(Exporter): new_srcs = [] for f in list(files): spl = f.name.split(sep) - if len(spl)==2: + if len(spl) <= 2: file_element = Element('file', attrib={ 'category':f.type, @@ -148,8 +148,4 @@ class CMSIS(Exporter): 'device': DeviceCMSIS(self.target), 'date': '' } - # TODO: find how to keep prettyxml from adding xml version to this blob - #dom = parseString(ctx['project_files']) - #ctx['project_files'] = dom.toprettyxml(indent="\t") - self.gen_file('cmsis/cpdsc.tmpl', ctx, 'project.cpdsc')