Cleanup `create_path_dict`
@@ -160,22 +160,14 @@ def get_filenames(window, bids):
def create_path_dict(window, bids):
- base_dir = ""
file_names_by_bid = get_filenames(window, bids)
- if len(file_names_by_bid) == 1:
- for bid, path in file_names_by_bid.items():
- base_dir, file_name = os.path.split(path)
- rel_paths = {bid: file_name}
- else:
base_dir = get_common_parent([
path
for path in file_names_by_bid.values()
if not path.startswith('<untitled')
])
- if not base_dir:
- rel_paths = file_names_by_bid
- else:
+
rel_paths = {
bid: (
abs_path
@@ -185,7 +177,7 @@ def create_path_dict(window, bids):
for bid, abs_path in file_names_by_bid.items()
}
- return rel_paths, base_dir or ""
+ return rel_paths, base_dir
def create_panel(window):
