Skip to content

Commit a83f481

Browse files
committed
Homogenize route declaration indentation
1 parent 71df294 commit a83f481

File tree

5 files changed

+39
-14
lines changed

5 files changed

+39
-14
lines changed

deepaas/api/v2/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,12 @@ def get_app(enable_train=True, enable_predict=True):
3838

3939
v2_debug.setup_debug()
4040

41-
APP.router.add_get('/', get_version, name="v2", allow_head=False)
41+
APP.router.add_get(
42+
'/',
43+
get_version,
44+
name="v2",
45+
allow_head=False
46+
)
4247
v2_debug.setup_routes(APP)
4348
v2_model.setup_routes(APP)
4449
v2_train.setup_routes(APP, enable=enable_train)

deepaas/api/v2/debug.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,8 @@ async def get(request, wsk_args=None):
9494

9595

9696
def setup_routes(app):
97-
app.router.add_get("/debug/", get, allow_head=False)
97+
app.router.add_get(
98+
"/debug/",
99+
get,
100+
allow_head=False
101+
)

deepaas/api/v2/models.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,19 @@ async def get(self, request, wsk_args=None):
8888

8989

9090
def setup_routes(app):
91-
app.router.add_get("/models/", index, allow_head=False)
91+
app.router.add_get(
92+
"/models/",
93+
index,
94+
allow_head=False
95+
)
9296

9397
# In the next lines we iterate over the loaded models and create the
9498
# different resources for each model. This way we can also load the
9599
# expected parameters if needed (as in the training method).
96100
for model_name, model_obj in model.V2_MODELS.items():
97101
hdlr = _get_handler(model_name, model_obj)
98-
app.router.add_get("/models/%s/" % model_name,
99-
hdlr.get,
100-
allow_head=False)
102+
app.router.add_get(
103+
"/models/%s/" % model_name,
104+
hdlr.get,
105+
allow_head=False
106+
)

deepaas/api/v2/predict.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,4 +98,7 @@ def setup_routes(app, enable=True):
9898
hdlr = _get_handler(model_name, model_obj)
9999
else:
100100
hdlr = utils.NotEnabledHandler()
101-
app.router.add_post("/models/%s/predict/" % model_name, hdlr.post)
101+
app.router.add_post(
102+
"/models/%s/predict/" % model_name,
103+
hdlr.post
104+
)

deepaas/api/v2/train.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,20 @@ def setup_routes(app, enable=True):
139139
hdlr = _get_handler(model_name, model_obj)
140140
else:
141141
hdlr = utils.NotEnabledHandler()
142-
app.router.add_post("/models/%s/train/" % model_name, hdlr.post)
143-
app.router.add_get("/models/%s/train/" % model_name,
144-
hdlr.index,
145-
allow_head=False)
146-
app.router.add_get("/models/%s/train/{uuid}" % model_name,
147-
hdlr.get,
148-
allow_head=False)
142+
app.router.add_post(
143+
"/models/%s/train/" % model_name,
144+
hdlr.post
145+
)
146+
app.router.add_get(
147+
"/models/%s/train/" % model_name,
148+
hdlr.index,
149+
allow_head=False
150+
)
151+
app.router.add_get(
152+
"/models/%s/train/{uuid}" % model_name,
153+
hdlr.get,
154+
allow_head=False
155+
)
149156
app.router.add_delete(
150157
"/models/%s/train/{uuid}" % model_name,
151158
hdlr.delete

0 commit comments

Comments
 (0)