From 782783040ab6f560b49d960e0f38754c604d3a34 Mon Sep 17 00:00:00 2001 From: Ni Lingli <1195621865@qq.com> Date: Sun, 4 Jun 2023 01:50:13 +0800 Subject: [PATCH] pylint:fixed 1 --- app/Login.py | 5 ++--- app/UseSqlite.py | 2 +- app/pickle_idea.py | 3 +-- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/app/Login.py b/app/Login.py index 0cbb1f1..c2a9175 100644 --- a/app/Login.py +++ b/app/Login.py @@ -1,7 +1,7 @@ import hashlib import string from datetime import datetime, timedelta -from model.user import get_user_by_username, insert_user, update_password_by_username + def md5(s): ''' MD5摘要 @@ -11,7 +11,7 @@ def md5(s): h = hashlib.md5(s.encode(encoding='utf-8')) return h.hexdigest() - +from app.model.user import get_user_by_username, insert_user, update_password_by_username path_prefix = '/var/www/wordfreq/wordfreq/' path_prefix = './' # comment this line in deployment @@ -22,7 +22,6 @@ def verify_pass(newpass,oldpass): ''' if newpass==oldpass: return True - return False def verify_user(username, password): diff --git a/app/UseSqlite.py b/app/UseSqlite.py index 902d0a5..ea4baeb 100644 --- a/app/UseSqlite.py +++ b/app/UseSqlite.py @@ -13,7 +13,7 @@ class Sqlite3Template: def __init__(self, db_fname): self.db_fname = db_fname - def connect(self): + def connect(self, db_fname): self.conn = sqlite3.connect(self.db_fname) def instructions(self, query_statement): diff --git a/app/pickle_idea.py b/app/pickle_idea.py index 96f804b..7380102 100644 --- a/app/pickle_idea.py +++ b/app/pickle_idea.py @@ -38,8 +38,7 @@ def merge_frequency(lst1, lst2): def load_record(pickle_fname): with open(pickle_fname, 'rb') as f: - pickle.load(f) - f.close() + d=pickle.load(f) return d