def cleanup_temp_dir(directory): """Exit and delete a temporary directory for executing PHYLIP""" os.chdir("..") assert "/" not in directory assert os.path.isdir(directory) util.deldir(directory)
def save_temp_dir(directory, newname): """Exit and save a temporary directory for executing PHYLIP""" os.chdir("..") assert "/" not in directory assert os.path.isdir(directory) if os.path.exists(newname): util.deldir(newname) os.rename(directory, newname)