mirror of
https://github.com/dkmstr/openuds.git
synced 2024-12-22 13:34:04 +03:00
Fixing up for 2.0 release
This commit is contained in:
parent
c606b6f00e
commit
489bb44c92
@ -79,8 +79,6 @@ class UDSAppConfig(AppConfig):
|
||||
from . import plugins # To make sure plugins are loaded on memory
|
||||
from . import REST # To make sure REST initializes all what it needs
|
||||
|
||||
plugins.appLoaded()
|
||||
|
||||
import uds.xmlrpc # To make actor live
|
||||
|
||||
|
||||
|
@ -33,31 +33,18 @@ import logging
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
__plugins = []
|
||||
|
||||
def __init__():
|
||||
'''
|
||||
This imports all packages that are descendant of this package, and, after that,
|
||||
it register all subclases of service provider as
|
||||
'''
|
||||
global __plugins
|
||||
import os.path, pkgutil
|
||||
import sys
|
||||
logger.debug('Importing plugins')
|
||||
|
||||
logger.debug('Initializing plugins')
|
||||
|
||||
# Dinamycally import children of this package. The __init__.py files must import classes
|
||||
pkgpath = os.path.dirname(sys.modules[__name__].__file__)
|
||||
for _, name, _ in pkgutil.iter_modules([pkgpath]):
|
||||
__plugins.append(__import__(name, globals(), locals(), [], -1))
|
||||
__import__(name, globals(), locals(), [], -1)
|
||||
|
||||
__init__()
|
||||
|
||||
def appLoaded():
|
||||
global __plugins
|
||||
for m in __plugins:
|
||||
try:
|
||||
m.appLoaded()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user