def test_exam_regress(self): #考试系统部分 self.login_from_index() self.exam_onequestion() self.exam_questions() self.import_questions() self.add_exam_subject() self.modify_exam_subject() self.delete_exam_subject() self.create_exam_cate() self.modify_exam_cate() self.delete_exam_cate() self.add_exam_point() self.modify_exam_point() self.delete_exam_point() self.createpaper() self.create_random_epaper() self.exam_student_management() login.logout(self.driver, self.base_url) self.login_user() self.exam_user() login.logout(self.driver, self.base_url) self.login_from_index() self.score_paper() # IE下不能导出 self.export_openpaper_result() self.export_sendpaper_result()
def delete(self, password): userid = login.get_user_fullid(self.key) if userid: db.roadhouse.people.update({"_id": userid}, {"$set": {"accountactive" : 0}}) login.logout(self.key) return 1 return 0
def logoutPage(): if "user" in session: username = session["user"] login.logout(username) session.pop("user") return handleRedirect()
def user(username=None): if request.method == 'POST': if request.form['logout'] == 'Logout': login.logout(username) return redirect(url_for('home')) else: flash(authenticationError) return redirect(url_for('home'))
def test_login(self): driver = self.driver driver.get(self.base_url) driver.maximize_window() #调用登录模块 login.login(self) #调用退出模块 login.logout(self)
def user(username=None): if request.method == 'POST': if request.form['logout'] == 'Logout': login.logout(username) return redirect(url_for('home')) if login.authenticated(username)== True: return render_template("user.html", username=username) else: flash(authenticationError) return redirect(url_for('home'))
def process(option, connection, current_user): if option == 0: search.search_flights(connection,str(current_user.email)) if option == 1: bookings.list(connection,str(current_user.email)) if option == 2: login.logout(connection, str(current_user.email)) if option == 3: user.record_dep(connection) if option == 4: user.record_arr(connection)
def test_as_regress(self): #网站主站回归流程 self.register() self.login_from_index() self.release_normal() self.release_two_video() self.release_three_video() self.agency_course() self.package_course() self.add_cate() self.presale_course() self.add_course_to_cate() self.add_exam_card() self.prepaid_cardgroup() self.course_cardgroup() self.cate_cardgroup() self.delete_cate() self.buy_listen_card() self.listen_cardgroup() self.import_one_student() self.import_multi_student() self.create_multi_student() self.open_course_for_one() self.open_course_for_multi() self.manage_course_num() self.buy_open_num() self.add_admin() self.modify_admin() self.delete_admin() self.release_href_announcement() self.change_homelogo() self.release_announcement() self.modify_pagefoot() self.change_headpic() self.verify_all_course_convert() login.logout(self.driver, self.base_url) #个人用户部分 self.login_user() self.use_prepaidcard() self.buy_course_use_RMB() self.buy_course_use_card() self.use_coursecard() self.use_catecard() self.use_exam_card() login.logout(self.driver, self.base_url) self.use_listencard()
def disconnect(self,popu,win): stat=login.logout(self.ids['username'].text) popu.dismiss() self.manager.get_screen('login').ids['status'].text=stat.reason self.manager.get_screen('login').kill_prev_clocks() self.manager.transition = SlideTransition(direction="right") self.manager.current = 'login' self.manager.get_screen('login').resetForm() Clock.schedule_once(self.setsize, 0)
def selectWindow(): global lastSelected list = mc.GetActiveWindow().GetList(100) items = list.GetItems() lastSelected = list.GetFocusedItem() item = items[lastSelected] label = item.GetLabel() windows = {'Movies' : 14000, 'TVSeries' : 14000, 'Documentaries' : 14000, 'Favorites' : 14000, 'Playlist' : 14000, 'Settings' : 14009, 'History' : 14000} pagetype = {'Movies' : 'movie', 'TVSeries' : 'episode', 'Documentaries' : 'documentary', 'Favorites' : 'favorites', 'Playlist' : 'playlist', 'History' : 'history'} if label in windows: if label in pagetype: mc.GetApp().GetLocalConfig().SetValue('pageType', pagetype[label]) mc.ActivateWindow(windows[label]) elif label == 'Logout': login.logout() postLogin() else: print "No window defined yet for %s" % label
def setUp(self): self.passwd = "$2a$12$CyLyLDPA5NFTY48o3fANQOEsni38JgHBk3FNwdUFd1OwYMBZxN146" db.delete('Users', where='id > 0') self.uid = db.insert('Users', uname='kevin', role=1, password=self.passwd) self.input_mock = MagicMock() self.winput = patch('web.input') self.config_mock = MagicMock() self.config = patch('web.config', new=self.config_mock) self.login_web = login() self.logout_web = logout()
def logout_page(): if (login.is_logged_in() == 0): #If use is not logged-in return redirect('login') #Try to log out: if (login.logout()): return render_template('login.html', message="You logged out successfully! ") return render_template( 'login.html', warning="Logout failed, please try to logout again! ")
def _execfunc(self): """Call the function after parsing It will change the value of username which view holds if the function is login. Login function will pass 2 args contains status and result(str). """ try: functag = self.position.find("./function") obj = functag.attrib['object'] name = functag.attrib['name'] if self.args: f, result = getattr(eval(obj), name)(self.args) else: f, result = getattr(eval(obj), name)() # set cursor value to username when login successd if name == "login" and f: self.view.username = self.args[0] elif (name == "login" and not f) or name == "logout": glob_dic.tips.write_file(self.view.username) glob_dic.tips.dic = dict() self.view.username = "" # result = result[1] # display result if f: for i in range(0, len(self.args)): if self.tp.get(self.args[i]) == 'project': glob_dic.tips.update_priority('project', self.args[i]) elif self.tp.get(self.args[i]) == 'sprint': glob_dic.tips.update_priority('sprint', self.args[i]) elif self.tp.get(self.args[i]) == 'assignee': glob_dic.tips.update_priority('assignee', self.args[i]) self._sendinfo(result) except Super401 as autherr: self.view.username = "" login.logout() self._sendinfo(autherr.err)
def test_logout(self): """return True and log the user out""" people = self.db[collectionName] totalUsers = people.count() for user in people.find(): success = login.logout(user['name'], self.dbname, collectionName) self.assertEquals(success, True) totalLoggedOutUsers = people.find({'authenticated': False}).count() self.assertEquals(totalUsers == totalLoggedOutUsers, True)
def test_regress(self): #考试系统部分 as_test_regress.Test.login_from_index(self) self.exam_onequestion(self) self.exam_questions() self.import_questions() self.add_exam_subject() self.modify_exam_subject() self.delete_exam_subject() self.create_exam_cate() self.modify_exam_cate() self.delete_exam_cate() self.add_exam_point() self.modify_exam_point() self.delete_exam_point() self.createpaper() self.exam_student_management() self.user_statistical_information() login.logout(self.driver, self.base_url) self.login_user() self.exam_user()
def parse(var): cmd_prep = "" cmd_execution = "" var_list = var.split(" ", 1) if len(var_list) <= 1: cmd_prep = var_list[0] elif len(var_list) > 1: cmd_prep = var_list[0] cmd_execution = var_list[1] cmd_prep = cmd_prep.lower() if cmd_prep == "login": dologin() elif cmd_prep == "logout": login.logout() elif cmd_prep == "say": sap(cmd_execution) elif cmd_prep == "read": read(cmd_execution) # come back to this and add search to wikipedia, google, youtube, and local system # elif cmd_prep == "search": else: print "Command is unknown, please try again." parse(raw_input(">> "))
status = stix_parser.stix_import(driver, logger, stixfile, count) except Exception as e: logger.warn('%s %s ' % (e, str(STIX[0]))) print(e) driver.get(host) # print ("sleep 5") time.sleep(5) count += 1 # print count if CONFIG.LONGRUN: time.sleep(1200) if count % 80 == 0: login.logout(logger, driver) time.sleep(1) login.login(logger, host, driver, usr=CONFIG.USER[0], pssword=CONFIG.USER[1]) logger.info("End STIX import test") # close the browser window driver.quit()
bili_timer = BiliTimer(loop) console_thread = threading.Thread(target=var_console.cmdloop) console_thread.start() Tasks.init() tasks = [ OnlineHeart.run(), Silver.run(), danmu_connection.run(), rafflehandler.run(), yjconnection.run() ] try: loop.run_until_complete(asyncio.wait(tasks + list_raffle_connection_task)) except KeyboardInterrupt: # print(sys.exc_info()[0], sys.exc_info()[1]) if ConfigLoader().dic_user['other_control']['keep-login']: pass else: response = login.logout() console_thread.join() loop.close()
def process(option, connection, user): if option == 4: login.logout(connection, user)
print('No valid Webdrive was provided. ') driver.implicitly_wait(CONFIG.waittime) # time.sleep(2) host = CONFIG.HOST usr = sys.argv[1] pssword = sys.argv[2] print(usr) print(pssword) logger.info('Start Saml config test.') try: login.login(logger, host, driver, usr, pssword, SAML=True) except Exception as e: print("login attempt failed for user: %s" % usr) time.sleep(5) try: login.logout(logger, wdriver=driver) except Exception as e: print("Logout not found for user: %s" % usr) driver.get(host) time.sleep(1) driver.quit()
def loginPage(environ, start_response): login.logout(login.getLoginToken(environ)) start_response('303 See Other',[('Location', connectToDatabase.getDirBase())]) return ''
def logout(): """Calls the log out function and returns the main page""" login.logout(session) return redirect(url_for('index'))
def logout(): login.logout() redirect('/login')
def test_logout(self, login_function): message = login('snsakala', 'Luxair123') message = logout(message['token']) self.assertEqual(message, {'message': 'logged out successfully'})
total_working_days = 0 avg_required_hrs=9 session, status = login.login() if not status: print("ERROR :: logging In") quit() attandances = get_month_summary(session, "05", "2019") for attandace in attandances: # print(attandace) if attandace.get('dayType') == 2: # skip if day is holiday continue print(attandace.get('attendanceDate'), attandace.get('totalEffectiveHours')) total_office_hrs = total_office_hrs + attandace.get('totalEffectiveHours') total_working_days = total_working_days + 1 total_required_hrs = total_working_days * avg_required_hrs # avg_hrs = total_required_hrs // total_office_hrs print("Total Working Days: ", total_working_days) print("Total Office Hrs: ", total_office_hrs) print("Total Required Hrs: ", total_required_hrs) print("Mission Hrs: ", total_required_hrs - total_office_hrs) # print("Average Hrs Required: ", avg_hrs) # Logout User login.logout(session)
def handle_accounts(self, url): obj = None if url == "login": # email, pass email = self.get_argument("email", "0") passw = self.get_argument("pass", "0") if email == "0" or passw == "0": return obj r = login.login(email, passw) if r != False: self.key = login.make_key(r) people = core.people.People(self.key) cuid = r userdata = people.get(str(cuid)) if userdata is None: obj = {"result" : "error"} login.logout(self.key) return obj if "dp" in userdata: if userdata["dp"] == "": dp_s = "" dp_l = "" else: dp_s = "/static/cdn/full/" + userdata["dp"] dp_l = "/static/cdn/full/" + userdata["dp"] else: dp_s = "" dp_l = "" print userdata["fname"] + " " + userdata["lname"] + " logged in dp - " + dp_s obj = {"result" : "success", "key": self.key, "user": {"id": str(cuid), "dp_s": dp_s, "dp_l": dp_l, "uname": userdata["fname"] + " " + userdata["lname"]}} else: obj = {"result" : "error"} return obj elif url == "create_account": obj = {"result" : "error"} people = core.people.People(self.key) person = {"fname" : self.get_argument("fname", ""), "lname" : self.get_argument("lname", ""), "username" : self.get_argument("username", ""), "email" : self.get_argument("email", ""), "rating" : {"rating1" : 0, "rating2" : 0}, "password" : self.get_argument("password", ""), "location" : {"name" : "Unknown Location", "type" : 0}, "coordinates" : [0, 0], "description" : self.get_argument("description", ""), "status" : self.get_argument("status", "")} pcr = people.create(person) if pcr == 1: email = self.get_argument("email", "0") passw = self.get_argument("password", "0") if email == "0" or passw == "0": return obj r = login.login(email, passw) if r != False: self.key = login.make_key(r) people = core.people.People(self.key) cuid = r userdata = people.get(str(cuid)) if userdata is None: obj = {"result" : "error"} login.logout(self.key) return obj if "dp" in userdata: if userdata["dp"] == "": dp_s = "" dp_l = "" else: dp_s = "/static/cdn/full/" + userdata["dp"] dp_l = "/static/cdn/full/" + userdata["dp"] else: dp_s = "" dp_l = "" print userdata["fname"] + " " + userdata["lname"] + " logged in dp - " + dp_s obj = {"result" : "success", "key": self.key, "user": {"id": str(cuid), "dp_s": dp_s, "dp_l": dp_l, "uname": userdata["fname"] + " " + userdata["lname"]}} else: obj = {"result" : "error"} if url == "logout": r = login.logout(self.key) if r == True: obj = {"result" : "success"} else: obj = {"result" : "error"} return obj if url == "deactivate": obj = {"result" : "Not Implemented"} return obj return obj
def get(self): token = request.headers.get('token') return login.logout(token)
def closeEvent(self, event): print('login out') self.server.stop() login.logout(self.Id) self.write_contact_info() event.accept()
def logout(): return login.logout()