Rename command/utils/read_yaml.py to command/utils/load_yaml.py
Browse files
command/utils/{read_yaml.py → load_yaml.py}
RENAMED
@@ -1,12 +1,12 @@
|
|
1 |
import yaml
|
2 |
-
import
|
3 |
-
from typing import Optional, Any
|
4 |
|
5 |
|
6 |
-
def load_commands_from_yaml(file_path:
|
7 |
try:
|
8 |
with open(file_path, 'r') as file:
|
9 |
commands_data = yaml.safe_load(file)
|
|
|
10 |
return commands_data.get('commands', [])
|
11 |
except IOError as e:
|
12 |
-
|
|
|
1 |
import yaml
|
2 |
+
from typing import Any
|
|
|
3 |
|
4 |
|
5 |
+
def load_commands_from_yaml(file_path: str) -> Any:
|
6 |
try:
|
7 |
with open(file_path, 'r') as file:
|
8 |
commands_data = yaml.safe_load(file)
|
9 |
+
print(commands_data)
|
10 |
return commands_data.get('commands', [])
|
11 |
except IOError as e:
|
12 |
+
print(f"Error: {e}")
|