From 14f41fb1a35b5956a7228d73b0ec0252c6eb7ab7 Mon Sep 17 00:00:00 2001 From: shu-mutou Date: Fri, 5 Feb 2016 11:23:22 +0900 Subject: [PATCH] Fix H405 violations There are H405 violation codes. We need to fix the code for avoiding more violations. Change-Id: Ia42cc20f2d2c19740feb57f80f166d715e4abc88 Closes-Bug: #1521899 --- tox.ini | 2 -- zaqar_ui/api/rest/zaqar.py | 9 +++------ zaqar_ui/api/zaqar.py | 24 ++++++++++-------------- 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/tox.ini b/tox.ini index 7234faf..2de97d9 100644 --- a/tox.ini +++ b/tox.ini @@ -59,8 +59,6 @@ downloadcache = ~/cache/pip [flake8] exclude = .venv,.git,.tox,dist,*openstack/common*,*lib/python*,*egg,build,panel_template,dash_template,local_settings.py,*/local/*,*/test/test_plugins/*,.ropeproject -# H405 multi line docstring summary not separated with an empty line -ignore = H405 max-complexity = 20 [hacking] diff --git a/zaqar_ui/api/rest/zaqar.py b/zaqar_ui/api/rest/zaqar.py index 1ac2708..65d3f12 100644 --- a/zaqar_ui/api/rest/zaqar.py +++ b/zaqar_ui/api/rest/zaqar.py @@ -22,21 +22,18 @@ from openstack_dashboard.api.rest import utils as rest_utils @urls.register class Queue(generic.View): - """API for retrieving a single queue - """ + """API for retrieving a single queue""" url_regex = r'zaqar/queues/(?P[^/]+)$' @rest_utils.ajax() def get(self, request, queue_name): - """Get a specific queue - """ + """Get a specific queue""" return zaqar.queue_show(request, queue_name).to_dict() @urls.register class Queues(generic.View): - """API for queues - """ + """API for queues""" url_regex = r'zaqar/queues/$' @rest_utils.ajax() diff --git a/zaqar_ui/api/zaqar.py b/zaqar_ui/api/zaqar.py index dc8d308..c4dd55c 100644 --- a/zaqar_ui/api/zaqar.py +++ b/zaqar_ui/api/zaqar.py @@ -55,12 +55,11 @@ def queue_list(request, limit=None, marker=None): def queue_create(request, queue_name, metadata): - """Pop up a modal form, which contains several inputbox: - 1. queue_name - 2. ttl - 3. max message size - 4. Metadata - """ + # Pop up a modal form, which contains several inputbox: + # 1. queue_name + # 2. ttl + # 3. max message size + # 4. Metadata queue = zaqarclient(request).queue(queue_name, force_create=True) queue.metadata(new_meta=metadata) @@ -72,9 +71,8 @@ def queue_delete(request, queue_name): def queue_update(request, queue_name, metadata): - """Popup a modal form, the queue name is a realonly label or inputbox. - user can change ttl, max message size and metadata - """ + # Popup a modal form, the queue name is a realonly label or inputbox. + # user can change ttl, max message size and metadata queue = zaqarclient(request).queue(queue_name, auto_create=False) queue.metadata(new_meta=metadata) @@ -85,9 +83,7 @@ def queue_get(request, queue_name): def queue_subscribe(request, subscriber, ttl=None, options={}): - """Popup a modal form, user can input subscriber, ttl and options to - subscribe the queue. - - subscriber could be an URL or email address. - """ + # Popup a modal form, user can input subscriber, ttl and options to + # subscribe the queue. + # subscriber could be an URL or email address. pass