Fix all H405 pep8 errors

Improved code style, fixed all H405 (Multi line docstring
summary not separated with an empty line) errors.

Change-Id: I6639a2e1a9dc5d3802cb1bda05c5bf9b302bc82f
This commit is contained in:
Anastasia Kuznetsova 2015-11-16 17:58:25 +03:00
parent ade1d89172
commit dbdc29531c
17 changed files with 53 additions and 25 deletions

View File

@ -73,6 +73,7 @@ class EnvironmentController(rest.RestController):
@wsme_pecan.wsexpose(Environments)
def get_all(self):
"""Return all environments.
Where project_id is the same as the requestor or
project_id is different but the scope is public.
"""

View File

@ -19,7 +19,9 @@ from pecan import hooks
class ContentTypeHook(hooks.PecanHook):
def __init__(self, content_type, methods=['GET']):
"""Content type hook is needed for changing content type of
"""Content type hook.
This hook is needed for changing content type of
responses but only for some HTTP methods. This is kind of
'hack' but it seems impossible using pecan/WSME to set different
content types on request and response.

View File

@ -185,7 +185,9 @@ def print_server_info():
def get_properly_ordered_parameters():
"""In oslo it's important the order of the launch parameters.
"""Orders launch parameters in the right order.
In oslo it's important the order of the launch parameters.
if --config-file came after the command line parameters the command
line parameters are ignored.
So to make user command line parameters are never ignored this method

View File

@ -116,8 +116,10 @@ def session_aware(param_name="session"):
def start_tx():
"""Opens new database session and starts new transaction assuming
there wasn't any opened sessions within the same thread.
"""Starts transaction.
Opens new database session and starts new transaction assuming
there wasn't any opened sessions within the same thread.
"""
if _get_thread_local_session():
raise exc.DataAccessException(
@ -158,8 +160,10 @@ def rollback_tx():
def end_tx():
"""Ends current database transaction.
It rolls back all uncommitted changes and closes database session.
"""Ends transaction.
Ends current database transaction.
It rolls back all uncommitted changes and closes database session.
"""
ses = _get_thread_local_session()

View File

@ -201,8 +201,10 @@ def validate_long_type_length(cls, field_name, value):
def register_length_validator(attr_name):
"""Register an event listener on the attribute that will
validate the size every time a 'set' occurs.
"""Register an event listener on the attribute.
This event listener will validate the size every
time a 'set' occurs.
"""
for cls in utils.iter_subclasses(Execution):
if hasattr(cls, attr_name):

View File

@ -355,7 +355,9 @@ class EngineClient(base.Engine):
@wrap_messaging_exception
def rerun_workflow(self, wf_ex_id, task_ex_id, reset=True):
"""Rerun the workflow with the given execution id
"""Rerun the workflow.
This method reruns workflow with the given execution id
at the specific task execution id.
:param wf_ex_id: Workflow execution id.

View File

@ -37,7 +37,9 @@ _schedulers = {}
def schedule_call(factory_method_path, target_method_name,
run_after, serializers=None, **method_args):
"""Add this call specification to DB, and then after run_after
"""Schedules call and lately invokes target_method.
Add this call specification to DB, and then after run_after
seconds service CallScheduler invokes the target_method.
:param factory_method_path: Full python-specific path to

View File

@ -203,7 +203,9 @@ class DbTestCase(BaseTest):
@classmethod
def __heavy_init(cls):
"""Make this method private to prevent extending this one.
"""Method that runs heavy_init().
Make this method private to prevent extending this one.
It runs heavy_init() only once.
Note: setUpClass() can be used, but it magically is not invoked
@ -215,7 +217,9 @@ class DbTestCase(BaseTest):
@classmethod
def heavy_init(cls):
"""Runs a long initialization (runs once by class)
"""Runs a long initialization.
This method runs long initialization once by class
and can be extended by child classes.
"""
# If using sqlite, change to memory. The default is file based.

View File

@ -237,7 +237,9 @@ class AuthProv(auth.KeystoneV2AuthProvider):
class TestCase(test.BaseTestCase):
@classmethod
def resource_setup(cls):
"""This method allows to initialize authentication before
"""Client authentication.
This method allows to initialize authentication before
each test case and define parameters of Mistral API Service.
"""
super(TestCase, cls).resource_setup()

View File

@ -29,9 +29,6 @@ __all__ = ['FunctionalTest']
class FunctionalTest(base.DbTestCase):
"""Used for functional tests where you need to test your
literal application and its integration with the framework.
"""
def setUp(self):
super(FunctionalTest, self).setUp()

View File

@ -58,7 +58,9 @@ PKI_TOKEN_VERIFIED = {
class TestKeystoneMiddleware(base.FunctionalTest):
"""Test that the keystone middleware AuthProtocol is executed
"""Test keystone middleware AuthProtocol.
It checks that keystone middleware AuthProtocol is executed
when enabled.
"""

View File

@ -95,6 +95,7 @@ def set_thread_local(var_name, val):
def log_exec(logger, level=logging.DEBUG):
"""Decorator for logging function execution.
By default, target function execution is logged with DEBUG level.
"""
@ -294,6 +295,7 @@ def save_text_to(text, file_path, overwrite=False):
def generate_key_pair(key_length=2048):
"""Create RSA key pair with specified number of bits in key.
Returns tuple of private and public keys.
"""
with tempdir() as tmpdir:

View File

@ -27,8 +27,7 @@ class JSEvaluator(object):
@classmethod
@abc.abstractmethod
def evaluate(cls, script, context):
"""Executes given JavaScript.
"""
"""Executes given JavaScript."""
pass

View File

@ -26,7 +26,9 @@ from mistral import exceptions as ex
def wrap_wsme_controller_exception(func):
"""This decorator wraps controllers method to manage wsme exceptions:
"""Decorator for controllers method.
This decorator wraps controllers method to manage wsme exceptions:
In case of expected error it aborts the request with specific status code.
"""
@functools.wraps(func)
@ -41,7 +43,9 @@ def wrap_wsme_controller_exception(func):
def wrap_pecan_controller_exception(func):
"""This decorator wraps controllers method to manage pecan exceptions:
"""Decorator for controllers method.
This decorator wraps controllers method to manage pecan exceptions:
In case of expected error it aborts the request with specific status code.
"""
@functools.wraps(func)

View File

@ -209,7 +209,9 @@ class DirectWorkflowController(base.WorkflowController):
@staticmethod
def _find_next_task_names_for_clause(clause, ctx):
"""Finds next task(command) names base on given {name: condition}
"""Finds next tasks names.
This method finds next task(command) base on given {name: condition}
dictionary.
:param clause: Dictionary {task_name: condition} taken from

View File

@ -41,8 +41,10 @@ class ReverseWorkflowController(base.WorkflowController):
__workflow_type__ = "reverse"
def _find_next_commands(self):
"""Finds all tasks with resolved dependencies and return them
in the form of workflow commands.
"""Finds all tasks with resolved dependencies.
This method finds all tasks with resolved dependencies and
returns them in the form of workflow commands.
"""
cmds = super(ReverseWorkflowController, self)._find_next_commands()

View File

@ -47,7 +47,6 @@ commands = bash tools/lintstack.sh
[flake8]
show-source = true
ignore = H405
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools,scripts