Permalink
Browse files

Changing how PluginManagers are used, now returned by all straight.pl…

…ugin loaders.
  • Loading branch information...
1 parent 986b31f commit 0a3596ca468a7490a291b95be6e7c17c1fcbc443 @ironfroggy committed Jul 2, 2012
Showing with 3 additions and 5 deletions.
  1. +3 −5 jules/__init__.py
View
8 jules/__init__.py
@@ -6,7 +6,7 @@
import shutil
import yaml
-from straight.plugin.manager import PluginManager
+from straight.plugin import load
import jinja2
import jules
@@ -24,7 +24,6 @@ def __init__(self, src_path):
self.bundles = {}
self._new_bundles = {}
self.context = {}
- self.plugins = PluginManager()
self.config = {}
def load_config(self):
@@ -127,7 +126,7 @@ def get_template(self, name):
return self._jinja_env.get_template(name)
def load_plugins(self, ns='jules.plugins'):
- self.plugins.load(ns)
+ self.plugins = load(ns)
self.plugins._plugins.sort(key=lambda p: getattr(p, 'plugin_order', 0))
def middleware(self, method, *args, **kwargs):
@@ -250,8 +249,7 @@ def _prepare_render(self, engine):
content = None
def _prepare_contents(self):
ext_plugins = {}
- content_plugins = PluginManager()
- content_plugins.load('jules.plugins', subclasses=jules.plugins.ContentPlugin)
+ content_plugins = load('jules.plugins', subclasses=jules.plugins.ContentPlugin)
for plugin in content_plugins:
for ext in plugin.extensions:
ext_plugins[ext] = plugin()

0 comments on commit 0a3596c

Please sign in to comment.