Oauth is optional again
@ -36,7 +36,11 @@ from cps.shelf import shelf
from cps.admin import admi
from cps.gdrive import gdrive
from cps.editbooks import editbook
from cps.oauth_bb import oauth
try:
oauth_available = True
except ImportError:
oauth_available = False
if __name__ == '__main__':
@ -49,7 +53,8 @@ if __name__ == '__main__':
app.register_blueprint(admi)
app.register_blueprint(gdrive)
app.register_blueprint(editbook)
app.register_blueprint(oauth)
if oauth_available:
Server.startServer()
@ -23,7 +23,7 @@
from flask import Blueprint
from flask_login import login_required
import db
from cps import db
import sys
import uploader
from babel import __version__ as babelVersion
@ -26,7 +26,7 @@ from cps import config, language_table, get_locale, app, ub, global_WorkerThread
from flask import request, flash, redirect, url_for, abort, Markup, Response
import datetime
import os
import json
from flask_babel import gettext as _
@ -19,13 +19,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from cps import config, global_WorkerThread, get_locale
from cps import config, global_WorkerThread, get_locale, db
from flask import current_app as app
from tempfile import gettempdir
import re
import unicodedata
import worker
import time
@ -22,12 +22,11 @@
# opds routing functions
from cps import config, mimetypes, app
from cps import config, mimetypes, app, db
from flask import request, render_template, Response, g, make_response
from pagination import Pagination
import ub
from flask_login import current_user
from functools import wraps
@ -22,13 +22,11 @@
from flask import Blueprint, request, flash, redirect, url_for
from cps import ub, searched_ids
from cps import ub, searched_ids, app, db
from sqlalchemy.sql.expression import func, or_
from flask_login import login_required, current_user
from web import render_title_template
from cps import app
shelf = Blueprint('shelf', __name__)
@ -40,10 +40,9 @@ import json
from iso639 import languages as isoLanguages
import gdriveutils
from redirect import redirect_back
from cps import lm, babel, ub, config, get_locale, language_table, app
from cps import lm, babel, ub, config, get_locale, language_table, app, db
from sqlalchemy.sql.expression import text