def __init__(self, width, hight, parent=None): super(RightPanel, self).__init__(parent) # set width and hight self.width = width self.hight = hight # declare page self.page0 = LoginSignup(300, 170) self.page1 = Top3() self.page2 = Interest() self.page3 = SearchPage() self.page4 = Messages() self.page5 = History() self.page6 = ClientProjs() self.page7 = DevProjs() self.page8 = SystemManager() self.page9 = TeamPage() self.initUI()
import urllib.parse import FrontendManager import SystemManager #from Camera import Camera from flask_cors import CORS, cross_origin app = Flask(__name__) CORS(app) logging.getLogger('flask_cors').level = logging.DEBUG frontendManager = FrontendManager.FrontendManager() systemManager = SystemManager.SystemManager() @app.route("/add_faces/<token>", methods=['POST', 'GET']) def add_faces(token): if request.method == 'POST': name = request.form.get("name") pic = request.form.get("pic").split(',')[-1] accessToken = token return jsonify(frontendManager.doAddFace(name, pic, accessToken)) return frontendManager.getAddFacesPage(token) @app.route("/auth/<token>") def auth_page(token): return frontendManager.getAdminPanel(token)
from logging import exception import MySQLdb import Student import Teacher import Login import SystemManager if __name__ == '__main__': conn = MySQLdb.connect(user='******', passwd='password', db='test') log = Login.Login(conn) if log.main_func(): account = log.get_login_account() if account[2] == 0: usr = SystemManager.SystemManager(conn, account[0], account[1]) usr.main_func() elif account[2] == 1: usr = Teacher.Teacher(conn, account[0], account[1]) usr.main_func() elif account[2] == 2: usr = Student.Student(conn, account[0], account[1]) usr.main_func() else: conn.close() raise exception() conn.close()