lnbits-legend/lnbits/extensions/boltcards/__init__.py

38 lines
949 B
Python
Raw Normal View History

2022-08-29 09:32:13 -06:00
import asyncio
2022-06-13 21:08:06 +02:00
from fastapi import APIRouter
2022-08-14 23:52:55 +02:00
from starlette.staticfiles import StaticFiles
2022-06-13 21:08:06 +02:00
from lnbits.db import Database
from lnbits.helpers import template_renderer
2022-08-29 09:32:13 -06:00
from lnbits.tasks import catch_everything_and_restart
2022-06-13 21:08:06 +02:00
db = Database("ext_boltcards")
2022-08-14 23:52:55 +02:00
boltcards_static_files = [
{
"path": "/boltcards/static",
"app": StaticFiles(packages=[("lnbits", "extensions/boltcards/static")]),
"name": "boltcards_static",
}
]
2022-07-15 16:43:06 +02:00
boltcards_ext: APIRouter = APIRouter(prefix="/boltcards", tags=["boltcards"])
2022-06-13 21:08:06 +02:00
2022-08-29 14:18:18 +01:00
2022-06-13 21:08:06 +02:00
def boltcards_renderer():
return template_renderer(["lnbits/extensions/boltcards/templates"])
2022-08-29 14:18:18 +01:00
from .lnurl import * # noqa: F401,F403
from .tasks import * # noqa: F401,F403
2022-08-29 09:32:13 -06:00
def boltcards_start():
loop = asyncio.get_event_loop()
2023-01-22 10:04:34 +00:00
loop.create_task(catch_everything_and_restart(wait_for_paid_invoices)) # noqa: F405
2022-08-29 09:32:13 -06:00
from .views import * # noqa: F401,F403
from .views_api import * # noqa: F401,F403