def index():
    response.view = 'wizard/step.html'
    reset(session)
    apps = os.listdir(os.path.join(request.folder, '..'))
    form = SQLFORM.factory(Field('name', requires=[IS_NOT_EMPTY(),
                                                   IS_ALPHANUMERIC()]), _class='span5 well well-small')
    if form.accepts(request.vars):
        app = form.vars.name
        session.app['name'] = app
        if MULTI_USER_MODE and db(db.app.name == app)(db.app.owner != auth.user.id).count():
            session.flash = 'App belongs already to other user'
        elif app in apps:
            meta = os.path.normpath(
                os.path.join(os.path.normpath(request.folder),
                             '..', app, 'wizard.metadata'))
            if os.path.exists(meta):
                try:
                    metafile = open(meta, 'rb')
                    try:
                        session.app = pickle.load(metafile)
                    finally:
                        metafile.close()
                    session.flash = T("The app exists, was created by wizard, continue to overwrite!")
                except:
                    session.flash = T("The app exists, was NOT created by wizard, continue to overwrite!")
        redirect(URL('step1'))
    return dict(step='Start', form=form)
dataset/ETHPy150Open uwdata/termite-data-server/web2py/applications-original/admin/controllers/wizard.py/index/original