Skip to content
Snippets Groups Projects

No empty string assignment anymore

Merged Ghost User requested to merge NoErrorFileSelectAbortion into master
1 file
+ 9
8
Compare changes
  • Side-by-side
  • Inline
+ 9
8
@@ -30,14 +30,15 @@ class ControllerClass:
"""
file_path = askopenfilename(filetypes=((".txt files", "*.txt"),
("all files", "*.*")))
label_text = "File %d: %s" % (fileno, file_path.title().split("/")[-1])
if fileno == 1:
self.model.file_1 = file_path
self.view.tf1_label["text"] = label_text
else:
self.model.file_2 = file_path
self.view.tf2_label["text"] = label_text
if file_path != "": # Do not assign an empty file path
label_text = "File %d: %s" % (fileno, file_path.title().split("/")[-1])
if fileno == 1:
self.model.file_1 = file_path
self.view.tf1_label["text"] = label_text
else:
self.model.file_2 = file_path
self.view.tf2_label["text"] = label_text
def check_for_files(self):
if self.model.file_1 is None:
Loading