Fix issues:

+ improve formatting
+ remove superfluous semicolons
+ comment unused parameters
+ rename Initialisation to Initialization
+ rename Deinitialisation to Finalization
+ remove spaces
This commit is contained in:
wmayer 2016-10-08 12:04:49 +02:00
parent 3a51404dd5
commit 9ac1810ea3
24 changed files with 147 additions and 148 deletions

View File

@ -1136,15 +1136,15 @@ void Application::initTypes(void)
App ::PropertyExpressionEngine ::init();
// Extension classes
App ::Extension ::init();
App ::ExtensionContainer ::init();
App ::DocumentObjectExtension ::init();
App ::GroupExtension ::init();
App ::GroupExtensionPython ::init();
App ::GeoFeatureGroupExtension ::init();
App ::Extension ::init();
App ::ExtensionContainer ::init();
App ::DocumentObjectExtension ::init();
App ::GroupExtension ::init();
App ::GroupExtensionPython ::init();
App ::GeoFeatureGroupExtension ::init();
App ::GeoFeatureGroupExtensionPython::init();
App ::OriginGroupExtension ::init();
App ::OriginGroupExtensionPython::init();
App ::OriginGroupExtension ::init();
App ::OriginGroupExtensionPython ::init();
// Document classes
App ::TransactionalObject ::init();

View File

@ -95,10 +95,10 @@ DocumentObjectExecReturn *DocumentObject::execute(void)
{
//call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector)
for(auto ext : vector) {
if(ext->extensionMustExecute())
ext->extensionExecute();
}
return StdReturn;
}
@ -109,10 +109,10 @@ short DocumentObject::mustExecute(void) const
//ask all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector)
for(auto ext : vector) {
if(ext->extensionMustExecute())
return 1;
}
return 0;
}
@ -388,24 +388,24 @@ void DocumentObject::connectRelabelSignals()
}
}
void DocumentObject::onSettingDocument() {
void DocumentObject::onSettingDocument()
{
//call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector)
ext->onExtendedSettingDocument();
}
void DocumentObject::setupObject() {
void DocumentObject::setupObject()
{
//call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector)
ext->onExtendedSetupObject();
}
void DocumentObject::unsetupObject() {
void DocumentObject::unsetupObject()
{
//call all extensions
auto vector = getExtensionsDerivedFromType<App::DocumentObjectExtension>();
for(auto ext : vector)

View File

@ -64,7 +64,7 @@ public:
/// returns the type name of the ViewProviderExtension which is automatically attached
/// to the viewprovider object when it is initiated
virtual const char* getViewProviderExtensionName(void) const {return "";};
virtual const char* getViewProviderExtensionName(void) const {return "";}
};
} //App

View File

@ -39,12 +39,12 @@ std::string DocumentObjectExtensionPy::representation(void) const
return std::string("<document object extension>");
}
PyObject *DocumentObjectExtensionPy::getCustomAttributes(const char* attr) const
PyObject *DocumentObjectExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
}
int DocumentObjectExtensionPy::setCustomAttributes(const char* attr, PyObject *obj)
int DocumentObjectExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
{
return 0;
}

View File

@ -46,7 +46,7 @@ public:
/// returns the type name of the ViewProvider
virtual const char* getViewProviderName(void) const {
return "Gui::ViewProviderDocumentObjectGroup";
};
}
virtual PyObject *getPyObject(void);
};

View File

@ -9,7 +9,7 @@
Namespace="App"
FatherInclude="App/PropertyContainerPy.h"
FatherNamespace="App"
Initialisation="true"
Initialization="true"
Constructor = "true">
<Documentation>
<Author Licence="LGPL" Name="Stefan Troeger" EMail="stefantroeger@gmx.net" />

View File

