From 4344fb664864b157ac397ea210a7b34eaf3b275f Mon Sep 17 00:00:00 2001 From: RaNaN Date: Thu, 7 Jul 2011 11:16:06 +0200 Subject: basic event manager --- module/database/FileDatabase.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'module/database/FileDatabase.py') diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py index 0ed526240..c77bf5e95 100644 --- a/module/database/FileDatabase.py +++ b/module/database/FileDatabase.py @@ -115,12 +115,14 @@ class FileHandler: @change def addLinks(self, urls, package): """adds links""" - + + self.core.hookManager.dispatchEvent("linksAdded", urls, package) + data = self.core.pluginManager.parseUrls(urls) self.db.addLinks(data, package) self.core.threadManager.createInfoThread(data, package) - + #@TODO change from reloadAll event to package update event self.core.pullManager.addEvent(ReloadAllEvent("collector")) @@ -158,6 +160,7 @@ class FileHandler: self.db.deletePackage(p) self.core.pullManager.addEvent(e) + self.core.hookManager.dispatchEvent("packageDeleted", id) if self.packageCache.has_key(id): del self.packageCache[id] @@ -183,7 +186,7 @@ class FileHandler: del self.cache[id] self.db.deleteLink(f) - + self.core.pullManager.addEvent(e) p = self.getPackage(pid) -- cgit v1.2.3