mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 15:53:48 +00:00
the wait_for_numpeers= argument to client.upload() is optional: make both the code and the Interface reflect this
This commit is contained in:
@ -293,7 +293,7 @@ class Client(node.Node, Referenceable, testutil.PollMixin):
|
|||||||
assert IMutableFileURI.providedBy(u), u
|
assert IMutableFileURI.providedBy(u), u
|
||||||
return MutableFileNode(self).init_from_uri(u)
|
return MutableFileNode(self).init_from_uri(u)
|
||||||
|
|
||||||
def create_empty_dirnode(self, wait_for_numpeers):
|
def create_empty_dirnode(self, wait_for_numpeers=None):
|
||||||
n = NewDirectoryNode(self)
|
n = NewDirectoryNode(self)
|
||||||
d = n.create(wait_for_numpeers=wait_for_numpeers)
|
d = n.create(wait_for_numpeers=wait_for_numpeers)
|
||||||
d.addCallback(lambda res: n)
|
d.addCallback(lambda res: n)
|
||||||
@ -305,7 +305,7 @@ class Client(node.Node, Referenceable, testutil.PollMixin):
|
|||||||
d.addCallback(lambda res: n)
|
d.addCallback(lambda res: n)
|
||||||
return d
|
return d
|
||||||
|
|
||||||
def upload(self, uploadable, wait_for_numpeers):
|
def upload(self, uploadable, wait_for_numpeers=None):
|
||||||
uploader = self.getServiceNamed("uploader")
|
uploader = self.getServiceNamed("uploader")
|
||||||
return uploader.upload(uploadable, wait_for_numpeers=wait_for_numpeers)
|
return uploader.upload(uploadable, wait_for_numpeers=wait_for_numpeers)
|
||||||
|
|
||||||
|
@ -1146,19 +1146,30 @@ class IChecker(Interface):
|
|||||||
"""
|
"""
|
||||||
|
|
||||||
class IClient(Interface):
|
class IClient(Interface):
|
||||||
def upload(uploadable, wait_for_numpeers):
|
def upload(uploadable, wait_for_numpeers=None):
|
||||||
"""Upload some data into a CHK, get back the URI string for it.
|
"""Upload some data into a CHK, get back the URI string for it.
|
||||||
@param uploadable: something that implements IUploadable
|
@param uploadable: something that implements IUploadable
|
||||||
@param wait_for_numpeers: don't upload anything until we have at least
|
@param wait_for_numpeers: don't upload anything until we have at least
|
||||||
this many peers connected
|
this many peers connected
|
||||||
@return: a Deferred that fires with the (string) URI for this file.
|
@return: a Deferred that fires with the (string) URI for this file.
|
||||||
"""
|
"""
|
||||||
def create_empty_dirnode(wait_for_numpeers):
|
|
||||||
|
def create_mutable_file(contents="", wait_for_numpeers=None):
|
||||||
|
"""Create a new mutable file with contents, get back the URI string.
|
||||||
|
@param contents: the initial contents to place in the file.
|
||||||
|
@param wait_for_numpeers: don't upload anything until we have at least
|
||||||
|
this many peers connected
|
||||||
|
@return: a Deferred that fires with tne (string) SSK URI for the new
|
||||||
|
file.
|
||||||
|
"""
|
||||||
|
|
||||||
|
def create_empty_dirnode(wait_for_numpeers=None):
|
||||||
"""Create a new dirnode, empty and unattached.
|
"""Create a new dirnode, empty and unattached.
|
||||||
@param wait_for_numpeers: don't create anything until we have at least
|
@param wait_for_numpeers: don't create anything until we have at least
|
||||||
this many peers connected.
|
this many peers connected.
|
||||||
@return: a Deferred that fires with the new IDirectoryNode instance.
|
@return: a Deferred that fires with the new IDirectoryNode instance.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def create_node_from_uri(uri):
|
def create_node_from_uri(uri):
|
||||||
"""Create a new IFilesystemNode instance from the uri, synchronously.
|
"""Create a new IFilesystemNode instance from the uri, synchronously.
|
||||||
@param uri: a string or IURI-providing instance. This could be for a
|
@param uri: a string or IURI-providing instance. This could be for a
|
||||||
|
Reference in New Issue
Block a user