Skip to content
This repository
Browse code

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

…ugin loaders.
  • Loading branch information...
commit 0a3596ca468a7490a291b95be6e7c17c1fcbc443 1 parent 986b31f
ironfroggy authored July 01, 2012

Showing 1 changed file with 3 additions and 5 deletions. Show diff stats Hide diff stats

  1. 8  jules/__init__.py
8  jules/__init__.py
@@ -6,7 +6,7 @@
6 6
 import shutil
7 7
 
8 8
 import yaml
9  
-from straight.plugin.manager import PluginManager
  9
+from straight.plugin import load
10 10
 import jinja2
11 11
 
12 12
 import jules
@@ -24,7 +24,6 @@ def __init__(self, src_path):
24 24
         self.bundles = {}
25 25
         self._new_bundles = {}
26 26
         self.context = {}
27  
-        self.plugins = PluginManager()
28 27
         self.config = {}
29 28
 
30 29
     def load_config(self):
@@ -127,7 +126,7 @@ def get_template(self, name):
127 126
         return self._jinja_env.get_template(name)
128 127
 
129 128
     def load_plugins(self, ns='jules.plugins'):
130  
-        self.plugins.load(ns)
  129
+        self.plugins = load(ns)
131 130
         self.plugins._plugins.sort(key=lambda p: getattr(p, 'plugin_order', 0))
132 131
 
133 132
     def middleware(self, method, *args, **kwargs):
@@ -250,8 +249,7 @@ def _prepare_render(self, engine):
250 249
     content = None
251 250
     def _prepare_contents(self):
252 251
         ext_plugins = {}
253  
-        content_plugins = PluginManager()
254  
-        content_plugins.load('jules.plugins', subclasses=jules.plugins.ContentPlugin)
  252
+        content_plugins = load('jules.plugins', subclasses=jules.plugins.ContentPlugin)
255 253
         for plugin in content_plugins:
256 254
             for ext in plugin.extensions:
257 255
                 ext_plugins[ext] = plugin()

0 notes on commit 0a3596c

Please sign in to comment.
Something went wrong with that request. Please try again.