bugfix
This commit is contained in:
parent
36c86520f0
commit
3f8fcc359d
@ -16,6 +16,7 @@ from .auth_api import AuthAPI
|
||||
from .myTE import setupTemplateEngine
|
||||
from .globalEnv import initEnv
|
||||
from .filestorage import TmpFileRecord
|
||||
from .loadplugins import load_plugins
|
||||
|
||||
class ConfiguredServer(AppLogger):
|
||||
def __init__(self, auth_klass=AuthAPI, workdir=None):
|
||||
@ -37,7 +38,7 @@ class ConfiguredServer(AppLogger):
|
||||
if config.website.client_max_size:
|
||||
client_max_size = config.website.client_max_size
|
||||
|
||||
print(f'{client_max_size=}')
|
||||
load_plugins(self.workdir)
|
||||
self.app = web.Application(client_max_size=client_max_size)
|
||||
|
||||
async def init_auth(self):
|
||||
|
21
ahserver/loadplugins.py
Normal file
21
ahserver/loadplugins.py
Normal file
@ -0,0 +1,21 @@
|
||||
import os
|
||||
import sys
|
||||
|
||||
from appPublic.folderUtils import listFile
|
||||
from appPublic.ExecFile import ExecFile
|
||||
from ahserver.serverenv import ServerEnv
|
||||
|
||||
def load_plugins(p_dir):
|
||||
ef = ExecFile()
|
||||
pdir = os.path.join(p_dir, 'plugins')
|
||||
if not os.path.isdir(pdir):
|
||||
print('load_plugins:%s not exists' % pdir)
|
||||
return
|
||||
sys.path.append(pdir)
|
||||
ef.set('sys',sys)
|
||||
ef.set('ServerEnv', ServerEnv)
|
||||
for m in listFile(pdir, subfixs='.py'):
|
||||
if m.endswith('__init__.py'):
|
||||
continue
|
||||
__import__(m[:-3], locals(), globals())
|
||||
|
Loading…
Reference in New Issue
Block a user