import yaml | |
import logging | |
from typing import Optional, Any | |
def load_commands_from_yaml(file_path: Optional[str] = None) -> Any: | |
try: | |
with open(file_path, 'r') as file: | |
commands_data = yaml.safe_load(file) | |
return commands_data.get('commands', []) | |
except IOError as e: | |
logging.error(e) | |