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