mutable: first pass at dirnodes, filenodes, new URIs. Some test coverage.

The URI typenames need revision, and only a few dirnode methods are
implemented. Filenodes are non-functional, but URI/key-management is in
place. There are a lot of classes with names like "NewDirectoryNode" that
will need to be rename once we decide what (if any) backwards compatibility
want to retain.
This commit is contained in:
Brian Warner
2007-11-01 15:15:29 -07:00
parent fb3eddafdb
commit 1d8a4cdfe7
7 changed files with 851 additions and 3 deletions

View File

@ -207,3 +207,29 @@ class Client(node.Node, Referenceable, testutil.PollMixin):
d.addCallback(lambda res: None)
return d
def create_empty_dirnode(self):
from allmydata.mutable import NewDirectoryNode
n = NewDirectoryNode(self)
d = n.create()
d.addCallback(lambda res: n)
return d
def create_dirnode_from_uri(self, u):
from allmydata.mutable import NewDirectoryNode
return NewDirectoryNode(self).init_from_uri(u)
def create_mutable_file(self, contents=""):
from allmydata.mutable import MutableFileNode
n = MutableFileNode(self)
d = n.create(contents)
d.addCallback(lambda res: n)
return d
def create_mutable_file_from_uri(self, u):
from allmydata.mutable import MutableFileNode
return MutableFileNode(self).init_from_uri(u)
def create_file_from_uri(self, u):
from allmydata.mutable import FileNode
return FileNode(u, self)