This repository has been archived on 2025-06-04. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
fl0w-old/Shared/Routing.py
2016-01-11 11:51:01 +01:00

20 lines
No EOL
422 B
Python

class ServerRoute:
def __init__(self, **kwargs):
self.setup(**kwargs)
def setup(self, **kwargs):
pass
def run(self, data, handler):
pass
class ClientRoute:
def run(self, data, handler):
pass
def create_routes(routes):
routes = routes.copy()
for prefix in routes:
if type(routes[prefix]) is tuple or type(routes[prefix]) is list:
routes[prefix] = routes[prefix][0](**routes[prefix][1])
return routes