@ -31,8 +31,8 @@
#include "DocumentObject.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml)
#include "ExtensionContainerPy.h"
#include "ExtensionContainerPy.cpp"
#include <App/ExtensionContainerPy.h>
#include <App/ExtensionContainerPy.cpp>
using namespace App;
@ -42,7 +42,7 @@ std::string ExtensionContainerPy::representation(void) const
return std::string("<extension>");
}
int ExtensionContainerPy::initialisation() {
int ExtensionContainerPy::initialization() {
if (this->ob_type->tp_dict == NULL) {
if (PyType_Ready(this->ob_type) < 0)
@ -69,7 +69,7 @@ int ExtensionContainerPy::initialisation() {
return 1;
}
int ExtensionContainerPy::deinitialisation() {
int ExtensionContainerPy::finalization() {
/*
//we need to delete all added python extensions, as we are the owner!
ExtensionContainer::ExtensionIterator it = this->getExtensionContainerPtr()->extensionBegin();
@ -78,7 +78,7 @@ int ExtensionContainerPy::deinitialisation() {
delete (*it).second;
}*/
return 1;
};
}
PyObject* ExtensionContainerPy::PyMake(struct _typeobject *, PyObject *, PyObject *) // Python wrapper
{
@ -92,12 +92,12 @@ int ExtensionContainerPy::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
return 0;
}
PyObject *ExtensionContainerPy::getCustomAttributes(const char* attr) const
PyObject *ExtensionContainerPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
}
int ExtensionContainerPy::setCustomAttributes(const char* attr, PyObject *obj)
int ExtensionContainerPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
{
return 0;
}

View File

@ -30,8 +30,8 @@
#include "Application.h"
// inclution of the generated files (generated out of PropertyContainerPy.xml)
#include "ExtensionPy.h"
#include "ExtensionPy.cpp"
#include <App/ExtensionPy.h>
#include <App/ExtensionPy.cpp>
using namespace App;
@ -41,12 +41,12 @@ std::string ExtensionPy::representation(void) const
return std::string("<extension>");
}
PyObject *ExtensionPy::getCustomAttributes(const char* attr) const
PyObject *ExtensionPy::getCustomAttributes(const char* /*attr*/) const
{
return 0;
}
int ExtensionPy::setCustomAttributes(const char* attr, PyObject *obj)
int ExtensionPy::setCustomAttributes(const char* /*attr*/, PyObject * /*obj*/)
{
return 0;
}

View File

@ -35,7 +35,6 @@
#pragma warning( disable : 4275 )
#pragma warning( disable : 4503 )
#pragma warning( disable : 4786 ) // specifier longer then 255 chars
#pragma warning( disable : 4250 ) // virtual inheritance warning
#endif
// standard

View File

@ -310,7 +310,7 @@ public:
//restoring the object from document: this may itnerest extensions, hence call them
virtual void Restore(Base::XMLReader& reader);
bool isRestoring() {return testStatus(Gui::isRestoring);};
bool isRestoring() {return testStatus(Gui::isRestoring);}
/** @name Display mask modes

View File

@ -65,16 +65,16 @@ public:
virtual void extensionDropObject(App::DocumentObject*) { }
/// Hides the view provider
virtual void extensionHide(void) { };
virtual void extensionHide(void) { }
/// Shows the view provider
virtual void extensionShow(void) { };
virtual void extensionShow(void) { }
virtual SoSeparator* extensionGetFrontRoot(void) const {return nullptr;}
virtual SoGroup* extensionGetChildRoot(void) const {return nullptr;}
virtual SoSeparator* extensionGetBackRoot(void) const {return nullptr;}
virtual void extensionAttach(App::DocumentObject* pcObject) { };
virtual void extensionSetDisplayMode(const char* ModeName) { };
virtual std::vector<std::string> extensionGetDisplayModes(void) const {return std::vector<std::string>();};
virtual void extensionAttach(App::DocumentObject* pcObject) { }
virtual void extensionSetDisplayMode(const char* ModeName) { }
virtual std::vector<std::string> extensionGetDisplayModes(void) const {return std::vector<std::string>();}
//update data of extended opject
virtual void extensionUpdateData(const App::Property*);

View File

@ -92,7 +92,6 @@ bool ViewProviderGroupExtension::extensionCanDropObject(App::DocumentObject* obj
return true;
return false;
}
void ViewProviderGroupExtension::extensionDropObject(App::DocumentObject* obj) {
@ -135,7 +134,6 @@ std::vector< App::DocumentObject* > ViewProviderGroupExtension::extensionClaimCh
return std::vector<App::DocumentObject*>(group->Group.getValues());
}
void ViewProviderGroupExtension::extensionShow(void) {
// when reading the Visibility property from file then do not hide the

View File

@ -79,7 +79,7 @@ namespace Gui { namespace PropertyEditor {
}
}
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyItem, Base::BaseClass);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyItem, Base::BaseClass)
PropertyItem::PropertyItem() : parentItem(0), readonly(false), cleared(false)
{
@ -475,7 +475,7 @@ void PropertyItem::bind(const App::Property& prop) {
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringItem, Gui::PropertyEditor::PropertyItem)
PropertyStringItem::PropertyStringItem()
{
@ -521,7 +521,7 @@ QVariant PropertyStringItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFontItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFontItem, Gui::PropertyEditor::PropertyItem)
PropertyFontItem::PropertyFontItem()
{
@ -571,7 +571,7 @@ QVariant PropertyFontItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertySeparatorItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertySeparatorItem, Gui::PropertyEditor::PropertyItem)
QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const QObject* receiver, const char* method) const
{
@ -583,7 +583,7 @@ QWidget* PropertySeparatorItem::createEditor(QWidget* parent, const QObject* rec
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerItem, Gui::PropertyEditor::PropertyItem)
PropertyIntegerItem::PropertyIntegerItem()
{
@ -650,7 +650,7 @@ QVariant PropertyIntegerItem::toString(const QVariant& v) const {
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerConstraintItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerConstraintItem, Gui::PropertyEditor::PropertyItem)
PropertyIntegerConstraintItem::PropertyIntegerConstraintItem()
{
@ -733,7 +733,7 @@ QVariant PropertyIntegerConstraintItem::toString(const QVariant& v) const {
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatItem, Gui::PropertyEditor::PropertyItem)
PropertyFloatItem::PropertyFloatItem()
{
@ -802,7 +802,7 @@ QVariant PropertyFloatItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitItem, Gui::PropertyEditor::PropertyItem)
PropertyUnitItem::PropertyUnitItem()
{
@ -876,7 +876,7 @@ QVariant PropertyUnitItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitConstraintItem, Gui::PropertyEditor::PropertyUnitItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyUnitConstraintItem, Gui::PropertyEditor::PropertyUnitItem)
PropertyUnitConstraintItem::PropertyUnitConstraintItem()
{
@ -912,7 +912,7 @@ void PropertyUnitConstraintItem::setEditorData(QWidget *editor, const QVariant&
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatConstraintItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatConstraintItem, Gui::PropertyEditor::PropertyItem)
PropertyFloatConstraintItem::PropertyFloatConstraintItem()
{
@ -994,7 +994,7 @@ QVariant PropertyFloatConstraintItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyAngleItem, Gui::PropertyEditor::PropertyFloatItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyAngleItem, Gui::PropertyEditor::PropertyFloatItem)
PropertyAngleItem::PropertyAngleItem()
{
@ -1036,7 +1036,7 @@ QVariant PropertyAngleItem::toString(const QVariant& prop) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyBoolItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyBoolItem, Gui::PropertyEditor::PropertyItem)
PropertyBoolItem::PropertyBoolItem()
{
@ -1084,7 +1084,7 @@ QVariant PropertyBoolItem::editorData(QWidget *editor) const
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorItem, Gui::PropertyEditor::PropertyItem)
PropertyVectorItem::PropertyVectorItem()
{
@ -1197,7 +1197,7 @@ void PropertyVectorItem::propertyBound() {
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorDistanceItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyVectorDistanceItem, Gui::PropertyEditor::PropertyItem)
PropertyVectorDistanceItem::PropertyVectorDistanceItem()
{
@ -1312,7 +1312,7 @@ void PropertyVectorDistanceItem::propertyBound() {
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMatrixItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMatrixItem, Gui::PropertyEditor::PropertyItem)
PropertyMatrixItem::PropertyMatrixItem()
{
@ -1733,7 +1733,7 @@ void PlacementEditor::updateValue(const QVariant& v, bool incr, bool data)
}
}
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPlacementItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPlacementItem, Gui::PropertyEditor::PropertyItem)
PropertyPlacementItem::PropertyPlacementItem() : init_axis(false), changed_value(false), rot_angle(0), rot_axis(0,0,1)
{
@ -1952,7 +1952,7 @@ void PropertyPlacementItem::propertyBound() {
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyEnumItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyEnumItem, Gui::PropertyEditor::PropertyItem)
PropertyEnumItem::PropertyEnumItem()
{
@ -2037,7 +2037,7 @@ QVariant PropertyEnumItem::editorData(QWidget *editor) const
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringListItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyStringListItem, Gui::PropertyEditor::PropertyItem)
PropertyStringListItem::PropertyStringListItem()
{
@ -2109,7 +2109,7 @@ void PropertyStringListItem::setValue(const QVariant& value)
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatListItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFloatListItem, Gui::PropertyEditor::PropertyItem)
PropertyFloatListItem::PropertyFloatListItem()
{
@ -2183,7 +2183,7 @@ void PropertyFloatListItem::setValue(const QVariant& value)
// ---------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerListItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyIntegerListItem, Gui::PropertyEditor::PropertyItem)
PropertyIntegerListItem::PropertyIntegerListItem()
{
@ -2258,7 +2258,7 @@ void PropertyIntegerListItem::setValue(const QVariant& value)
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyColorItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyColorItem, Gui::PropertyEditor::PropertyItem)
PropertyColorItem::PropertyColorItem()
{
@ -2345,7 +2345,7 @@ namespace Gui { namespace PropertyEditor {
Q_DECLARE_METATYPE(Gui::PropertyEditor::Material)
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialItem, Gui::PropertyEditor::PropertyItem)
PropertyMaterialItem::PropertyMaterialItem()
{
@ -2657,7 +2657,7 @@ QVariant PropertyMaterialItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialListItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyMaterialListItem, Gui::PropertyEditor::PropertyItem)
PropertyMaterialListItem::PropertyMaterialListItem()
{
@ -3122,7 +3122,7 @@ QVariant PropertyMaterialListItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFileItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyFileItem, Gui::PropertyEditor::PropertyItem)
PropertyFileItem::PropertyFileItem()
{
@ -3173,7 +3173,7 @@ QVariant PropertyFileItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPathItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyPathItem, Gui::PropertyEditor::PropertyItem)
PropertyPathItem::PropertyPathItem()
{
@ -3225,7 +3225,7 @@ QVariant PropertyPathItem::editorData(QWidget *editor) const
// --------------------------------------------------------------------
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyTransientFileItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyTransientFileItem, Gui::PropertyEditor::PropertyItem)
PropertyTransientFileItem::PropertyTransientFileItem()
{
@ -3346,7 +3346,7 @@ void LinkLabel::onLinkActivated (const QString& s)
}
}
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyLinkItem, Gui::PropertyEditor::PropertyItem);
TYPESYSTEM_SOURCE(Gui::PropertyEditor::PropertyLinkItem, Gui::PropertyEditor::PropertyItem)
PropertyLinkItem::PropertyLinkItem()
{
@ -3379,8 +3379,9 @@ QVariant PropertyLinkItem::value(const App::Property* prop) const
App::DocumentObject* obj = static_cast<App::DocumentObject*>(c);
list << QString::fromLatin1(obj->getDocument()->getName());
}
else
else {
list << QString::fromLatin1("");
}
// the internal object name
list << QString::fromLatin1("Null");
@ -3393,8 +3394,9 @@ QVariant PropertyLinkItem::value(const App::Property* prop) const
App::DocumentObject* obj = static_cast<App::DocumentObject*>(c);
list << QString::fromLatin1(obj->getNameInDocument());
}
else
else {
list << QString::fromLatin1("Null");
}
return QVariant(list);
}

View File

@ -216,7 +216,7 @@ class GenerateModel:
class PythonExport:
subclass = None
def __init__(self, FatherNamespace='', RichCompare=0, Name='', Reference=0, FatherInclude='', Father='', Namespace='', Twin='', Constructor=0, TwinPointer='', Include='', NumberProtocol=0, Delete=0, Documentation=None, Methode=None, Attribute=None, Sequence=None, CustomAttributes='', ClassDeclarations='', Initialisation=0):
def __init__(self, FatherNamespace='', RichCompare=0, Name='', Reference=0, FatherInclude='', Father='', Namespace='', Twin='', Constructor=0, TwinPointer='', Include='', NumberProtocol=0, Delete=0, Documentation=None, Methode=None, Attribute=None, Sequence=None, CustomAttributes='', ClassDeclarations='', Initialization=0):
self.FatherNamespace = FatherNamespace
self.RichCompare = RichCompare
self.Name = Name
@ -231,7 +231,7 @@ class PythonExport:
self.NumberProtocol = NumberProtocol
self.Delete = Delete
self.Documentation = Documentation
self.Initialisation = Initialisation
self.Initialization = Initialization
if Methode is None:
self.Methode = []
else:
@ -249,8 +249,8 @@ class PythonExport:
else:
return PythonExport(*args_, **kwargs_)
factory = staticmethod(factory)
def getInitialisation(self): return self.Initialisation
def setInitialisation(self, Initialisation): self.Initialisation = Initialisation
def getInitialization(self): return self.Initialization
def setInitialization(self, Initialization): self.Initialization = Initialization
def getDocumentation(self): return self.Documentation
def setDocumentation(self, Documentation): self.Documentation = Documentation
def getMethode(self): return self.Methode
@ -314,8 +314,8 @@ class PythonExport:
outfile.write(' Twin="%s"' % (self.getTwin(), ))
if self.getConstructor() is not None:
outfile.write(' Constructor="%s"' % (self.getConstructor(), ))
if self.getInitialisation() is not None:
outfile.write(' Initialisation="%s"' % (self.getInitialisation(), ))
if self.getInitialization() is not None:
outfile.write(' Initialization="%s"' % (self.getInitialization(), ))
outfile.write(' TwinPointer="%s"' % (self.getTwinpointer(), ))
outfile.write(' Include="%s"' % (self.getInclude(), ))
if self.getNumberprotocol() is not None:
@ -359,7 +359,7 @@ class PythonExport:
showIndent(outfile, level)
outfile.write('Constructor = "%s",\n' % (self.getConstructor(),))
showIndent(outfile, level)
outfile.write('Initialisation = "%s",\n' % (self.getInitialisation(),))
outfile.write('Initialization = "%s",\n' % (self.getInitialization(),))
outfile.write('TwinPointer = "%s",\n' % (self.getTwinpointer(),))
showIndent(outfile, level)
outfile.write('Include = "%s",\n' % (self.getInclude(),))
@ -448,13 +448,13 @@ class PythonExport:
self.Constructor = 0
else:
raise ValueError('Bad boolean attribute (Constructor)')
if attrs.get('Initialisation'):
if attrs.get('Initialisation').value in ('true', '1'):
self.Initialisation = 1
elif attrs.get('Initialisation').value in ('false', '0'):
self.Initialisation = 0
if attrs.get('Initialization'):
if attrs.get('Initialization').value in ('true', '1'):
self.Initialization = 1
elif attrs.get('Initialization').value in ('false', '0'):
self.Initialization = 0
else:
raise ValueError('Bad boolean attribute (Initialisation)')
raise ValueError('Bad boolean attribute (Initialization)')
if attrs.get('TwinPointer'):
self.TwinPointer = attrs.get('TwinPointer').value
if attrs.get('Include'):
@ -507,7 +507,7 @@ class PythonExport:
ClassDeclarations_ += text__content_.nodeValue
self.ClassDeclarations = ClassDeclarations_
elif child_.nodeType == Node.ELEMENT_NODE and \
nodeName_ == 'Initialisation':
nodeName_ == 'Initialization':
obj_ = Documentation.factory()
obj_.build(child_)
self.setDocumentation(obj_)
@ -1845,14 +1845,14 @@ class SaxGeneratemodelHandler(handler.ContentHandler):
obj.setConstructor(0)
else:
self.reportError('"Constructor" attribute must be boolean ("true", "1", "false", "0")')
val = attrs.get('Initialisation', None)
val = attrs.get('Initialization', None)
if val is not None:
if val in ('true', '1'):
obj.setInitialisation(1)
obj.setInitialization(1)
elif val in ('false', '0'):
obj.setInitialisation(0)
obj.setInitialization(0)
else:
self.reportError('"Initialisation" attribute must be boolean ("true", "1", "false", "0")')
self.reportError('"Initialization" attribute must be boolean ("true", "1", "false", "0")')
val = attrs.get('TwinPointer', None)
if val is not None:
obj.setTwinpointer(val)

View File

@ -60,7 +60,7 @@ public:
static PyObject * richCompare(PyObject *v, PyObject *w, int op);
-
static PyGetSetDef GetterSetter[];
virtual PyTypeObject *GetType(void) {return &Type;};
virtual PyTypeObject *GetType(void) {return &Type;}
public:
@self.export.Name@(@self.export.TwinPointer@ *pcObject, PyTypeObject *T = &Type);
@ -68,9 +68,9 @@ public:
virtual int PyInit(PyObject* args, PyObject*k);
~@self.export.Name@();
+ if (self.export.Initialisation):
int initialisation();
int deinitialisation();
+ if (self.export.Initialization):
int initialization();
int finalization();
-
typedef @self.export.TwinPointer@* PointerType ;
@ -612,8 +612,8 @@ int @self.export.Name@::staticCallback_set@i.Name@ (PyObject *self, PyObject *va
pcObject->ref();
-
+ if (self.export.Initialisation):
initialisation();
+ if (self.export.Initialization):
initialization();
-
}
@ -645,8 +645,8 @@ int @self.export.Name@::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
@self.export.Name@::PointerType ptr = static_cast<@self.export.Name@::PointerType>(_pcTwinPointer);
delete ptr;
-
+ if (self.export.Initialisation):
deinitialisation();
+ if (self.export.Initialization):
finalization();
-
}
@ -820,12 +820,12 @@ int @self.export.Name@::PyInit(PyObject* /*args*/, PyObject* /*kwd*/)
}
-
+ if (self.export.Initialisation):
int @self.export.Name@::initialisation()
+ if (self.export.Initialization):
int @self.export.Name@::initialization()
{
return 0;
}
int @self.export.Name@::deinitialisation()
int @self.export.Name@::finalization()
{
return 0;
}