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

convert windows path delimiter to posix (#2149) #2150

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/rp2_common/pico_lwip/tools/makefsdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def process_file(input_dir, file):
content_type = "application/octet-stream"

# file name
data = f"/{file.relative_to(input_dir)}\x00"
comment = f"\"/{file.relative_to(input_dir)}\" ({len(data)} chars)"
data = f"/{file.relative_to(input_dir).as_posix()}\x00"
comment = f"\"/{file.relative_to(input_dir).as_posix()}\" ({len(data)} chars)"
Comment on lines +27 to +28
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be worth doing a small refactoring here, so that the file.relative_to(input_dir).as_posix() is done just once (and assigned to a new variable) ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that this minor refactor would make it a bit cleaner for sure.

Copy link
Author

Choose a reason for hiding this comment

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

Perhaps separate refactoring from delimiter handling to make changes more consistent, since there are some format strings that could be refactored ? Perhaps add a new issue for refactoring ?

while(len(data) % PAYLOAD_ALIGNMENT != 0):
data += "\x00"
results.append({'data': bytes(data, "utf-8"), 'comment': comment});
Expand Down
Loading