Massive speedup in executing startup_scripts
This commit is contained in:
parent
fd955544af
commit
05d32ae705
2 changed files with 19 additions and 4 deletions
startup_scripts
18
startup_scripts/__main__.py
Normal file
18
startup_scripts/__main__.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/env python3
|
||||
|
||||
import runpy
|
||||
from os import scandir
|
||||
from os.path import dirname, abspath
|
||||
|
||||
this_dir = dirname(abspath(__file__))
|
||||
|
||||
def filename(f):
|
||||
return f.name
|
||||
|
||||
with scandir(dirname(abspath(__file__))) as it:
|
||||
for f in sorted(it, key = filename):
|
||||
if f.name.startswith('__') or not f.is_file():
|
||||
continue
|
||||
|
||||
print(f"Running {f.path}")
|
||||
runpy.run_path(f.path)
|
Loading…
Add table
Add a link
Reference in a new issue