~nataliabidart/magicicada-client/fix-travis-ubuntuone-clientdefs

« back to all changes in this revision

Viewing changes to magicicadaclient/syncdaemon/volume_manager.py

  • Committer: Natalia
  • Date: 2018-05-19 20:44:54 UTC
  • mto: This revision was merged to the branch mainline in revision 1445.
  • Revision ID: natalia.bidart@ubuntu.com-20180519204454-fliiqyexj67r7fp9
- Rename python package to magicicadaclient.

Show diffs side-by-side

added added

removed removed

Lines of Context:
49
49
    RootVolume,
50
50
)
51
51
from twisted.internet import defer
52
 
from ubuntuone.platform import expand_user
 
52
from magicicadaclient.platform import expand_user
53
53
 
54
 
from ubuntuone.syncdaemon.marker import MDMarker
55
 
from ubuntuone.syncdaemon.interfaces import IMarker
56
 
from ubuntuone.syncdaemon import file_shelf, config
57
 
from ubuntuone.syncdaemon.tritcask import TritcaskShelf
58
 
from ubuntuone.syncdaemon.vm_helper import (
 
54
from magicicadaclient.syncdaemon.marker import MDMarker
 
55
from magicicadaclient.syncdaemon.interfaces import IMarker
 
56
from magicicadaclient.syncdaemon import file_shelf, config
 
57
from magicicadaclient.syncdaemon.tritcask import TritcaskShelf
 
58
from magicicadaclient.syncdaemon.vm_helper import (
59
59
    create_shares_link,
60
60
    get_share_dir_name,
61
61
    get_udf_path,
62
62
    get_udf_suggested_path,
63
63
)
64
 
from ubuntuone.platform import (
 
64
from magicicadaclient.platform import (
65
65
    allow_writes,
66
66
    get_path_list,
67
67
    is_link,
1589
1589
 
1590
1590
    def _upgrade_metadata_None(self, md_version):
1591
1591
        """Upgrade the shelf layout, for *very* old clients."""
1592
 
        from ubuntuone.syncdaemon.volume_manager import LegacyShareFileShelf
 
1592
        from magicicadaclient.syncdaemon.volume_manager import LegacyShareFileShelf
1593
1593
        self.log.debug('Upgrading the share shelf layout')
1594
1594
        # the shelf already exists, and don't have a .version file
1595
1595
        # first backup the old data
1630
1630
        Upgrade all pickled Share to the new package/module layout.
1631
1631
 
1632
1632
        """
1633
 
        from ubuntuone.syncdaemon.volume_manager import LegacyShareFileShelf
 
1633
        from magicicadaclient.syncdaemon.volume_manager import LegacyShareFileShelf
1634
1634
        self.log.debug('upgrading share shelfs from metadata 1')
1635
1635
        shares = LegacyShareFileShelf(self._shares_md_dir)
1636
1636
        for key, share in shares.iteritems():
1700
1700
        move "~/<root>/My Files" contents to "~/<root>"
1701
1701
 
1702
1702
        """
1703
 
        from ubuntuone.syncdaemon.volume_manager import LegacyShareFileShelf
 
1703
        from magicicadaclient.syncdaemon.volume_manager import LegacyShareFileShelf
1704
1704
        self.log.debug('upgrading from metadata 3 (new layout)')
1705
1705
        old_share_dir = os.path.join(self._root_dir, 'Shared With Me')
1706
1706
        old_root_dir = os.path.join(self._root_dir, 'My Files')
1783
1783
 
1784
1784
    def _upgrade_metadata_5(self, md_version):
1785
1785
        """Upgrade to version 6 (plain dict storage)."""
1786
 
        from ubuntuone.syncdaemon.volume_manager import (
 
1786
        from magicicadaclient.syncdaemon.volume_manager import (
1787
1787
            VMFileShelf, LegacyShareFileShelf, UDF)
1788
1788
        self.log.debug('upgrading from metadata 5')
1789
1789
        bkp_dir = os.path.join(os.path.dirname(self._data_dir), '5.bkp')
1820
1820
 
1821
1821
    def _upgrade_share_to_volume(self, share, shared=False):
1822
1822
        """Upgrade from _Share to new Volume hierarchy."""
1823
 
        from ubuntuone.syncdaemon.volume_manager import (
 
1823
        from magicicadaclient.syncdaemon.volume_manager import (
1824
1824
            VMFileShelf, Root, Share, Shared)
1825
1825
 
1826
1826
        def upgrade_share_dict(share):
1857
1857
 
1858
1858
    def _upgrade_metadata_6(self, md_version):
1859
1859
        """Upgrade to version 7, tritcask!."""
1860
 
        from ubuntuone.syncdaemon.volume_manager import (
 
1860
        from magicicadaclient.syncdaemon.volume_manager import (
1861
1861
            VMFileShelf, VMTritcaskShelf,
1862
1862
            SHARE_ROW_TYPE, SHARED_ROW_TYPE, UDF_ROW_TYPE,
1863
1863
        )