From e0d08076f3ca082850a2a3338e8011b21d81f045 Mon Sep 17 00:00:00 2001 From: zhanghan2021 Date: Mon, 20 Nov 2023 16:21:57 +0800 Subject: [PATCH] Used to obtain path information in the configuration --- common/config.py | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/common/config.py b/common/config.py index ff6dc66..053e481 100644 --- a/common/config.py +++ b/common/config.py @@ -35,4 +35,50 @@ class Config: # if not os.path.exists(Config.out_path+'/temp/'): # os.makedirs(Config.out_path + '/temp/') - \ No newline at end of file + @staticmethod + def get_json_dict(): + return Config.dict_json + + + @staticmethod + def get_work_path(): + ''' + get work path + ''' + return Config.path_format(Config.work_path) + + @staticmethod + def get_out_path(): + ''' + get out path + ''' + return Config.path_format(Config.out_path) + + @staticmethod + def get_inst_path(): + ''' + get install path + ''' + return Config.path_format(Config.inst_path) + + @staticmethod + def get_output_path(): + ''' + Get the output file save directory + ''' + return Config.path_format('{}/output-{}/'.format(Config.out_path, Config.dt)) + + @staticmethod + def get_log_path(): + ''' + get log directory + ''' + return Config.path_format(Config.out_path + '/log/') + + + @staticmethod + def path_format(path ): + if len(path): + return path.rstrip('\/') + '/' + else: + return './' -- Gitee