pyfilesystem2 icon indicating copy to clipboard operation
pyfilesystem2 copied to clipboard

Move dir optimization

Open tfeldmann opened this issue 3 years ago • 3 comments

Type of changes

  • New feature
  • Tests

Checklist

  • [x] I've run the latest black with default args on new code.
  • [x] I've updated CHANGELOG.md and CONTRIBUTORS.md where appropriate.
  • [x] I've added tests for new code.
  • [x] I accept that @PyFilesystem/maintainers may be pedantic in the code review.

Description

  • Use shutil.move to move folders if both filesystems have a syspath
  • Check for ResourceNotFound, DirectoryExpected and IllegalDestination in fs.move.move_dir

tfeldmann avatar Aug 30 '22 12:08 tfeldmann

Coverage Status

Coverage decreased (-0.0003%) to 94.814% when pulling 7c34e41dbb713066ab7931adfbc2dbde6376fe14 on tfeldmann:move_dir-optimization into 59f6e4d51a1983ca28d0b667bd1d6b3284ab5c56 on PyFilesystem:master.

coveralls avatar Aug 30 '22 12:08 coveralls

Once again I should rebase this for fewer commits. And it seems to have some problems on windows.

tfeldmann avatar Aug 30 '22 12:08 tfeldmann

This works now, but I'm kind of unhappy with it. For example I'm missing a param overwrite in move.move_dir. Is it ok for you if I add one? It would have to default to true to be backwards compatible.

tfeldmann avatar Sep 01 '22 09:09 tfeldmann