From 28d2d94a9100c1a809955cde93fdbb7a36263057 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Thu, 5 Sep 2019 18:49:36 -0700 Subject: refactor all python source for client lib name --- python/fatcat_web/__init__.py | 10 +++++----- python/fatcat_web/auth.py | 4 ++-- python/fatcat_web/editing_routes.py | 4 ++-- python/fatcat_web/entity_helpers.py | 2 +- python/fatcat_web/forms.py | 2 +- python/fatcat_web/routes.py | 4 ++-- python/fatcat_web/web_config.py | 2 +- 7 files changed, 14 insertions(+), 14 deletions(-) (limited to 'python/fatcat_web') diff --git a/python/fatcat_web/__init__.py b/python/fatcat_web/__init__.py index ba789609..50757858 100644 --- a/python/fatcat_web/__init__.py +++ b/python/fatcat_web/__init__.py @@ -10,7 +10,7 @@ from flask_mwoauth import MWOAuth from authlib.flask.client import OAuth from loginpass import create_flask_blueprint, Gitlab, GitHub, ORCiD from raven.contrib.flask import Sentry -import fatcat_client +import fatcat_openapi_client from fatcat_web.web_config import Config @@ -39,20 +39,20 @@ oauth = OAuth(app) # Grabs sentry config from SENTRY_DSN environment variable sentry = Sentry(app) -conf = fatcat_client.Configuration() +conf = fatcat_openapi_client.Configuration() conf.host = Config.FATCAT_API_HOST -api = fatcat_client.DefaultApi(fatcat_client.ApiClient(conf)) +api = fatcat_openapi_client.DefaultApi(fatcat_openapi_client.ApiClient(conf)) # remove most jinja2 template whitespace app.jinja_env.trim_blocks = True app.jinja_env.lstrip_blocks = True def auth_api(token): - conf = fatcat_client.Configuration() + conf = fatcat_openapi_client.Configuration() conf.api_key["Authorization"] = token conf.api_key_prefix["Authorization"] = "Bearer" conf.host = Config.FATCAT_API_HOST - return fatcat_client.DefaultApi(fatcat_client.ApiClient(conf)) + return fatcat_openapi_client.DefaultApi(fatcat_openapi_client.ApiClient(conf)) if Config.FATCAT_API_AUTH_TOKEN: print("Found and using privileged token (eg, for account signup)") diff --git a/python/fatcat_web/auth.py b/python/fatcat_web/auth.py index 06c8475b..fc2430f1 100644 --- a/python/fatcat_web/auth.py +++ b/python/fatcat_web/auth.py @@ -6,7 +6,7 @@ from flask import Flask, render_template, send_from_directory, request, \ url_for, abort, g, redirect, jsonify, session, flash from flask_login import logout_user, login_user, UserMixin from fatcat_web import login_manager, app, api, priv_api, Config -import fatcat_client +import fatcat_openapi_client def handle_logout(): logout_user() @@ -62,7 +62,7 @@ def handle_oauth(remote, token, user_info): else: preferred_username = user_info['sub'] - params = fatcat_client.AuthOidc(remote.name, user_info['sub'], iss, preferred_username) + params = fatcat_openapi_client.AuthOidc(remote.name, user_info['sub'], iss, preferred_username) # this call requires admin privs (resp, http_status, http_headers) = priv_api.auth_oidc_with_http_info(params) editor = resp.editor diff --git a/python/fatcat_web/editing_routes.py b/python/fatcat_web/editing_routes.py index 73db76a6..87223868 100644 --- a/python/fatcat_web/editing_routes.py +++ b/python/fatcat_web/editing_routes.py @@ -5,8 +5,8 @@ from flask import Flask, render_template, send_from_directory, request, \ url_for, abort, g, redirect, jsonify, session, flash, Response from flask_login import login_required -from fatcat_client import Editgroup -from fatcat_client.rest import ApiException +from fatcat_openapi_client import Editgroup +from fatcat_openapi_client.rest import ApiException from fatcat_tools.transforms import * from fatcat_web import app, api, auth_api, priv_api from fatcat_web.auth import handle_token_login, handle_logout, load_user, handle_ia_xauth diff --git a/python/fatcat_web/entity_helpers.py b/python/fatcat_web/entity_helpers.py index d6a6eb26..043c67ca 100644 --- a/python/fatcat_web/entity_helpers.py +++ b/python/fatcat_web/entity_helpers.py @@ -1,6 +1,6 @@ from flask import abort -from fatcat_client.rest import ApiException +from fatcat_openapi_client.rest import ApiException from fatcat_tools.transforms import * from fatcat_web import app, api from fatcat_web.search import get_elastic_container_stats, get_elastic_container_random_releases diff --git a/python/fatcat_web/forms.py b/python/fatcat_web/forms.py index 4a1ca3e7..b3073fb9 100644 --- a/python/fatcat_web/forms.py +++ b/python/fatcat_web/forms.py @@ -8,7 +8,7 @@ from flask_wtf import FlaskForm from wtforms import SelectField, DateField, StringField, IntegerField, \ HiddenField, FormField, FieldList, validators -from fatcat_client import ContainerEntity, CreatorEntity, FileEntity, \ +from fatcat_openapi_client import ContainerEntity, CreatorEntity, FileEntity, \ ReleaseEntity, ReleaseContrib, FileUrl, ReleaseExtIds release_type_options = [ diff --git a/python/fatcat_web/routes.py b/python/fatcat_web/routes.py index d41d6bdf..b626ad1d 100644 --- a/python/fatcat_web/routes.py +++ b/python/fatcat_web/routes.py @@ -6,8 +6,8 @@ from flask import Flask, render_template, make_response, send_from_directory, \ from flask_login import login_required from flask_wtf.csrf import CSRFError -from fatcat_client import Editgroup, EditgroupAnnotation -from fatcat_client.rest import ApiException +from fatcat_openapi_client import Editgroup, EditgroupAnnotation +from fatcat_openapi_client.rest import ApiException from fatcat_tools.transforms import * from fatcat_tools.normal import * from fatcat_web import app, api, auth_api, priv_api, mwoauth diff --git a/python/fatcat_web/web_config.py b/python/fatcat_web/web_config.py index e681b397..ec37b66d 100644 --- a/python/fatcat_web/web_config.py +++ b/python/fatcat_web/web_config.py @@ -72,7 +72,7 @@ class Config(object): GIT_RELEASE = None SENTRY_CONFIG = { - #'include_paths': ['fatcat_web', 'fatcat_client', 'fatcat_tools'], + #'include_paths': ['fatcat_web', 'fatcat_openapi_client', 'fatcat_tools'], 'enable-threads': True, # for uWSGI 'release': GIT_RELEASE, 'tags': { -- cgit v1.2.3