1. 修复qq频道发不了图片的问题

This commit is contained in:
Soulter
2023-09-14 08:39:05 +08:00
parent 5852f36557
commit 8352fc269b
4 changed files with 64 additions and 24 deletions
+7 -3
View File
@@ -12,11 +12,15 @@ def get_classes(p_name, arg):
break
return classes
# 获取一个文件夹下所有的模块
# 获取一个文件夹下所有的模块, 文件名和文件夹名相同
def get_modules(path):
modules = []
for root, dirs, files in os.walk(path):
# 获得所在目录名
p_name = os.path.basename(root)
print(p_name)
for file in files:
if file.endswith(".py") and not file.startswith("__"):
if file.endswith(".py") and not file.startswith("__") and p_name.lower() == file[:-3].lower():
modules.append(file[:-3])
return modules
return modules