aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.snekrc19
-rw-r--r--.travis.yml5
-rw-r--r--error_handlers/http_404.py11
-rw-r--r--routes/healthcheck.py14
-rw-r--r--routes/index.py11
-rw-r--r--routes/invite.py12
6 files changed, 69 insertions, 3 deletions
diff --git a/.snekrc b/.snekrc
index 3f26eea5..db963566 100644
--- a/.snekrc
+++ b/.snekrc
@@ -1,6 +1,21 @@
[all]
-linters = flake8, safety, dodgy
+linters = flake8, safety, dodgy, yapf, isort
[flake8]
max-line-length=120
-application_import_names=pysite \ No newline at end of file
+application_import_names=pysite
+ignore=I100,I201
+
+[isort]
+line_length=120
+indent=' '
+multi_line_output=0
+length_sort=1
+use_parentheses=true
+sections=FUTURE,STDLIB,THIRDPARTY,FIRSTPARTY,LOCALFOLDER
+import_heading_stdlib=Stdlib
+import_heading_thirdparty=External Libraries
+import_heading_firstparty=Site Internals
+force_sort_within_sections=true
+
+[style] # yapf \ No newline at end of file
diff --git a/.travis.yml b/.travis.yml
index 90ae14fd..30c17486 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,4 +8,7 @@ install:
script:
- snekchek
after_success:
- "curl $AUTODEPLOY_WEBHOOK -H \"token: $AUTODEPLOY_TOKEN\"" \ No newline at end of file
+ "curl $AUTODEPLOY_WEBHOOK -H \"token: $AUTODEPLOY_TOKEN\""
+
+notifications:
+ email: false
diff --git a/error_handlers/http_404.py b/error_handlers/http_404.py
new file mode 100644
index 00000000..5920806f
--- /dev/null
+++ b/error_handlers/http_404.py
@@ -0,0 +1,11 @@
+# coding=utf-8
+
+# External Libraries
+from werkzeug.wrappers import Response
+
+
+class Index:
+ error_code = 404
+
+ def err(self):
+ return Response("Page not found!", 404)
diff --git a/routes/healthcheck.py b/routes/healthcheck.py
new file mode 100644
index 00000000..f06b18d3
--- /dev/null
+++ b/routes/healthcheck.py
@@ -0,0 +1,14 @@
+# coding=utf-8
+
+# External Libraries
+from werkzeug.wrappers import Response
+
+# Site Internals
+import ujson as json
+
+
+class Index:
+ path = ["/healthcheck"]
+
+ def get(self):
+ return Response(json.dumps({"status": "ok"}))
diff --git a/routes/index.py b/routes/index.py
new file mode 100644
index 00000000..403e5452
--- /dev/null
+++ b/routes/index.py
@@ -0,0 +1,11 @@
+# coding=utf-8
+
+# External Libraries
+from werkzeug.wrappers import Response
+
+
+class Index:
+ path = ["/", "/index"]
+
+ def get(self):
+ return Response("Coming soon:tm:")
diff --git a/routes/invite.py b/routes/invite.py
new file mode 100644
index 00000000..a3400cf2
--- /dev/null
+++ b/routes/invite.py
@@ -0,0 +1,12 @@
+# coding=utf-8
+
+# External Libraries
+from werkzeug.wrappers import Response
+
+
+class Index:
+ path = ["/invite"]
+
+ def get(self):
+ return Response(
+ status_code=301, text="http://invite.pythondiscord.com/")