allow running python3 setup.py flake8

This commit is contained in:
Henning Jacobs
2015-06-12 10:42:25 +02:00
parent 0803c4b954
commit 8e440446d5
3 changed files with 16 additions and 14 deletions

View File

@@ -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

View File

@@ -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

2
tox.ini Normal file
View File

@@ -0,0 +1,2 @@
[flake8]
max-line-length = 120