slightly cleaner
This commit is contained in:
@ -42,9 +42,9 @@ class ModuleManager:
|
|||||||
|
|
||||||
|
|
||||||
def _update_new(self):
|
def _update_new(self):
|
||||||
for fn in self.fnames:
|
for fn in self.get_fnames():
|
||||||
if fn in self.modules:
|
if fn in self.modules:
|
||||||
print(f"{fn} already cached... skipping")
|
print(f"{fn} already cached... skipping load")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
mod = Module(fn)
|
mod = Module(fn)
|
||||||
@ -64,16 +64,16 @@ class ModuleManager:
|
|||||||
for mod in self.modules.values():
|
for mod in self.modules.values():
|
||||||
if mod.is_running:
|
if mod.is_running:
|
||||||
print(f"{mod.name} is running already")
|
print(f"{mod.name} is running already")
|
||||||
else:
|
continue
|
||||||
print(f"{mod.name} starting")
|
|
||||||
try:
|
print(f"{mod.name} starting")
|
||||||
mod.start()
|
try:
|
||||||
except MissingRunFunctionError:
|
mod.start()
|
||||||
print(f"{mod.name} has no function to run")
|
except MissingRunFunctionError:
|
||||||
|
print(f"{mod.name} has no function to run")
|
||||||
|
|
||||||
|
|
||||||
@property
|
def get_fnames(self):
|
||||||
def fnames(self):
|
|
||||||
fns = self.folder.glob("*.py")
|
fns = self.folder.glob("*.py")
|
||||||
return sorted(fns)
|
return sorted(fns)
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user