Administrator
2023-08-17 16db33c161f5dbbb423f2d84199b3f7723e9b2ad
log_module/log_analyse.py
@@ -42,5 +42,22 @@
    return dict_
# 获取华鑫的委托数据
def load_huaxin_delegate_datas():
    file_path = "{}/logs/gp/kpl/kpl_block_can_buy.{}.log".format(constant.get_path_prefix(), tool.get_now_date_str())
    dict_ = {}
    if os.path.exists(file_path):
        with open(file_path, encoding="utf-8") as f:
            line = f.readline()
            while line:
                if True:
                    code = line.split("code=")[1][:6]
                    time_ = line.split("|")[0].split(" ")[1][:12]
                    reason = line.split(f"code={code}:")[1].strip()
                    dict_[code] = (time_, reason.replace("可以下单", ""))
                    # print(time_, code, reason)
                line = f.readline()
if __name__ == "__main__":
    print(get_kpl_can_buy_reasons_dict())