From ecc62b0011ba6c2194ebb6f5b15f22fcaed716c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?dni=20=E2=9A=A1?= Date: Mon, 14 Oct 2024 09:35:41 +0200 Subject: [PATCH] feat: explicitly export for extensions from `__init__.py` (#2669) * feat: explicitly export for extensions from `__init__.py` makes it clear what extensions are expected to use and also makes future changes to the structure of core safer because extension can just depend on ```from lnbits import require_admin_key``` for example --- lnbits/__init__.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lnbits/__init__.py b/lnbits/__init__.py index e69de29bb..5c2e31194 100644 --- a/lnbits/__init__.py +++ b/lnbits/__init__.py @@ -0,0 +1,24 @@ +from .core.services import create_invoice, pay_invoice +from .decorators import ( + check_admin, + check_super_user, + check_user_exists, + require_admin_key, + require_invoice_key, +) +from .exceptions import InvoiceError, PaymentError + +__all__ = [ + # decorators + "require_admin_key", + "require_invoice_key", + "check_admin", + "check_super_user", + "check_user_exists", + # services + "pay_invoice", + "create_invoice", + # exceptions + "PaymentError", + "InvoiceError", +]