mirror of
https://github.com/Pardus-LiderAhenk/ahenk
synced 2024-11-23 10:12:18 +03:00
27 lines
838 B
Python
27 lines
838 B
Python
#!/usr/bin/python3
|
|
# -*- coding: utf-8 -*-
|
|
# Author: İsmail BAŞARAN <ismail.basaran@tubitak.gov.tr> <basaran.ismaill@gmail.com>
|
|
import threading
|
|
from base.Scope import Scope
|
|
|
|
class Plugin(threading.Thread):
|
|
"""docstring for Plugin"""
|
|
def __init__(self, name,InQueue):
|
|
super(Plugin, self).__init__()
|
|
self.name = name
|
|
self.InQueue = InQueue
|
|
self.scope=Scope.getInstance()
|
|
self.pluginManager = self.scope.getPluginManager()
|
|
|
|
def run():
|
|
try:
|
|
task=self.InQueue.get()
|
|
command = self.pluginManager.findCommand(task.getCommandId())
|
|
command.handle_task(task)
|
|
# TODO add result to response queue
|
|
|
|
except Exception as e:
|
|
print("exception occured when executing plugin")
|
|
|
|
def getName(self):
|
|
return self.name
|