Update settingsManager.py

This commit is contained in:
chrys87 2016-10-05 11:14:01 +02:00 committed by GitHub
parent 203266af18
commit 491b981f03

View File

@ -6,6 +6,7 @@
import importlib.util
import os
import __main__
from configparser import ConfigParser
from core import inputManager
from core import outputManager
@ -128,7 +129,7 @@ class settingsManager():
if self.env['runtime'][driverType] != None:
print('shutdown %s',driverType)
self.env['runtime'][driverType].shutdown(self.env)
spec = importlib.util.spec_from_file_location(driverName, driverType + '/' + driverName + '.py')
spec = importlib.util.spec_from_file_location(driverName, os.path.dirname(os.path.realpath(__main__.__file__)) + "/" + driverType + '/' + driverName + '.py')
driver_mod = importlib.util.module_from_spec(spec)
spec.loader.exec_module(driver_mod)
self.env['runtime'][driverType] = driver_mod.driver()