Skip to content

Commit

Permalink
Renaming getPyDict to getPyObject for consistency with BaseClass
Browse files Browse the repository at this point in the history
  • Loading branch information
abdullahtahiriyo authored and wwmayer committed May 13, 2017
1 parent b410f88 commit a7bc962
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/Base/Exception.cpp
Expand Up @@ -98,7 +98,7 @@ void Exception::ReportException (void) const
Console().Error("Exception (%s): %s \n",Console().Time(),str.c_str());
}

PyObject * Exception::getPyDict() const
PyObject * Exception::getPyObject(void) const
{
PyObject *edict = PyDict_New();

Expand All @@ -112,7 +112,7 @@ PyObject * Exception::getPyDict() const
return edict;
}

void Exception::setPyDict( PyObject * pydict)
void Exception::setPyObject( PyObject * pydict)
{
if(pydict!=NULL) {
PyObject *pystring;
Expand Down Expand Up @@ -283,7 +283,7 @@ void FileException::ReportException (void) const
Console().Error("Exception (%s): %s \n",Console().Time(),str.c_str());
}

PyObject * FileException::getPyDict() const
PyObject * FileException::getPyObject(void) const
{
PyObject *edict = PyDict_New();

Expand All @@ -298,7 +298,7 @@ PyObject * FileException::getPyDict() const
return edict;
}

void FileException::setPyDict( PyObject * pydict)
void FileException::setPyObject( PyObject * pydict)
{
if(pydict!=NULL) {
PyObject *pystring;
Expand Down
8 changes: 4 additions & 4 deletions src/Base/Exception.h
Expand Up @@ -85,9 +85,9 @@ class BaseExport Exception : public BaseClass
/// intended to use via macro for autofilling of debugging information
inline void setDebugInformation(const std::string & file, const int line, const std::string & function);
/// returns a Python dictionary containing the exception data
virtual PyObject * getPyDict() const;
virtual PyObject * getPyObject(void) const;
/// returns sets the exception data from a Python dictionary
virtual void setPyDict( PyObject * pydict);
virtual void setPyObject( PyObject * pydict);

protected:
public: // FIXME: Remove the public keyword
Expand Down Expand Up @@ -193,9 +193,9 @@ class BaseExport FileException : public Exception
/// Get file name for use with tranlatable message
std::string getFileName() const;
/// returns a Python dictionary containing the exception data
virtual PyObject * getPyDict() const;
virtual PyObject * getPyObject(void) const;
/// returns sets the exception data from a Python dictionary
virtual void setPyDict( PyObject * pydict);
virtual void setPyObject( PyObject * pydict);
protected:
FileInfo file;
// necesary for what() legacy behaviour as it returns a buffer that can not be of a temporary object to be destroyed at end of what()
Expand Down
2 changes: 1 addition & 1 deletion src/Base/ExceptionFactory.h
Expand Up @@ -80,7 +80,7 @@ class BaseExport ExceptionProducer : public AbstractExceptionProducer
{
CLASS c;

c.setPyDict(pydict);
c.setPyObject(pydict);

throw c;
}
Expand Down
10 changes: 5 additions & 5 deletions src/Tools/generateTemplates/templateClassPyExport.py
Expand Up @@ -494,7 +494,7 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat
}
catch(const Base::Exception& e) // catch the FreeCAD exceptions
{
PyObject *edict = e.getPyDict();
PyObject *edict = e.getPyObject();
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADError, edict);
Expand Down Expand Up @@ -684,7 +684,7 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat
#ifndef DONT_CATCH_CXX_EXCEPTIONS
catch(const Base::Exception& e) // catch the FreeCAD exceptions
{
PyObject *edict = e.getPyDict();
PyObject *edict = e.getPyObject();
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADError, edict);
Expand Down Expand Up @@ -714,7 +714,7 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat
#else // DONT_CATCH_CXX_EXCEPTIONS
catch(const Base::Exception& e) // catch the FreeCAD exceptions
{
PyObject *edict = e.getPyDict();
PyObject *edict = e.getPyObject();
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADError, edict);
Expand Down Expand Up @@ -757,7 +757,7 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat
#ifndef DONT_CATCH_CXX_EXCEPTIONS
catch(const Base::Exception& e) // catch the FreeCAD exceptions
{
PyObject *edict = e.getPyDict();
PyObject *edict = e.getPyObject();
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADError, edict);
Expand Down Expand Up @@ -788,7 +788,7 @@ class @self.export.Namespace@Export @self.export.Name@ : public @self.export.Fat
#else // DONT_CATCH_CXX_EXCEPTIONS
catch(const Base::Exception& e) // catch the FreeCAD exceptions
{
PyObject *edict = e.getPyDict();
PyObject *edict = e.getPyObject();
e.ReportException();
PyErr_SetObject(Base::BaseExceptionFreeCADError, edict);
Expand Down

0 comments on commit a7bc962

Please sign in to comment.