Skip to content

Refresh

Routines to refresh calculated values.

refresh_path(path)

Parameters:

Name Type Description Default
path Path
required
Source code in named_xlsx/refresh.py
12
13
14
15
16
17
18
19
20
21
22
23
24
25
def refresh_path(path: Path) -> None:
    """

    Parameters
    ----------
    path

    """
    modified_time_old = path.stat().st_mtime
    with xlwings.Book(path) as wb:
        wb.save()
    modified_time_new = path.stat().st_mtime
    if modified_time_old >= modified_time_new:
        raise ValueError("File was not updated.")