Merge lp:~mandel/ubuntuone-windows-installer/migrate-data into lp:ubuntuone-windows-installer

Proposed by Manuel de la Peña
Status: Merged
Approved by: Manuel de la Peña
Approved revision: 93
Merged at revision: 81
Proposed branch: lp:~mandel/ubuntuone-windows-installer/migrate-data
Merge into: lp:ubuntuone-windows-installer
Prerequisite: lp:~mandel/ubuntuone-windows-installer/uninstall-old-app
Diff against target: 0 lines
To merge this branch: bzr merge lp:~mandel/ubuntuone-windows-installer/migrate-data
Reviewer Review Type Date Requested Status
Natalia Bidart (community) Approve
Diego Sarmentero (community) Approve
Review via email: mp+78387@code.launchpad.net

Commit message

Provides a function that allows to migrate the data that was downloed by the previous beta.

Description of the change

Provides a function that allows to migrate the data that was downloed by the previous beta.

To post a comment you must log in.
Revision history for this message
Natalia Bidart (nataliabidart) wrote :

A couple of fixes:

* Instead of importing from windows, which should be a 'hidden' module:

from ubuntuone.platform.windows import recursive_move, listdir, tools

import from platform directly:

from ubuntuone.platform import recursive_move, listdir, tools

* Can you please remove the duplication of the code calculating the path to the Documents folder? can you replace the logic in migrate_old_data() with a call to get_special_folders()[0]?

* I think the migration of old data should remove the old metadata. Can we do that?

* Also, the user should be prompt to confirm if s/he wants to the migration to happen, no?

* If I understand the code correctly, you're overwriting all the files inside the new location. We should check if we're about to overwrite a file and handle that case gracefully (probably adding a suffix to the old file, we should ask Lisette).

review: Needs Fixing
85. By Manuel de la Peña

Removed any use of the os_helper module from ubuntuone. Added an exception to check if the destination is already present, that way we can state that the move cannot be savely done.

86. By Manuel de la Peña

Fixed small pep8 error.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

===============================================================================
[FAIL]
Traceback (most recent call last):
  File "X:\ubuntuone-windows-installer-mandel\ubuntuone_installer\gui\qt\utils\t
ests\test_windows.py", line 234, in test_special_folders
    self.assertEqual(sorted(folders), sorted(expected))
twisted.trial.unittest.FailTest: not equal:
a = [u'C:\\Users\\\xf1o\xf1o \xf1and\xfa.utopia\\Documents',
 u'C:\\Users\\\xf1o\xf1o \xf1and\xfa.utopia\\Music',
 u'C:\\Users\\\xf1o\xf1o \xf1and\xfa.utopia\\Pictures']
b = ['C:\\Users\\\xf1o\xf1o \xf1and\xfa.utopia\\Documents',
 'C:\\Users\\\xf1o\xf1o \xf1and\xfa.utopia\\Music',
 'C:\\Users\\\xf1o\xf1o \xf1and\xfa.utopia\\Pictures']

ubuntuone_installer.gui.qt.utils.tests.test_windows.DefaultFoldersTestCase.test_
special_folders
-------------------------------------------------------------------------------

review: Needs Fixing
87. By Manuel de la Peña

Merged with parent.

88. By Manuel de la Peña

Fixed tests to ensure that we do get the correct folders.

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

+1

review: Approve
89. By Manuel de la Peña

Fixed lint issues.

90. By Manuel de la Peña

Improve code by removing redundancy in tests and using the default_folders call.

91. By Manuel de la Peña

Remove small lint issue.

Revision history for this message
Natalia Bidart (nataliabidart) wrote :

Code looks good, pasting a few minor fixes I discussed with mandel in the IRC channel:

(01:02:32 PM) nessita: mandel: for future references, this is not valid pep8 styling for lists: ['Music', 'Photos', 'Personal', ] it should be ['Music', 'Photos', 'Personal']
(01:03:17 PM) mandel: nessita, the problem is the last ',' right?
(01:03:26 PM) nessita: mandel: and the last space
(01:03:40 PM) nessita: so, the exta ", " should not be there

(01:07:04 PM) nessita: from ubuntuone.platform.windows import tools
(01:07:12 PM) nessita: I mentioned you should not import from windows but from:
(01:07:16 PM) nessita: from ubuntuone.platform import tools

Thanks!

review: Approve
92. By Manuel de la Peña

* Do not import from platform.windows but from platform.
* [] is not a () so there is no real reason to add the extra,

93. By Manuel de la Peña

Merged with root code.

Preview Diff

Empty

Subscribers

People subscribed via source and target branches