Clean up reviewboard.hostingsvcs.service

Review Request #8908 — Created April 19, 2017 and discarded — Latest diff uploaded

Information

Review Board
release-2.5.x

Reviewers

This patch is mostly a documentation cleanup for the
hostingsvcs.service module. All docstrings in the module are brought
into line with our conventions.

In addition, some internal API changes have been made:

  • The HostingServiceClient._build_request method was only ever used in
    one place so it has been removed and its definition been made inline.
  • The logic for adding HTTP basic auth headers to a request has moved
    into the URLRequest class. The external API for adding HTTP basic
    auth remains unchanged.
  • All default values that were mutable have been replaced with None.
    These methods now all check for None and generate the appropriate
    default value.
  • The HostingServiceClient._build_form_data has been made both a
    staticmethod (since it should never be looking at instance variables
    and public (since it is generally useful outside the class).
  • HostingServiceClient.build_form_data now generates a list of strings
    to append together, instead of repeatedly performing string addition.
    Also, multiline string literals are now used to generate the content
    instead of doing string concatenation. Interpolation has been changed
    to use dictionaries for clarity.
  • Built the docs.
  • Ran unit tests.
    Loading...