commit 517ce30c5535fa30bdf58b7a24eb4e22c978a8ef
parent f54c132fef2bcc80f037227634b1894f5f12e8b1
Author: René Wagner <rwa@clttr.info>
Date: Sat, 3 Jun 2023 14:06:52 +0200
remove unused dependency 'twisted'
Diffstat:
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
@@ -13,7 +13,6 @@ jetforce = { git = "https://github.com/michael-lazar/jetforce", branch = "master
jinja2 = "^3.1.2"
peewee = "^3.16"
feedparser = "^6.0.10"
-twisted = "^22.1.0"
[tool.poetry.dev-dependencies]
black = "^19.10b0"
diff --git a/serve/views.py b/serve/views.py
@@ -6,8 +6,6 @@ from urllib.parse import quote, unquote
import jinja2
from jetforce import Request, Response, Status, JetforceApplication
-from twisted.internet.threads import deferToThread
-
from . import constants
from .models import (
compute_verbose,
@@ -31,15 +29,7 @@ def datetimeformat(value, format="%Y-%m-%d"):
return value.strftime(format)
-def threadaddressformat(value):
- depth = len(value.split("."))
- if depth > 1:
- return " " * (depth - 1) + "↳"
- return ""
-
-
template_env.filters["datetimeformat"] = datetimeformat
-template_env.filters["threadaddressformat"] = threadaddressformat
def render_template(name: str, *args, **kwargs) -> str:
@@ -64,12 +54,12 @@ def status(request):
User-agent: indexer
User-agent: archiver
Disallow: /v/search
-Disallow: /search
+Disallow: /searce
Disallow: /backlinks
User-agent: *
Disallow: /add-seed
-Disallow: /threads""")
+""")
@app.route("/favicon.txt", strict_trailing_slash=False)
def favicon(request):
@@ -245,9 +235,6 @@ def search(request):
# )
return body
- def deferred_search():
- yield deferToThread(perform_search)
-
return Response(Status.SUCCESS, "text/gemini", deferred_search())
else:
return Response(Status.INPUT, "Search query")