Skip to content

Commit

Permalink
rename is_file_externally_updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Oct 28, 2023
1 parent 692abd0 commit 52378a3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def validate_file(raw_data: str) -> list[Todo]:
return [Todo(line) for line in raw_data.split("\n")]


def is_file_externally_updated(filename: Path, todos: list[Todo]) -> bool:
def is_file_updated(filename: Path, todos: list[Todo]) -> bool:
with filename.open() as file_obj:
return not validate_file(file_obj.read()) == todos

Expand Down Expand Up @@ -516,7 +516,7 @@ def remove_file(filename: Path) -> int:


def quit_program(todos: list[Todo], edits: int) -> int:
if is_file_externally_updated(FILENAME, todos):
if is_file_updated(FILENAME, todos):
todos = validate_file(read_file(FILENAME))
if edits < 2:
return remove_file(FILENAME)
Expand Down Expand Up @@ -859,7 +859,7 @@ def main(stdscr: Any) -> int:

while True:
edits += 1
if is_file_externally_updated(FILENAME, todos):
if is_file_updated(FILENAME, todos):
todos = validate_file(read_file(FILENAME))
set_header(stdscr, f"{HEADER}:")
sublist_top = print_todos(stdscr, todos, selected, sublist_top)
Expand Down

0 comments on commit 52378a3

Please sign in to comment.