Exemplo n.º 1
0
 def _dispose(self):
     connectionManager.onLoggedOn -= self.__onLoggedOn
     LoginView._dispose(self)
Exemplo n.º 2
0
lm.login_view = "LoginView:index"

@lm.user_loader
def load_user(userid):
    from models import User
    return User.query.get(userid)

from IndexView import IndexView
from BlogView import BlogView
from LoginView import LoginView
from RegisterView import RegisterView
from ToolsView import ToolsView

IndexView.register(app, route_base='/')
BlogView.register(app, route_base='/blog')
LoginView.register(app, route_base='/login')
RegisterView.register(app, route_base='/register')
ToolsView.register(app, route_base='/tools')

from admin import HexAdmin, HexAdminHome

admin = HexAdmin(index_view=HexAdminHome())
admin.start(app)

@app.errorhandler(Exception)
def generic_error_handler(error):
    app.logger.exception(error)
    from datetime import datetime
    if hasattr(error, 'code'):
        return render_template('error.html', details=error, code=error.code, now=datetime.utcnow()), error.code
    else:
Exemplo n.º 3
0
 def __init__(self, ctx=None):
     LoginView.__init__(self, ctx=ctx)
     self.__userName = self.loginManager.getPreference('name')
     self.__lastLoginType = self.loginManager.getPreference('login_type')
Exemplo n.º 4
0
 def _populate(self):
     LoginView._populate(self)
     connectionManager.onLoggedOn += self.__onLoggedOn
Exemplo n.º 5
0
 def _populate(self):
     LoginView._populate(self)
     connectionManager.onLoggedOn += self.__onLoggedOn
Exemplo n.º 6
0
 def _dispose(self):
     connectionManager.onLoggedOn -= self.__onLoggedOn
     LoginView._dispose(self)
Exemplo n.º 7
0
#-*- config:utf-8 -*-
import tkinter

from LoginView import LoginView
from Sql import Sql

Sql.initDB()

root = tkinter.Tk()
LoginView(root)
root.mainloop()
Exemplo n.º 8
0
 def __init__(self, ctx = None):
     LoginView.__init__(self, ctx=ctx)
     self.__userName = g_loginManager.getPreference('name')
     self.__lastLoginType = g_loginManager.getPreference('login_type')
Exemplo n.º 9
0
 def _dispose(self):
     LoginView._dispose(self)
Exemplo n.º 10
0
#-*- coding:utf-8 -*-
from Sql import sql
from LoginView import LoginView

sql.initDB()
LoginView()
Exemplo n.º 11
0
 def _populate(self):
     LoginView._populate(self)
Exemplo n.º 12
0
 def _dispose(self):
     self.connectionMgr.onLoggedOn -= self.__onLoggedOn
     LoginView._dispose(self)
Exemplo n.º 13
0
 def _populate(self):
     LoginView._populate(self)
     self.connectionMgr.onLoggedOn += self.__onLoggedOn
Exemplo n.º 14
0
 def test_login_error(self):
     logging.info("=====test login with error account=====")
     login_action = LoginView(self.driver)
     row = login_action.get_csv_data(self.csv_file, 3)
     login_action.login(row[0], row[1])
     self.assertEqual(login_action.check_login_status(), False)
Exemplo n.º 15
0
 def test_login_6421(self):
     logging.info("=====test login george6421=====")
     login_action = LoginView(self.driver)
     row = login_action.get_csv_data(self.csv_file, 2)
     login_action.login(row[0], row[1])
     self.assertEqual(login_action.check_login_status(), True)