Skip to content
Snippets Groups Projects
Commit 905f6033 authored by Lan Dam's avatar Lan Dam
Browse files

Fix bug happen when select 2 folders with different type

parent 493ac1e3
No related branches found
No related tags found
1 merge request!163Fix bug happen when select 2 folders with different type
......@@ -7,7 +7,7 @@ import os
import json
import re
from pathlib import Path
from typing import List, Optional, Dict, Tuple
from typing import List, Optional, Dict, Tuple, Union
from PySide6.QtCore import QEventLoop, Qt
from PySide6.QtGui import QCursor
......@@ -167,7 +167,7 @@ def read_mseed_channels(tracking_box: QTextBrowser, list_of_dir: List[str],
return channel_info
def detect_data_type(list_of_dir: List[str]) -> Optional[str]:
def detect_data_type(list_of_dir: List[Union[str, Path]]) -> Optional[str]:
"""
Detect data type for the given directories using get_data_type_from_file
:param list_of_dir: list of directories selected by users
......@@ -183,6 +183,10 @@ def detect_data_type(list_of_dir: List[str]) -> Optional[str]:
dir_data_type_dict = {}
is_multiplex_dict = {}
for d in list_of_dir:
try:
d = d.as_posix()
except AttributeError:
pass
data_type = "Unknown"
is_multiplex = None
for path, subdirs, files in os.walk(d):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment