fix: improve file path handling in theme generator script#9426
Merged
BenHenning merged 2 commits intoRaspberryPiFoundation:developfrom Oct 31, 2025
Merged
fix: improve file path handling in theme generator script#9426BenHenning merged 2 commits intoRaspberryPiFoundation:developfrom
BenHenning merged 2 commits intoRaspberryPiFoundation:developfrom
Conversation
- Use Path objects from pathlib to handle file paths properly - Generate output files in the same directory as input file - Create output filenames with "new_" prefix while preserving original stem name - Ensure script works with files from any location in the filesystem
BenHenning
approved these changes
Oct 31, 2025
Collaborator
BenHenning
left a comment
There was a problem hiding this comment.
Thanks @mmvarma-pro! I don't have a lot of familiarity with the workings of the script, but I also suspect few people on the team do since it hasn't been changed in a long time. The change here makes sense to me and seems like a really solid improvement. I'm happy to accept this change.
91d5b00
into
RaspberryPiFoundation:develop
8 of 9 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The basics
The details
Resolves
Improve file path handling in theme generator script
Proposed Changes
This PR enhances the
create_blockStyles.pyscript to handle input files from any location by:Reason for Changes
Previously, the script would only work correctly when run from the same directory as the input file. This change makes the script more robust by:
This improves developer experience when using the theme generator from different working directories.
Test Coverage
The changes were tested manually by:
Documentation
No documentation updates are needed as this is an internal improvement to the script's functionality.
Additional Information
This change maintains backward compatibility with existing usage patterns while adding more flexibility for different file locations.