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

12345678910111213141516171819202122232425262728293031323334
  1. #-*- coding: utf-8 -*-
  2. from lodel.plugin import LodelHook, CustomMethod
  3. @LodelHook('leapi_get_post')
  4. @LodelHook('leapi_update_pre')
  5. @LodelHook('leapi_update_post')
  6. @LodelHook('leapi_delete_pre')
  7. @LodelHook('leapi_delete_post')
  8. @LodelHook('leapi_insert_pre')
  9. @LodelHook('leapi_insert_post')
  10. def dummy_callback(hook_name, caller, payload):
  11. if Lodel.settings.Settings.debug:
  12. print("\tHook %s\tcaller %s with %s" % (hook_name, caller, payload))
  13. return payload
  14. @CustomMethod('Object', 'dummy_method')
  15. def dummy_instance_method(self):
  16. print("Hello world !\
  17. I'm a custom method on an instance of class %s" % self.__class__)
  18. @CustomMethod('Object', 'dummy_class_method', CustomMethod.CLASS_METHOD)
  19. def dummy_instance_method(self):
  20. print("Hello world !\
  21. I'm a custom method on class %s" % self.__class__)
  22. @LodelHook('lodel2_loader_main')
  23. def foofun(hname, caller, payload):
  24. from lodel import dyncode
  25. print("Hello world ! I read dyncode from lodel.dyncode : ",
  26. dyncode.dynclasses)