Няма описание
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

1234567891011121314151617181920212223242526272829303132333435
  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 Returns a dynamically generated class given its 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 Returns a dynamically generated class given its 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 Triggers 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)