cleaned trailing spaces

This commit is contained in:
Maxime Alves LIRMM@home 2020-07-28 09:46:21 +02:00
parent e4d0b6c17e
commit ad3792340c
2 changed files with 7 additions and 7 deletions

View File

@ -89,7 +89,7 @@ def dbupdate(domain):
def get_fct_name(http_verb, path): def get_fct_name(http_verb, path):
if path[0] != '/': if path[0] != '/':
raise Exception('Malformed path') raise Exception('Malformed path')
elts = [] if len(path) == 1 else path[1:].split('/') elts = [] if len(path) == 1 else path[1:].split('/')
fct_name = [http_verb.lower()] fct_name = [http_verb.lower()]
@ -98,7 +98,7 @@ def dbupdate(domain):
fct_name.append(elt[1:-1].split(':')[0].upper()) fct_name.append(elt[1:-1].split(':')[0].upper())
else: else:
fct_name.append(elt) fct_name.append(elt)
return '_'.join(fct_name) return '_'.join(fct_name)
@ -122,7 +122,7 @@ def dbupdate(domain):
if len(route) == 0: if len(route) == 0:
route.insert() route.insert()
add_acls(acls, **route.to_dict()) add_acls(acls, **route.to_dict())

View File

@ -39,9 +39,9 @@ def get_routes(domains=None):
return func(req, *args, **kwargs) return func(req, *args, **kwargs)
raise HTTPException(401) raise HTTPException(401)
return caller return caller
app_routes = [] app_routes = []
for domain in Domain(name=domains).select(): for domain in Domain(name=domains).select():
domain_acl_mod = importlib.import_module(f'{domain["name"]}.acl') domain_acl_mod = importlib.import_module(f'{domain["name"]}.acl')
@ -51,7 +51,7 @@ def get_routes(domains=None):
router_mod = importlib.import_module( router_mod = importlib.import_module(
'{domain}.routers.{name}'.format(**router)) '{domain}.routers.{name}'.format(**router))
with APIRoute(domain=domain['name'], with APIRoute(domain=domain['name'],
router=router['name']) as routes: router=router['name']) as routes:
for route in routes.select(): for route in routes.select():
@ -67,7 +67,7 @@ def get_routes(domains=None):
acls acls
), methods=[route['http_verb']]) ), methods=[route['http_verb']])
) )
domain_routes.append( domain_routes.append(
Mount('/{name}'.format(**router), routes=router_routes)) Mount('/{name}'.format(**router), routes=router_routes))