tools / hoho /__init__.py
jacklangerman's picture
add files
19b8852
raw
history blame
666 Bytes
from .hoho import *
from . import vis
from . import read_write_colmap
import importlib
import sys
class LazyLoadModule:
def __init__(self, module_name):
self.module_name = module_name
self.module = None
def __getattribute__(self, attr):
if attr == 'module_name' or attr == 'module':
return super().__getattribute__(attr)
if self.module is None:
self.module = importlib.import_module(f'hoho.{self.module_name}')
sys.modules[self.module_name] = self.module
return getattr(self.module, attr)
print('hi')
vis = LazyLoadModule('vis')
viz3d = LazyLoadModule('viz3d')
print(viz3d)