INNER CODE UNIT · Python
save_yaml
yohey-w/multi-agent-shogun · scripts/slim_yaml.py:40
def save_yaml(filepath, data):
"""Safely save YAML file."""
try:
with open(filepath, 'w', encoding='utf-8') as f:
yaml.dump(data, f, allow_unicode=True, sort_keys=False, default_flow_style=False)
return True
except Exception as e:
print(f"Error writing {filepath}: {e}", file=sys.stderr)
return False
def get_timestamp():
"""Generate archive filename timestamp."""
return datetime.now().strftime('%Y%m%d%H%M%S')
def get_queue_dir():
override = os.environ.get('SHOGUN_QUEUE_DIR')