forked from PURPLE-YO/VillageInRemote
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
64 lines (50 loc) · 2.06 KB
/
main.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# -*- coding: utf-8 -*-
"""
Created on Tue Apr 3 13:45:05 2018
@author: Nan
"""
import sys
from PyQt5.QtCore import pyqtSlot
from PyQt5.QtWidgets import QApplication, QDialog
from PyQt5.uic import loadUi
from Client import Client
class main(QDialog):
client = Client()
filename = ''
def __init__(self):
super(main, self).__init__()
loadUi('uploadModule.ui', self)
self.setWindowTitle('File uploading!')
self.submitButton.clicked.connect(self.on_submitButton_clicked)
# self.submitButton.clicked.connect(self.open_selectionModule)
@pyqtSlot()
def on_submitButton_clicked(self):
# set the file path in the lineEdit into filename
self.filename = self.filePathInput.text()
# self.label_2.setText(self.filename)
# call the upload function in an object of Client, and use filename as input arg
self.client.upload_file(self.filename)
if self.client.output == "File Not Found!":
self.label_2.setText(self.client.output)
elif self.client.output == "SyntaxError, file path should be C:/Users/data.csv":
self.label_2.setText(self.client.output)
elif self.client.output == 'Pass':
self.newD = SelectionModule() # once the file has been successfully read, create an object of new ui
self.newD.show() # show second widget
self.hide() # hide the main widget
self.newD.track_label.setText(str(self.client.listOfFields))
# self.label_3.setText(self.client.output)
# def open_selectionModule(self):
# self.newD = SelectionModule(self)
# self.newD.show()
class SelectionModule(QDialog):
def __init__(self):
super(SelectionModule,self).__init__()
loadUi('selectionModule.ui',self)
self.setWindowTitle('Question selection!')
if __name__ == '__main__':
app = QApplication(sys.argv)
widget = main()
widget.show()
>>>>>>> master:main.py
sys.exit(app.exec_())