fix accepted_formats in spectacle-screenshots

This commit is contained in:
cswimr 2025-02-02 18:52:46 -06:00
parent 712c2c2163
commit f265752a8a
Signed by: cswimr
GPG key ID: 0EC431A8DA8F8087

View file

@ -27,7 +27,9 @@ def spectacle_screenshot(
'File already exists. Please provide a different file path, or use the zipline function to upload the file.\nExample: zipline "{file_path}"'
)
accepted_formats = [str(f) for f in QImageWriter.supportedImageFormats()]
accepted_formats = [
f.data().decode() for f in QImageWriter.supportedImageFormats()
]
accepted_formats.extend(("webm", "mp4"))
print(accepted_formats)
if not format:
@ -37,7 +39,7 @@ def spectacle_screenshot(
f"Invalid format. Accepted formats are: {', '.join(accepted_formats)}"
)
else:
format = f".{format}"
format = f".{str(format)}"
if not file_path:
use_temp_file = True