Skip to content
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

Conversation

Technoguyfication
Copy link

Refactor excessively long f-string into separate variables to resolve issue

Fixes #288

refactor excessively long f-string into separate variables
@CyanVoxel CyanVoxel self-assigned this Jun 14, 2024
@CyanVoxel CyanVoxel added Type: Bug Something isn't working as intended Priority: High An important issue requiring attention labels Jun 14, 2024
@CyanVoxel CyanVoxel added this to the Alpha 9.4 milestone Jun 14, 2024
@@ -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'
Copy link
Member

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 😅

Copy link
Author

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

Copy link
Member

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

@CyanVoxel
Copy link
Member

I can do the Ruff format, everything else looks good!

@CyanVoxel CyanVoxel merged commit 888b674 into TagStudioDev:Alpha-v9.4 Jun 14, 2024
3 checks passed
CarterPillow pushed a commit to CarterPillow/TagStudio that referenced this pull request Sep 7, 2024
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: High An important issue requiring attention Type: Bug Something isn't working as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants