m1n1.utils.Reloadable: Be verbose about what gets reloaded

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-06-22 01:16:42 +09:00
parent 026c16c7c2
commit d942984b72

View file

@ -78,6 +78,7 @@ class Reloadable(metaclass=ReloadableMeta):
continue continue
newest = max(newest, os.stat(source).st_mtime, pcls._load_time) newest = max(newest, os.stat(source).st_mtime, pcls._load_time)
if (reloaded or pcls._load_time < newest) and mod.__name__ not in reloaded: if (reloaded or pcls._load_time < newest) and mod.__name__ not in reloaded:
print(f"Reload: {mod.__name__}")
mod = importlib.reload(mod) mod = importlib.reload(mod)
reloaded.add(mod.__name__) reloaded.add(mod.__name__)