Example #1
0
 def start(self):
     global client
     if (len(self.email) > 0 and len(self.password) > 0):
         self.email = str(self.email[0])
         self.password = str(base64.b64decode(self.password[0]))
         client = Client(self.email, self.password)
         response = client.login()
     
         if (response['result'] == 'ok'):
             startup = client.notify_startup()
             if (not startup):
                 print_message("Could not startup!")
             else:
                 print_message("Notified!")
     
     else:
         Mbox("Budibox", "Credentials undefined or incorrect. Please login again.") 
         
         # Create the QML user interface.
         view = QDeclarativeView()
         view.setSource(QUrl('qml/main.qml'))
         view.setWindowTitle("Budibox")
         view.setWindowIcon(QIcon("qml/budibox.jpg"))
         
         context = view.rootContext()
         context.setContextProperty("send_data",Receive_data())
         
         # Display the user interface and allow the user to interact with it.
         view.setGeometry(360, 360, 360, 360)
         view.setMaximumSize(360, 360)
         view.show()
         
         app.exec_()