View Issue Details

IDProjectCategoryView StatusLast Update
0001151DraftBugpublic2013-07-01 09:36
ReporterwmayerAssigned Toyorik 
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version 
Target Version0.14Fixed in Version0.14 
Summary0001151: Draft and Arch module load Part module at program start
DescriptionAt startup modules shouldn't load such "heavy" modules like the Part module because this depends on a long list of OCC libs and delays the startup significantly.

For both the Part module is loaded by the InitGui.py file. The chain is:
InitGui.py > DraftTools > importSVG > DraftGeomUtils > Part
TagsNo tags attached.

Activities

yorik

2013-06-15 14:17

administrator   ~0003215

Ooh good catch! I had missed that one. Thanks! I'll fix it at once...

yorik

2013-06-15 16:35

administrator   ~0003216

Fixed in commit 31fbfd3
May I ask how you discovered? I always have difficulty to follow that kind of import chains and see what imports what and when...

wmayer

2013-06-15 17:14

administrator   ~0003217

The first step is to make a workbench the default that does not depend on Part, e.g. the Mesh workbench.

Then close FreeCAD and set a breakpoint into the function initPart(). Start FreeCAD with the debugger, you will see that it enters this function.

The second step is to modify the initPart() function that it raises an exception every time when you want to import it. This way you'll see at startup of FreeCAD which scripts tried to load Part. It appeared to be InitGui.py of Draft and Arch.

In order to see how the import chain is you need a Python with debug information. If you go up the stack trace you'll see in the argument of a function (I don't remember its name atm) which module loads Part. Then go again up the stack trace to see which other modules loads the module that loads Part, and so on.

I don't know if there is a better way than this.

yorik

2013-06-15 18:06

administrator   ~0003219

Thanks for the explanation!

wmayer

2013-07-01 09:36

administrator   ~0003306

It's fixed!

Issue History

Date Modified Username Field Change
2013-06-15 13:56 wmayer New Issue
2013-06-15 13:56 wmayer Status new => assigned
2013-06-15 13:56 wmayer Assigned To => yorik
2013-06-15 14:17 yorik Note Added: 0003215
2013-06-15 16:35 yorik Note Added: 0003216
2013-06-15 17:14 wmayer Note Added: 0003217
2013-06-15 18:06 yorik Note Added: 0003219
2013-07-01 09:36 wmayer Note Added: 0003306
2013-07-01 09:36 wmayer Status assigned => closed
2013-07-01 09:36 wmayer Resolution open => fixed
2013-07-01 09:36 wmayer Fixed in Version => 0.14