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