Fixing docstring formatting errors and warnings

Correcting numerous errors and warnings for doc generation.

Partial-Bug: #1486222
Change-Id: I6d6b20a433aa9965a1bafbd098e64b19886e5fca
This commit is contained in:
David Lyle 2015-08-18 17:13:29 -06:00
parent 6fbb70ebf2
commit efafd2ba96
8 changed files with 46 additions and 35 deletions

View File

@ -147,30 +147,31 @@ class SelectWidget(widgets.Select):
for the option object. It returns a dictionary for the option object. It returns a dictionary
containing the html attributes and their values. containing the html attributes and their values.
For example, to define a title attribute for the For example, to define a title attribute for the
choices: choices::
helpText = { 'Apple': 'This is a fruit', helpText = { 'Apple': 'This is a fruit',
'Carrot': 'This is a vegetable' } 'Carrot': 'This is a vegetable' }
def get_title(data): def get_title(data):
text = helpText.get(data, None) text = helpText.get(data, None)
if text: if text:
return {'title': text} return {'title': text}
else: else:
return {} return {}
.... ....
.... ....
widget=forms.SelectWidget( attrs={'class': 'switchable', widget=forms.SelectWidget( attrs={'class': 'switchable',
'data-slug': 'source'}, 'data-slug': 'source'},
transform_html_attrs=get_title ) transform_html_attrs=get_title )
self.fields[<field name>].choices =
([
('apple','Apple'),
('carrot','Carrot')
])
self.fields[<field name>].choices =
([
('apple','Apple'),
('carrot','Carrot')
])
""" """
def __init__(self, attrs=None, choices=(), data_attrs=(), transform=None, def __init__(self, attrs=None, choices=(), data_attrs=(), transform=None,
transform_html_attrs=None): transform_html_attrs=None):

View File

@ -163,7 +163,7 @@ class Column(html.HTMLElement):
A callable to get the HTML attributes of a column cell depending A callable to get the HTML attributes of a column cell depending
on the data. For example, to add additional description or help on the data. For example, to add additional description or help
information for data in a column cell (e.g. in Images panel, for the information for data in a column cell (e.g. in Images panel, for the
column 'format'): column 'format')::
helpText = { helpText = {
'ARI':'Amazon Ramdisk Image' 'ARI':'Amazon Ramdisk Image'

View File

@ -40,11 +40,14 @@ def sort_js_files(js_files):
and spec files based on file extension. and spec files based on file extension.
Output: Output:
* sources: source files for production. The order of source files * sources: source files for production. The order of source files
is significant and should be listed in the below order: is significant and should be listed in the below order:
- First, all the that defines the other application's angular module. - First, all the that defines the other application's angular module.
Those files have extension of `.module.js`. The order among them is Those files have extension of `.module.js`. The order among them is
not significant. not significant.
- Followed by all other source code files. The order among them - Followed by all other source code files. The order among them
is not significant. is not significant.
@ -53,6 +56,7 @@ def sort_js_files(js_files):
* specs: spec files for testing. They have extension of `.spec.js`. * specs: spec files for testing. They have extension of `.spec.js`.
The order among them is not significant. The order among them is not significant.
""" """
modules = [f for f in js_files if f.endswith(MODULE_EXT)] modules = [f for f in js_files if f.endswith(MODULE_EXT)]
mocks = [f for f in js_files if f.endswith(MOCK_EXT)] mocks = [f for f in js_files if f.endswith(MOCK_EXT)]

View File

@ -128,13 +128,13 @@ def image_update(request, image_id, **kwargs):
def image_create(request, **kwargs): def image_create(request, **kwargs):
"""Create image. """Create image.
Keyword arguments: :param kwargs:
copy_from -- URL from which Glance server should immediately copy * copy_from: URL from which Glance server should immediately copy
the data and store it in its configured image store. the data and store it in its configured image store.
data -- Form data posted from client. * data: Form data posted from client.
location -- URL where the data for this image already resides. * location: URL where the data for this image already resides.
In the case of 'copy_from' and 'location' the Glance server In the case of 'copy_from' and 'location', the Glance server
will give us a immediate response from create and handle the data will give us a immediate response from create and handle the data
asynchronously. asynchronously.
@ -234,6 +234,7 @@ def metadefs_namespace_list(request,
marker=None, marker=None,
paginate=False): paginate=False):
"""Retrieve a listing of Namespaces """Retrieve a listing of Namespaces
:param paginate: If true will perform pagination based on settings. :param paginate: If true will perform pagination based on settings.
:param marker: Specifies the namespace of the last-seen namespace. :param marker: Specifies the namespace of the last-seen namespace.
The typical pattern of limit and marker is to make an The typical pattern of limit and marker is to make an
@ -250,9 +251,10 @@ def metadefs_namespace_list(request,
:param filters: specifies addition fields to filter on such as :param filters: specifies addition fields to filter on such as
resource_types. resource_types.
:returns A tuple of three values: :returns A tuple of three values:
1) Current page results 1) Current page results
2) A boolean of whether or not there are previous page(s). 2) A boolean of whether or not there are previous page(s).
3) A boolean of whether or not there are more page(s). 3) A boolean of whether or not there are more page(s).
""" """
limit = getattr(settings, 'API_RESULT_LIMIT', 1000) limit = getattr(settings, 'API_RESULT_LIMIT', 1000)
page_size = utils.get_page_size(request) page_size = utils.get_page_size(request)

