mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 08:17:58 -05:00
Plugins: make on_load take "g" so it can add stuff to globals.
This commit is contained in:
@@ -55,7 +55,7 @@ class Plugin(object):
|
||||
def static_dir(self):
|
||||
return os.path.join(self.path, 'public')
|
||||
|
||||
def on_load(self):
|
||||
def on_load(self, g):
|
||||
pass
|
||||
|
||||
def add_js(self, module_registry=None):
|
||||
@@ -142,7 +142,7 @@ class PluginLoader(object):
|
||||
g.config.add_spec(plugin.config)
|
||||
config['pylons.paths']['templates'].insert(0, plugin.template_dir)
|
||||
plugin.add_js()
|
||||
plugin.on_load()
|
||||
plugin.on_load(g)
|
||||
|
||||
def load_controllers(self):
|
||||
for plugin in self:
|
||||
|
||||
Reference in New Issue
Block a user