Index: shared/scripts/configuration/utility.py =================================================================== diff -u -r09c151304b448aecfed8a67c28800d161018641e -r5712621df8e57a627411ef8e6f6c19a927987c43 --- shared/scripts/configuration/utility.py (.../utility.py) (revision 09c151304b448aecfed8a67c28800d161018641e) +++ shared/scripts/configuration/utility.py (.../utility.py) (revision 5712621df8e57a627411ef8e6f6c19a927987c43) @@ -21,11 +21,13 @@ import object import sys import squish +import shutil import time import test from builtins import format from builtins import str as pyStr from builtins import int as pyInt +from dialin.ui import utils from configuration import config from dialin.ui import utils from dialin.utils import * @@ -1179,10 +1181,8 @@ def get_extracted_error_file(): """ - This function is the handler for getting error file from service folder. - + This function is the handler for getting error file from service folder. Application log file is automatically created on '/home/denali/Desktop/sd-card/service/ {current_date}_denaliSquish.err ' - @return latest_file - (string) returns latest file that append on log folder from service """ try: @@ -1193,5 +1193,37 @@ return False raise LookupError("value 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)) +