plugins.cfg.sample 983 B

1234567891011121314151617181920212223242526272829303132333435
  1. # This file demonstrates how to load plugins in pagure.
  2. # Pagure uses Flask Blueprints as plugins, so what we need to do is import all
  3. # the Blueprints into a variable called PLUGINS.
  4. # See the "Plugins" section in the pagure documentation for more information.
  5. ###############################################################################
  6. import os
  7. import sys
  8. # For plugins that are already available in sys.path, for example packages that
  9. # have been installed on the system, we simply import them
  10. import plugin1
  11. import plugin2
  12. ...
  13. # For any other custom plugin that is *not* in sys.path we need to add our
  14. # folder to sys.path first
  15. PLUGINS_PATH = "/path/to/plugins/folder/"
  16. if PLUGINS_PATH not in sys.path:
  17. sys.path.append(PLUGINS_PATH)
  18. # Then we can import all the plugins
  19. import myplugin1
  20. import myplugin2
  21. ...
  22. # Finally, create the PLUGINS list of Blueprints that we want pagure to register
  23. PLUGINS = [ plugin1.APP,
  24. myplugin2.APP,
  25. ... ]