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

wxGUI: Fix PTH208 use pathlib Path instead of os module #5461

Merged
merged 2 commits into from
Apr 1, 2025

Conversation

arohanajit
Copy link
Contributor

PR addresses the PTH208 linting error in gui/wxpython/icons/grass_icons.py by replacing os.listdir and os.path.splitext with their pathlib equivalents.

  • Imports Path from pathlib.
  • Converts the iconPath string to a Path object.
  • Uses Path.iterdir() to iterate over directory contents.
  • Uses Path.stem and Path.suffix to get the filename components.
  • Uses Path.name to get the full filename for storage in iconSet

@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Mar 28, 2025
Copy link
Member

@echoix echoix left a comment

Choose a reason for hiding this comment

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

Sorry, I had the comment and review last week done for this, but it didn't send, maybe I had a week cell connection at that time and left right after.

So, this one is also weird, we usually don't comment on all the lines like this, and you usually don't either, so was this a new tool or AI of some kind? Do you still review the same way the work that is made?

@echoix echoix merged commit 4b0da5d into OSGeo:main Apr 1, 2025
28 checks passed
@github-actions github-actions bot added this to the 8.5.0 milestone Apr 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
GUI wxGUI related Python Related code is in Python
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants