aboutsummaryrefslogtreecommitdiffstats
path: root/pysite/base_route.py
diff options
context:
space:
mode:
authorGravatar martmists <[email protected]>2018-02-05 20:26:54 +0100
committerGravatar martmists <[email protected]>2018-02-05 20:26:54 +0100
commit80a1ab522e7a49f3ea1168d8658fbff293c866f1 (patch)
tree206a45b1a68c273db43ad04b105bcd3e7c48f565 /pysite/base_route.py
parentDynamic route loader; proper application structure (diff)
Major update
- Switch to Japronto - More linters - Rewrite route handling - Rewrite error handling - Rewrite static handling - Error when no `Index` propery is found - Probably some more stuff? idk Code needs testing; Maybe we could use pytest? Signed-off-by: martmists <[email protected]>
Diffstat (limited to 'pysite/base_route.py')
-rw-r--r--pysite/base_route.py29
1 files changed, 0 insertions, 29 deletions
diff --git a/pysite/base_route.py b/pysite/base_route.py
deleted file mode 100644
index 76338280..00000000
--- a/pysite/base_route.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# coding=utf-8
-from flask import Flask
-from flask.views import MethodView
-
-__author__ = "Gareth Coles"
-
-
-class BaseView(MethodView):
- path = None #: str
- name = None #: str
-
- @classmethod
- def setup(cls: "BaseView", app: Flask):
- if not cls.path or not cls.name:
- raise RuntimeError("Route views must have both `path` and `name` defined")
-
- app.add_url_rule(cls.path, view_func=cls.as_view(cls.name))
-
-
-class ErrorView(MethodView):
- name = None #: str
- error_code = None #: int
-
- @classmethod
- def setup(cls: "ErrorView", app: Flask):
- if not cls.name or not cls.error_code:
- raise RuntimeError("Error views must have both `name` and `error_code` defined")
-
- app._register_error_handler(None, 404, cls.as_view(cls.name))