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

Replace use of os.path with pathlib #156

Merged
merged 43 commits into from
May 26, 2024
Merged

Conversation

Icosahunter
Copy link
Collaborator

No description provided.

@Icosahunter
Copy link
Collaborator Author

Tested on Linux (Solus) for basic functionality

@CyanVoxel CyanVoxel added the Type: Refactor Code that needs to be restructured or cleaned up label May 10, 2024
@CyanVoxel CyanVoxel added this to the Alpha 9.3.x milestone May 10, 2024
@yedpodtrzitko
Copy link
Collaborator

good job, this was really needed 👍

@Icosahunter
Copy link
Collaborator Author

@yedpodtrzitko Thanks for the comments, I think I've resolved most of them. I'll have to test with the changes and ruff-format it again.

@yedpodtrzitko yedpodtrzitko mentioned this pull request May 11, 2024
@CyanVoxel
Copy link
Member

Just a heads up, I'll be pulling #142 (a rewrite of #88) before this, which will cause some additional conflicts - I apologize in advance.

qim = ImageQt.ImageQt(final)
final.save(f'/home/icosahunter/Documents/test/{filepath.stem}.png')
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, I'll need to fix that 🤦‍♂️

@Icosahunter
Copy link
Collaborator Author

Tested basic functionality on my Linux distro (Solus) and seems to be working. At one point I did get a segfault... but it didn't happen in later testing.

Icosahunter and others added 8 commits May 26, 2024 16:12
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
Co-authored-by: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com>
@Icosahunter
Copy link
Collaborator Author

Got a segmentation fault when trying to delete unlinked entries, but I couldn't reproduce the issue.

[ThumbRenderer][ERROR]: Couldn't render thumbnail for /home/icosahunter/Documents/test.txt ([Errno 2] No such file or directory: '/home/icosahunter/Documents/test.txt')
Traceback (most recent call last):
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/widgets/preview_panel.py", line 530, in update_widgets
    raise UnidentifiedImageError
PIL.UnidentifiedImageError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/ts_qt.py", line 1209, in <lambda>
    lambda checked=False, entry=entry: self.select_item(
                                       ^^^^^^^^^^^^^^^^^
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/ts_qt.py", line 1137, in select_item
    self.preview_panel.update_widgets()
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/widgets/preview_panel.py", line 539, in update_widgets
    f"{filepath.suffix.upper()[1:]}  •  {format_size(os.stat(filepath).st_size)}"
                                                     ^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/icosahunter/Documents/test.txt'
Start RMF: <PySide6.QtCore.QThread(0x55681a5ac5b0) at 0x7fc9d3f2d600>
TagStudio.sh: line 7:  9544 Segmentation fault      (core dumped) python tagstudio/tag_studio.py

- Suffix comparisons are now case-insensitive
- Restore original thumbnail extension label behavior
- Fix preview panel trying to read file size from missing files
@CyanVoxel CyanVoxel merged commit 6798ffd into TagStudioDev:main May 26, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Refactor Code that needs to be restructured or cleaned up
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

3 participants