Merge pull request #28 from anandpdoshi/master

Download Backup
This commit is contained in:
Rushabh Mehta 2011-08-30 06:01:28 -07:00
commit 453e266f7f

View file

@ -123,7 +123,7 @@ def get_backup():
"""
#if verbose: print webnotes.conn.cur_db_name + " " + webnotes.defs.db_password
odb = BackupGenerator(webnotes.conn.cur_db_name, webnotes.conn.cur_db_name,\
webnotes.defs.db_password)
get_db_password(webnotes.conn.cur_db_name))
recipient_list = odb.get_backup()
delete_temp_backups()
webnotes.msgprint("""A download link to your backup will be emailed \
@ -131,6 +131,19 @@ def get_backup():
%s""" % (', '.join(recipient_list)))
def get_db_password(db_name):
"""
Get db password from defs
"""
from webnotes import defs
if hasattr(defs, 'get_db_password'):
return defs.get_db_password(db_name)
if hasattr(defs, 'db_password'):
return defs.db_password
def delete_temp_backups():
"""
Cleans up the backup_link_path directory by deleting files older than 24 hours