comparison encryptobin.py @ 0:1c8dbbdce596

Origination.
author Atul Varma <varmaa@toolness.com>
date Tue, 07 Apr 2009 16:07:54 -0700
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:1c8dbbdce596
1 import atulweb
2 import config
3
4 blob = ''
5
6 @atulweb.wsgiapp
7 def application(environ, start_response):
8 global blob
9 if environ['PATH_INFO'] == '/' + config.SECRET:
10 if environ['REQUEST_METHOD'] == 'GET':
11 return atulweb.Response(blob)
12 elif environ['REQUEST_METHOD'] == 'PUT':
13 blob = environ['atulweb.request'].get_input()
14 return atulweb.Response('OK')
15 else:
16 raise atulweb.HttpError('method not allowed')
17 else:
18 raise atulweb.HttpError('not found')
19
20 if __name__ == '__main__':
21 atulweb.main(application)