def getDropBoxClient(self): auth = dropbox.auth.Authenticator(self.config) token = auth.obtain_trusted_access_token(self.config['user_name'], self.config['user_password']) c = dropbox.client.DropboxClient(self.config['server'], self.config['content_server'], self.config['port'], auth, token) return c
def _db_auth(self, username, password): auth = dropbox.auth.Authenticator(config) try: token = auth.obtain_trusted_access_token(username, password) except: print(sys.exc_info()[0]) #Login failed. self.redirect("/login?status=fail") return DropKindleData.saveuerauth(username, token.key, token.secret) self.set_secure_cookie("user", username) self.redirect("/files")
def getDropBoxClient(self): auth = dropbox.auth.Authenticator( self.config ) token = auth.obtain_trusted_access_token(self.config['user_name'], self.config['user_password']) c = dropbox.client.DropboxClient(self.config['server'], self.config['content_server'], self.config['port'], auth, token) return c