FEM: solver framework, two checks for _dirTypes

This commit is contained in:
joha2
2018-01-09 07:29:08 +01:00
committed by Bernd Hahnebach
parent 6a15a2f31e
commit 90f3aada2d

View File

@@ -59,7 +59,7 @@ def getMachine(solver, path=None):
def _isPathValid(m, path):
t = _dirTypes[m.directory]
t = _dirTypes.get(m.directory) # setting default None
setting = settings.getDirSetting()
if path is not None:
return t is None and m.directory == path
@@ -94,7 +94,7 @@ def _createMachine(solver, path, testmode):
_dirTypes[path] = settings.CUSTOM
m = solver.Proxy.createMachine(solver, path, testmode)
oldMachine = _machines.get(solver)
if oldMachine is not None:
if oldMachine is not None and _dirTypes.get(oldMachine.directory) is not None:
del _dirTypes[oldMachine.directory]
_machines[solver] = m
return m