Beispiel #1
0
def users():
    search_value = request.args.get("search")
    if search_value:
        users = get_user(search_value)
    else:
        users = get_users()
    return render_template('users.html', users=users)
Beispiel #2
0
def users():
    #search_value = request.args.get("search")
    #print search_value
    #if search_value:
    #    users = get_user(search_value)
    #else:
    #    users = get_users()
    users = get_users()
    return render_template('users.html', users=users)
Beispiel #3
0
def users():
    if not session.get('sign', None):
        return redirect('/login')
    #search_value = request.args.get("search")
    #print search_value
    #if search_value:
    #    users = get_user(search_value)
    #else:
    #    users = get_users()
    users = get_users()
    return render_template('users.html', users=users)
def new_question_route():
    """Show new question page"""
    title = "Add new question"
    action = "/newpost"
    data = {}
    users = common.get_users()
    tags = common.show_tags_type()
    return render_template("new-question.html",
                           action=action,
                           title=title,
                           data=data,
                           tags=tags,
                           users=users)
Beispiel #5
0
def users():
    search_value = request.args.get("search")
    print search_value
    if search_value:
        users = get_user(search_value)
        #for i in users:
        #    for j in i:
        #        print j
    else:
        users = get_users()
        #for i in users:
        #    for j in i:
        #        print j
    return render_template('users.html', users=users)
Beispiel #6
0
def users_edit(uid):
    if request.method == 'POST':
        data = request.form.to_dict()
        if data['password'] != data['rpassword']:
            errmsg = "Confirm password error"
            return render_template('users_add.html', errmsg=errmsg)
        print data
        response = userEdit(uid, data)
        print response
        return redirect("/users")
    else:
        users = get_users()
        for user in users:
            if user[0] == uid:
                return render_template('users_edit.html', user=user)
Beispiel #7
0
def users():
    search_value = request.args.get("search")
    if request.method == 'POST':
        data = request.form.to_dict()
        #if data['username'] and data['email'] and data['password']:
        response = register(data)
        #    return "11111111"
        #else:
        return json.dumps({"status": 1})
    else:
        if search_value:
            users = get_user(search_value)
        else:
            users = get_users()
        return render_template('users.html', users=users)
def add_new_question_comment(question_id):
    """
    Routed to url: /question/question_id/new-comment
    Renders comment.html with arguments for adding new comment for a question
    """
    sql_query = """SELECT message FROM question WHERE id={}""".format(
        question_id)
    question_content = data_manager.run_query(sql_query)[0][0]
    users = common.get_users()
    return render_template('comment.html',
                           basis='question',
                           mode='Add_new',
                           button='Create',
                           comment='',
                           content=question_content,
                           question_id=str(question_id),
                           answer_id='',
                           title='Add a',
                           users=users)
Beispiel #9
0
import face_recognition
import cv2
import numpy as np 
from livenessmodel import get_liveness_model
from common import get_users
font = cv2.FONT_HERSHEY_DUPLEX

# Get the liveness network
model = get_liveness_model()

# load weights into new model
model.load_weights("model/model.h5")
print("Loaded model from disk")

# Read the users data and create face encodings 
known_names, known_encods = get_users()


video_capture = cv2.VideoCapture(0)
video_capture.set(3, 640)
video_capture.set(4, 480)

# Initialize some variables
face_locations = []
face_encodings = []
face_names = []
process_this_frame = True
input_vid = []

while True:
    # Grab a single frame of video
Beispiel #10
0
def users():
    users = get_users()
    return render_template('users.html', users=users)