def index(): if request.method == 'POST': login = request.form.get('login') password = request.form.get('password') return view.login(login, password) else: return view.home()
def home(): choice = None while choice != 0: choice = view.home() if choice == 2: client = add_client() display_client_file(client) elif choice == 1: #clients = session.query(Client).all() #clients = session.query(Client).filter(Client.firstname.startswith("K")) #clients = session.query(Client).first() clients = session.query(Client).order_by(Client.lastname) index = view.display_client_list(clients) if index != 0: display_client_file(clients[index - 1])
#!C:\Python\python.exe #-*- coding: utf-8 -*- # import sys # # import codecs # # sys.stdout = codecs.getwriter("iso-8859-1")(sys.stdout, 'xmlcharrefreplace') # if sys.stdout.encoding != 'cp850': # sys.stdout = codecs.getwriter('cp850')(sys.stdout.buffer, 'strict') # if sys.stderr.encoding != 'cp850': # sys.stderr = codecs.getwriter('cp850')(sys.stderr.buffer, 'strict') # #chcp 65001 # #print(data.decode('utf-8').encode('cp850','replace').decode('cp850')) print("Content-type: text/html\n\n") import view html = view.head() + view.home() + view.footer() print(html)
def GET(self): return render.base(view.home(), title='WhatsApp Chat Analyzer')
def home(): return view.home()