Skip to content

Commit

Permalink
Add docstring on labrad.protocol.connect
Browse files Browse the repository at this point in the history
  • Loading branch information
maffoo committed Dec 22, 2015
1 parent 638432c commit 697f258
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion labrad/protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,20 @@ def __repr__(self):

@inlineCallbacks
def connect(host=C.MANAGER_HOST, port=None, tls=C.MANAGER_TLS):
"""Connect to LabRAD and return a deferred that fires the protocol object."""
"""Connect to LabRAD and return a deferred that fires the protocol object.
Args:
host (str): The hostname of the manager.
port (int): The tcp port of the manager. If None, use the appropriate
default value based on the TLS mode.
tls (str): The tls mode to use for this connection. See:
`labrad.constants.check_tls_mode`.
Returns:
twisted.internet.defer.Deferred(LabradProtocol): A deferred that will
fire with the protocol once the connection is established, or will
errback if the connection fails.
"""
tls = C.check_tls_mode(tls)
if port is None:
port = C.MANAGER_PORT_TLS if tls == 'on' else C.MANAGER_PORT
Expand Down

0 comments on commit 697f258

Please sign in to comment.