def del_path_history(fpath, memory): """ @type fpath:str, unicode @type memory: Memory """ memory = del_server_path_history(memory, fpath) memory = del_local_path_history(memory, fpath) return memory
def remove_local_paths(memory, file_del_local): """ @type memory: Memory @type file_del_local: tuple """ for fpath in file_del_local: if os.path.exists(fpath): os.remove(fpath) memory = del_local_path_history(memory, fpath) return memory
def remove_local_folders(memory, dirs_del_local): """ @type memory: Memory @type dirs_del_local: tuple """ for node in dirs_del_local: if os.path.exists(node["dirname"]): shutil.rmtree(node["dirname"], True) memory = del_local_path_history(memory, node["dirname"]) return memory