1
0
mirror of https://github.com/janeczku/calibre-web synced 2024-12-18 06:00:32 +00:00

Update gmail.json location

This commit is contained in:
Ozzie Isaacs 2022-03-21 18:50:02 +01:00
parent f5b79930ad
commit 0d49b56883
2 changed files with 4 additions and 4 deletions

View File

@ -43,7 +43,7 @@ Calibre-Web is a web app providing a clean interface for browsing, reading and d
1. To avoid problems with already installed python dependencies, it's recommended to create a virtual environment for Calibre-Web 1. To avoid problems with already installed python dependencies, it's recommended to create a virtual environment for Calibre-Web
2. Install Calibre-Web via pip with the command `pip install calibreweb` (Depending on your OS and or distro the command could also be `pip3`). 2. Install Calibre-Web via pip with the command `pip install calibreweb` (Depending on your OS and or distro the command could also be `pip3`).
3. Optional features can also be installed via pip, please refer to [this page](https://github.com/janeczku/calibre-web/wiki/Dependencies-in-Calibre-Web-Linux-Windows) for details 3. Optional features can also be installed via pip, please refer to [this page](https://github.com/janeczku/calibre-web/wiki/Dependencies-in-Calibre-Web-Linux-Windows) for details
4. Calibre-Web can be started afterwards by typing `cps` or `python3 -m cps` 4. Calibre-Web can be started afterwards by typing `cps`
In the Wiki there are also examples for a [manual installation](https://github.com/janeczku/calibre-web/wiki/Manual-installation) and for installation on [Linux Mint](https://github.com/janeczku/calibre-web/wiki/How-To:Install-Calibre-Web-in-Linux-Mint-19-or-20) In the Wiki there are also examples for a [manual installation](https://github.com/janeczku/calibre-web/wiki/Manual-installation) and for installation on [Linux Mint](https://github.com/janeczku/calibre-web/wiki/How-To:Install-Calibre-Web-in-Linux-Mint-19-or-20)

View File

@ -25,7 +25,7 @@ from google.oauth2.credentials import Credentials
from datetime import datetime from datetime import datetime
import base64 import base64
from flask_babel import gettext as _ from flask_babel import gettext as _
from ..constants import BASE_DIR from ..constants import CONFIG_DIR
from .. import logger from .. import logger
@ -53,11 +53,11 @@ def setup_gmail(token):
if creds and creds.expired and creds.refresh_token: if creds and creds.expired and creds.refresh_token:
creds.refresh(Request()) creds.refresh(Request())
else: else:
cred_file = os.path.join(BASE_DIR, 'gmail.json') cred_file = os.path.join(CONFIG_DIR, 'gmail.json')
if not os.path.exists(cred_file): if not os.path.exists(cred_file):
raise Exception(_("Found no valid gmail.json file with OAuth information")) raise Exception(_("Found no valid gmail.json file with OAuth information"))
flow = InstalledAppFlow.from_client_secrets_file( flow = InstalledAppFlow.from_client_secrets_file(
os.path.join(BASE_DIR, 'gmail.json'), SCOPES) os.path.join(CONFIG_DIR, 'gmail.json'), SCOPES)
creds = flow.run_local_server(port=0) creds = flow.run_local_server(port=0)
user_info = get_user_info(creds) user_info = get_user_info(creds)
return { return {