Skip to content
Snippets Groups Projects
Commit ffc57c26 authored by Kien Le's avatar Kien Le
Browse files

Documentation and type hint

parent 4f46f8dc
No related branches found
No related tags found
No related merge requests found
......@@ -321,6 +321,9 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
self.open_files_list.clear()
self.set_open_files_list_texts()
# We only disable the from data card checkbox because it has behavior
# that conflics with the log file checkbox. Other widgets are kept
# enabled because they don't break what the log file checkbox does.
self.from_data_card_check_box.setEnabled(not is_checked)
self.filter_folder_list(self.search_line_edit.text())
......@@ -501,6 +504,7 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
for item in self.open_files_list.selectedItems():
log_abspath = root_dir.joinpath(item.file_path)
self.rt130_log_files.append(log_abspath)
# Log files can only come from programs that work with RT130 data.
self.data_type = 'RT130'
self.is_multiplex = False
elif self.rt130_das_dict != {}:
......@@ -538,6 +542,8 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
msg = "No directories have been selected."
raise Exception(msg)
# Log files don't have a data type that can be detected, so we don't
# detect the data type if we are reading them.
if self.rt130_das_dict == {} and not self.log_checkbox.isChecked():
self.data_type, self.is_multiplex = detect_data_type(
self.list_of_dir)
......@@ -950,6 +956,9 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
self.rt130_das_dict = rt130_find_cf_dass(path)
if self.log_checkbox.isChecked():
for dent in pathlib.Path(path).iterdir():
# Currently, we only read file that has the extension .log.
# Dealing with general file is a lot more difficult and is
# not worth the time it takes to do so.
if dent.is_file() and dent.name.endswith('.log'):
self.open_files_list.addItem(FileListItem(dent))
......
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