No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

lefactory_common.py 1.1KB

123456789101112131415161718192021222324252627282930313233343536
  1. #-
  2. #- THE CONTENT OF THIS FILE IS DESIGNED TO BE INCLUDED IN DYNAMICALLY
  3. #- GENERATED CODE
  4. #-
  5. #- All lines that begins with #- will be deleted from dynamically generated
  6. #- code...
  7. ##@brief Return a dynamically generated class given it's name
  8. #@param name str : The dynamic class name
  9. #@return False or a child class of LeObject
  10. def name2class(name):
  11. if name not in dynclasses_dict:
  12. return False
  13. return dynclasses_dict[name]
  14. ##@brief Return a dynamically generated class given it's name
  15. #@note Case insensitive version of name2class
  16. #@param name str
  17. #@return False or a child class of LeObject
  18. def lowername2class(name):
  19. name = name.lower()
  20. new_dict = {k.lower():v for k,v in dynclasses_dict.items()}
  21. if name not in new_dict:
  22. return False
  23. return new_dict[name]
  24. ##@brief Trigger dynclasses datasources initialisation
  25. @LodelHook("lodel2_plugins_loaded")
  26. def lodel2_dyncode_datasources_init(self, caller, payload):
  27. for cls in dynclasses:
  28. cls._init_datasources()
  29. LodelContext.expose_modules(globals(), {'lodel.plugin.hooks': ['LodelHook']})
  30. LodelHook.call_hook("lodel2_dyncode_loaded", __name__, dynclasses)