Add type hints

This commit is contained in:
2023-01-09 04:25:20 +01:00
parent fc424f7263
commit ab477c0ab4
10 changed files with 69 additions and 64 deletions

View File

@ -18,7 +18,7 @@ def generate_html_for_videos(url: str, width: int, height: int, screenshot: str,
Returns:
Returns HTML for video.
"""
video_html = f"""
video_html: str = f"""
<!DOCTYPE html>
<html>
<!-- Generated at {datetime.now().strftime('%Y-%m-%d %H:%M:%S')} -->
@ -33,13 +33,13 @@ def generate_html_for_videos(url: str, width: int, height: int, screenshot: str,
</head>
</html>
"""
domain = settings.serve_domain
domain: str = settings.serve_domain
html_url: str = urljoin(domain, filename)
# Take the filename and append .html to it.
filename += ".html"
file_path = os.path.join(settings.upload_folder, filename)
file_path: str = os.path.join(settings.upload_folder, filename)
with open(file_path, "w", encoding="utf-8") as f:
f.write(video_html)