1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-12-03 17:26:54 +01:00

loader enhancement

This commit is contained in:
Yann 2016-06-01 16:58:00 +02:00
commit 43911cdfe4
2 changed files with 16 additions and 2 deletions

View file

@ -11,7 +11,7 @@ if LODEL2_LIB_ABS_PATH is not None:
try:
import lodel
except ImportError:
print("Unable to load lodel module. exiting...", file = sys.stderr)
print("Unable to load lodel module. exiting...")
exit(1)
@ -27,10 +27,21 @@ from lodel.settings import Settings
from lodel.plugin import Plugin
Plugin.load_all()
from lodel.plugin import LodelHook
LodelHook.call_hook('lodel2_bootstraped', '__main__', None)
def start():
#Importing dynamic code classes in lodel.leapi
import leapi_dyncode
import lodel.leapi
for cls in leapi_dyncode.dynclasses:
setattr(lodel.leapi, cls.__name__, cls)
LodelHook.call_hook('lodel2_bootstraped', '__main__', None)
if __name__ == '__main__':
start()
LodelHook.call_hook('lodel2_loader_main', '__main__', None)
#Run interative python
import code

View file

@ -6,5 +6,8 @@ __author__ = "Lodel2 dev team"
__fullname__ = "Dummy plugin"
##@brief This methods allow plugin writter to write some checks
#
#@return True if checks are OK else return a string with a reason
def _activate():
return True