From 45130cbd31992d458de8c6850ea212398f07d2a1 Mon Sep 17 00:00:00 2001 From: lixiaoyong1 Date: Mon, 9 Dec 2024 12:46:40 -0500 Subject: [PATCH] Add varible out_d to distinguish reports by datetime --- common/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/config.py b/common/config.py index c3b0d74..9cb1919 100644 --- a/common/config.py +++ b/common/config.py @@ -15,7 +15,7 @@ class Config: out_path = '' dict_json = {} conf_fn = '' - dt = time.strftime("%m%d%H%M") + out_d = '/output-{}/'.format(time.strftime("%m%d%H%M")) # set work path @staticmethod @@ -99,6 +99,9 @@ class Config: if not os.path.exists('{}/output-{}/'.format(Config.out_path, Config.dt)): os.makedirs('{}/output-{}/'.format(Config.out_path, Config.dt)) + if not os.path.exists(Config.out_path + Config.out_d): + os.makedirs(Config.out_path + Config.out_d) + if not os.path.exists(Config.out_path + '/log/'): os.makedirs(Config.out_path + '/log/') -- Gitee