forked from mrlan/EnglishPal
				
			pylint:fixed 1
							parent
							
								
									9a95842b7c
								
							
						
					
					
						commit
						782783040a
					
				| 
						 | 
					@ -1,7 +1,7 @@
 | 
				
			||||||
import hashlib
 | 
					import hashlib
 | 
				
			||||||
import string
 | 
					import string
 | 
				
			||||||
from datetime import datetime, timedelta
 | 
					from datetime import datetime, timedelta
 | 
				
			||||||
from model.user import get_user_by_username, insert_user, update_password_by_username
 | 
					
 | 
				
			||||||
def md5(s):
 | 
					def md5(s):
 | 
				
			||||||
    '''
 | 
					    '''
 | 
				
			||||||
    MD5摘要
 | 
					    MD5摘要
 | 
				
			||||||
| 
						 | 
					@ -11,7 +11,7 @@ def md5(s):
 | 
				
			||||||
    h = hashlib.md5(s.encode(encoding='utf-8'))
 | 
					    h = hashlib.md5(s.encode(encoding='utf-8'))
 | 
				
			||||||
    return h.hexdigest()
 | 
					    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 = '/var/www/wordfreq/wordfreq/'
 | 
				
			||||||
path_prefix = './'  # comment this line in deployment
 | 
					path_prefix = './'  # comment this line in deployment
 | 
				
			||||||
| 
						 | 
					@ -22,7 +22,6 @@ def verify_pass(newpass,oldpass):
 | 
				
			||||||
    '''
 | 
					    '''
 | 
				
			||||||
    if newpass==oldpass:
 | 
					    if newpass==oldpass:
 | 
				
			||||||
        return True
 | 
					        return True
 | 
				
			||||||
    return False
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def verify_user(username, password):
 | 
					def verify_user(username, password):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -13,7 +13,7 @@ class Sqlite3Template:
 | 
				
			||||||
    def __init__(self, db_fname):
 | 
					    def __init__(self, db_fname):
 | 
				
			||||||
        self.db_fname = db_fname
 | 
					        self.db_fname = db_fname
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def connect(self):
 | 
					    def connect(self, db_fname):
 | 
				
			||||||
        self.conn = sqlite3.connect(self.db_fname)
 | 
					        self.conn = sqlite3.connect(self.db_fname)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def instructions(self, query_statement):
 | 
					    def instructions(self, query_statement):
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -38,8 +38,7 @@ def merge_frequency(lst1, lst2):
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def load_record(pickle_fname):
 | 
					def load_record(pickle_fname):
 | 
				
			||||||
    with open(pickle_fname, 'rb') as f:
 | 
					    with open(pickle_fname, 'rb') as f:
 | 
				
			||||||
        pickle.load(f)
 | 
					        d=pickle.load(f)
 | 
				
			||||||
    f.close()
 | 
					 | 
				
			||||||
    return d
 | 
					    return d
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue