From 98b97165ce9bef52fd779421a419bfef93fa15e3 Mon Sep 17 00:00:00 2001 From: Kaminyou Date: Fri, 19 Jan 2024 23:45:55 +0800 Subject: [PATCH] linting --- backend/parsers/parser.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/backend/parsers/parser.py b/backend/parsers/parser.py index 15dd812..932ec2b 100644 --- a/backend/parsers/parser.py +++ b/backend/parsers/parser.py @@ -1,7 +1,3 @@ -import time -from datetime import datetime - - PERSON_PROFILE_KEY = { 'name': str, 'gender': str, @@ -23,7 +19,6 @@ } - def parse_personal_profile( profile_instance, ): @@ -37,7 +32,7 @@ def parse_personal_profile( transform = PERSON_PROFILE_KEY[k] v = transform(v) response[k] = v - except: + except Exception: pass return response @@ -55,7 +50,7 @@ def parse_request_instance( transform = REQUEST_STATUS_KEY[k] v = transform(v) response[k] = v - except: + except Exception: pass return response @@ -80,6 +75,7 @@ def parse_user_instance(user_instance): response['category'] = user_instance.__dict__['category'].name return response + def parse_subordinate_instances(subordinate_instances): response = [] for subordinate_instance in subordinate_instances: @@ -87,6 +83,7 @@ def parse_subordinate_instances(subordinate_instances): response.append(parse_subordinate_instance(subordinate_instance)) return response + def parse_subordinate_instance(subordinate_instance): response = {} response['subordinate'] = subordinate_instance.__dict__['subordinate']