mirror of
https://github.com/flucont/btcloud.git
synced 2025-10-21 03:11:36 +00:00
update
This commit is contained in:
@@ -148,6 +148,27 @@ def module_run(module_name,def_name,args):
|
||||
result = run_object(args)
|
||||
return result
|
||||
|
||||
def get_module(filename: str):
|
||||
'''
|
||||
@name 获取模块对象
|
||||
@param filename<string> 模块文件名
|
||||
@return object
|
||||
'''
|
||||
if not filename: return None
|
||||
|
||||
if filename[0:2] == './':
|
||||
return public.returnMsg(False,'不能是相对路径')
|
||||
|
||||
if not public.path_safe_check(filename):
|
||||
return public.returnMsg(False,'模块路径不合法')
|
||||
|
||||
if not os.path.exists(filename):
|
||||
return public.returnMsg(False,'模块文件不存在' % filename)
|
||||
|
||||
def_object = public.get_script_object(filename)
|
||||
if not def_object: return public.returnMsg(False,'模块[%s]不存在' % filename)
|
||||
|
||||
return def_object.main()
|
||||
|
||||
def get_plugin_list(upgrade_force = False):
|
||||
'''
|
||||
|
Reference in New Issue
Block a user