Index: shared/scripts/configuration/utility.py =================================================================== diff -u -rce5a0db0c7033fbf15d8725a4e9973372a611c92 -r601e6a8d7aab96143cd363a40088eefc29439672 --- shared/scripts/configuration/utility.py (.../utility.py) (revision ce5a0db0c7033fbf15d8725a4e9973372a611c92) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 601e6a8d7aab96143cd363a40088eefc29439672) @@ -17,8 +17,10 @@ import names import squish import test - +import os +import shutil from builtins import int as pyInt +from dialin.ui import utils from configuration import config from dialin.ui.hd_simulator import HDSimulator @@ -123,6 +125,39 @@ raise LookupError("zone object is not in view to the user after " + \ "trying 100 times") + +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)) +