From 1ec6701519f964e2c4182c1400590d7392ebf7d9 Mon Sep 17 00:00:00 2001 From: wmayer Date: Wed, 20 Nov 2019 22:57:58 +0100 Subject: [PATCH] handle nested name spaces in Python generation script --- src/Tools/generateTemplates/templateClassPyExport.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Tools/generateTemplates/templateClassPyExport.py b/src/Tools/generateTemplates/templateClassPyExport.py index 81a575e661b9..bc845daf2193 100644 --- a/src/Tools/generateTemplates/templateClassPyExport.py +++ b/src/Tools/generateTemplates/templateClassPyExport.py @@ -38,8 +38,8 @@ def Generate(self): TemplateHeader = """ // This file is generated by src/Tools/generateTemaplates/templateClassPyExport.py out of the XML file // Every change you make here gets lost in the next full rebuild! -#ifndef @self.export.Namespace.upper()@_@self.export.Name.upper()@_H -#define @self.export.Namespace.upper()@_@self.export.Name.upper()@_H +#ifndef @self.export.Namespace.upper().replace("::", "_")@_@self.export.Name.upper()@_H +#define @self.export.Namespace.upper().replace("::", "_")@_@self.export.Name.upper()@_H #include <@self.export.FatherInclude@> #include <@self.export.Include@> @@ -50,7 +50,7 @@ def Generate(self): @self.export.ForwardDeclarations@ - -namespace @self.export.Namespace@ +namespace @self.export.Namespace.replace("::"," { namespace ")@ { //=========================================================================== @@ -59,7 +59,7 @@ def Generate(self): /** The python export class for @self.export.Twin@ */ -class @self.export.Namespace@Export @self.export.Name@ : public @self.export.FatherNamespace@::@self.export.Father@ +class @self.export.Namespace.replace("::","_")@Export @self.export.Name@ : public @self.export.FatherNamespace@::@self.export.Father@ { protected: ~@self.export.Name@(); @@ -248,9 +248,9 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat - }; -} //namespace @self.export.Namespace@ +@"}"*len(self.export.Namespace.split("::"))@ //namespace @self.export.Namespace@ -#endif // @self.export.Namespace.upper()@_@self.export.Name.upper()@_H +#endif // @self.export.Namespace.upper().replace("::", "_")@_@self.export.Name.upper()@_H """