def AutoLogIn(self): """Logs in to Google Apps based on the credentials given in the apps object, which is assumed to work successfully.""" gas.execute(['log_in']) # if we get here, then we've successfully logged in to gas email = gas.get_logged_in_user() self.log_out_label.configure(text='Currently signed in as %s' % email) self.log_in_frame.pack_forget() self.log_out_frame.pack()
def LogIn(self, event): """Logs in with the username and password supplied in the fields.""" fullUsername = self.log_in_username.get() password = self.log_in_password.get() try: username = fullUsername.split('@')[0] domain = fullUsername.split('@')[1] except: sys.stderr.write('Username must be of form: [email protected]') # log in to gas gas.execute(['log_in', 'email=%s' % fullUsername, 'password=%s' % password]) # if we get here, then we've successfully logged in to gas email = gas.get_logged_in_user() self.log_out_label.configure(text='Currently signed in as %s' % email) self.log_in_password.configure(text='') self.log_in_frame.pack_forget() self.log_out_frame.pack() sys.stderr.write('') # clears the status frame, in case there is anything there
def LogIn(self, event): """Logs in with the username and password supplied in the fields.""" fullUsername = self.log_in_username.get() password = self.log_in_password.get() try: username = fullUsername.split('@')[0] domain = fullUsername.split('@')[1] except: sys.stderr.write('Username must be of form: [email protected]') # log in to gas gas.execute( ['log_in', 'email=%s' % fullUsername, 'password=%s' % password]) # if we get here, then we've successfully logged in to gas email = gas.get_logged_in_user() self.log_out_label.configure(text='Currently signed in as %s' % email) self.log_in_password.configure(text='') self.log_in_frame.pack_forget() self.log_out_frame.pack() sys.stderr.write( '') # clears the status frame, in case there is anything there