1
0
mirror of https://github.com/wting/autojump synced 2024-10-27 20:34:07 +00:00

Only allow adding of existing directories

This commit is contained in:
Jared Hess 2015-12-30 01:45:27 -08:00
parent c391c7f394
commit 9aeee1b9b6

View File

@ -139,6 +139,9 @@ def add_path(data, path, weight=10):
if path == os.path.expanduser('~'):
return data, Entry(path, 0)
if not os.path.isdir(path):
return data, Entry(path, 0)
data[path] = sqrt((data.get(path, 0) ** 2) + (weight ** 2))
return data, Entry(path, data[path])