This repository has been archived on 2024-02-23. You can view files and clone it, but cannot push or open issues or pull requests.
Auberge_Vagabonde/utils.py

17 lines
376 B
Python
Raw Normal View History

2022-01-18 20:43:45 +00:00
import asyncio
2022-01-18 21:53:50 +00:00
import functools
2022-01-18 20:43:45 +00:00
2022-01-18 21:53:50 +00:00
def executor(f):
@functools.wraps(f)
async def wrapped(*args, **kwargs):
return await asyncio.get_running_loop().run_in_executor(
None, lambda: f(*args, **kwargs)
2022-01-18 20:43:45 +00:00
)
2022-01-18 21:53:50 +00:00
return wrapped
2022-08-18 10:59:02 +00:00
def generate_title_html(title, content):
return f"<h1 style='text-align:center;margin:4rem'>{title}</h1>{content}"