style: Fix formatting and string literals in commands.py

This commit is contained in:
Paul Gauthier (aider) 2024-08-09 14:47:43 -03:00
parent 8bae297e5d
commit 61bcf04d15

View file

@ -906,7 +906,7 @@ class Commands:
if args.strip():
filename = args.strip()
ext = os.path.splitext(filename)[1].lower()
if ext in ('.jpg', '.jpeg', '.png'):
if ext in (".jpg", ".jpeg", ".png"):
basename = filename
else:
basename = f"{filename}.png"
@ -915,7 +915,7 @@ class Commands:
temp_dir = tempfile.mkdtemp()
temp_file_path = os.path.join(temp_dir, basename)
image_format = 'PNG' if basename.lower().endswith('.png') else 'JPEG'
image_format = "PNG" if basename.lower().endswith(".png") else "JPEG"
image.save(temp_file_path, image_format)
abs_file_path = Path(temp_file_path).resolve()