Exemple #1
0
def list_annotations(image_pid,assignment_pid=None):
    if assignment_pid is not None:
        return jsonr(list(my(ANNOTATION_STORE).list_annotations(image=image_pid,assignment=assignment_pid)))
    else:
        return jsonr(list(my(ANNOTATION_STORE).list_annotations(image=image_pid)))
Exemple #2
0
def fetch_assignment(assignment_pid):
    return jsonr(my(ASSIGNMENT_STORE).fetch_assignment(assignment_pid))
Exemple #3
0
def fetch_annotation(pid):
    return jsonr(my(ANNOTATION_STORE).fetch_annotation(pid))
Exemple #4
0
def deprecate_annotation(pid):
    if not 'username' in session:
        abort(401)
    return jsonr(my(ANNOTATION_STORE).deprecate_annotation(pid))
Exemple #5
0
def list_categories(mode,scope=None):
    return jsonr(list(my(CATEGORIES).list_categories(mode,scope)))
Exemple #6
0
def category_autocomplete(mode,scope=None):
    stem = request.values['term']
    return jsonr(list(stem_search(stem,mode,scope)))
Exemple #7
0
def list_idmodes():
    return jsonr({'idmodes': my(ASSIGNMENT_STORE).list_idmodes()})
Exemple #8
0
def list_assignments():
    return jsonr({'assignments': my(ASSIGNMENT_STORE).list_assignments()})
Exemple #9
0
def set_status(assignment_id,image_id,status,post_status=None):
    assignment_id = urllib.unquote(assignment_id)
    status = urllib.unquote_plus(status)
    my(ASSIGNMENT_STORE).set_status(assignment_id,image_id,status)
    return jsonr(dict(status='OK',new_image_status=status))
Exemple #10
0
def find_image(offset,status,post_status=None,assignment_pid=None):
    return jsonr(dict(offset=my(ASSIGNMENT_STORE).find_image(assignment_pid,offset,status,post_status)))
Exemple #11
0
def list_images(limit,offset,assignment_pid,status=None):
    return jsonr(list(my(ASSIGNMENT_STORE).list_images(assignment_pid,limit,offset,status)))