refactor: use relative imports for own module

This commit is contained in:
Vlad Stan 2023-01-09 11:54:17 +02:00
parent e97fb086cc
commit 8cd6c7c9bc
12 changed files with 15 additions and 20 deletions

View File

@ -1,10 +1,10 @@
import asyncio import asyncio
from lnbits.core.models import Payment from lnbits.core.models import Payment
from lnbits.extensions.events.models import CreateTicket
from lnbits.helpers import get_current_extension_name from lnbits.helpers import get_current_extension_name
from lnbits.tasks import register_invoice_listener from lnbits.tasks import register_invoice_listener
from .models import CreateTicket
from .views_api import api_ticket_send_ticket from .views_api import api_ticket_send_ticket

View File

@ -7,7 +7,6 @@ from lnbits.core.crud import get_user
from lnbits.core.services import create_invoice from lnbits.core.services import create_invoice
from lnbits.core.views.api import api_payment from lnbits.core.views.api import api_payment
from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.decorators import WalletTypeInfo, get_key_type
from lnbits.extensions.events.models import CreateEvent, CreateTicket
from . import events_ext from . import events_ext
from .crud import ( from .crud import (
@ -24,6 +23,7 @@ from .crud import (
reg_ticket, reg_ticket,
update_event, update_event,
) )
from .models import CreateEvent, CreateTicket
# Events # Events

View File

@ -2,7 +2,7 @@ import json
import httpx import httpx
from lnbits.extensions.lnaddress.models import Domains from .models import Domains
async def cloudflare_create_record(domain: Domains, ip: str): async def cloudflare_create_record(domain: Domains, ip: str):

View File

@ -6,7 +6,6 @@ from fastapi import Depends, HTTPException, Query, Request
from lnbits.core.crud import get_user from lnbits.core.crud import get_user
from lnbits.core.services import check_transaction_status, create_invoice from lnbits.core.services import check_transaction_status, create_invoice
from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.decorators import WalletTypeInfo, get_key_type
from lnbits.extensions.lnaddress.models import CreateAddress, CreateDomain
from . import lnaddress_ext from . import lnaddress_ext
from .cloudflare import cloudflare_create_record from .cloudflare import cloudflare_create_record
@ -23,6 +22,7 @@ from .crud import (
get_domains, get_domains,
update_domain, update_domain,
) )
from .models import CreateAddress, CreateDomain
# DOMAINS # DOMAINS

View File

@ -8,7 +8,6 @@ from lnbits.core.crud import get_user
from lnbits.core.services import create_invoice from lnbits.core.services import create_invoice
from lnbits.core.views.api import api_payment from lnbits.core.views.api import api_payment
from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.decorators import WalletTypeInfo, get_key_type
from lnbits.extensions.lnticket.models import CreateFormData, CreateTicketData
from . import lnticket_ext from . import lnticket_ext
from .crud import ( from .crud import (
@ -23,6 +22,7 @@ from .crud import (
set_ticket_paid, set_ticket_paid,
update_form, update_form,
) )
from .models import CreateFormData, CreateTicketData
# FORMS # FORMS

View File

@ -10,8 +10,8 @@ from collections import defaultdict
from fastapi import WebSocket from fastapi import WebSocket
from loguru import logger from loguru import logger
from lnbits.extensions.market.crud import create_chat_message from .crud import create_chat_message
from lnbits.extensions.market.models import CreateChatMessage from .models import CreateChatMessage
class Notifier: class Notifier:

View File

@ -17,10 +17,8 @@ from starlette.responses import HTMLResponse
from lnbits.core.models import User from lnbits.core.models import User
from lnbits.decorators import check_user_exists # type: ignore from lnbits.decorators import check_user_exists # type: ignore
from lnbits.extensions.market import market_ext, market_renderer
from lnbits.extensions.market.models import CreateChatMessage, SetSettings
from lnbits.extensions.market.notifier import Notifier
from . import market_ext, market_renderer
from .crud import ( from .crud import (
create_chat_message, create_chat_message,
create_market_settings, create_market_settings,
@ -35,6 +33,8 @@ from .crud import (
get_market_zones, get_market_zones,
update_market_product_stock, update_market_product_stock,
) )
from .models import CreateChatMessage, SetSettings
from .notifier import Notifier
templates = Jinja2Templates(directory="templates") templates = Jinja2Templates(directory="templates")

View File

@ -4,11 +4,10 @@ import json
from loguru import logger from loguru import logger
from lnbits.core.models import Payment from lnbits.core.models import Payment
from lnbits.extensions.satspay.crud import check_address_balance, get_charge
from lnbits.helpers import get_current_extension_name from lnbits.helpers import get_current_extension_name
from lnbits.tasks import register_invoice_listener from lnbits.tasks import register_invoice_listener
from .crud import update_charge from .crud import check_address_balance, get_charge, update_charge
from .helpers import call_webhook from .helpers import call_webhook

View File

@ -6,10 +6,10 @@ from starlette.responses import HTMLResponse
from lnbits.core.models import User from lnbits.core.models import User
from lnbits.decorators import check_user_exists from lnbits.decorators import check_user_exists
from lnbits.extensions.satspay.helpers import public_charge
from . import satspay_ext, satspay_renderer from . import satspay_ext, satspay_renderer
from .crud import get_charge, get_theme from .crud import get_charge, get_theme
from .helpers import public_charge
templates = Jinja2Templates(directory="templates") templates = Jinja2Templates(directory="templates")

View File

@ -8,11 +8,6 @@ from starlette.responses import RedirectResponse
from lnbits.core.crud import get_user from lnbits.core.crud import get_user
from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.decorators import WalletTypeInfo, get_key_type
from lnbits.extensions.satspay.models import CreateCharge from lnbits.extensions.satspay.models import CreateCharge
from lnbits.extensions.streamalerts.models import (
CreateDonation,
CreateService,
ValidateDonation,
)
from lnbits.utils.exchange_rates import btc_price from lnbits.utils.exchange_rates import btc_price
from ..satspay.crud import create_charge, get_charge from ..satspay.crud import create_charge, get_charge
@ -33,6 +28,7 @@ from .crud import (
update_donation, update_donation,
update_service, update_service,
) )
from .models import CreateDonation, CreateService, ValidateDonation
@streamalerts_ext.post("/api/v1/services") @streamalerts_ext.post("/api/v1/services")

View File

@ -2,7 +2,7 @@ import json
import httpx import httpx
from lnbits.extensions.subdomains.models import Domains from .models import Domains
async def cloudflare_create_subdomain( async def cloudflare_create_subdomain(

View File

@ -6,7 +6,6 @@ from starlette.exceptions import HTTPException
from lnbits.core.crud import get_user from lnbits.core.crud import get_user
from lnbits.core.services import check_transaction_status, create_invoice from lnbits.core.services import check_transaction_status, create_invoice
from lnbits.decorators import WalletTypeInfo, get_key_type from lnbits.decorators import WalletTypeInfo, get_key_type
from lnbits.extensions.subdomains.models import CreateDomain, CreateSubdomain
from . import subdomains_ext from . import subdomains_ext
from .cloudflare import cloudflare_create_subdomain, cloudflare_deletesubdomain from .cloudflare import cloudflare_create_subdomain, cloudflare_deletesubdomain
@ -22,6 +21,7 @@ from .crud import (
get_subdomains, get_subdomains,
update_domain, update_domain,
) )
from .models import CreateDomain, CreateSubdomain
# domainS # domainS