/silverlining/server-root/var/www/default-disabled/main.py

https://bitbucket.org/ianb/silverlining/ · Python · 13 lines · 11 code · 2 blank · 0 comment · 0 complexity · e8ecd4e53b6cf754c467dc6c3709c5d2 MD5 · raw file

  1. import os
  2. fp = open(os.path.join(os.path.dirname(__file__), 'static', 'disabled.html'), 'rb')
  3. disabled = fp.read()
  4. fp.close()
  5. def application(environ, start_response):
  6. start_response('503 Service Unavailable',
  7. [('Content-type', 'text/html; charset=UTF-8'),
  8. ('Content-Length', str(len(disabled))),
  9. ('Cache-Control', 'no-store, no-cache, max-age=0'),
  10. ('Pragma', 'no-cache')])
  11. return [disabled]