From e1927e427125a93a8f6ea369b760f7f21f879fcc Mon Sep 17 00:00:00 2001 From: RaNaN Date: Sat, 19 Feb 2011 23:22:14 +0100 Subject: new permission system --- module/plugins/Hook.py | 8 +++++++- module/plugins/hooks/UpdateManager.py | 3 ++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'module/plugins') diff --git a/module/plugins/Hook.py b/module/plugins/Hook.py index 4bbf6e33a..56541f7fe 100644 --- a/module/plugins/Hook.py +++ b/module/plugins/Hook.py @@ -18,6 +18,12 @@ @interface-version: 0.2 """ +from thread import start_new_thread + +def threaded(f): + def run(*args,**kwargs): + return start_new_thread(f, args, kwargs) + return run class Hook(): __name__ = "Hook" @@ -39,7 +45,7 @@ class Hook(): self.setup() def __repr__(self): - return self.__name__ + return "" % self.__name__ def setup(self): """ more init stuff if needed""" diff --git a/module/plugins/hooks/UpdateManager.py b/module/plugins/hooks/UpdateManager.py index 70fd15fad..887aedbd1 100644 --- a/module/plugins/hooks/UpdateManager.py +++ b/module/plugins/hooks/UpdateManager.py @@ -20,7 +20,7 @@ from os.path import join from module.network.RequestFactory import getURL -from module.plugins.Hook import Hook +from module.plugins.Hook import threaded, Hook class UpdateManager(Hook): __name__ = "UpdateManager" @@ -35,6 +35,7 @@ class UpdateManager(Hook): self.interval = self.getConfig("interval") * 60 self.updated = False + @threaded def periodical(self): update = self.checkForUpdate() if not update: -- cgit v1.2.3