Merge lp://qastaging/~facundo/ubuntuone-client/delete-to-trash into lp://qastaging/ubuntuone-client

Proposed by Facundo Batista
Status: Merged
Approved by: Facundo Batista
Approved revision: 936
Merged at revision: 934
Proposed branch: lp://qastaging/~facundo/ubuntuone-client/delete-to-trash
Merge into: lp://qastaging/ubuntuone-client
Diff against target: 893 lines (+397/-120)
9 files modified
data/syncdaemon.conf (+6/-0)
tests/platform/linux/test_os_helper.py (+105/-0)
tests/syncdaemon/test_config.py (+5/-0)
tests/syncdaemon/test_fsm.py (+107/-30)
ubuntuone/platform/linux/__init__.py (+2/-1)
ubuntuone/platform/linux/os_helper.py (+26/-0)
ubuntuone/syncdaemon/config.py (+17/-3)
ubuntuone/syncdaemon/filesystem_manager.py (+120/-80)
ubuntuone/syncdaemon/sync.py (+9/-6)
To merge this branch: bzr merge lp://qastaging/~facundo/ubuntuone-client/delete-to-trash
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Lucio Torre (community) Approve
Review via email: mp+56000@code.qastaging.launchpad.net

Commit message

Move to trash instead of plain deletion (LP: #690673)

Description of the change

Move to trash instead of plain deletion

For this, os_helper grown a new "move_to_trash" operation (only the linux part, for the windows version see #747741).

FSM calls this new method instead of just removing the file. The only issue was that for tree deletion the code relied on shutil.rmtree's on_error calls to make the directories RW, and we couldn't do that (because if we need to remove a whole tree, that whole tree must go to trash, not files and directories individually).

So, I had to refactor how EnableShareWrite works, to support a "recursive" option.

Finally, note that this new behaviour is configurable. However, to make it work, I had to fix the path in config.py, to take also the configuration from the branch (this was broken somewhen, you only notice that when a new parameter is added).

Tests included for everything.

To post a comment you must log in.
Revision history for this message
Lucio Torre (lucio.torre) wrote :

=== modified file 'data/syncdaemon.conf'
+use_trash.help = Send the files and folders to XDG Trash folder instead of
+ removing them permanently.

syncdaemon.conf is not platform dependent and i am not sure the trashbin in windows or other OSes is done/managed or anything by xdg.

we should get guillos coment on this one as well.

review: Approve
936. By Facundo Batista

Better help message

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.

Subscribers

People subscribed via source and target branches