From 3585caa93d9e48ab61a670eeb575e2300d450673 Mon Sep 17 00:00:00 2001 From: 1F616EMO Date: Tue, 26 Dec 2023 16:28:27 +0800 Subject: [PATCH] Code structure minor fix --- bchosttrust/__init__.py | 8 ++++---- bchosttrust/analysis/__init__.py | 1 + bchosttrust/consensus/__init__.py | 4 ++-- bchosttrust/internal/__init__.py | 4 ++-- bchosttrust/storage/__init__.py | 4 ++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/bchosttrust/__init__.py b/bchosttrust/__init__.py index e7e134c..12a5b6c 100644 --- a/bchosttrust/__init__.py +++ b/bchosttrust/__init__.py @@ -20,6 +20,10 @@ # The legal text of GPLv3 and LGPLv3 can be found at # bchosttrust/gpl-3.0.txt and bchosttrust/lgpl-3.0.txt respectively. +import lazy_loader as lazy + +from .internal import BCHTBlock, BCHTEntry + __version__ = "0.0.3" __all__ = ( @@ -33,8 +37,4 @@ "exceptions" ) -import lazy_loader as lazy - -from .internal import BCHTBlock, BCHTEntry - __getattr__, __dir__, _ = lazy.attach(__name__, __all__) diff --git a/bchosttrust/analysis/__init__.py b/bchosttrust/analysis/__init__.py index 8467f38..24d797a 100644 --- a/bchosttrust/analysis/__init__.py +++ b/bchosttrust/analysis/__init__.py @@ -25,6 +25,7 @@ from ..internal import BCHTBlock from ..storage import BCHTStorageBase from ..storage.import_block import parse_curr_hashes + __all__ = ("search", "tree", "horizontal") __getattr__, __dir__, _ = lazy.attach(__name__, __all__) diff --git a/bchosttrust/consensus/__init__.py b/bchosttrust/consensus/__init__.py index 6877d29..2a214c2 100644 --- a/bchosttrust/consensus/__init__.py +++ b/bchosttrust/consensus/__init__.py @@ -19,14 +19,14 @@ # The legal text of GPLv3 and LGPLv3 can be found at # bchosttrust/gpl-3.0.txt and bchosttrust/lgpl-3.0.txt respectively. -__all__ = ("powc", "limitations") - import lazy_loader as lazy from bchosttrust.internal.block import BCHTBlock from .powc import validate_block_hash from .limitations import validate_block_limitations +__all__ = ("powc", "limitations") + __getattr__, __dir__, _ = lazy.attach(__name__, __all__) diff --git a/bchosttrust/internal/__init__.py b/bchosttrust/internal/__init__.py index 5dfb1ef..34c8cf5 100644 --- a/bchosttrust/internal/__init__.py +++ b/bchosttrust/internal/__init__.py @@ -19,10 +19,10 @@ # The legal text of GPLv3 and LGPLv3 can be found at # bchosttrust/gpl-3.0.txt and bchosttrust/lgpl-3.0.txt respectively. -__all__ = ("block", ) - import lazy_loader as lazy from .block import BCHTBlock, BCHTEntry +__all__ = ("block", ) + __getattr__, __dir__, _ = lazy.attach(__name__, __all__) diff --git a/bchosttrust/storage/__init__.py b/bchosttrust/storage/__init__.py index 86e2e09..0062495 100644 --- a/bchosttrust/storage/__init__.py +++ b/bchosttrust/storage/__init__.py @@ -19,8 +19,6 @@ # The legal text of GPLv3 and LGPLv3 can be found at # bchosttrust/gpl-3.0.txt and bchosttrust/lgpl-3.0.txt respectively. -__all__ = ("leveldb", "meta", "dummy") - import os import lazy_loader as lazy @@ -29,6 +27,8 @@ from .dummy import BCHTDummyStorage from ..utils import get_data_path +__all__ = ("leveldb", "meta", "dummy") + __getattr__, __dir__, _ = lazy.attach(__name__, __all__)