Skip to content

Add file and directory renaming #6769

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

Merged
merged 2 commits into from
Aug 17, 2022
Merged

Add file and directory renaming #6769

merged 2 commits into from
Aug 17, 2022

Conversation

tannewt
Copy link
Member

@tannewt tannewt commented Aug 16, 2022

Internally this is done with a MOVE HTTP verb. It is modeled after
WebDAV MOVE but not exact to keep the Destination header shorter
and have more consistent response codes.

Fixes #6647

Internally this is done with a MOVE HTTP verb. It is modeled after
WebDAV MOVE but not exact to keep the Destination header shorter
and have more consistent response codes.

Fixes micropython#6647
@tannewt tannewt requested a review from dhalbert August 16, 2022 20:55
@tannewt tannewt added this to the 8.0.0 milestone Aug 16, 2022
@RetiredWizard
Copy link

If you clear the "rename to" field and then press cancel the file is renamed to null.

@RetiredWizard
Copy link

I'm a little disappointed that the edit option has gone away for unknown file types. I know editing a .mpy file didn't make much sense but it didn't crash anything and it was useful to be able to edit files like "menu.bat" or ".env"

@RetiredWizard
Copy link

RetiredWizard commented Aug 16, 2022

Probably can just add to the known file types as we go though. .env is really the only file type I can think of right know that needs to be added. Although, I guess with a working rename, you can always just add the .txt temporarily onto any file you want to edit and then rename it back...

@RetiredWizard
Copy link

Was the lack of any error reporting (target file exists, move to nonexistent folder) intentional? The rename seems to do the right thing in these cases which is nothing :)

@tannewt
Copy link
Member Author

tannewt commented Aug 16, 2022

If you clear the "rename to" field and then press cancel the file is renamed to null.

Haha, oops. Thanks for the testing!

I'm a little disappointed that the edit option has gone away for unknown file types. I know editing a .mpy file didn't make much sense but it didn't crash anything and it was useful to be able to edit files like "menu.bat" or ".env"

This is just the link. You can create the link yourself and the edit page won't be wiser. I did add .env support now.

Was the lack of any error reporting (target file exists, move to nonexistent folder) intentional? The rename seems to do the right thing in these cases which is nothing :)

I'm hesitant to add it because it'll add a lot of strings to the code. We can see what folks say when using it.

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

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

This looks ok by me. _decode_percents looks like it will give you garbage if the input string is truncated and doesn't have a second character after a %, but that doesn't really matter, I think.

I will leave use testing to @RetiredWizard.

@RetiredWizard
Copy link

The null file rename issue is fixed, I've tried to break it everyway I can think of but I think I'm stumped :)

@tannewt tannewt merged commit 1287d9c into adafruit:main Aug 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add move support to the web workflow
3 participants