From 02715dd97f74b198c904c3e5b5439fe54e10fa56 Mon Sep 17 00:00:00 2001 From: PhilipTrauner Date: Mon, 4 Jan 2016 03:57:00 +0100 Subject: [PATCH] Moved Routing from Server/Server.py to own file --- Shared/Routing.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Shared/Routing.py diff --git a/Shared/Routing.py b/Shared/Routing.py new file mode 100644 index 0000000..10653c2 --- /dev/null +++ b/Shared/Routing.py @@ -0,0 +1,17 @@ +class Route: + def __init__(self, **kwargs): + self.setup(**kwargs) + + def setup(self, **kwargs): + pass + + 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 \ No newline at end of file