Completed
Push — master ( e004f0...1a0efd )
by Daniel
01:07
created

ThreadPlugin.thread_func()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 1
c 1
b 1
f 0
dl 0
loc 3
rs 10
1
from groundwork.patterns import GwThreadsPattern
2
3
4
class ThreadPlugin(GwThreadsPattern):
5
    def __init__(self, *args, **kwargs):
6
        self.name = self.__class__.__name__
7
        super().__init__(*args, **kwargs)
8
9
    def activate(self):
10
        self.threads.register("test_thread", self.thread_func, description="Test Thread")
11
12
    def thread_func(self, plugin, **kwargs):
13
        print("Thread executed by %s" % plugin.name)
14
        return "Done"
15
16
    def deactivate(self):
17
        pass
18