def rename_func(path,*args,**kwargs): find_str = args[0] replace_str = args[1] ignorecase = kwargs.get('ignorecase',True) re_args = re.UNICODE if ignorecase: re_args = re_args | re.IGNORECASE find_re = re.compile(find_str,re_args) return utils.resub((find_re,replace_str),path)
def track_correct(path): path = utils.resub(track_correct_resub, path) path = utils.resub(track_double_digit_resub, path) path = path.replace("_", " ") return path
def rename_func(path): head, bname = os.path.split(path) new_bname = utils.resub(remove_track_resub, bname) return os.path.join(head, new_bname)