diff options
Diffstat (limited to 'module/PluginThread.py')
-rw-r--r-- | module/PluginThread.py | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py index 35ad796b3..d17f638f0 100644 --- a/module/PluginThread.py +++ b/module/PluginThread.py @@ -263,5 +263,38 @@ class HookThread(PluginThread): self.active.finishIfDone() - -
\ No newline at end of file +######################################################################## +class InfoThread(PluginThread): + + #---------------------------------------------------------------------- + def __init__(self, manager): + """Constructor""" + PluginThread.__init__(self, manager) + + self.queue = Queue() # job queue + self.active = False + + self.start() + + #---------------------------------------------------------------------- + def run(self): + """run method""" + + while True: + self.active = self.queue.get() + if self.active == "quit": + return True + pyfile = self.active + + pyfile.plugin.getInfo() + + #---------------------------------------------------------------------- + def put(self, job): + """assing job to thread""" + self.queue.put(job) + + #---------------------------------------------------------------------- + def stop(self): + """stops the thread""" + self.put("quit") + |