Skip to content

Commit 143c5d1

Browse files
committed
[Gui] remove/replace deprecated imp module for module import test
1 parent 66a261f commit 143c5d1

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

python/mor/gui/ui_mor.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,15 @@
3838
path = os.path.dirname(os.path.abspath(__file__))
3939

4040
try:
41-
import imp
42-
imp.find_module('mor')
43-
except:
44-
sys.path.append(path+'/../../') # TEMPORARY
45-
# raise ImportError("You need to give to PYTHONPATH the path to the python folder\n"\
46-
# +"of the modelorderreduction plugin in order to use this utility\n"\
47-
# +"Enter this command in your terminal (for temporary use) or in your .bashrc to resolve this:\n"\
48-
# +"export PYTHONPATH=/PathToYourMOR/python")
41+
import mor
42+
except ModuleNotFoundError as err:
43+
sys.path.append(path+'/../../')
44+
print(err)
45+
print("mor added automatically to sys.path")
46+
# print("You need to give to PYTHONPATH the path to the python folder\n"\
47+
# +"of the modelorderreduction plugin in order to use this utility\n"\
48+
# +"Enter this command in your terminal (for temporary use) or in your .bashrc to resolve this:\n"\
49+
# +"export PYTHONPATH=/PathToYourMOR/python")
4950

5051
#### MOR IMPORT ####
5152
# This file holds our MainWindow and all design related things
@@ -313,7 +314,7 @@ def checkPhases(self):
313314
phasesFile = [
314315
["/debug/debug_scene.py","/debug/stateFile.state"],
315316
["/data/modes.txt"],
316-
["/debug/reducedFF_*","/debug/*_elmts.txt"], #["/debug/step2_stateFile.state",
317+
["/debug/reducedFF_*"], #["/debug/step2_stateFile.state",
317318
["/data/*_RID.txt","/data/*_weight.txt","/reduced_*"]
318319
]
319320

0 commit comments

Comments
 (0)