Ejemplo n.º 1
0
    def upload(self, path, hash):
        fullpath = join(self.syncdir, path)
        if hash == 'DEL':
            client.delete_object(self.container, path)
        elif hash == 'DIR':
            client.create_directory_marker(self.container, path)
        else:
            prefix, name = split(path)
            if prefix:
                prefix += '/'
            print 'Uploading %s...' % path
            upload(client, fullpath, self.container, prefix, name)

        remote = self.remote_hash(path)
        assert remote == hash, "Uploaded file does not match hash"
        self.save(path, hash)
Ejemplo n.º 2
0
    def upload(self, path, hash):
        fullpath = join(self.syncdir, path)
        if hash == 'DEL':
            client.delete_object(self.container, path)
        elif hash == 'DIR':
            client.create_directory_marker(self.container, path)
        else:
            prefix, name = split(path)
            if prefix:
                prefix += '/'
            print 'Uploading %s...' % path
            upload(client, fullpath, self.container, prefix, name)

        remote = self.remote_hash(path)
        assert remote == hash, "Uploaded file does not match hash"
        self.save(path, hash)
Ejemplo n.º 3
0
 def execute(self, file, path):
     container, sep, prefix = path.partition('/')
     upload(self.client, file, container, prefix)
Ejemplo n.º 4
0
 def execute(self, file, path):
     container, sep, prefix = path.partition('/')
     upload(self.client, file, container, prefix)