INNER CODE UNIT · Python
module_name
ALW1EZ/PANO · entities/__init__.py:18
module_name = filename[:-3] # Remove .py extension
module = importlib.import_module(f'.{module_name}', package='entities')
# Find all Entity subclasses in the module
for name, obj in inspect.getmembers(module):
if (inspect.isclass(obj) and issubclass(obj, Entity)
and obj != Entity and not inspect.isabstract(obj)):
ENTITY_TYPES[obj.__name__] = obj
# Load entities when the module is imported
load_entities()
__all__ = ['Entity', 'ENTITY_TYPES', 'load_entities']