mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-19 03:06:33 +00:00
code cleanup, docs
This commit is contained in:
parent
955d7abfa3
commit
a82aa4ba2c
@ -196,14 +196,13 @@ def create_client(basedir=u".", _client_factory=None):
|
||||
:returns: :class:`allmydata.client._Client` instance (or whatever
|
||||
`_client_factory` returns)
|
||||
"""
|
||||
# should we check for this directory existing first? (this used to
|
||||
# be in Node's constructor)
|
||||
node.create_node_dir(basedir, CLIENT_README)
|
||||
config = read_config(basedir, u"client.port")
|
||||
|
||||
# read config file and create instance
|
||||
config = read_config(basedir, u"client.port")
|
||||
return create_client_from_config(config, _client_factory=_client_factory) # async
|
||||
# following call is async
|
||||
return create_client_from_config(
|
||||
config,
|
||||
_client_factory=_client_factory,
|
||||
)
|
||||
|
||||
|
||||
# this method is async
|
||||
@ -213,10 +212,13 @@ def create_client_from_config(config, _client_factory=None):
|
||||
Creates a new client instance (a subclass of Node). Most code
|
||||
should probably use `create_client` instead.
|
||||
|
||||
:returns: Deferred yielding a _Client instance
|
||||
|
||||
:param config: configuration instance (from read_config()) which
|
||||
encapsulates everything in the "node directory".
|
||||
|
||||
:param _client_factory: for testing; the class to instantiate
|
||||
instead of _Client
|
||||
"""
|
||||
if _client_factory is None:
|
||||
_client_factory = _Client
|
||||
|
Loading…
Reference in New Issue
Block a user