Clean up reviewboard.hostingsvcs.service
Review Request #8908 — Created April 19, 2017 and discarded
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 theURLRequest
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 forNone
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.
Description | From | Last Updated |
---|---|---|
This really should be several small changes instead of one big one. It's pretty hard to review as-is. |
david |
- Change Summary:
-
Whitespace issues.
- Diff:
-
Revision 2 (+604 -92)
Checks run (3 succeeded)
JSHint
passed.
PEP8 Style Checker
passed.
Pyflakes
passed.
- Description:
-
This patch is mostly a documentation cleanup for the
hostingsvcs.service
module. All docstrings in the module are broughtinto 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 theURLRequest
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 forNone
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.
- The
- Diff:
-
Revision 3 (+604 -92)
Checks run (3 succeeded)
JSHint
passed.
PEP8 Style Checker
passed.
Pyflakes
passed.