bugfix
This commit is contained in:
parent
5df13d1cbb
commit
4186659cd0
@ -44,7 +44,7 @@ if __name__ == '__main__':
|
|||||||
i18n = getI18N(path=workdir)
|
i18n = getI18N(path=workdir)
|
||||||
# server = ConfiguredServer(auth_klass=MyAuthAPI, workdir=workdir)
|
# server = ConfiguredServer(auth_klass=MyAuthAPI, workdir=workdir)
|
||||||
server = ConfiguredServer(workdir=workdir)
|
server = ConfiguredServer(workdir=workdir)
|
||||||
load_plugins(workdir)
|
load_plugins(workdir, server)
|
||||||
logger.info(f'gadget version={__version__}')
|
logger.info(f'gadget version={__version__}')
|
||||||
logger.debug(f'debug mode show ?')
|
logger.debug(f'debug mode show ?')
|
||||||
port = args.port or config.website.port or 8080
|
port = args.port or config.website.port or 8080
|
||||||
|
@ -4,14 +4,15 @@ import sys
|
|||||||
from appPublic.folderUtils import listFile
|
from appPublic.folderUtils import listFile
|
||||||
from appPublic.ExecFile import ExecFile
|
from appPublic.ExecFile import ExecFile
|
||||||
|
|
||||||
def load_plugins(p_dir):
|
def load_plugins(p_dir, server):
|
||||||
ef = ExecFile()
|
ef = ExecFile()
|
||||||
pdir = os.path.join(p_dir, 'plugins')
|
pdir = os.path.join(p_dir, 'plugins')
|
||||||
if not os.path.isdir(pdir):
|
if not os.path.isdir(pdir):
|
||||||
print('load_plugins:%s not exists' % pdir)
|
print('load_plugins:%s not exists' % pdir)
|
||||||
return
|
return
|
||||||
sys.path.append(pdir)
|
sys.path.append(pdir)
|
||||||
for py in listFile(pdir, suffixs=['.py'], rescursive=True):
|
ef.set('server', server)
|
||||||
|
for py in listFile(pdir, suffixs=['.py'], rescursive=False):
|
||||||
ef.set('sys',sys)
|
ef.set('sys',sys)
|
||||||
ef.run(py)
|
ef.run(py)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user