Finishing the abstract trick class

This commit is contained in:
Anonymus Raccoon
2020-04-25 14:30:51 +02:00
parent 9bd4761369
commit fe649825ec
2 changed files with 17 additions and 3 deletions
+8
View File
@@ -2,5 +2,13 @@ from trick import Trick
class TestTrick(Trick):
@property
def name(self):
return "Test"
@property
def delay(self):
return 1
def run(self):
print("Test succeed")
+9 -3
View File
@@ -3,9 +3,15 @@ from abc import ABC, abstractmethod
class Trick(ABC):
def __init__(self):
self.name = "Undefined"
self.delay = 1
@property
@abstractmethod
def name(self):
raise NotImplementedError
@property
@abstractmethod
def delay(self):
return 1
@abstractmethod
def run(self):