linkkf 로직수정중
This commit is contained in:
@@ -8,6 +8,8 @@ from support import SupportYaml
|
||||
from . import (Logic, default_route, default_route_single_module,
|
||||
get_model_setting)
|
||||
|
||||
from loguru import logger as logger1
|
||||
|
||||
|
||||
class PluginBase(object):
|
||||
package_name = None
|
||||
@@ -52,6 +54,7 @@ class PluginBase(object):
|
||||
self.home_module = setting.get('home_module')
|
||||
self.status = "init_success"
|
||||
self.config = {}
|
||||
self.recent_menu_plugin_except_list = setting.get('recent_menu_plugin_except_list', [])
|
||||
except Exception as e:
|
||||
self.logger.error(f'Exception:{str(e)}')
|
||||
self.logger.error(traceback.format_exc())
|
||||
@@ -59,10 +62,16 @@ class PluginBase(object):
|
||||
|
||||
def set_module_list(self, mod_list):
|
||||
try:
|
||||
# self.module_list = []
|
||||
for mod in mod_list:
|
||||
logger1.debug(mod)
|
||||
mod_ins = mod(self)
|
||||
# self.logger.debug(mod_ins)
|
||||
logger1.debug(mod_ins)
|
||||
self.module_list.append(mod_ins)
|
||||
|
||||
|
||||
if self.home_module == None:
|
||||
self.home_module = self.module_list[0].name
|
||||
except Exception as e:
|
||||
F.logger.error(f'[{self.package_name}] Exception:{str(e)}')
|
||||
F.logger.error(traceback.format_exc())
|
||||
@@ -77,16 +86,31 @@ class PluginBase(object):
|
||||
|
||||
|
||||
def plugin_load(self):
|
||||
self.logic.plugin_load()
|
||||
if self.logic:
|
||||
self.logic.plugin_load()
|
||||
|
||||
def plugin_load_celery(self):
|
||||
if self.logic:
|
||||
self.logic.plugin_load_celery()
|
||||
|
||||
|
||||
def plugin_unload(self):
|
||||
self.logic.plugin_unload()
|
||||
if self.logic:
|
||||
self.logic.plugin_unload()
|
||||
|
||||
def get_first_manual_path(self):
|
||||
for __ in self.menu['list']:
|
||||
if __['uri'] == 'manual' and len(__['list']) > 0:
|
||||
return __['list'][0]['uri']
|
||||
|
||||
def get_module(self, sub):
|
||||
try:
|
||||
for module in self.module_list:
|
||||
if module.name == sub:
|
||||
return module
|
||||
except Exception as e:
|
||||
self.logger.error(f'Exception:{str(e)}')
|
||||
#self.P.logger.error(traceback.format_exc())
|
||||
|
||||
def create_plugin_instance(config):
|
||||
ins = PluginBase(config)
|
||||
|
||||
Reference in New Issue
Block a user