Exemplo n.º 1
0
def add_app(request):
    """ Adds an application by index (sent per URI) to the registered
        applications. """

    found_apps = apps.get_found_apps()
    index = int(request.match.group(1))

    if index not in found_apps:
        return '{"status": "INVALID_INDEX"}'

    id = apps.register_application(found_apps.pop(index))
    return '{"status": "OK"}'
Exemplo n.º 2
0
def appfind(request):
    template = os.path.join(maindir, 'templates', 'applist.jtmp')
    apps_ = apps.get_found_apps().values()
    return jutils.render_template(template, {'apps':apps_, 'addable':True})