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.

sessionhandler.py 959B

12345678910111213141516171819202122232425262728
  1. from .plugins import Plugin
  2. from .exceptions import *
  3. from lodel.settings.validator import SettingValidator
  4. ##@page lodel2_plugins Lodel2 plugins system
  5. #
  6. # @par Plugin structure
  7. #A plugin is a package (a folder containing, at least, an __init__.py file.
  8. #This file should expose multiple things :
  9. # - a CONFSPEC variable containing configuration specifications
  10. # - an _activate() method that returns True if the plugin can be activated (
  11. # optionnal)
  12. #
  13. class SessionHandlerPlugin(Plugin):
  14. __instance = None
  15. _plist_confspecs = {
  16. 'section': 'lodel2',
  17. 'key': 'session_handler',
  18. 'default': None,
  19. 'validator': SettingValidator('string', none_is_valid=False)}
  20. def __init__(self, plugin_name):
  21. if self.__instance is None:
  22. super(Plugin, self).__init__(plugin_name)
  23. self.__instance = True
  24. else:
  25. raise RuntimeError("A SessionHandler Plugin is already plug")