refs #579 do not load modules unconditionally, look for everything in the module paths
parent
53f44ad3ab
commit
0cadbf3381
|
|
@ -4,7 +4,7 @@ address=0.0.0.0
|
||||||
port=8000
|
port=8000
|
||||||
|
|
||||||
# This is a comma separated list of paths where to look for modules to load
|
# This is a comma separated list of paths where to look for modules to load
|
||||||
path=test_modules/server
|
#path=test_modules/server,more_modules/server
|
||||||
|
|
||||||
# Remote OpenGnsys Service
|
# Remote OpenGnsys Service
|
||||||
remote=https://192.168.2.10/opengnsys/rest
|
remote=https://192.168.2.10/opengnsys/rest
|
||||||
|
|
@ -21,7 +21,7 @@ log=DEBUG
|
||||||
# The sections must match the module name
|
# The sections must match the module name
|
||||||
# This section will be passes on activation to module
|
# This section will be passes on activation to module
|
||||||
[ogAdmClient]
|
[ogAdmClient]
|
||||||
#path=test_modules/server
|
#path=test_modules/server,more_modules/server
|
||||||
## this URL will probably be left equal to the other one, but let's see
|
## this URL will probably be left equal to the other one, but let's see
|
||||||
remote=https://192.168.2.10/opengnsys/rest
|
remote=https://192.168.2.10/opengnsys/rest
|
||||||
log=DEBUG
|
log=DEBUG
|
||||||
|
|
|
||||||
|
|
@ -35,6 +35,7 @@
|
||||||
# Modules under "opengsnsys/modules" are always autoloaded
|
# Modules under "opengsnsys/modules" are always autoloaded
|
||||||
|
|
||||||
|
|
||||||
|
import sys
|
||||||
import pkgutil
|
import pkgutil
|
||||||
import os.path
|
import os.path
|
||||||
|
|
||||||
|
|
@ -55,12 +56,10 @@ def loadModules(controller, client=False):
|
||||||
ogModules = []
|
ogModules = []
|
||||||
|
|
||||||
if client is False:
|
if client is False:
|
||||||
from opengnsys.modules.server import OpenGnSys # @UnusedImport
|
|
||||||
from .modules import server # @UnusedImport, just used to ensure opengnsys modules are initialized
|
from .modules import server # @UnusedImport, just used to ensure opengnsys modules are initialized
|
||||||
modPath = 'opengnsys.modules.server'
|
modPath = 'opengnsys.modules.server'
|
||||||
modType = ServerWorker
|
modType = ServerWorker
|
||||||
else:
|
else:
|
||||||
from opengnsys.modules.client import OpenGnSys # @UnusedImport @Reimport
|
|
||||||
from .modules import client # @UnusedImport, just used to ensure opengnsys modules are initialized
|
from .modules import client # @UnusedImport, just used to ensure opengnsys modules are initialized
|
||||||
modPath = 'opengnsys.modules.client'
|
modPath = 'opengnsys.modules.client'
|
||||||
modType = ClientWorker
|
modType = ClientWorker
|
||||||
|
|
@ -98,7 +97,7 @@ def loadModules(controller, client=False):
|
||||||
else:
|
else:
|
||||||
paths = ()
|
paths = ()
|
||||||
|
|
||||||
# paths += (os.path.dirname(sys.modules[modPath].__file__),)
|
paths += (os.path.dirname(sys.modules[modPath].__file__),)
|
||||||
|
|
||||||
# Load modules
|
# Load modules
|
||||||
logger.debug('Loading modules from {}'.format(paths))
|
logger.debug('Loading modules from {}'.format(paths))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue