add InitError exception
This commit is contained in:
parent
3f0dc2ad9a
commit
e1e8169985
2 changed files with 15 additions and 0 deletions
|
@ -35,6 +35,7 @@ from edbob.configuration import (
|
|||
default_system_paths,
|
||||
default_user_paths,
|
||||
)
|
||||
from edbob.exceptions import InitError
|
||||
|
||||
|
||||
__all__ = ['init']
|
||||
|
@ -90,6 +91,8 @@ def init(appname='edbob', *args, **kwargs):
|
|||
for name in modules.split(','):
|
||||
name = name.strip()
|
||||
module = __import__(name, globals(), locals(), fromlist=['init'])
|
||||
if not hasattr(module, 'init'):
|
||||
raise InitError(module)
|
||||
getattr(module, 'init')(config)
|
||||
# config.inited.append(name)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue