Skip to content
Snippets Groups Projects

Fix all linting violation

Merged Bo-Chun Chen requested to merge louistw/account-app:fix-linting into master
1 file
+ 39
0
Compare changes
  • Side-by-side
  • Inline
+ 39
0
 
"""
 
This python module defines celery tasks for following fucntions:
 
* Account creation
 
* Account certification
 
"""
# standard imports
# standard imports
import json
import json
import sys
import sys
@@ -22,7 +27,24 @@ timeout = 30
@@ -22,7 +27,24 @@ timeout = 30
def gen_f(room):
def gen_f(room):
 
"""
 
This function defines the callback function for creating account process.
 
Inputs:
 
room: Room/session ID for the flask session, so that communications are going to the right session.
 
Output:
 
RabbitMQ callback function.
 
"""
def callback(channel, method, properties, body):
def callback(channel, method, properties, body):
 
"""
 
This function defines the RabbitMQ callback function executed after account creation process.
 
Inputs:
 
channel: channel over which the RabbitMQ communication is happening.
 
method: Defines meta information regarding the message delivery.
 
properties: user-defined properties on the message
 
body: Message that is passed throughout account creation process across multiple agents.
 
Output:
 
Send appropriate message to the frontend, for account creation success or failure. And delete the queue.
 
"""
msg = json.loads(body)
msg = json.loads(body)
username = msg["username"]
username = msg["username"]
queuename = msg["queuename"]
queuename = msg["queuename"]
@@ -44,7 +66,24 @@ def gen_f(room):
@@ -44,7 +66,24 @@ def gen_f(room):
def certify_gen_f(room):
def certify_gen_f(room):
 
"""
 
This function defines the callback function for certifying account process.
 
Inputs:
 
room: Room/session ID for the flask session, so that communications are going to the right session.
 
Output:
 
RabbitMQ callback function.
 
"""
def callback(channel, method, properties, body):
def callback(channel, method, properties, body):
 
"""
 
This function defines the RabbitMQ callback function executed after account certification process.
 
Inputs:
 
channel: channel over which the RabbitMQ communication is happening.
 
method: Defines meta information regarding the message delivery.
 
properties: user-defined properties on the message
 
body: Message that is passed throughout account creation process across multiple agents.
 
Output:
 
Send appropriate message to the frontend, for account certification success or failure. And delete the queue.
 
"""
msg = json.loads(body)
msg = json.loads(body)
username = msg["username"]
username = msg["username"]
queuename = msg["queuename"]
queuename = msg["queuename"]
Loading