View File

@ -170,9 +170,9 @@ class SecurityGroupManager(object):
* from_port: lower limit of allowed port range (inclusive) * from_port: lower limit of allowed port range (inclusive)
* to_port: upper limit of allowed port range (inclusive) * to_port: upper limit of allowed port range (inclusive)
* ip_range: remote IP CIDR (source for ingress, dest for egress). * ip_range: remote IP CIDR (source for ingress, dest for egress).
The value should be a format of "{'cidr': <cidr>}" The value should be a format of "{'cidr': <cidr>}"
* group: remote security group. The value should be a format of * group: remote security group. The value should be a format of
"{'name': <secgroup_name>}" "{'name': <secgroup_name>}"
""" """

View File

@ -26,6 +26,7 @@ from openstack_dashboard.api.rest import urls
@urls.register @urls.register
class Networks(generic.View): class Networks(generic.View):
"""API for Neutron Networks """API for Neutron Networks
http://developer.openstack.org/api-ref-networking-v2.html http://developer.openstack.org/api-ref-networking-v2.html
""" """
url_regex = r'neutron/networks/$' url_regex = r'neutron/networks/$'
@ -44,6 +45,7 @@ class Networks(generic.View):
@rest_utils.ajax(data_required=True) @rest_utils.ajax(data_required=True)
def post(self, request): def post(self, request):
"""Create a network """Create a network
:param admin_state_up (optional): The administrative state of the :param admin_state_up (optional): The administrative state of the
network, which is up (true) or down (false). network, which is up (true) or down (false).
:param name (optional): The network name. A request body is optional: :param name (optional): The network name. A request body is optional:

View File

@ -86,8 +86,10 @@ def image_field_data(request, include_empty_option=False):
:param request: django http request object :param request: django http request object
:param include_empty_option: flag to include a empty tuple in the front of :param include_empty_option: flag to include a empty tuple in the front of
the list the list
:return: list of (id, name) tuples :return: list of (id, name) tuples
""" """
try: try:
images = get_available_images(request, request.user.project_id) images = get_available_images(request, request.user.project_id)

View File

@ -82,7 +82,7 @@ def network_field_data(request, include_empty_option=False):
:param request: django http request object :param request: django http request object
:param include_empty_option: flag to include a empty tuple in the front of :param include_empty_option: flag to include a empty tuple in the front of
the list the list
:return: list of (id, name) tuples :return: list of (id, name) tuples
""" """
tenant_id = request.user.tenant_id tenant_id = request.user.tenant_id
@ -114,7 +114,7 @@ def keypair_field_data(request, include_empty_option=False):
:param request: django http request object :param request: django http request object
:param include_empty_option: flag to include a empty tuple in the front of :param include_empty_option: flag to include a empty tuple in the front of
the list the list
:return: list of (id, name) tuples :return: list of (id, name) tuples
""" """
keypair_list = [] keypair_list = []
@ -142,7 +142,7 @@ def flavor_field_data(request, include_empty_option=False):
:param request: django http request object :param request: django http request object
:param include_empty_option: flag to include a empty tuple in the front of :param include_empty_option: flag to include a empty tuple in the front of
the list the list
:return: list of (id, name) tuples :return: list of (id, name) tuples
""" """
flavors = flavor_list(request) flavors = flavor_list(request)