This commit is contained in:
yumoqing 2023-10-27 11:43:23 +08:00
parent 5c0f786a8e
commit 21b2b907fd

View File

@ -4,6 +4,9 @@ import sys
from appPublic.folderUtils import listFile
from appPublic.ExecFile import ExecFile
from ahserver.serverenv import ServerEnv
import appPublic
import sqlor
import ahserver
def load_plugins(p_dir):
ef = ExecFile()
@ -15,8 +18,11 @@ def load_plugins(p_dir):
ef.set('sys',sys)
ef.set('ServerEnv', ServerEnv)
for m in listFile(pdir, suffixs='.py'):
if m.endswith('__init__.py'):
if m == '__init__.py':
continue
if not m.endswith('.py'):
continue
print(f'{m=}')
module = os.path.basename(m[:-3])
print('module=', module)
__import__(module, locals(), globals())