generated from ApeWorX/project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
perf: make plugin load faster for
ape --help
(#48)
- Loading branch information
Showing
9 changed files
with
127 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,25 @@ | ||
from ape import plugins | ||
from importlib import import_module | ||
from typing import Any | ||
|
||
from ape_ledger.accounts import AccountContainer, LedgerAccount | ||
from ape import plugins | ||
|
||
|
||
@plugins.register(plugins.AccountPlugin) | ||
def account_types(): | ||
from ape_ledger.accounts import AccountContainer, LedgerAccount | ||
|
||
return AccountContainer, LedgerAccount | ||
|
||
|
||
def __getattr__(name: str) -> Any: | ||
if name in ("AccountContainer", "LedgerAccount"): | ||
return getattr(import_module("ape_ledger.accounts"), name) | ||
|
||
else: | ||
raise AttributeError(name) | ||
|
||
|
||
__all__ = [ | ||
"AccountContainer", | ||
"LedgerAccount", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.