Skip to content

Commit

Permalink
Merge pull request #17 from Someshsw1109/David(GUI)-patch-2
Browse files Browse the repository at this point in the history
Add files via upload
  • Loading branch information
Someshsw1109 authored Feb 3, 2024
2 parents 4e032b9 + 545eca8 commit 5002e8f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
4 changes: 1 addition & 3 deletions DavidUI.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'DavidUI.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.

Expand All @@ -16,7 +14,7 @@ def setupUi(self, Dialog):
Dialog.setObjectName("Dialog")
Dialog.resize(700, 550)
Dialog.setStyleSheet("background-color: rgb(0, 0, 0);")
Dialog.setModal(False)
Dialog.isModal()
self.label = QtWidgets.QLabel(Dialog)
self.label.setGeometry(QtCore.QRect(2, -5, 331, 51))
self.label.setText("")
Expand Down
26 changes: 13 additions & 13 deletions david.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ def run(self):
self.Main()

# @app.route('/')
# def index(self):
# return "David- A personal Assistant"
def index(self):
return "David- A personal Assistant"

# @app.route('/Main', methods=['POST'])
def Main(self):
Expand All @@ -82,7 +82,7 @@ def Main(self):
if prob.item() > 0.75:
for intent in intents['intents']:
if tag == intent['tag']:
self.reply = self.random.choice(intent["response"])
self.reply = random.choice(intent["response"])

if "time" in self.reply:
Say("Sir the time is:")
Expand Down Expand Up @@ -176,14 +176,10 @@ def Main(self):

else:
Say(self.reply)
return jsonify({'response': 'your response here'})
# return jsonify({'response': 'your response here'})


if __name__ == "__main__":
WishMe()
# app.run(ssl_context=("C:\\ProgramData\\chocolatey\\bin\\self_signed_cert.pem", "C:\\ProgramData\\chocolatey\\bin\\self_signed_key.pem"))

StartThread = MainThread()

class main(QMainWindow):
def __init__(self):
Expand Down Expand Up @@ -250,11 +246,15 @@ def showTime(self):
label_date = current_date.toString(Qt.ISODate)
self.ui.textBrowser.setText(label_date)
self.ui.textBrowser_2.setText(label_time)

app = QApplication(sys.argv)
David = main()
David.show()
exit(app.exec_())
if __name__ == "__main__":
WishMe()
StartThread = MainThread()
# app.run(ssl_context=("C:\\ProgramData\\chocolatey\\bin\\self_signed_cert.pem", "C:\\ProgramData\\chocolatey\\bin\\self_signed_key.pem"))
while True:
app = QApplication(sys.argv)
David = main()
David.show()
exit(app.exec_())



0 comments on commit 5002e8f

Please sign in to comment.