From 70117f9d34e693bb585736de43eac4762b3d4837 Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Fri, 1 Mar 2019 13:57:51 +0100 Subject: [PATCH] Fix most brutal breakages introduced by commit 974a567 The cleanup commit 974a567 added some stub namespace-addition code to project-text-files.py, which was never completed, but which broke all other functionality of project-text-files.py. This commit doesn't complete the implementation, but restores its previous functionality. Signed-off-by: Jan Lindemann --- scripts/process-text-files.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/process-text-files.py b/scripts/process-text-files.py index 0e41f39..49eb1ce 100644 --- a/scripts/process-text-files.py +++ b/scripts/process-text-files.py @@ -83,14 +83,15 @@ class Cmd(jwutils.Cmd): r = r + line return r - def self._add_namespace_to_header(self, data, ns_new): + def _add_namespace_to_header(self, data, ns_new): lines = data.splitlines() old = None ns_cur = [] for line in iter(lines): match = re.sub('^ *namespace[ \t]*([^ ]+)[ \t]*{.*', '\\1', line) if match != line: - ns_cur = match(blah, bl + #ns_cur = match(blah, bl + raise Exception("Name space addition is not yet implemented") classname = re.sub('^ *#[ \t]*ifndef[\t ]+([^ ]+)($|[ \t/;])', '\\1', line) def _fix_multiple_inclusion_preventer(self, prefix, path): @@ -292,8 +293,8 @@ class CmdAddCppNamespace(Cmd): data = self._add_namespace_to_header(data, namespace) elif ext in _exts_cpp: data = self._add_using_namespace(data, namespace) - elif: - continue + #elif: Not sure what this was meant to do + # continue if data == odata: continue tmp = path + '.' + ('rep' if args.backup is None else args.backup)