mirror of
https://github.com/LukeHagar/connexion.git
synced 2025-12-06 04:19:26 +00:00
allow running python3 setup.py flake8
This commit is contained in:
@@ -14,7 +14,7 @@ Unless required by applicable law or agreed to in writing, software distributed
|
||||
"""
|
||||
|
||||
|
||||
from flask import abort, request, send_file, send_from_directory, render_template, render_template_string, url_for
|
||||
from connexion.app import App
|
||||
from connexion.api import Api
|
||||
import werkzeug.exceptions as exceptions
|
||||
from flask import abort, request, send_file, send_from_directory, render_template, render_template_string, url_for # noqa
|
||||
from connexion.app import App # noqa
|
||||
from connexion.api import Api # noqa
|
||||
import werkzeug.exceptions as exceptions # noqa
|
||||
|
||||
@@ -22,16 +22,16 @@ def flaskify_endpoint(identifier: str) -> str:
|
||||
|
||||
|
||||
def flaskify_path(swagger_path: str) -> str:
|
||||
"""
|
||||
Convert swagger path templates to flask path templates
|
||||
"""
|
||||
translation_table = str.maketrans('{-}', '<_>')
|
||||
# TODO add types
|
||||
return swagger_path.translate(translation_table)
|
||||
"""
|
||||
Convert swagger path templates to flask path templates
|
||||
"""
|
||||
translation_table = str.maketrans('{-}', '<_>')
|
||||
# TODO add types
|
||||
return swagger_path.translate(translation_table)
|
||||
|
||||
|
||||
def get_function_from_name(operation_id: str):
|
||||
module_name, function_name = operation_id.rsplit('.', maxsplit=1)
|
||||
module = importlib.import_module(module_name)
|
||||
function = getattr(module, function_name)
|
||||
return function
|
||||
module_name, function_name = operation_id.rsplit('.', maxsplit=1)
|
||||
module = importlib.import_module(module_name)
|
||||
function = getattr(module, function_name)
|
||||
return function
|
||||
|
||||
Reference in New Issue
Block a user