diff --git a/VERSION b/VERSION index 94a0778c..9ff7d60c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.00.0 (2012-08-24 16:36:11) dev +Version 2.00.0 (2012-08-24 17:05:15) dev diff --git a/applications/admin/controllers/default.py b/applications/admin/controllers/default.py index f1f4e9db..d4ece9ce 100644 --- a/applications/admin/controllers/default.py +++ b/applications/admin/controllers/default.py @@ -206,7 +206,8 @@ def site(): elif form_create.accepted: # create a new application appname = cleanpath(form_create.vars.name) - if app_create(appname, request): + created, error = app_create(appname, request,info=True) + if created: if MULTI_USER_MODE: db.app.insert(name=appname,owner=auth.user.id) log_progress(appname) @@ -214,8 +215,8 @@ def site(): redirect(URL('design',args=appname)) else: session.flash = \ - T('unable to create application "%s" (it may exist already)', - form_create.vars.name) + DIV(T('unable to create application "%s"' % appname), + PRE(error)) redirect(URL(r=request)) elif form_update.accepted: diff --git a/applications/admin/views/default/site.html b/applications/admin/views/default/site.html index a9e7719d..e983d00c 100644 --- a/applications/admin/views/default/site.html +++ b/applications/admin/views/default/site.html @@ -83,8 +83,8 @@

{{=T("Multi User Mode")}}

- {{=button(URL('bulk_register'),T('Bulk Register'))}} - {{=button(URL('manage_students'),T('Manage Students'))}} + {{=button(URL('bulk_register'),T('Bulk Register'))}} + {{=button(URL('manage_students'),T('Manage Students'))}}

{{pass}} @@ -135,15 +135,13 @@ {{=form_update.custom.end}} - {{if not MULTI_USER_MODE or is_manager():}}

{{=T("Deploy")}}

{{=button(URL('gae','deploy'), T('Deploy on Google App Engine'))}} {{=button(URL('openshift','deploy'),T('Deploy to OpenShift'))}}

-
- {{pass}} +
{{if TWITTER_HASH:}}

{{=T("%s Recent Tweets"%TWITTER_HASH)}}

diff --git a/gluon/admin.py b/gluon/admin.py index b5037bd8..d84ece9e 100644 --- a/gluon/admin.py +++ b/gluon/admin.py @@ -18,6 +18,7 @@ from fileutils import up, fix_newlines, abspath, recursive_unlink from fileutils import read_file, write_file, parse_version from restricted import RestrictedError from settings import global_settings +from http import HTTP if not global_settings.web2py_runtime_gae: import site @@ -157,7 +158,7 @@ def app_compile(app, request): remove_compiled_application(folder) return tb -def app_create(app, request,force=False,key=None): +def app_create(app, request,force=False,key=None,info=False): """ Create a copy of welcome.w2p (scaffolding) app @@ -169,11 +170,19 @@ def app_create(app, request,force=False,key=None): the global request object """ - try: - path = apath(app, request) - os.mkdir(path) - except: - if not force: + path = apath(app, request) + if not os.path.exists(path): + try: + os.mkdir(path) + except: + if info: + return False, traceback.format_exc(sys.exc_info) + else: + return False + elif not force: + if info: + return False, "Application exists" + else: return False try: w2p_unpack('welcome.w2p', path) @@ -189,10 +198,16 @@ def app_create(app, request,force=False,key=None): data = data.replace('', 'sha512:'+(key or web2py_uuid())) write_file(db, data) - return True + if info: + return True, None + else: + return True except: rmtree(path) - return False + if info: + return False, traceback.format_exc(sys.exc_info) + else: + return False def app_install(app, fobj, request, filename, overwrite=None):