py3: Part: Gui: gathering commits from python3-branch
This commit is contained in:
@@ -83,7 +83,7 @@ class CommandEditAttachment:
|
||||
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_()
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ except ImportError as err:
|
||||
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
|
||||
@@ -583,7 +583,7 @@ class AttachmentEditorTaskPanel(FrozenClass):
|
||||
# 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))
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user