Skip to content

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
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
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
@Computerdores Computerdores moved this to ✅ Done in TagStudio Development Sep 8, 2025
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

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

2 participants