1 Star 0 Fork 102

SSSSoiphon / jxxghp-nas-tools

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
build_sites.py 631 Bytes
一键复制 编辑 原始数据 按行查看 历史
jxxghp 提交于 2023-02-13 12:52 . init
import os.path
import pickle
import ruamel.yaml
from app.utils.path_utils import PathUtils
from config import Config
if __name__ == "__main__":
_indexers = []
_site_path = os.path.join(Config().get_config_path(), "sites")
cfg_files = PathUtils.get_dir_files(in_path=_site_path, exts=[".yml"])
for cfg_file in cfg_files:
with open(cfg_file, mode='r', encoding='utf-8') as f:
print(cfg_file)
_indexers.append(ruamel.yaml.YAML().load(f))
with open(os.path.join(Config().get_inner_config_path(), "sites.dat"), 'wb') as f:
pickle.dump(_indexers, f, pickle.HIGHEST_PROTOCOL)
Python
1
https://gitee.com/SSSSoiphon/jxxghp-nas-tools.git
git@gitee.com:SSSSoiphon/jxxghp-nas-tools.git
SSSSoiphon
jxxghp-nas-tools
jxxghp-nas-tools
master

搜索帮助