diff options
| author | 2023-07-04 13:18:41 +0800 | |
|---|---|---|
| committer | 2023-07-04 13:18:41 +0800 | |
| commit | d09541bb2dab3e49a81ba2de7b7f2d27856e4f1e (patch) | |
| tree | f59baefa2175269b25e33690e70bbdad64ec503e /hydrorollcore | |
| parent | 685bb5b0ebb5505733eed6b77f97b975fa0cfcea (diff) | |
| download | infini-d09541bb2dab3e49a81ba2de7b7f2d27856e4f1e.tar.gz infini-d09541bb2dab3e49a81ba2de7b7f2d27856e4f1e.zip | |
Rename rule.py to rule.py
Diffstat (limited to 'hydrorollcore')
| -rw-r--r-- | hydrorollcore/rule.py | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/hydrorollcore/rule.py b/hydrorollcore/rule.py deleted file mode 100644 index bdc24369..00000000 --- a/hydrorollcore/rule.py +++ /dev/null @@ -1,30 +0,0 @@ -import os -import importlib.util - -__all__ = ["Rule"] - -class Rule: - def __init__(self, folder_path): - self.folder_path = folder_path - - def load_modules(self): - # 获取指定文件夹下的所有文件和文件夹 - file_list = os.listdir(self.folder_path) - module_list = [] - - # 遍历文件列表 - for file_name in file_list: - file_path = os.path.join(self.folder_path, file_name) - - # 判断是否为Python文件或者包 - if file_name.startswith('_') or not file_name.endswith(".py"): - continue - - # 尝试加载模块 - module_name = os.path.splitext(file_name)[0] - spec = importlib.util.spec_from_file_location(module_name, file_path) - module = importlib.util.module_from_spec(spec) - spec.loader.exec_module(module) - module_list.append(module) - - return module_list |
