@gf.catch_error
def delete_watch_folders_and_files(self, repos_list, sobject_item):

    def onerror(func, path, exc_info):
        '\n            Error handler for ``shutil.rmtree``.\n\n            If the error is due to an access error (read only file)\n            it attempts to add write permission and then retries.\n\n            If the error is for another reason it re-raises the error.\n\n            Usage : ``shutil.rmtree(path, onerror=onerror)``\n            '
        import stat
        if (not os.access(path, os.W_OK)):
            os.chmod(path, stat.S_IWUSR)
            func(path)
    for repo in repos_list:
        abs_path = ((env_tactic.get_base_dir(repo)['value'][0] + '/') + sobject_item.get_watch_folder_path())
        if os.path.exists(gf.form_path(abs_path)):
            shutil.rmtree(gf.form_path(abs_path), ignore_errors=True, onerror=onerror)
@gf.catch_error
def delete_watch_folders_and_files(self, repos_list, sobject_item):

    def onerror(func, path, exc_info):
        '\n            Error handler for ``shutil.rmtree``.\n\n            If the error is due to an access error (read only file)\n            it attempts to add write permission and then retries.\n\n            If the error is for another reason it re-raises the error.\n\n            Usage : ``shutil.rmtree(path, onerror=onerror)``\n            '
        import stat
        if (not os.access(path, os.W_OK)):
            os.chmod(path, stat.S_IWUSR)
            func(path)
    for repo in repos_list:
        abs_path = ((env_tactic.get_base_dir(repo)['value'][0] + '/') + sobject_item.get_watch_folder_path())
        if os.path.exists(gf.form_path(abs_path)):
            shutil.rmtree(gf.form_path(abs_path), ignore_errors=True, onerror=onerror)