keep_exporter/export.py
def try_rename_note(note: LocalNote, target_file: pathlib.Path) -> pathlib.Path:
    """
    Attempts to rename an existing note to the new canonical filename,
    but accepts failures to rename. Returns the path the note now exists
    in, either the old path or the new renamed path.
    """
    if not note.path:
        return target_file

    click.echo(f"Renaming [{note.path}] to [{target_file}]")

    try:
        note.path.rename(target_file)
        return target_file
    except Exception as ex:
        click.echo(f"Unable to rename note. Using existing name: %s" % ex, err=True)
        return note.path

    Attempts to rename an existing note to the new canonical filename,
    but accepts failures to rename. Returns the path the note now exists
    in, either the old path or the new renamed path.
    
Attempts to rename an existing note to the new canonical filename,
but accepts failures to rename. Returns the path the note now exists
in, either the old path or the new renamed path.
Attempts to rename an existing note to the new canonical filename but accepts failures to rename . Returns the path the note now exists in either the old path or the new renamed path .
def try_rename_note(note: LocalNote, target_file: pathlib.Path) -> pathlib.Path:
    if not note.path:
        return target_file
    click.echo(f"Renaming [{note.path}] to [{target_file}]")
    try:
        note.path.rename(target_file)
        return target_file
    except Exception as ex:
        click.echo(f"Unable to rename note. Using existing name: %s" % ex, err=True)
        return note.path
def try_rename_note ( note : LocalNote , target_file : pathlib . Path ) -> pathlib . Path : if not note . path : return target_file click . echo ( f"Renaming [{note.path}] to [{target_file}]" ) try : note . path . rename ( target_file ) return target_file except Exception as ex : click . echo ( f"Unable to rename note. Using existing name: %s" % ex , err = True ) return note . path
Attempts to rename an existing note to the new canonical filename,
but accepts failures to rename.
Attempts to rename an existing note to the new canonical filename but accepts failures to rename .
"""
    Attempts to rename an existing note to the new canonical filename,
    but accepts failures to rename. Returns the path the note now exists
    in, either the old path or the new renamed path.
    """
note
LocalNote
target_file
pathlib.Path