fix bug
This commit is contained in:
parent
8e8a587bca
commit
8e842c385d
@ -21,6 +21,7 @@ class ModuleHelper:
|
||||
packages = importlib.import_module(package_path)
|
||||
importlib.reload(packages)
|
||||
for importer, package_name, _ in pkgutil.iter_modules(packages.__path__):
|
||||
try:
|
||||
if package_name.startswith('_'):
|
||||
continue
|
||||
full_package_name = f'{package_path}.{package_name}'
|
||||
@ -30,5 +31,7 @@ class ModuleHelper:
|
||||
continue
|
||||
if isinstance(obj, type) and filter_func(name, obj):
|
||||
submodules.append(obj)
|
||||
except Exception as err:
|
||||
print(f'加载模块 {package_name} 失败:{err}')
|
||||
|
||||
return submodules
|
||||
|
@ -79,10 +79,11 @@ class PluginHelper(metaclass=Singleton):
|
||||
f.write(res.text)
|
||||
else:
|
||||
# 递归下载子目录
|
||||
l, m = __get_filelist(f"{_p}/{item.get('name')}")
|
||||
p = f"{_p}/{item.get('name')}"
|
||||
l, m = __get_filelist(p)
|
||||
if not l:
|
||||
return False, m
|
||||
return __download_files(_p, _l)
|
||||
return __download_files(p, l)
|
||||
return True, ""
|
||||
|
||||
if not pid or not repo_url:
|
||||
@ -119,3 +120,4 @@ class PluginHelper(metaclass=Singleton):
|
||||
shutil.rmtree(plugin_dir, ignore_errors=True)
|
||||
# 下载所有文件
|
||||
__download_files(pid.lower(), file_list)
|
||||
return True, ""
|
||||
|
Loading…
x
Reference in New Issue
Block a user