Skip to content

Commit

Permalink
Some minor docs fixes, mainly alphabetic sorting.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgtaylor committed Nov 7, 2014
1 parent acda5db commit d54f829
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions boto3/docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ def document_resource(service_name, official_name, resource_model,
preset = len(resource_model.identifiers)

if resource_model.sub_resources:
for resource in resource_model.sub_resources.resources:
for resource in sorted(resource_model.sub_resources.resources,
key=lambda i: i.name):
docs += ' .. py:method:: {0}({1})\n\n'.format(
resource.name,
', '.join([xform_name(i.name) for i in \
Expand All @@ -246,7 +247,8 @@ def document_resource(service_name, official_name, resource_model,

if is_service_resource:
# TODO: expose service-level subresources via the model
for name, resource_def in resource_model._resource_defs.items():
for name, resource_def in sorted(resource_model._resource_defs.items(),
key=lambda i: i[0]):
docs += ' .. py:method:: {0}({1})\n\n'.format(
name,
', '.join([xform_name(i['name']) for i in \
Expand All @@ -260,7 +262,8 @@ def document_resource(service_name, official_name, resource_model,
docs += (' .. rst-class:: admonition-title\n\n Collections\n\n'
' Collections provide an interface to iterate and'
' manipulate groups of resources.\n\n')
for collection in resource_model.collections:
for collection in sorted(resource_model.collections,
key=lambda i: i.name):
docs += (' .. py:attribute:: {0}\n\n '
'(:py:class:`~boto3.resources.collection.CollectionManager`)'
' A collection of :py:class:`{1}.{2}` instances. This'
Expand Down

0 comments on commit d54f829

Please sign in to comment.