Thing: Use a hook for on_thing_commit.

This commit is contained in:
Neil Williams
2013-03-21 13:25:21 -07:00
parent 5bd81b5f6e
commit f7f5d26d3e
2 changed files with 2 additions and 8 deletions

View File

@@ -35,7 +35,7 @@ from .. utils import iters, Results, tup, to36, Storage, thing_utils, timefromno
from r2.config import cache
from r2.lib.cache import sgm
from r2.lib.log import log_text
from r2.lib import stats
from r2.lib import stats, hooks
from pylons import g
@@ -297,7 +297,7 @@ class DataThing(object):
if lock:
lock.release()
g.plugins.on_thing_commit(self, to_set)
hooks.get_hook("thing.commit").call(thing=self, changes=to_set)
@classmethod
def _load_multi(cls, need):

View File

@@ -78,8 +78,6 @@ class Plugin(object):
def load_controllers(self):
pass
def on_thing_commit(self, thing, changes):
pass
class PluginLoader(object):
@@ -149,7 +147,3 @@ class PluginLoader(object):
def load_controllers(self):
for plugin in self:
plugin.load_controllers()
def on_thing_commit(self, thing, changes):
for plugin in self:
plugin.on_thing_commit(thing, changes)