Skip to content

Comments

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

Merged
echoix merged 2 commits intoOSGeo:mainfrom
arohanajit:ruff-icons
Apr 1, 2025
Merged

wxGUI: Fix PTH208 use pathlib Path instead of os module#5461
echoix merged 2 commits intoOSGeo:mainfrom
arohanajit:ruff-icons

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
Kiraschild pushed a commit to Kiraschild/grass that referenced this pull request Apr 4, 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