BGPSpeaker: Move docstring from __init__ to class

By the default, Sphinx does not include __init__() method for the
"autoclass" directive, and currently the description for the arguments
of BGPSpeaker is not generated.

This patch moves the docstring of __init__() to the class's docstring
and enables to generate the docs for the arguments of __init__().

Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWASE Yusuke
2018-01-23 09:41:34 +09:00
committed by FUJITA Tomonori
parent 80312a4d64
commit 7d0b080e73

View File

@@ -221,23 +221,7 @@ class EventPrefix(object):
class BGPSpeaker(object): class BGPSpeaker(object):
def __init__(self, as_number, router_id, """Class to provide the APIs of Ryu BGP Speaker.
bgp_server_hosts=DEFAULT_BGP_SERVER_HOSTS,
bgp_server_port=DEFAULT_BGP_SERVER_PORT,
refresh_stalepath_time=DEFAULT_REFRESH_STALEPATH_TIME,
refresh_max_eor_time=DEFAULT_REFRESH_MAX_EOR_TIME,
best_path_change_handler=None,
adj_rib_in_change_handler=None,
peer_down_handler=None,
peer_up_handler=None,
ssh_console=False,
ssh_port=None, ssh_host=None, ssh_host_key=None,
label_range=DEFAULT_LABEL_RANGE,
allow_local_as_in_count=0,
cluster_id=None,
local_pref=DEFAULT_LOCAL_PREF):
"""Create a new BGPSpeaker object with as_number and router_id to
listen on bgp_server_port.
``as_number`` specifies an Autonomous Number. It must be an integer ``as_number`` specifies an Autonomous Number. It must be an integer
between 1 and 65535. between 1 and 65535.
@@ -306,6 +290,21 @@ class BGPSpeaker(object):
integer. integer.
""" """
def __init__(self, as_number, router_id,
bgp_server_hosts=DEFAULT_BGP_SERVER_HOSTS,
bgp_server_port=DEFAULT_BGP_SERVER_PORT,
refresh_stalepath_time=DEFAULT_REFRESH_STALEPATH_TIME,
refresh_max_eor_time=DEFAULT_REFRESH_MAX_EOR_TIME,
best_path_change_handler=None,
adj_rib_in_change_handler=None,
peer_down_handler=None,
peer_up_handler=None,
ssh_console=False,
ssh_port=None, ssh_host=None, ssh_host_key=None,
label_range=DEFAULT_LABEL_RANGE,
allow_local_as_in_count=0,
cluster_id=None,
local_pref=DEFAULT_LOCAL_PREF):
super(BGPSpeaker, self).__init__() super(BGPSpeaker, self).__init__()
settings = { settings = {