Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r400b948437c1cefd1133b56e756c3f7a94c3cb33 -r58d65e5126cac3a1947465c92eeb1abdc7fbcf4c --- shared/scripts/configuration/utility.py (.../utility.py) (revision 400b948437c1cefd1133b56e756c3f7a94c3cb33) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 58d65e5126cac3a1947465c92eeb1abdc7fbcf4c) @@ -11,14 +11,16 @@ # @date (last) 15-Jan-2022 # ############################################################################ - +import os import csv import test import squish +import shutil from configuration import config from dialin.ui.hd_simulator import HDSimulator from builtins import int as pyInt from builtins import format +from dialin.ui import utils from datetime import datetime hd_simulator = HDSimulator() @@ -248,5 +250,36 @@ content_record.append(ack_bak_status) return content_record +def rename_file(path,filename): + """ + This method Rename the original folder name to dummy name. + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename+"_1": + if os.path.exists(path+filename+"_1"): + shutil.rmtree(path+filename+"_1") + test.log(str(filename+" name changed to "+files)) + if files == filename: + if os.path.exists(path+filename): + utils.waitForGUI(1) + os.rename(path+filename,path+filename+"_1") + test.log(str(files+" name changed to "+filename+"_1")) +def rename_old_name(path,filename): + """ + This method Rename the dummy name to original folder name . + """ + folder_path = os.listdir(path) + for files in folder_path: + if files == filename: + if os.path.exists(path+filename): + shutil.rmtree(path+filename) + test.log(str(files+"_1 name changed to "+filename)) + utils.waitForGUI(5) + if files != filename: + if (files == filename+"_1"): + os.rename(path+files,path+filename) + test.log(str(files+" name changed to "+filename)) +