mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-31 16:36:20 +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
|
:returns: :class:`allmydata.client._Client` instance (or whatever
|
||||||
`_client_factory` returns)
|
`_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)
|
node.create_node_dir(basedir, CLIENT_README)
|
||||||
config = read_config(basedir, u"client.port")
|
config = read_config(basedir, u"client.port")
|
||||||
|
# following call is async
|
||||||
# read config file and create instance
|
return create_client_from_config(
|
||||||
config = read_config(basedir, u"client.port")
|
config,
|
||||||
return create_client_from_config(config, _client_factory=_client_factory) # async
|
_client_factory=_client_factory,
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# this method is async
|
# 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
|
Creates a new client instance (a subclass of Node). Most code
|
||||||
should probably use `create_client` instead.
|
should probably use `create_client` instead.
|
||||||
|
|
||||||
|
:returns: Deferred yielding a _Client instance
|
||||||
|
|
||||||
:param config: configuration instance (from read_config()) which
|
:param config: configuration instance (from read_config()) which
|
||||||
encapsulates everything in the "node directory".
|
encapsulates everything in the "node directory".
|
||||||
|
|
||||||
:param _client_factory: for testing; the class to instantiate
|
:param _client_factory: for testing; the class to instantiate
|
||||||
|
instead of _Client
|
||||||
"""
|
"""
|
||||||
if _client_factory is None:
|
if _client_factory is None:
|
||||||
_client_factory = _Client
|
_client_factory = _Client
|
||||||
|
Loading…
x
Reference in New Issue
Block a user