mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 14:39:19 +00:00
removed unnecessary imports from backup manager files
This commit is contained in:
@@ -11,12 +11,11 @@
|
|||||||
# gdrive_client_secret
|
# gdrive_client_secret
|
||||||
|
|
||||||
import httplib2
|
import httplib2
|
||||||
import sys
|
|
||||||
import os
|
import os
|
||||||
import mimetypes
|
import mimetypes
|
||||||
import webnotes
|
import webnotes
|
||||||
import oauth2client.client
|
import oauth2client.client
|
||||||
from webnotes.utils import get_request_site_address, get_base_path
|
from webnotes.utils import get_base_path
|
||||||
from webnotes import _, msgprint
|
from webnotes import _, msgprint
|
||||||
from apiclient.discovery import build
|
from apiclient.discovery import build
|
||||||
from apiclient.http import MediaFileUpload
|
from apiclient.http import MediaFileUpload
|
||||||
@@ -53,7 +52,7 @@ def backup_to_gdrive():
|
|||||||
from webnotes.utils.backups import new_backup
|
from webnotes.utils.backups import new_backup
|
||||||
if not webnotes.conn:
|
if not webnotes.conn:
|
||||||
webnotes.connect()
|
webnotes.connect()
|
||||||
flow = get_gdrive_flow()
|
get_gdrive_flow()
|
||||||
credentials_json = webnotes.conn.get_value("Backup Manager", None, "gdrive_credentials")
|
credentials_json = webnotes.conn.get_value("Backup Manager", None, "gdrive_credentials")
|
||||||
credentials = oauth2client.client.Credentials.new_from_json(credentials_json)
|
credentials = oauth2client.client.Credentials.new_from_json(credentials_json)
|
||||||
http = httplib2.Http()
|
http = httplib2.Http()
|
||||||
@@ -101,11 +100,6 @@ def get_gdrive_flow():
|
|||||||
webnotes.msgprint(_("Please set Google Drive access keys in") + " conf.py",
|
webnotes.msgprint(_("Please set Google Drive access keys in") + " conf.py",
|
||||||
raise_exception=True)
|
raise_exception=True)
|
||||||
|
|
||||||
#callback_url = get_request_site_address(True) \
|
|
||||||
# + "?cmd=setup.doctype.backup_manager.backup_googledrive.googledrive_callback"
|
|
||||||
|
|
||||||
# for installed apps since google does not support subdomains
|
|
||||||
|
|
||||||
flow = OAuth2WebServerFlow(conf.gdrive_client_id, conf.gdrive_client_secret,
|
flow = OAuth2WebServerFlow(conf.gdrive_client_id, conf.gdrive_client_secret,
|
||||||
"https://www.googleapis.com/auth/drive", 'urn:ietf:wg:oauth:2.0:oob')
|
"https://www.googleapis.com/auth/drive", 'urn:ietf:wg:oauth:2.0:oob')
|
||||||
return flow
|
return flow
|
||||||
|
|||||||
@@ -3,8 +3,6 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import webnotes
|
import webnotes
|
||||||
from webnotes import _
|
from webnotes import _
|
||||||
from backup_dropbox import dropbox_callback, get_dropbox_session, get_dropbox_authorize_url
|
|
||||||
from backup_googledrive import gdrive_callback, get_gdrive_flow, get_gdrive_authorize_url
|
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self, d, dl):
|
def __init__(self, d, dl):
|
||||||
|
|||||||
Reference in New Issue
Block a user