docstrings for the Tor and I2P address family implementations

This commit is contained in:
Jean-Paul Calderone 2020-12-14 17:36:35 -05:00
parent 18c18a0e1d
commit fcbe56ba0a
2 changed files with 13 additions and 0 deletions

View File

@ -169,6 +169,13 @@ class _Provider(service.MultiService):
return i2p_port
def get_client_endpoint(self):
"""
Get an ``IStreamClientEndpoint`` which will set up a connection to an I2P
address.
If I2P is not enabled or the dependencies are not available, return
``None`` instead.
"""
enabled = self._get_i2p_config("enabled", True, boolean=True)
if not enabled:
return None

View File

@ -236,6 +236,12 @@ class _Provider(service.MultiService):
return ep
def get_client_endpoint(self):
"""
Get an ``IStreamClientEndpoint`` which will set up a connection using Tor.
If Tor is not enabled or the dependencies are not available, return
``None`` instead.
"""
enabled = self._get_tor_config("enabled", True, boolean=True)
if not enabled:
return None