From b35a4185d1efad07ad329129d44157351ee8699e Mon Sep 17 00:00:00 2001 From: zhanghan2021 Date: Tue, 28 Nov 2023 09:41:27 +0800 Subject: [PATCH] Wrap the given command into a specific file format and return the result --- common/file.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common/file.py b/common/file.py index 65251aa..c2a2134 100644 --- a/common/file.py +++ b/common/file.py @@ -19,3 +19,18 @@ class FileOperation: # os.mkdir(Config.get_output_path() + file_name) file = open(Config.get_output_path() + file_name,'w') file.close() + + @staticmethod + def wrap_output_format(cmd_name, data, split): + ''' + wrap file format to data , use --- or === split and return + do not write file + ''' + out = 'Command: ' + cmd_name + '\nSubCommand: ' + data + if split == '=': + out = out + "=========================kylin=========================\n" + else: + out = out + "-------------------------kylin-------------------------\n" + + return out + \ No newline at end of file -- Gitee