|
1 #!/usr/bin/env python |
|
2 # |
|
3 # Copyright 2007 Google Inc. |
|
4 # |
|
5 # Licensed under the Apache License, Version 2.0 (the "License"); |
|
6 # you may not use this file except in compliance with the License. |
|
7 # You may obtain a copy of the License at |
|
8 # |
|
9 # http://www.apache.org/licenses/LICENSE-2.0 |
|
10 # |
|
11 # Unless required by applicable law or agreed to in writing, software |
|
12 # distributed under the License is distributed on an "AS IS" BASIS, |
|
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
14 # See the License for the specific language governing permissions and |
|
15 # limitations under the License. |
|
16 # |
|
17 |
|
18 |
|
19 from google.appengine.ext import webapp |
|
20 from google.appengine.ext.webapp import util |
|
21 |
|
22 |
|
23 class MainHandler(webapp.RequestHandler): |
|
24 |
|
25 def __init__(self): |
|
26 self.key="853b128a-0c18-42f2-835f-db9f5b6f7fb9" |
|
27 # version |
|
28 self.apiVersion=1 |
|
29 |
|
30 def get(self): |
|
31 self.response.headers['Content-Type'] = 'text/xml' |
|
32 self.response.out.write('<SymbianSigned>') |
|
33 self.response.out.write('<UID3>') |
|
34 self.response.out.write('0xDEADBEEF') |
|
35 self.response.out.write('</UID3>') |
|
36 self.response.out.write('<description>') |
|
37 self.response.out.write('leviation application. Pretty cool, ahe?') |
|
38 self.response.out.write('</description>') |
|
39 self.response.out.write('</SymbianSigned>') |
|
40 |
|
41 def post(self): |
|
42 self.response.headers['Content-Type'] = 'text/xml' |
|
43 self.response.out.write('<args>') |
|
44 self.response.out.write(self.request.query_string) |
|
45 self.response.out.write('</args>') |
|
46 self.response.out.write('<body>') |
|
47 self.response.out.write(self.request.body) |
|
48 self.response.out.write('</body>') |
|
49 |
|
50 |
|
51 def main(): |
|
52 application = webapp.WSGIApplication([('/', MainHandler)], |
|
53 debug=True) |
|
54 util.run_wsgi_app(application) |
|
55 |
|
56 |
|
57 if __name__ == '__main__': |
|
58 main() |