-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
My systems don't have ack installed by default; so I have two points:
- If ack is not installed and uincaught OSError is raised:
Traceback (most recent call last):
File "/home/myuser/.local/bin/todo", line 16, in <module>
todo.interactive(match_names=args.names, show_count=args.count)
File "/home/myuser/.local/lib/python2.7/site-packages/todo/__init__.py", line 77, in interactive
matches = get_todo_matches()
File "/home/myuser/.local/lib/python2.7/site-packages/todo/__init__.py", line 66, in get_todo_matches
matches = subprocess.check_output(['ack', '--with-filename', "TODO\\(.*\\)"])
File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
Suggest wrapping like 66 in a try catch to fail gracefully and alert the user that the programs depends on ack, link to readme w/e.
- Allow for alternate/fallback
get_todo_matchesmodules so pure python implementations can be used to not have a hard dependency on ack when not available.
Cool tool!
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels