Resolve docstring pep8 issues

Enable the folowing rules:
* H402
* H403
* H404

Change-Id: I72483f7b75799ee1a3bf8a42e8f95e6b863d8dde
This commit is contained in:
Ekaterina Fedorova
2014-05-05 15:13:36 +04:00
parent dcd8b7e622
commit 7e805c4b0a
9 changed files with 19 additions and 27 deletions

View File

@@ -162,9 +162,7 @@ class LazyWizard(wizard_views.SessionWizardView):
"""
@django_dec.classonlymethod
def as_view(cls, initforms, *initargs, **initkwargs):
"""
Main entry point for a request-response process.
"""
"""Main entry point for a request-response process."""
# sanitize keyword arguments
for key in initkwargs:
if key in cls.http_method_names:

View File

@@ -14,8 +14,7 @@
class Bunch(object):
"""
Bunch is a container that provides both dictionary-like and
"""Bunch is a container that provides both dictionary-like and
object-like attribute access.
"""
def __init__(self, **kwargs):

View File

@@ -58,7 +58,8 @@ def prepare_regexp(regexp):
"""Converts regular expression string pattern into RegexValidator object.
Also /regexp/flags syntax is allowed, where flags is a string of
one-character flags that will be appended to the compiled regexp."""
one-character flags that will be appended to the compiled regexp.
"""
if regexp.startswith('/'):
groups = re.match(r'^/(.*)/([A-Za-z]*)$', regexp).groups()
regexp, flags_str = groups
@@ -117,8 +118,8 @@ def insert_hidden_ids(application):
def int2base(x, base):
"""
Converts decimal integers into another number base from base-2 to base-36
"""Converts decimal integers into another number base
from base-2 to base-36.
:param x: decimal integer
:param base: number base, max value is 36

View File

@@ -132,7 +132,8 @@ class Service(object):
def get_data(self, form_name, expr, data=None):
"""First try to get value from cleaned data, if none
found, use raw data."""
found, use raw data.
"""
if data:
self.update_cleaned_data(data, form_name=form_name)
data = self.cleaned_data

View File

@@ -36,9 +36,9 @@ _random_string_counter = None
@yaql.context.EvalArg('pattern', types.StringTypes)
@yaql.context.EvalArg('number', types.IntType)
def _generate_hostname(pattern, number):
"""
Replace '#' char in pattern with supplied number, if no pattern is
supplied generate short and unique name for the host
"""Replace '#' char in pattern with supplied number, if no pattern is
supplied generate short and unique name for the host.
:param pattern: hostname pattern
:param number: number to replace with in pattern
:return: hostname

View File

@@ -118,8 +118,7 @@ def get_status_messages_for_service(request, service_id, environment_id):
class Session(object):
@staticmethod
def get_or_create(request, environment_id):
"""
Gets id from already opened session for specified environment,
"""Gets id from already opened session for specified environment,
otherwise opens new session and returns it's id
:param request:
@@ -141,10 +140,9 @@ class Session(object):
@staticmethod
def get_or_create_or_delete(request, environment_id):
"""
Gets id from session in open state for specified environment, if state
is deployed - this session will be deleted and new would be created.
If there are no any sessions new would be created.
"""Gets id from session in open state for specified environment,
if state is deployed - this session will be deleted and new
would be created. If there are no any sessions new would be created.
Returns if of chosen or created session.
:param request:
@@ -187,8 +185,7 @@ class Session(object):
@staticmethod
def get(request, environment_id):
"""
Gets id from already opened session for specified environment,
"""Gets id from already opened session for specified environment,
otherwise returns None
:param request:

View File

@@ -33,7 +33,7 @@ class OverviewTab(tabs.Tab):
template_name = 'services/_overview.html'
def get_context_data(self, request):
"""
"""Return application details.
:param request:
:return:

View File

@@ -16,9 +16,7 @@ import string
class BlankFormatter(string.Formatter):
"""
Utility class aimed to provide empty string for non-existent keys.
"""
"""Utility class aimed to provide empty string for non-existent keys."""
def __init__(self, default=''):
self.default = default

View File

@@ -39,12 +39,10 @@ downloadcache = ~/cache/pip
# H301 one import per line
# H302 import only modules
# H306 imports not in alphabetical order
# H402 one line docstring needs punctuation
# H404 multi line docstring should start without a leading new line
# H501 Do not use locals() for string formatting
# H701 Empty localization string
# H702 Argument to _ must be just a string
ignore = H301,H302,H306,H402,H403,H404,H501,H701,H702
ignore = H301,H302,H306,H501,H701,H702
show-source = true
builtins = _
exclude=.build,.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools