]> oss.titaniummirror.com Git - webber.git/commitdiff
webber.py: add plugin_dirs[] configuration
authorHolger Schurig <holgerschurig@gmail.com>
Fri, 16 Apr 2010 08:59:22 +0000 (10:59 +0200)
committerHolger Schurig <holgerschurig@gmail.com>
Fri, 16 Apr 2010 08:59:22 +0000 (10:59 +0200)
in/configuration.md
in/plugins/index.md
webber.py

index ed5648f7f4f2bfb18f4418e6e46267be924349b4..4e785c9039ae08cce9a00b6f3f09284b5379ab83 100644 (file)
@@ -27,6 +27,9 @@ Webber expects a `webber.conf` file in it's root directory. It should look like
                "read_markdown",
                "template_mako",
                ]
+       plugin_dirs: [
+               "my_plugins"
+               ]
        exclude_dir: [
                "webber.conf",
                "*.tmpl",
@@ -65,7 +68,12 @@ Encoding ('utf-8', 'iso-8859-1' etc) used when writing the final HTML pages.
 
 == plugins ==
 
-List of [[plugins]] to load.
+List of  to load.
+
+== plugin_dirs ==
+
+List of directories that should be search for [[plugins]]. Can be empty or
+completely omitted.
 
 == exclude_dirs ==
 
index 176cde1faea168f000ccaf0556f6d677a74d287c..bbf30a345db9375f45e55af9cfbcd993a3a7f087 100644 (file)
@@ -17,10 +17,13 @@ to plugins. Those plugins do:
 There's another plugin there ([[skeleton.py|skeleton]]), which is
 is just a demo for plugin-programmers.
 
-Plugins simply reside in the "`plugins/`" directory. However, webber
-doesn't load all of them automatically. Instead you specify in the
-configuration file [[webber.conf|configuration]] which
-plugins you want.
+Plugins simply reside in the "`plugins/`" directory from webber itself. If your
+web project needs local plugins, you can specifiy additional plugins with
+"`plugin_dirs`" in [[webber.conf|configuration]].
+
+Note that webber doesn't load all of them automatically. Instead you specify
+in the configuration file [[webber.conf|configuration]] which plugins you
+want. Use the variable "`plugins`" for that.
 
 Once plugins are loaded, webber orchestrates the work of itself and
 all plugins via [[hooks]].
index 73f9e73d43eea65335428d6c94fa65292a1a8690..9b3d0728baa2af88b79360fc1a0fddb0d8b16990 100644 (file)
--- a/webber.py
+++ b/webber.py
@@ -337,6 +337,9 @@ hooks = {}
 def load_plugins():
        """Loads all plugins in the plugins directory."""
        sys.path.append(os.path.join(get_program_directory(), "plugins"))
+       if cfg.has_key("plugin_dirs"):
+               for s in cfg.plugin_dirs:
+                       sys.path.append(s)
        for s in cfg.plugins:
                #print "import:", s
                try: