Functional with logging
This commit is contained in:
@@ -26,7 +26,7 @@ def print_num_list(paths):
|
||||
n += 1
|
||||
return 0
|
||||
|
||||
def select_path(paths):
|
||||
def select_path(filename, paths):
|
||||
l = len(paths)
|
||||
if l == 0 :
|
||||
raise Exception("Error select_path - empty list")
|
||||
@@ -34,7 +34,7 @@ def select_path(paths):
|
||||
return paths[0]
|
||||
c = '0'
|
||||
while not (c.isdigit() and 0 < int(c) <= l):
|
||||
print("Multiple matches found.")
|
||||
print(f"Multiple matches found for {filename}")
|
||||
print("Please select target:")
|
||||
print_num_list(paths)
|
||||
c = input(f"Please select file to link to: (1-{l})")
|
||||
@@ -44,5 +44,5 @@ def search_file(filename, path):
|
||||
paths = search_all_match(filename, path)
|
||||
if len(paths) == 0 :
|
||||
raise Exception(f"No match found for {filename}")
|
||||
p = select_path(paths)
|
||||
p = select_path(filename, paths)
|
||||
return p
|
||||
|
||||
Reference in New Issue
Block a user