Пример #1
0
 def initiateFileUpload(self, filePath):
     self.queue = Queue()
     self.waitDialog = StickyDialog(self.root,
                                    message="Please wait, uploading...")
     fileUploadThread = UploadFile(self.queue, filePath)
     fileUploadThread.start()
     self.master.after(100, self.checkQueueForUploadStatus)
 def downloadFile(self):
     print("Download")
     self.dqueue = Queue()
     self.remove()
     self.waitDialog = StickyDialog(self,
                                    message="Downloading! Please wait...")
     userFileDownloadThread = DownloadFile(queue=self.dqueue,
                                           owner=self.fileDetails[0],
                                           name=self.fileDetails[1])
     userFileDownloadThread.start()
     self.checkDownloadQueue()
Пример #3
0
 def saveUserInfoInitiator(self):
     self.waitDialog = StickyDialog(self.root,
                                    message="Initializing...\nPlease wait!")
     self.user = User(userId=self.loginResponse.uid,
                      name=self.loginResponse.name,
                      email=self.emailStr)
     self.queue = Queue()
     saveUserInfoThread = SaveUserLoginInfo(
         self.queue,
         user=self.user,
         accJwt=self.loginResponse.accessToken,
         refJwt=self.loginResponse.refreshToken)
     saveUserInfoThread.start()
     self.root.after(100, self.checkQueueForDb)
Пример #4
0
 def loginInitiator(self):
     self.emailStr = self.email.get()
     self.passwordStr = self.password.get()
     if not validateEmail(self.emailStr):
         GenericDialog(self.root,
                       title="Validation Error",
                       message="Invalid Email Address!")
     elif self.passwordStr == "" or len(self.passwordStr) < 8:
         GenericDialog(self.root,
                       title="Validation Error",
                       message="Password must be 8 characters long!")
     else:
         self.waitDialog = StickyDialog(self.root, message="Please wait!")
         userLoginThread = UserLogin(self.queue,
                                     email=self.emailStr,
                                     password=self.passwordStr)
         userLoginThread.start()
         self.root.after(100, self.checkQueueForLogin)
Пример #5
0
 def grantAccess(self):
     print("granting")
     toEmail = self.emailEntry.get()
     self.remove()
     if validateEmail(email=toEmail):
         self.waitDialog = StickyDialog(self,
                                        message="Granting! Please wait...")
         updateAclGrantThread = UpdateFileACL(queue=self.queue,
                                              owner=self.fileDetails[0],
                                              name=self.fileDetails[1],
                                              grant=True,
                                              toEmail=toEmail)
         updateAclGrantThread.start()
         self.checkACLUpdateQueue()
     else:
         GenericDialog(self,
                       title="Error!",
                       message="Invalid Email Address!")
Пример #6
0
    def signUpInitiator(self):
        name = self.username.get()
        email = self.email.get()
        password = self.password.get()
        confPassword = self.confirmPassword.get()

        if name == "" or not validateUsername(name) or len(name) > 32:
            GenericDialog(
                self.root,
                title="Validation Error",
                message=
                "Invalid name!\nContains only alphabets.\nMax length: 32.")
        elif not validateEmail(email):
            GenericDialog(self.root,
                          title="Validation Error",
                          message="Invalid Email Address!")
        elif password != confPassword:
            GenericDialog(self.root,
                          title="Validation Error",
                          message="Passwords do not match!")
        elif password == confPassword and len(password) < 8:
            GenericDialog(self.root,
                          title="Validation Error",
                          message="Password minimum length: 8")
        elif password == confPassword and len(password) > 64:
            GenericDialog(self.root,
                          title="Validation Error",
                          message="Password maximum length: 64")
        else:
            # initiate sign up
            self.waitDialog = StickyDialog(self.root, message="Please wait!")
            userSignUpThread = UserSignUp(queue=self.queue,
                                          username=name,
                                          email=email,
                                          password=password)
            userSignUpThread.start()
            self.root.after(100, self.checkQueue)