diff piecrust/app.py @ 848:7d83b9484b98

plugins: Add support for "ad-hoc" local plugins. These are loose `.py` files inside of the `plugins` folder of a website. They're loaded along with other normal (packaged) plugins.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 27 Apr 2017 20:54:29 -0700
parents 69d16e1afb95
children 4850f8c21b6e 46025a1b5434
line wrap: on
line diff
--- a/piecrust/app.py	Thu Apr 27 20:53:18 2017 -0700
+++ b/piecrust/app.py	Thu Apr 27 20:54:29 2017 -0700
@@ -7,7 +7,7 @@
 from piecrust import (
         RESOURCES_DIR,
         CACHE_DIR, TEMPLATES_DIR, ASSETS_DIR,
-        THEME_DIR,
+        THEME_DIR, PLUGINS_DIR,
         CONFIG_PATH, THEME_CONFIG_PATH)
 from piecrust.appconfig import PieCrustConfiguration
 from piecrust.cache import ExtensibleCache, NullExtensibleCache
@@ -127,6 +127,10 @@
         return os.path.join(RESOURCES_DIR, 'theme')
 
     @cached_property
+    def plugins_dir(self):
+        return self._get_dir(PLUGINS_DIR)
+
+    @cached_property
     def cache_dir(self):
         return os.path.join(self.root_dir, CACHE_DIR, self.cache_key)