Example #1
0
    def download(self, path, hash):
        fullpath = join(self.syncdir, path)
        if hash == 'DEL':
            self.trash(path)
        elif hash == 'DIR':
            _makedirs(fullpath)
        else:
            self.trash(path)    # Trash any old version
            localpath = self.find_hash(hash)
            if localpath:
                copyfile(localpath, fullpath)
            else:
                print 'Downloading %s...' % path
                download(client, self.container, path, fullpath)

        current = self.current_hash(path)
        assert current == hash, "Downloaded file does not match hash"
        self.save(path, hash)
Example #2
0
    def download(self, path, hash):
        fullpath = join(self.syncdir, path)
        if hash == 'DEL':
            self.trash(path)
        elif hash == 'DIR':
            _makedirs(fullpath)
        else:
            self.trash(path)    # Trash any old version
            localpath = self.find_hash(hash)
            if localpath:
                copyfile(localpath, fullpath)
            else:
                print 'Downloading %s...' % path
                download(client, self.container, path, fullpath)

        current = self.current_hash(path)
        assert current == hash, "Downloaded file does not match hash"
        self.save(path, hash)
Example #3
0
 def execute(self, path, file):
     container, sep, object = path.partition('/')
     download(self.client, container, object, file)
Example #4
0
 def execute(self, path, file):
     container, sep, object = path.partition('/')
     download(self.client, container, object, file)