summaryrefslogtreecommitdiff
path: root/src/home/soundsensor/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/home/soundsensor/__init__.py')
-rw-r--r--src/home/soundsensor/__init__.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/home/soundsensor/__init__.py b/src/home/soundsensor/__init__.py
new file mode 100644
index 0000000..30052f8
--- /dev/null
+++ b/src/home/soundsensor/__init__.py
@@ -0,0 +1,22 @@
+import importlib
+
+__all__ = [
+ 'SoundSensorNode',
+ 'SoundSensorHitHandler',
+ 'SoundSensorServer',
+ 'SoundSensorServerGuardClient'
+]
+
+
+def __getattr__(name):
+ if name in __all__:
+ if name == 'SoundSensorNode':
+ file = 'node'
+ elif name == 'SoundSensorServerGuardClient':
+ file = 'server_client'
+ else:
+ file = 'server'
+ module = importlib.import_module(f'.{file}', __name__)
+ return getattr(module, name)
+
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")