rr- 9aea55e3d1 server/general: embrace most of PEP8
Ignored only the rules about continuing / hanging indentation.

Also, added __init__.py to tests so that pylint discovers them. (I don't
buy pytest's BS about installing your package.)
2016-08-14 16:44:03 +02:00

33 lines
589 B
Python

from collections import defaultdict
routes = defaultdict(dict) # pylint: disable=invalid-name
def get(url):
def wrapper(handler):
routes[url]['GET'] = handler
return handler
return wrapper
def put(url):
def wrapper(handler):
routes[url]['PUT'] = handler
return handler
return wrapper
def post(url):
def wrapper(handler):
routes[url]['POST'] = handler
return handler
return wrapper
def delete(url):
def wrapper(handler):
routes[url]['DELETE'] = handler
return handler
return wrapper