Example #1
0
def create_face_picture(url, facebook_id, x, y, width, height):
    global FacePictures
    raw = get_raw_picture_by(facebook_id)
    face_id = uuid.uuid4().hex
    doc = {
        _FACE_ID: face_id,
        'url': url,
        'face_x': x,
        'face_y': y,
        'face_width': width,
        'face_height': height,
        'source_width': raw.get('width'),
        'source_height': raw.get('height'),
        'facebook_id': facebook_id,
        'datetime': datetime.datetime.now(),
        'nb_votes': 0,
        'nb_votes_total': 0,
        'tag': NOTTAGGED,
        'tags': {},
        'views': 0,
        'views_total': 0,
        'score': 0,
        'score_total': 0,
        'nb_favorited': 0,
        'favorite_votes': 0,
        'favorite_votes_total': 0,
        'bonusmalus': [],
        'bonusmalus_total': [],
        'has_won': False
    }
    FacePictures.insert(doc)
    return get_face_from(face_id)
Example #2
0
def create_face_picture(url, facebook_id, x, y, width, height):
    global FacePictures
    raw = get_raw_picture_by(facebook_id)
    face_id = uuid.uuid4().hex
    doc = {_FACE_ID: face_id,
           'url': url,
           'face_x': x,
           'face_y': y,
           'face_width': width,
           'face_height': height,
           'source_width': raw.get('width'),
           'source_height': raw.get('height'),
           'facebook_id': facebook_id,
           'datetime': datetime.datetime.now(),
           'nb_votes': 0,
           'nb_votes_total': 0,
           'tag': NOTTAGGED,
           'tags': {},
           'views': 0,
           'views_total': 0,
           'score': 0,
           'score_total': 0,
           'nb_favorited': 0,
           'favorite_votes': 0,
           'favorite_votes_total': 0,
           'bonusmalus': [],
           'bonusmalus_total': [],
           'has_won': False}
    FacePictures.insert(doc)
    return get_face_from(face_id)