Skip to content

Commit

Permalink
simplify possible args in main
Browse files Browse the repository at this point in the history
  • Loading branch information
mecaneer23 committed Oct 3, 2023
1 parent a933058 commit d81b52f
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions todo.py
Original file line number Diff line number Diff line change
Expand Up @@ -704,6 +704,9 @@ def get_possible_todos(
) -> list[Todo] | None:
params = []
for arg in args.split(", "):
if arg.isdigit():
params.append(int(arg))
continue
if arg != "None":
params.append(possible_args[arg])
return func(*params)
Expand Down Expand Up @@ -840,32 +843,11 @@ def main(stdscr: Any, header: str) -> int:
func,
args,
{
"0": 0,
"1": 1,
"2": 2,
"3": 3,
"4": 4,
"5": 5,
"6": 6,
"7": 7,
"8": 8,
"9": 9,
"48": 48,
"49": 49,
"50": 50,
"51": 51,
"52": 52,
"53": 53,
"54": 54,
"55": 55,
"56": 56,
"57": 57,
"copied_todo": copied_todo,
"int(selected)": int(selected),
"history": history,
"len(todos)": len(todos),
"mode": mode,
"None": "None",
"selected": selected,
"stdscr": stdscr,
"todos": todos,
Expand Down

0 comments on commit d81b52f

Please sign in to comment.