diff --git a/allmydata/filetable.py b/allmydata/filetable.py index e93413c17..bb96b02ad 100644 --- a/allmydata/filetable.py +++ b/allmydata/filetable.py @@ -90,6 +90,7 @@ class MutableDirectoryNode(Referenceable): os.unlink(absname) else: raise BadFileError("Cannot delete non-existent file '%s'" % name) + remote_remove = remove class GlobalVirtualDrive(service.MultiService): diff --git a/allmydata/vdrive.py b/allmydata/vdrive.py index c0eed1fb5..22e012d08 100644 --- a/allmydata/vdrive.py +++ b/allmydata/vdrive.py @@ -106,8 +106,23 @@ class VDrive(service.MultiService): d.addCallback(lambda parent: parent.callRemote("add_directory", name)) return d - def remove(self, something): # TODO - pass + def remove(self, parent, name): + assert not isinstance(parent, str) + log.msg("vdrive removing %s" % name) + # first find the verifierid + d = self.get_verifierid_from_parent(parent, name) + def _got_verifierid(vid): + # TODO: delete the file's shares using this + pass + d.addCallback(_got_verifierid) + def _delete_from_parent(res): + return parent.callRemote("remove", name) + d.addCallback(_delete_from_parent) + def _done(res): + log.msg("vdrive done removing %s" % name) + d.addCallback(_done) + return d + def get_file(self, dir_and_name_or_path, download_target): """Retrieve a file from the virtual drive and put it somewhere. diff --git a/allmydata/web/directory.xhtml b/allmydata/web/directory.xhtml index 47f8cd473..5b4d9c7aa 100644 --- a/allmydata/web/directory.xhtml +++ b/allmydata/web/directory.xhtml @@ -17,11 +17,13 @@