+ unify DLL export defines to namespace names
git-svn-id: https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk@5000 e8eeb9e2-ec13-0410-a4a9-efa5cf37419d
This commit is contained in:
53
src/Tools/generateTemplates/templateModuleAppMain.py
Normal file
53
src/Tools/generateTemplates/templateModuleAppMain.py
Normal file
@@ -0,0 +1,53 @@
|
||||
#! python
|
||||
# -*- coding: utf-8 -*-
|
||||
# (c) 2006 Juergen Riegel
|
||||
|
||||
import template
|
||||
import generateBase.generateModel_Module
|
||||
import generateBase.generateTools
|
||||
|
||||
class TemplateModuleAppMain (template.ModelTemplate):
|
||||
def Generate(self):
|
||||
file = open(self.path + "/App" + self.module.Name + ".cpp",'w')
|
||||
generateBase.generateTools.replace(self.Template,locals(),file)
|
||||
#file.write( generateBase.generateTools.replace(self.Template,locals()))
|
||||
|
||||
Template = """
|
||||
/***************************************************************************
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU Library General Public License as *
|
||||
* published by the Free Software Foundation; either version 2 of the *
|
||||
* License, or (at your option) any later version. *
|
||||
* for detail see the LICENCE text file. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#ifndef _PreComp_
|
||||
# include <Python.h>
|
||||
#endif
|
||||
|
||||
#include <Base/Console.h>
|
||||
|
||||
+ for i in self.module.Content.Feature:
|
||||
#include "Feature/@i.Name@.h"
|
||||
-
|
||||
|
||||
extern struct PyMethodDef @self.module.Name@_methods[];
|
||||
|
||||
|
||||
extern "C" {
|
||||
void App@self.module.Name@Export init@self.module.Name@() {
|
||||
|
||||
Base::Console().Log("Mod: Loading @self.module.Name@ module... done\\n");
|
||||
PyObject* partModule = Py_InitModule3("@self.module.Name@", @self.module.Name@_methods, module_@self.module.Name@_doc); /* mod name, table ptr */
|
||||
|
||||
+ for i in self.module.Content.Feature:
|
||||
@self.module.Name@::Feature@i.Name@::init();
|
||||
-
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
} // extern "C"
|
||||
"""
|
||||
Reference in New Issue
Block a user