Fix and enable H401

Remove leading spaces from doc comments.

Change-Id: I75b055c0d64dda478c63839d44158e301900107f
This commit is contained in:
Dirk Mueller
2013-06-21 19:04:50 +02:00
parent 6691276ca2
commit fe8f9023ac
14 changed files with 65 additions and 63 deletions

View File

@@ -118,7 +118,8 @@ def is_ans1_token(token):
def cms_sign_text(text, signing_cert_file_name, signing_key_file_name): def cms_sign_text(text, signing_cert_file_name, signing_key_file_name):
""" Uses OpenSSL to sign a document """Uses OpenSSL to sign a document.
Produces a Base64 encoding of a DER formatted CMS Document Produces a Base64 encoding of a DER formatted CMS Document
http://en.wikipedia.org/wiki/Cryptographic_Message_Syntax http://en.wikipedia.org/wiki/Cryptographic_Message_Syntax
""" """

View File

@@ -74,11 +74,11 @@ class Client(client.HTTPClient):
return self._local_keystone_exists() return self._local_keystone_exists()
def _local_keystone_exists(self): def _local_keystone_exists(self):
""" Checks if Keystone is available on default local port 35357 """ """Checks if Keystone is available on default local port 35357."""
return self._check_keystone_versions("http://localhost:35357") return self._check_keystone_versions("http://localhost:35357")
def _check_keystone_versions(self, url): def _check_keystone_versions(self, url):
""" Calls Keystone URL and detects the available API versions """ """Calls Keystone URL and detects the available API versions."""
try: try:
httpclient = client.HTTPClient() httpclient = client.HTTPClient()
resp, body = httpclient.request(url, "GET", resp, body = httpclient.request(url, "GET",
@@ -141,7 +141,7 @@ class Client(client.HTTPClient):
return self._check_keystone_extensions(url) return self._check_keystone_extensions(url)
def _check_keystone_extensions(self, url): def _check_keystone_extensions(self, url):
""" Calls Keystone URL and detects the available extensions """ """Calls Keystone URL and detects the available extensions."""
try: try:
httpclient = client.HTTPClient() httpclient = client.HTTPClient()
if not url.endswith("/"): if not url.endswith("/"):
@@ -184,7 +184,7 @@ class Client(client.HTTPClient):
@staticmethod @staticmethod
def _get_version_info(version, root_url): def _get_version_info(version, root_url):
""" Parses version information """Parses version information.
:param version: a dict of a Keystone version response :param version: a dict of a Keystone version response
:param root_url: string url used to construct :param root_url: string url used to construct
@@ -203,7 +203,7 @@ class Client(client.HTTPClient):
@staticmethod @staticmethod
def _get_extension_info(extension): def _get_extension_info(extension):
""" Parses extension information """Parses extension information.
:param extension: a dict of a Keystone extension response :param extension: a dict of a Keystone extension response
:returns: tuple - (alias, name) :returns: tuple - (alias, name)

View File

@@ -49,7 +49,7 @@ DIGEST_LENGTH_B64 = 4 * int(math.ceil(DIGEST_LENGTH / 3.0))
class InvalidMacError(Exception): class InvalidMacError(Exception):
""" raise when unable to verify MACed data """raise when unable to verify MACed data.
This usually indicates that data had been expectedly modified in memcache. This usually indicates that data had been expectedly modified in memcache.
@@ -58,14 +58,14 @@ class InvalidMacError(Exception):
class DecryptError(Exception): class DecryptError(Exception):
""" raise when unable to decrypt encrypted data """raise when unable to decrypt encrypted data.
""" """
pass pass
class CryptoUnavailableError(Exception): class CryptoUnavailableError(Exception):
""" raise when Python Crypto module is not available """raise when Python Crypto module is not available.
""" """
pass pass
@@ -83,7 +83,7 @@ def assert_crypto_availability(f):
def constant_time_compare(first, second): def constant_time_compare(first, second):
""" Returns True if both string inputs are equal, otherwise False """Returns True if both string inputs are equal, otherwise False.
This function should take a constant amount of time regardless of This function should take a constant amount of time regardless of
how many characters in the strings match. how many characters in the strings match.

View File

@@ -368,7 +368,7 @@ VERSION_LIST_v2 = {
class NoModuleFinder(object): class NoModuleFinder(object):
""" Disallow further imports of 'module' """ """Disallow further imports of 'module'."""
def __init__(self, module): def __init__(self, module):
self.module = module self.module = module
@@ -473,7 +473,7 @@ class BaseFakeHTTPConnection(object):
class FakeHTTPConnection(BaseFakeHTTPConnection): class FakeHTTPConnection(BaseFakeHTTPConnection):
""" Emulate a fake Keystone v2 server """ """Emulate a fake Keystone v2 server."""
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
self.send_valid_revocation_list = True self.send_valid_revocation_list = True
@@ -519,7 +519,7 @@ class FakeHTTPConnection(BaseFakeHTTPConnection):
class v3FakeHTTPConnection(FakeHTTPConnection): class v3FakeHTTPConnection(FakeHTTPConnection):
""" Emulate a fake Keystone v3 server """ """Emulate a fake Keystone v3 server."""
def request(self, method, path, **kwargs): def request(self, method, path, **kwargs):
"""Fakes out several http responses. """Fakes out several http responses.

View File

@@ -89,7 +89,7 @@ class TestCase(testtools.TestCase):
class UnauthenticatedTestCase(testtools.TestCase): class UnauthenticatedTestCase(testtools.TestCase):
""" Class used as base for unauthenticated calls """ """Class used as base for unauthenticated calls."""
TEST_ROOT_URL = 'http://127.0.0.1:5000/' TEST_ROOT_URL = 'http://127.0.0.1:5000/'
TEST_URL = '%s%s' % (TEST_ROOT_URL, 'v2.0') TEST_URL = '%s%s' % (TEST_ROOT_URL, 'v2.0')
TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/' TEST_ROOT_ADMIN_URL = 'http://127.0.0.1:35357/'
@@ -114,7 +114,8 @@ class UnauthenticatedTestCase(testtools.TestCase):
class TestResponse(requests.Response): class TestResponse(requests.Response):
"""Class used to wrap requests.Response and provide some """Class used to wrap requests.Response and provide some
convenience to initialize with a dict """ convenience to initialize with a dict.
"""
def __init__(self, data): def __init__(self, data):
self._text = None self._text = None

View File

@@ -356,7 +356,8 @@ class CrudTests(testtools.TestCase):
class TestResponse(requests.Response): class TestResponse(requests.Response):
"""Class used to wrap requests.Response and provide some """Class used to wrap requests.Response and provide some
convenience to initialize with a dict """ convenience to initialize with a dict.
"""
def __init__(self, data): def __init__(self, data):
self._text = None self._text = None

View File

@@ -35,11 +35,10 @@ downloadcache = ~/cache/pip
# H302: import only modules # H302: import only modules
# H304: no relative imports # H304: no relative imports
# H306: imports not in alphabetical order # H306: imports not in alphabetical order
# H401: docstring should not start with a space
# H402: one line docstring needs punctuation. # H402: one line docstring needs punctuation.
# H403: multi line docstring end on new line # H403: multi line docstring end on new line
# H404: multi line docstring should start with a summary # H404: multi line docstring should start with a summary
# H802: git commit title # H802: git commit title
ignore = F811,F821,F841,H201,H202,H302,H304,H306,H401,H402,H403,H404,H802 ignore = F811,F821,F841,H201,H202,H302,H304,H306,H402,H403,H404,H802
show-source = True show-source = True
exclude = .venv,.tox,dist,doc,*egg exclude = .venv,.tox,dist,doc,*egg