Merge branch 'master' into edge

This commit is contained in:
Anand Doshi 2013-04-23 17:08:34 +05:30
commit deb31432dd
2 changed files with 9 additions and 5 deletions

View File

@ -21,6 +21,11 @@ from webnotes import _, msgprint
from apiclient.discovery import build
from apiclient.http import MediaFileUpload
# define log config for google drive api's log messages
# basicConfig redirects log to stderr
import logging
logging.basicConfig()
@webnotes.whitelist()
def get_gdrive_authorize_url():
flow = get_gdrive_flow()
@ -31,9 +36,6 @@ def get_gdrive_authorize_url():
@webnotes.whitelist()
def upload_files(name, mimetype, service, folder_id):
import logging
logging.basicConfig()
if not webnotes.conn:
webnotes.connect()
file_name = os.path.basename(name)

View File

@ -33,7 +33,8 @@ def take_backups_dropbox():
send_email(True, "Dropbox")
except Exception:
error_message = ("\n".join(error_log) + "\n" + webnotes.getTraceback())
file_and_error = [" - ".join(f) for f in zip(did_not_upload, error_log)]
error_message = ("\n".join(file_and_error) + "\n" + webnotes.getTraceback())
print error_message
send_email(False, "Dropbox", error_message)
@ -48,7 +49,8 @@ def take_backups_gdrive():
send_email(True, "Google Drive")
except Exception:
error_message = ("\n".join(error_log) + "\n" + webnotes.getTraceback())
file_and_error = [" - ".join(f) for f in zip(did_not_upload, error_log)]
error_message = ("\n".join(file_and_error) + "\n" + webnotes.getTraceback())
print error_message
send_email(False, "Google Drive", error_message)