handle nested name spaces in Python generation script

This commit is contained in:
wmayer
2019-11-20 22:57:58 +01:00
parent 8d36cfe69e
commit 7f7a573ace

View File

@@ -38,8 +38,8 @@ class TemplateClassPyExport (template.ModelTemplate):
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 @@ class TemplateClassPyExport (template.ModelTemplate):
@self.export.ForwardDeclarations@
-
namespace @self.export.Namespace@
namespace @self.export.Namespace.replace("::"," { namespace ")@
{
//===========================================================================
@@ -59,7 +59,7 @@ namespace @self.export.Namespace@
/** 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 @@ public:
-
};
} //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
"""