diff options
author | Dina Belova <dbelova@mirantis.com> | 2013-06-03 17:44:55 +0400 |
---|---|---|
committer | Dina Belova <dbelova@mirantis.com> | 2013-06-11 18:28:29 +0400 |
commit | 7119e29cb535426c587eaf2cfc2cfcd11a422df0 (patch) | |
tree | ee61f4db5c8ef559a9c50c5c501fb6c421f41fa0 /openstack/common/strutils.py | |
parent | ebaa578351c9c6b47c2f28ef6d74451e1483036b (diff) | |
download | oslo-7119e29cb535426c587eaf2cfc2cfcd11a422df0.tar.gz oslo-7119e29cb535426c587eaf2cfc2cfcd11a422df0.tar.xz oslo-7119e29cb535426c587eaf2cfc2cfcd11a422df0.zip |
Enable hacking H404 test.
H404 - multi line docstring should start with a summary.
Change-Id: I2099e1ee81ff9657f7a07401b8e8f3327d03bdbd
Diffstat (limited to 'openstack/common/strutils.py')
-rw-r--r-- | openstack/common/strutils.py | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/openstack/common/strutils.py b/openstack/common/strutils.py index 8a5367b..bbe2c92 100644 --- a/openstack/common/strutils.py +++ b/openstack/common/strutils.py @@ -40,8 +40,7 @@ FALSE_STRINGS = ('0', 'f', 'false', 'off', 'n', 'no') def int_from_bool_as_string(subject): - """ - Interpret a string as a boolean and return either 1 or 0. + """Interpret a string as a boolean and return either 1 or 0. Any string value in: @@ -55,8 +54,7 @@ def int_from_bool_as_string(subject): def bool_from_string(subject, strict=False): - """ - Interpret a string as a boolean. + """Interpret a string as a boolean. A case-insensitive match is performed such that strings matching 't', 'true', 'on', 'y', 'yes', or '1' are considered True and, when @@ -89,9 +87,7 @@ def bool_from_string(subject, strict=False): def safe_decode(text, incoming=None, errors='strict'): - """ - Decodes incoming str using `incoming` if they're - not already unicode. + """Decodes incoming str using `incoming` if they're not already unicode. :param incoming: Text's current encoding :param errors: Errors handling policy. See here for valid @@ -130,11 +126,10 @@ def safe_decode(text, incoming=None, errors='strict'): def safe_encode(text, incoming=None, encoding='utf-8', errors='strict'): - """ - Encodes incoming str/unicode using `encoding`. If - incoming is not specified, text is expected to - be encoded with current python's default encoding. - (`sys.getdefaultencoding`) + """Encodes incoming str/unicode using `encoding`. + + If incoming is not specified, text is expected to be encoded with + current python's default encoding. (`sys.getdefaultencoding`) :param incoming: Text's current encoding :param encoding: Expected encoding for text (Default UTF-8) |