richer structure in DISABLED
This commit is contained in:
@@ -1 +1 @@
|
|||||||
Version 2.6.0-development+timestamp.2013.08.09.04.38.18
|
Version 2.6.0-development+timestamp.2013.08.09.04.48.26
|
||||||
|
|||||||
@@ -491,13 +491,11 @@ def enable():
|
|||||||
if is_gae:
|
if is_gae:
|
||||||
return SPAN(T('Not supported'), _style='color:yellow')
|
return SPAN(T('Not supported'), _style='color:yellow')
|
||||||
elif os.path.exists(filename):
|
elif os.path.exists(filename):
|
||||||
os.unlink(filename)
|
|
||||||
return SPAN(T('Disable'), _style='color:green')
|
return SPAN(T('Disable'), _style='color:green')
|
||||||
else:
|
else:
|
||||||
safe_open(filename, 'wb').write('time-disabled: %s' % request.now)
|
safe_open(filename, 'wb').write('disabled: True\ntime-disabled: %s' % request.now)
|
||||||
return SPAN(T('Enable'), _style='color:red')
|
return SPAN(T('Enable'), _style='color:red')
|
||||||
|
|
||||||
|
|
||||||
def peek():
|
def peek():
|
||||||
""" Visualize object code """
|
""" Visualize object code """
|
||||||
app = get_app(request.vars.app)
|
app = get_app(request.vars.app)
|
||||||
|
|||||||
+6
-5
@@ -398,11 +398,12 @@ def wsgibase(environ, responder):
|
|||||||
elif request.is_local and exists(disabled):
|
elif request.is_local and exists(disabled):
|
||||||
data = dict([item.strip() for item in line.split(':',1)]
|
data = dict([item.strip() for item in line.split(':',1)]
|
||||||
for line in open(disabled) if line.strip())
|
for line in open(disabled) if line.strip())
|
||||||
if 'redirect' in data:
|
if data.get('disabled','True').lower() != 'false':
|
||||||
redirect(data['redirect'])
|
if 'redirect' in data:
|
||||||
if 'message' in data:
|
redirect(data['redirect'])
|
||||||
raise HTTP(503, data['message'])
|
if 'message' in data:
|
||||||
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
raise HTTP(503, data['message'])
|
||||||
|
raise HTTP(503, "<html><body><h1>Temporarily down for maintenance</h1></body></html>")
|
||||||
|
|
||||||
# ##################################################
|
# ##################################################
|
||||||
# build missing folders
|
# build missing folders
|
||||||
|
|||||||
Reference in New Issue
Block a user