Пример #1
0
def update(updater_thread):
    while 1:
        time.sleep(time_delta)
        Companies.update_company_information()
        update_lock.acquire()
        try:
            pf.total_value = pf.calculate_total_value()
        finally:
            update_lock.release()
Пример #2
0
        self.ui.exec_()

    def perform_send_message(self):
        user = self.ui.userEdit.text()
        email = self.ui.emailEdit.text()
        subject = self.ui.subjectEdit.text()
        message = self.ui.messageEdit.text()
        print(user+'\n'+email+'\n'+subject+'\n'+message)
        ej.sendMessage(user, email, subject, message)        
               
if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    login = Login_UI()
    if login.exec_() == QtWidgets.QDialog.Accepted:
        mainApp = MainApp()
        mainApp.setWindowIcon(QtGui.QIcon('res/icon.png'))
        mainApp.show()
        
        try:
            Companies.update_company_information()
        except:
            QMessageBox.about(mainApp, "No Connection", "You must be connected to the Internet in order to get accurate data.")
        
        #This will continuously pull from the API and push all the data into the cache
        updater = UpdaterThread.UpdaterThread(1, "updater")
        updater.daemon = True
        updater.start()

        ret = app.exec_()
        sys.exit(ret)