Fixing up for 2.0 release

This commit is contained in:
Adolfo Gómez García 2016-04-04 07:24:30 +02:00
parent c606b6f00e
commit 489bb44c92
2 changed files with 2 additions and 17 deletions

View File

@ -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

View File

@ -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