general cleanup and unused imports removal

This commit is contained in:
Tiago vasconcelos
2021-11-25 18:52:16 +00:00
parent 2b0bd43974
commit cfac70d394
62 changed files with 159 additions and 442 deletions
-1
View File
@@ -77,7 +77,6 @@ async def get_subdomainBySubdomain(subdomain: str) -> Optional[Subdomains]:
"SELECT s.*, d.domain as domain_name FROM subdomains.subdomain s INNER JOIN domain d ON (s.domain = d.id) WHERE s.subdomain = ?",
(subdomain,),
)
print(row)
return Subdomains(**row) if row else None
-11
View File
@@ -18,17 +18,6 @@ async def wait_for_paid_invoices():
await on_invoice_paid(payment)
# async def register_listeners():
# invoice_paid_chan_send, invoice_paid_chan_recv = trio.open_memory_channel(2)
# register_invoice_listener(invoice_paid_chan_send)
# await wait_for_paid_invoices(invoice_paid_chan_recv)
# async def wait_for_paid_invoices(invoice_paid_chan: trio.MemoryReceiveChannel):
# async for payment in invoice_paid_chan:
# await on_invoice_paid(payment)
async def on_invoice_paid(payment: Payment) -> None:
if "lnsubdomain" != payment.extra.get("tag"):
# not an lnurlp invoice
+1 -5
View File
@@ -1,11 +1,7 @@
from lnbits.extensions.subdomains.models import Subdomains
# Python3 program to validate
# domain name
# using regular expression
import re
import socket
# Function to validate domain name.
def isValidDomain(str):
# Regex to check valid