Skip to content

Commit

Permalink
py3: Part: Gui: gathering commits from python3-branch
Browse files Browse the repository at this point in the history
  • Loading branch information
looooo committed Mar 1, 2017
1 parent 69828c2 commit 8b45976
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Mod/Part/AttachmentEditor/Commands.py
Expand Up @@ -83,7 +83,7 @@ def Activated(self):
from PySide import QtGui
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(err.message)
mb.setText(str(err))
mb.setWindowTitle("Error")
mb.exec_()

Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Part/AttachmentEditor/TaskAttachmentEditor.py
Expand Up @@ -40,7 +40,7 @@ def TempoVis(doc):
def getAllDependent(feature):
return []
App.Console.PrintWarning("AttachmentEditor: Failed to import some code from Show module. Functionality will be limited.\n")
App.Console.PrintWarning(err.message)
App.Console.PrintWarning(str(err))

if App.GuiUp:
import FreeCADGui as Gui
Expand Down Expand Up @@ -583,7 +583,7 @@ def updatePreview(self):
# when entering and extiting dialog without changing anything
self.obj.Placement = new_plm
except Exception as err:
self.form.message.setText(_translate('AttachmentEditor',"Error: {err}",None).format(err= err.message))
self.form.message.setText(_translate('AttachmentEditor',"Error: {err}",None).format(err= str(err)))

if new_plm is not None:
self.form.groupBox_superplacement.setTitle(_translate('AttachmentEditor',"Extra placement:",None))
Expand Down
6 changes: 6 additions & 0 deletions src/Mod/Part/Gui/AppPartGui.cpp
Expand Up @@ -122,8 +122,14 @@ PyMOD_INIT_FUNC(PartGui)

Base::Console().Log("Loading GUI of Part module... done\n");

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef pAttachEngineTextsModuleDef = {PyModuleDef_HEAD_INIT,"AttachEngineResources", "AttachEngineResources", -1, 0};
PyObject* pAttachEngineTextsModule = PyModule_Create(&pAttachEngineTextsModuleDef);
#else
PyObject* pAttachEngineTextsModule = Py_InitModule3("AttachEngineResources", AttacherGui::AttacherGuiPy::Methods,
"AttachEngine Gui resources");
#endif

Py_INCREF(pAttachEngineTextsModule);
PyModule_AddObject(partGuiModule, "AttachEngineResources", pAttachEngineTextsModule);

Expand Down

0 comments on commit 8b45976

Please sign in to comment.