Use black for formatting

This commit is contained in:
richard-dds
2018-06-26 10:31:39 -04:00
parent 3599440ee6
commit f9335c7a4e
28 changed files with 362 additions and 255 deletions

View File

@@ -20,14 +20,14 @@ def make_app(config, deps, **kwargs):
routes = [
url(r"/", Home, {"page": "login"}, name="main"),
url(
r"/login",
Login,
{"authnid_client": deps["authnid_client"]},
name="login",
),
url(r"/login", Login, {"authnid_client": deps["authnid_client"]}, name="login"),
url(r"/home", MainHandler, {"page": "home"}, name="home"),
url( r"/workspaces/blank", MainHandler, {'page': 'workspaces_blank'}, name='workspaces_blank' ),
url(
r"/workspaces/blank",
MainHandler,
{"page": "workspaces_blank"},
name="workspaces_blank",
),
url(
r"/workspaces",
Workspace,
@@ -37,13 +37,15 @@ def make_app(config, deps, **kwargs):
url(
r"/requests",
Request,
{"page": "requests", 'requests_client': deps['requests_client']},
name="requests"),
{"page": "requests", "requests_client": deps["requests_client"]},
name="requests",
),
url(
r"/requests/new",
RequestNew,
{"page": "requests_new", "requests_client": deps["requests_client"]},
name="request_new"),
name="request_new",
),
url(
r"/requests/new/([0-9])",
RequestNew,
@@ -67,12 +69,11 @@ def make_app(config, deps, **kwargs):
app = tornado.web.Application(
routes,
login_url="/",
template_path = home.child('templates'),
static_path = home.child('static'),
template_path=home.child("templates"),
static_path=home.child("static"),
cookie_secret=config["default"]["COOKIE_SECRET"],
debug=config['default'].getboolean('DEBUG'),
**kwargs
debug=config["default"].getboolean("DEBUG"),
**kwargs,
)
app.config = config
return app
@@ -80,23 +81,30 @@ def make_app(config, deps, **kwargs):
def make_deps(config):
# we do not want to do SSL verify services in test and development
validate_cert = ENV == 'production'
validate_cert = ENV == "production"
return {
'authz_client': ApiClient(config["default"]["AUTHZ_BASE_URL"], api_version='v1', validate_cert=validate_cert),
'authnid_client': ApiClient(config["default"]["AUTHNID_BASE_URL"], api_version='v1', validate_cert=validate_cert),
'requests_client': ApiClient(config["default"]["REQUESTS_QUEUE_BASE_URL"], api_version='v1', validate_cert=validate_cert)
"authz_client": ApiClient(
config["default"]["AUTHZ_BASE_URL"],
api_version="v1",
validate_cert=validate_cert,
),
"authnid_client": ApiClient(
config["default"]["AUTHNID_BASE_URL"],
api_version="v1",
validate_cert=validate_cert,
),
"requests_client": ApiClient(
config["default"]["REQUESTS_QUEUE_BASE_URL"],
api_version="v1",
validate_cert=validate_cert,
),
}
def make_config():
BASE_CONFIG_FILENAME = os.path.join(
os.path.dirname(__file__),
"../config/base.ini"
)
BASE_CONFIG_FILENAME = os.path.join(os.path.dirname(__file__), "../config/base.ini")
ENV_CONFIG_FILENAME = os.path.join(
os.path.dirname(__file__),
"../config/",
"{}.ini".format(ENV.lower())
os.path.dirname(__file__), "../config/", "{}.ini".format(ENV.lower())
)
config = ConfigParser()