mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
Replaced sanic.exceptions.NotFound
This commit is contained in:
parent
979ae4f916
commit
3c4d4f3535
4 changed files with 7 additions and 4 deletions
|
|
@ -12,7 +12,6 @@ from pathlib import Path
|
|||
import click
|
||||
from markupsafe import Markup
|
||||
from jinja2 import ChoiceLoader, Environment, FileSystemLoader, PrefixLoader
|
||||
from sanic.exceptions import NotFound
|
||||
|
||||
from .views.base import DatasetteError, ureg, AsgiRouter
|
||||
from .views.database import DatabaseDownload, DatabaseView
|
||||
|
|
@ -35,6 +34,7 @@ from .utils import (
|
|||
)
|
||||
from .utils.asgi import (
|
||||
AsgiLifespan,
|
||||
NotFound,
|
||||
asgi_static,
|
||||
asgi_send,
|
||||
asgi_send_html,
|
||||
|
|
|
|||
|
|
@ -7,6 +7,10 @@ import re
|
|||
import aiofiles
|
||||
|
||||
|
||||
class NotFound(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class AsgiRouter:
|
||||
def __init__(self, routes=None):
|
||||
routes = routes or []
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import urllib
|
|||
import jinja2
|
||||
import pint
|
||||
from sanic import response
|
||||
from sanic.exceptions import NotFound
|
||||
|
||||
from html import escape
|
||||
|
||||
|
|
@ -27,7 +26,7 @@ from datasette.utils import (
|
|||
sqlite3,
|
||||
to_css_class,
|
||||
)
|
||||
from datasette.utils.asgi import AsgiStream, AsgiWriter, AsgiRouter, AsgiView
|
||||
from datasette.utils.asgi import AsgiStream, AsgiWriter, AsgiRouter, AsgiView, NotFound
|
||||
|
||||
ureg = pint.UnitRegistry()
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ import itertools
|
|||
import json
|
||||
|
||||
import jinja2
|
||||
from sanic.exceptions import NotFound
|
||||
|
||||
from datasette.plugins import pm
|
||||
from datasette.utils import (
|
||||
|
|
@ -24,6 +23,7 @@ from datasette.utils import (
|
|||
urlsafe_components,
|
||||
value_as_boolean,
|
||||
)
|
||||
from datasette.utils.asgi import NotFound
|
||||
from datasette.filters import Filters
|
||||
from .base import DataView, DatasetteError, ureg
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue