-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFileInputChooserPopup.py
35 lines (26 loc) · 992 Bytes
/
FileInputChooserPopup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from kivy.uix.popup import Popup
class FileInputChooserPopup(Popup):
"""
ROLE: Give the user the ability to choose what file he wants to align
"""
def __init__(self, caller, **kwargs):
"""
ROLE: Constructor
PARAMETERS: caller, AlignSequencesTool (Main widget)
"""
super(FileInputChooserPopup, self).__init__(**kwargs)
self.caller = caller
def update_file_path(self):
"""
ROLE: Change the wanted file path to the selected file path.
Convert the file path to the name of the file
OUTT: caller.pathToFileX, string
caller.fileNameX, string
"""
if self.caller.fileNumber==1:
self.caller.pathToFile1 = self.ids.file_chooser.selection[0]
self.caller.fileName1 = self.caller.pathToFile1.split('/')[-1]
elif self.caller.fileNumber==2:
self.caller.pathToFile2 = self.ids.file_chooser.selection[0]
self.caller.fileName2 = self.caller.pathToFile2.split('/')[-1]
self.dismiss()