Convert to black formatting

This commit is contained in:
Alan Pryor
2019-08-03 12:55:38 -04:00
parent 9bdaa8f161
commit 9b136b1ffa
59 changed files with 512 additions and 476 deletions

View File

@@ -3,12 +3,14 @@ def create_bp(env=None):
from flask_sqlalchemy import SQLAlchemy
from flask_restplus import Api, Resource, Namespace
bp = Blueprint('Example third party API', __name__)
api = Api(bp, title='Flaskerific API', version='0.1.0')
ns = Namespace('Third party hello world API')
@ns.route('/')
bp = Blueprint("Example third party API", __name__)
api = Api(bp, title="Flaskerific API", version="0.1.0")
ns = Namespace("Third party hello world API")
@ns.route("/")
class ExampleResource(Resource):
def get(self):
return "I'm a third party API!"
api.add_namespace(ns, path='/hello_world')
api.add_namespace(ns, path="/hello_world")
return bp

View File

@@ -5,16 +5,17 @@ basedir = os.path.abspath(os.path.dirname(__file__))
class BaseConfig:
CONFIG_NAME = 'base'
CONFIG_NAME = "base"
USE_MOCK_EQUIVALENCY = False
DEBUG = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
class DevelopmentConfig(BaseConfig):
CONFIG_NAME = 'dev'
CONFIG_NAME = "dev"
SECRET_KEY = os.getenv(
"DEV_SECRET_KEY", "You can't see California without Marlon Widgeto's eyes")
"DEV_SECRET_KEY", "You can't see California without Marlon Widgeto's eyes"
)
DEBUG = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
TESTING = False
@@ -22,7 +23,7 @@ class DevelopmentConfig(BaseConfig):
class TestingConfig(BaseConfig):
CONFIG_NAME = 'test'
CONFIG_NAME = "test"
SECRET_KEY = os.getenv("TEST_SECRET_KEY", "Thanos did nothing wrong")
DEBUG = True
SQLALCHEMY_TRACK_MODIFICATIONS = False
@@ -31,7 +32,7 @@ class TestingConfig(BaseConfig):
class ProductionConfig(BaseConfig):
CONFIG_NAME = 'prod'
CONFIG_NAME = "prod"
SECRET_KEY = os.getenv("PROD_SECRET_KEY", "I'm Ron Burgundy?")
DEBUG = False
SQLALCHEMY_TRACK_MODIFICATIONS = False
@@ -40,5 +41,8 @@ class ProductionConfig(BaseConfig):
EXPORT_CONFIGS: List[Type[BaseConfig]] = [
DevelopmentConfig, TestingConfig, ProductionConfig]
DevelopmentConfig,
TestingConfig,
ProductionConfig,
]
config_by_name = {cfg.CONFIG_NAME: cfg for cfg in EXPORT_CONFIGS}

View File

@@ -1,4 +1,4 @@
def register_routes(api, app, root='api'):
def register_routes(api, app, root="api"):
from app.widget import register_routes as attach_widget
from app.fizz import register_routes as attach_fizz
from app.other_api import register_routes as attach_other_api