Convert to black formatting
This commit is contained in:
12
app/third_party/app/__init__.py
vendored
12
app/third_party/app/__init__.py
vendored
@@ -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
|
||||
|
16
app/third_party/app/config.py
vendored
16
app/third_party/app/config.py
vendored
@@ -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}
|
||||
|
2
app/third_party/app/routes.py
vendored
2
app/third_party/app/routes.py
vendored
@@ -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
|
||||
|
Reference in New Issue
Block a user