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

gui: Use comprehensions when initializing lists, dicts, and sets #4914

Merged
merged 6 commits into from
Jan 4, 2025

Conversation

echoix
Copy link
Member

@echoix echoix commented Jan 4, 2025

Analogous to #4909, but for files in gui/

All combined changes come from this branch (where it gets rebased): https://github.com/echoix/grass/tree/pyrefact-gui (echoix#335)

@github-actions github-actions bot added GUI wxGUI related Python Related code is in Python labels Jan 4, 2025
@echoix
Copy link
Member Author

echoix commented Jan 4, 2025

For the remaining, i'll file them in later, it is getting late, and I'm not sure that I can create a PR that is completely free of conflicts for the PR grouping the context managers (analogous to #4908). There's also one for early exits (can be split in two: functions and loops, similar to #4910), and one more for the remaining of changes in gui (analogous to #4911).

@echoix echoix requested a review from ninsbl January 4, 2025 05:39
@echoix
Copy link
Member Author

echoix commented Jan 4, 2025

Tomorrow I also want to see how many wx.Dialogs that I can use a context manager to handle the dlg.Destroy cleanly in all cases (like the second example here: https://docs.wxpython.org/wx.Dialog.html#phoenix-title-modal-and-modeless).
Ideally some of the pending GUI PRs should be merged to not work for nothing

Copy link
Member

@ninsbl ninsbl left a comment

Choose a reason for hiding this comment

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

Looks good. It is quite a sizeable change though, so I hope I did not overlook anything. I assume you leave the %-string formating for another round.

gui/wxpython/animation/temporal_manager.py Show resolved Hide resolved
gui/wxpython/core/render.py Show resolved Hide resolved
@echoix
Copy link
Member Author

echoix commented Jan 4, 2025

Looks good. It is quite a sizeable change though, so I hope I did not overlook anything. I assume you leave the %-string formating for another round.

Yes, there's like 2400 UP031 and 382 UP032, so it's not really a good thing to shove into the rest.

The PR for early exit is a bit harder to review, so I made sure to keep (manually replace) the empty lines to have a "landmark"

@echoix echoix merged commit 3f98304 into OSGeo:main Jan 4, 2025
26 checks passed
@echoix echoix deleted the pyrefact-gui-comprehensions branch January 4, 2025 23:18
@github-actions github-actions bot added this to the 8.5.0 milestone Jan 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