Package: freecad / 0.14.3702+dfsg-3

use_share.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
Index: freecad/src/App/FreeCADInit.py
===================================================================
--- freecad.orig/src/App/FreeCADInit.py
+++ freecad/src/App/FreeCADInit.py
@@ -43,6 +43,8 @@ def InitApplications():
 	# Checking on FreeCAD module path ++++++++++++++++++++++++++++++++++++++++++
 	ModDir = FreeCAD.getHomePath()+'Mod'
 	ModDir = os.path.realpath(ModDir)
+	ModShareDir = '/usr/share/freecad/Mod'
+	ModShareDir = os.path.realpath(ModShareDir)
 	BinDir = FreeCAD.getHomePath()+'bin'
 	BinDir = os.path.realpath(BinDir)
 	LibDir = FreeCAD.getHomePath()+'lib'
@@ -65,6 +67,14 @@ def InitApplications():
 		for i in ModDirs: ModDict[i.lower()] = os.path.join(ModDir,i)
 	else:
 		Wrn ("No modules found in " + ModDir + "\n")
+
+	if os.path.isdir(ModShareDir):
+		Log("")
+		ModDirs = os.listdir(ModShareDir)
+		for i in ModDirs: ModDict[i.lower()] = os.path.join(ModShareDir,i)
+	else:
+		Wrn ("No modules found in " + ModShareDir + "\n")
+
 	# Search for additional modules in the home directory
 	if os.path.isdir(HomeMod):
 		HomeMods = os.listdir(HomeMod)
@@ -105,6 +115,8 @@ def InitApplications():
 	sys.path.insert(0,LibDir)
 	sys.path.insert(0,ModDir)
 	Log("Using "+ModDir+" as module path!\n")
+	sys.path.insert(0,ModShareDir)
+	Log("Using "+ModShareDir+" as module path!\n")
 	# new paths must be prepended to avoid to load a wrong version of a library
 	try:
 		os.environ["PATH"] = PathExtension + os.environ["PATH"]