mirror of
https://github.com/markqvist/Reticulum.git
synced 2025-08-03 12:06:29 -04:00
Allow dynamic sub-module import from compiled python bytecode
This commit is contained in:
parent
19adadf4cf
commit
8df89cc2d0
7 changed files with 26 additions and 13 deletions
|
@ -43,8 +43,10 @@ from .Resource import Resource, ResourceAdvertisement
|
|||
from .Cryptography import HKDF
|
||||
from .Cryptography import Hashes
|
||||
|
||||
modules = glob.glob(os.path.dirname(__file__)+"/*.py")
|
||||
__all__ = [ os.path.basename(f)[:-3] for f in modules if not f.endswith('__init__.py')]
|
||||
py_modules = glob.glob(os.path.dirname(__file__)+"/*.py")
|
||||
pyc_modules = glob.glob(os.path.dirname(__file__)+"/*.pyc")
|
||||
modules = py_modules+pyc_modules
|
||||
__all__ = list(set([os.path.basename(f).replace(".pyc", "").replace(".py", "") for f in modules if not (f.endswith("__init__.py") or f.endswith("__init__.pyc"))]))
|
||||
|
||||
LOG_CRITICAL = 0
|
||||
LOG_ERROR = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue