diff --git a/halfapi/cli.py b/halfapi/cli.py index f495cd0..aae92ab 100755 --- a/halfapi/cli.py +++ b/halfapi/cli.py @@ -89,7 +89,7 @@ def dbupdate(domain): def get_fct_name(http_verb, path): if path[0] != '/': raise Exception('Malformed path') - + elts = [] if len(path) == 1 else path[1:].split('/') fct_name = [http_verb.lower()] @@ -98,7 +98,7 @@ def dbupdate(domain): fct_name.append(elt[1:-1].split(':')[0].upper()) else: fct_name.append(elt) - + return '_'.join(fct_name) @@ -122,7 +122,7 @@ def dbupdate(domain): if len(route) == 0: route.insert() - + add_acls(acls, **route.to_dict()) diff --git a/halfapi/lib/routes.py b/halfapi/lib/routes.py index b90cce7..236847f 100644 --- a/halfapi/lib/routes.py +++ b/halfapi/lib/routes.py @@ -39,9 +39,9 @@ def get_routes(domains=None): return func(req, *args, **kwargs) raise HTTPException(401) - + return caller - + app_routes = [] for domain in Domain(name=domains).select(): domain_acl_mod = importlib.import_module(f'{domain["name"]}.acl') @@ -51,7 +51,7 @@ def get_routes(domains=None): router_mod = importlib.import_module( '{domain}.routers.{name}'.format(**router)) - + with APIRoute(domain=domain['name'], router=router['name']) as routes: for route in routes.select(): @@ -67,7 +67,7 @@ def get_routes(domains=None): acls ), methods=[route['http_verb']]) ) - + domain_routes.append( Mount('/{name}'.format(**router), routes=router_routes))