-
Notifications
You must be signed in to change notification settings - Fork 385
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: backslashes in f-string error on file drop dupe widget #289
fix: backslashes in f-string error on file drop dupe widget #289
Conversation
refactor excessively long f-string into separate variables
@@ -167,10 +167,11 @@ def duplicates_choice(self) -> int: | |||
dupes_to_show = self.duplicate_files | |||
if len(self.duplicate_files) > display_limit: | |||
dupes_to_show = dupes_to_show[0:display_limit] | |||
|
|||
dupes_str = '\n '.join(map(lambda path: str(path),dupes_to_show)) | |||
dupes_more = f"\nand {len(self.duplicate_files)-display_limit} more " if len(self.duplicate_files) > display_limit else '\n' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But now there's a backslash inside of the f-string again, causing the issue in #289 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a backslash inside the template, not the expression. Python was upset about backslashes being between the { }
curly brackets. It seems to be running for me with these changes on 3.11.2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah interesting, in that case if it works then I've got no issue with it
I can do the Ruff format, everything else looks good! |
…oDev#289) * fix: python complaining about backslashes inside f-string expressions refactor excessively long f-string into separate variables * fix: missing f on f-string * Format with Ruff
Refactor excessively long f-string into separate variables to resolve issue
Fixes #288