Re enabled gevent as dependency

Fix #1399 (Calibre-web starting with installed and not activated gdrive denpendencies without internet connection again)
pull/1516/head
Ozzieisaacs 4 years ago
parent 88d2c60ee8
commit dde5b08c47

@ -724,7 +724,7 @@ def _configuration_result(error_flash=None, gdriveError=None):
gdriveError = _(gdriveError)
else:
# if config.config_use_google_drive and\
if not gdrive_authenticate:
if not gdrive_authenticate and gdrive_support:
gdrivefolders = gdriveutils.listRootFolders()
show_back_button = current_user.is_authenticated

@ -33,6 +33,7 @@ try:
from pydrive.drive import GoogleDrive
from pydrive.auth import RefreshError
from apiclient import errors
from httplib2 import ServerNotFoundError
gdrive_support = True
except ImportError:
gdrive_support = False
@ -192,9 +193,13 @@ def getDrive(drive=None, gauth=None):
return drive
def listRootFolders():
try:
drive = getDrive(Gdrive.Instance().drive)
folder = "'root' in parents and mimeType = 'application/vnd.google-apps.folder' and trashed = false"
fileList = drive.ListFile({'q': folder}).GetList()
except ServerNotFoundError as e:
log.info("GDrive Error %s" % e)
fileList = []
return fileList

@ -1,6 +1,6 @@
# GDrive Integration
google-api-python-client==1.7.11,<1.8.0
#gevent>=1.2.1,<20.6.0
gevent>=1.2.1,<20.6.0
greenlet>=0.4.12,<0.5.0
httplib2>=0.9.2,<0.18.0
oauth2client>=4.0.0,<4.1.4

Loading…
Cancel
Save