Rename command/command_handler.py to command/command_interface.py
Browse files- command/command_handler.py +0 -15
- command/command_interface.py +15 -0
command/command_handler.py
DELETED
@@ -1,15 +0,0 @@
|
|
1 |
-
from typing import Optional
|
2 |
-
from abc import ABC, abstractmethod
|
3 |
-
|
4 |
-
|
5 |
-
class CommandHandler(ABC):
|
6 |
-
def __init__(self, successor: Optional["CommandHandler"] = None):
|
7 |
-
self.successor = successor
|
8 |
-
|
9 |
-
def handle_command(self, command):
|
10 |
-
if self.successor:
|
11 |
-
self.successor.handle_command(command)
|
12 |
-
|
13 |
-
@abstractmethod
|
14 |
-
def execute_command(self):
|
15 |
-
"""Method of processing command execution logic"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
command/command_interface.py
ADDED
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from typing import Optional, Dict
|
2 |
+
from abc import ABC, abstractmethod
|
3 |
+
|
4 |
+
|
5 |
+
class CommandHandler(ABC):
|
6 |
+
# {"base": {"name": command}, "advance": {"name": command}}
|
7 |
+
@abstractmethod
|
8 |
+
def get_command(path_to_command_file: str) -> Dict[str, Dict[str, list]]:
|
9 |
+
"Method to get command from yaml file and return dictionary"
|
10 |
+
pass
|
11 |
+
|
12 |
+
@abstractmethod
|
13 |
+
def execute(command: Dict[str, Dict[str, list]]):
|
14 |
+
"Method to execute command"
|
15 |
+
pass
|