Skip to content
Snippets Groups Projects
Commit 4c868e9a authored by Verbeek, J.M. (Janneke)'s avatar Verbeek, J.M. (Janneke) :speech_balloon:
Browse files

Documentation.

parent e5eaccb1
No related branches found
No related tags found
2 merge requests!53Master,!49Fileselection/sc 108
......@@ -50,6 +50,9 @@ class Controller:
self._delete_files(type[0], True)
def _select_folder(self, type="shadow"):
"""
Select a folder from which multiple files can be read.
"""
folder_path = fd.askdirectory()
file_names = os.listdir(folder_path)
file_paths = [folder_path + "/" + x for x in file_names]
......@@ -94,7 +97,9 @@ class Controller:
self._view.update_files(files, type)
def _compare_files(self):
"""Check source and shadow data availability, and compare."""
"""Check source and shadow data availability, read in, and compare.
If multiple, read in and compare accordingly.
"""
if self._source_files == []:
self._view.update_message('no source')
elif self._shadow_files == []:
......@@ -112,7 +117,9 @@ class Controller:
self._view.update_message('comparison complete')
def _save_results(self):
"""Save analysis results to file."""
"""Save analysis results to file. If there is multiple results,
save those.
"""
if not self._model.analysis_complete():
self._view.update_message('no comparison')
else:
......
......@@ -73,7 +73,6 @@ class Model:
result = self._stats.analyze(self._data_source, data)
self.add_to_dict(key+"_res", result, self._multi_results)
else:
print("passed")
pass
else:
print("Single analysis")
......@@ -81,10 +80,3 @@ class Model:
self._stats.analyze(self._data_source, self._data_shadow)
else:
print("This needs fixing")
# I needs it
def add_to_dict(self, key, item, dict):
if key in dict:
pass # TODO: raise error
else:
dict[key] = item
......@@ -45,7 +45,7 @@ class View:
self._window.mainloop()
def select_files(self, type):
"""Select file from pc.
"""Select file from directory.
Args:
type (str): Role of file ('source' or 'shadow')
......@@ -55,11 +55,9 @@ class View:
filetypes=(('.csv files', '*.csv'),
("all files", "*.*")))
# TODO: Which file type(s)?
# TODO: Deal with multiple files at once
# TODO: Empty path, do what?
for path in paths:
if path == "": # Do not assign an empty file path
# TODO: Error message and close
if path == "":
select_files(type) # prompt again
return paths
......@@ -140,10 +138,9 @@ class View:
parent=self._window,
filetypes=((".txt files", "*.txt"),
("all files", "*.*")))
if ".txt" not in path:
path += ".txt"
if path == ".txt":
if path == "":
# TODO: Error message & close
# TODO: If no path then what?
self.ask_save_location() # Prompt again
return path
......
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